trybeacon 0.1.36 → 0.1.38
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 +17 -15
- 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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/route.js +2 -2
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/route.js +1 -1
- package/.next/server/app/api/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 +3 -3
- package/.next/server/app/docs.segments/_full.segment.rsc +3 -3
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +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 +2 -2
- package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +2 -2
- package/.next/server/app/help.segments/_full.segment.rsc +2 -2
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +2 -2
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +2 -2
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +17 -15
- package/.next/server/chunks/1130.js +1 -1
- 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/249.js +1 -1
- package/.next/server/chunks/2713.js +1 -0
- package/.next/server/chunks/2933.js +1 -1
- package/.next/server/chunks/2981.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/8423.js +1 -1
- package/.next/server/chunks/9213.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/chunks/8015-9cd5b2ea19e9aa77.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-b51abf8d1c3ec85a.js +1 -0
- package/.next/static/chunks/app/plan/{page-b765e85e904c1e89.js → page-928529a405650444.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/static/css/4cddafb96f165148.css +1 -0
- package/.next/static/sJAp6c61WGwLy0STzGlio/_buildManifest.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 +17 -17
- package/dist/bin/hook.js +15 -15
- package/dist/bin/mcp.js +28 -28
- package/dist/bin/plan.js +23 -23
- package/dist/bin/remove.js +5 -5
- package/dist/bin/uninstall.js +18 -18
- package/dist/lib/codex-install.js +16 -16
- package/dist/lib/global-install.js +15 -15
- package/dist/lib/telemetry.js +2 -0
- package/package.json +1 -1
- package/.next/server/chunks/7985.js +0 -1
- package/.next/server/chunks/9313.js +0 -14
- package/.next/static/Zhl4m6Il4yuyevCov8KYX/_buildManifest.js +0 -1
- package/.next/static/chunks/3019-a37a9ee45f25e870.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-86998ce8e4714ada.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/css/496162fa86c30a1d.css +0 -1
- /package/.next/static/{Zhl4m6Il4yuyevCov8KYX → sJAp6c61WGwLy0STzGlio}/_ssgManifest.js +0 -0
package/dist/bin/uninstall.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var
|
|
3
|
+
var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var xQ={};WQ(xQ,{removeRepoAssets:()=>jQ,installRefreshSkill:()=>FZ,installPlanSkill:()=>RZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>IZ,ensureWorkflowDoc:()=>bZ,ensureMcp:()=>OZ,auditRepo:()=>AZ,REFRESH_SKILL:()=>HQ,PLAN_SKILL:()=>mQ,INIT_SKILL:()=>PQ});import{existsSync as M,mkdirSync as L,readFileSync as x,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,PQ),$}function FZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,HQ),$}function RZ(Q){let Z=q(Q,".claude","skills","beacon-plan");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,mQ),$}function IZ(Q){let Z=[];for(let $ of EZ){let J=q(Q,".agents","skills",$.name);L(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function bZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${k}[\\s\\S]*?${BQ}`);$=J.test($)?$.replace(J,hQ):`${$.trim()}
|
|
4
4
|
|
|
5
5
|
${hQ}
|
|
6
6
|
`.trimStart(),H(Z,$.endsWith(`
|
|
@@ -9,13 +9,13 @@ ${hQ}
|
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
11
|
`)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},H(Z,JSON.stringify($,null,2)+`
|
|
12
|
-
`),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function
|
|
13
|
-
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),W=new RegExp(`\\n?${k}[\\s\\S]*?${
|
|
12
|
+
`),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function jQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=q(Q,".claude","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=q(Q,".agents","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(x(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
|
|
13
|
+
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),W=new RegExp(`\\n?${k}[\\s\\S]*?${BQ}\\n?`);if(W.test(z)){let UQ=z.replace(W,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();H(V,
|
|
17
|
-
`)?
|
|
18
|
-
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())_(U,{force:!0});else H(U,W);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var
|
|
16
|
+
`).trimStart();H(V,UQ.endsWith(`
|
|
17
|
+
`)?UQ:`${UQ}
|
|
18
|
+
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())_(U,{force:!0});else H(U,W);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var PQ=`---
|
|
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
|
---
|
|
@@ -53,7 +53,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
53
53
|
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
54
|
|
|
55
55
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
56
|
-
`,
|
|
56
|
+
`,HQ=`---
|
|
57
57
|
name: beacon-refresh
|
|
58
58
|
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
59
|
---
|
|
@@ -142,7 +142,7 @@ If it returns feedback, revise and call it again.
|
|
|
142
142
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
143
143
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
144
144
|
run \`beacon\` in this repo once.
|
|
145
|
-
`,EZ,k="<!-- beacon:workflow:start -->",
|
|
145
|
+
`,EZ,k="<!-- beacon:workflow:start -->",BQ="<!-- beacon:workflow:end -->",hQ;var S=g(()=>{EZ=[{name:"beacon-init",body:()=>PQ},{name:"beacon-refresh",body:()=>HQ}];hQ=`${k}
|
|
146
146
|
## Beacon \u2014 feature workflow
|
|
147
147
|
|
|
148
148
|
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 +200,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
200
200
|
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
201
|
|
|
202
202
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
203
|
-
${
|
|
204
|
-
`)}function l(Q,Z){let $=
|
|
203
|
+
${BQ}`});import{existsSync as pQ,mkdirSync as vQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as cQ,join as h}from"path";function NQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){vQ(cQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
|
|
204
|
+
`)}function l(Q,Z){let $=NQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function n(Q,Z){return(NQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function t(Q,Z){let $=NQ(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((W)=>W.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function d(Q,Z,$,J){let Y=`${Z}
|
|
205
205
|
${J.trim()}
|
|
206
206
|
${$}`,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
207
|
|
|
208
208
|
${Y}
|
|
209
209
|
`:`${Y}
|
|
210
|
-
`,
|
|
210
|
+
`,vQ(cQ(Q),{recursive:!0}),p(Q,V.endsWith(`
|
|
211
211
|
`)?V:`${V}
|
|
212
212
|
`)}function F(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
213
|
|
|
214
|
-
`).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);
|
|
214
|
+
`).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);vQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function R(Q,Z){return pQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!pQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var P,c=`## Beacon (visual planning panel)
|
|
215
215
|
|
|
216
216
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
217
217
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -232,20 +232,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
232
232
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
233
233
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
234
234
|
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
|
|
235
|
+
verbatim. Do NOT implement until the tool returns approval.`;var uQ=g(()=>{P=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as yZ,renameSync as _Z,rmSync as LZ,writeFileSync as kZ}from"fs";import{dirname as SZ}from"path";function o(Q,Z){yZ(SZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{kZ($,Z),_Z($,Q)}catch(J){throw LZ($,{force:!0}),J}}function L0(Q,Z,$=!1){o(Q,JSON.stringify(Z,null,$?2:void 0))}var nQ=()=>{};var eQ={};WQ(eQ,{setupCodexAssets:()=>cZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>TQ,hasCodexMcp:()=>MQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>pZ,codexDetected:()=>aQ,auditCodex:()=>fQ,CODEX_HOOKS:()=>T});import{readFileSync as ZQ}from"fs";import{homedir as hZ}from"os";import{join as b}from"path";function tQ(){return process.env.HOME||process.env.USERPROFILE||hZ()}function aQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(GQ===void 0)GQ=Bun.which("codex")!==null;return GQ}function I(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function MQ(){try{return Boolean(I(ZQ(f(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function pZ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return null}let Z=I(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${E}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${E}`;return null}function oQ(){let Q="",Z=!1;try{Q=ZQ(f(),"utf8"),Z=!0}catch{}if(Z){let V=I(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${E}`};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 ${E}`}}let $=!Q?"":Q.endsWith(`
|
|
236
236
|
`)?`
|
|
237
237
|
`:`
|
|
238
238
|
|
|
239
|
-
`,J=Q+$+mZ;if(I(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${E}`};return
|
|
239
|
+
`,J=Q+$+mZ;if(I(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${E}`};return o(f(),J),{added:!0}}function iQ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
240
240
|
`),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:MQ()};let J=Z.indexOf(rQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
241
241
|
`).replace(/\n{3,}/g,`
|
|
242
242
|
|
|
243
|
-
`).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return
|
|
243
|
+
`).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return o(f(),Y),{removed:!0}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),xQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of P){if(!R(e(),z))Y.push(z);s(e(),z,J[z])}let V=0;for(let z of T)if(l(CQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=F(i(),QQ);d(i(),QQ,dQ,c);let U=oQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function fQ(){let Q={};for(let $ of P)Q[$]=R(e(),$);let Z={};for(let $ of T)Z[$.event]=n(CQ(),{event:$.event,command:$.command});return{detected:aQ(),skills:Q,hooks:Z,agentsMdBlock:F(i(),QQ),mcp:MQ()}}function TQ(){let Q=[];for(let Y of P)if(r(e(),Y))Q.push(Y);let Z=0;for(let Y of T)if(t(CQ(),{event:Y.event,command:Y.command}))Z++;let $=a(i(),QQ,dQ),J=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var KQ=()=>b(tQ(),".codex"),CQ=()=>b(KQ(),"hooks.json"),f=()=>b(KQ(),"config.toml"),i=()=>b(KQ(),"AGENTS.md"),e=()=>b(tQ(),".agents","skills"),QQ="<!-- beacon:global:start -->",dQ="<!-- beacon:global:end -->",T,GQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",mZ,E="add it manually: codex mcp add beacon -- beacon mcp";var wQ=g(()=>{uQ();nQ();T=[{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."}];mZ=`${sQ}
|
|
244
244
|
[mcp_servers.beacon]
|
|
245
245
|
command = "beacon"
|
|
246
246
|
args = ["mcp"]
|
|
247
247
|
${rQ}
|
|
248
|
-
`});var zZ={};
|
|
249
|
-
\x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=LQ(),SQ=JZ();console.log(C(CZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(C("Global"));console.log(` ${
|
|
250
|
-
`),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=TQ();if(u.skillsRemoved.length)console.log(` ${j(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${j(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${j("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${MZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of y){if(!
|
|
248
|
+
`});var zZ={};WQ(zZ,{provisionDb:()=>B0});import{createClient as $0}from"@libsql/client";import{drizzle as J0}from"drizzle-orm/libsql";import{migrate as Y0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as V0}from"drizzle-orm/migrator";import{dirname as IQ,join as z0}from"path";import{fileURLToPath as q0}from"url";async function YQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function P0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function VZ(Q){if(!await YQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function H0(Q){for(let[Z,$]of Object.entries(W0)){if(!await YQ(Q,Z))continue;let J=await P0(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 B0(Q,Z=U0){let $=$0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await YQ($,"__drizzle_migrations"),Y=await YQ($,"Node"),V=!1;if(Y&&!J){let U=V0({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 VZ($);if(await Y0(J0($),{migrationsFolder:Z}),await VZ($)>X)V=!0;return await H0($),{migrated:V}}finally{$.close()}}var X0,U0,W0;var qZ=g(async()=>{X0=IQ(IQ(IQ(q0(import.meta.url)))),U0=process.env.BEACON_MIGRATIONS_DIR||z0(X0,"drizzle"),W0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});uQ();import{existsSync as lZ}from"fs";import{homedir as nZ}from"os";import{join as $Q}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var JQ=()=>$Q(tZ(),".claude"),gQ=()=>$Q(JQ(),"skills"),FQ=()=>$Q(JQ(),"settings.json"),RQ=()=>$Q(JQ(),"CLAUDE.md"),EQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var dZ=c,O=[{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 aZ(Q,Z){return s(gQ(),Q,Z)}function ZZ(Q){return R(gQ(),Q)}function sZ(Q){return r(gQ(),Q)}function rZ(Q){return l(FQ(),Q)}function oZ(Q){return n(FQ(),Q)}function iZ(Q){return t(FQ(),Q)}function eZ(Q){d(RQ(),EQ,QZ,Q)}function $Z(){return F(RQ(),EQ)}function Q0(){return a(RQ(),EQ,QZ)}function JZ(){let Q={};for(let $ of P)Q[$]=ZZ($);let Z={};for(let $ of O)Z[$.event]=oZ({event:$.event,command:$.command});return{homeExists:lZ(JQ()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),xQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of P){if(!ZZ(U))Y.push(U);aZ(U,J[U])}let V=0;for(let U of O)if(rZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=$Z();return eZ(dZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function a0(){let Q;try{Q={ok:!0,...await Z0()}}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(() => (wQ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function YZ(){let Q=[];for(let J of P)if(sZ(J))Q.push(J);let Z=0;for(let J of O)if(iZ(J))Z++;let $=Q0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as j0}from"async_hooks";import{spawnSync as x0}from"child_process";import{createHash as v0}from"crypto";import{existsSync as UZ,mkdirSync as A,readFileSync as OQ,writeFileSync as AQ}from"fs";import{homedir as WZ}from"os";import{basename as N0,join as N,parse as u0,resolve as XZ}from"path";function v(){return process.env.BEACON_HOME||N(WZ(),".beacon")}function DQ(){return N(v(),"workspaces.json")}function VQ(Q){return v0("sha256").update(Q).digest("hex").slice(0,12)}function X1(Q=process.cwd()){let Z=x0("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 PZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==u0(Z).root}function HZ(){return N(v(),"deleted.json")}function yQ(){try{let Q=JSON.parse(OQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(v(),{recursive:!0}),AQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return yQ().includes(Q)}function U1(Q){let Z=yQ();if(!Z.includes(Q))BZ([...Z,Q])}function G0(Q){let Z=yQ();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function zQ(Q){return N(v(),Q)}function K0(Q){return`file:${N(zQ(Q),"db.sqlite")}`}function D(){try{let Q=JSON.parse(OQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function _Q(Q){A(v(),{recursive:!0}),AQ(DQ(),JSON.stringify(Q,null,2))}function LQ(){return D().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return D().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!PZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=VQ(Q);if(jZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=D(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||N0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(zQ(J),{recursive:!0}),_Q(U),X}function W1(Q,Z){return G0(VQ(Q)),xZ(Q,Z)}function P1(Q,Z=new Date().toISOString()){let $=D(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,_Q($)}function H1(Q){if(_Q(D().filter((Z)=>Z.id!==Q)),kQ()===Q)C0(LQ()[0]?.id??null)}function vZ(){return N(v(),"active")}function kQ(){try{return OQ(vZ(),"utf8").trim()||null}catch{return null}}function C0(Q){A(v(),{recursive:!0}),AQ(vZ(),Q??"")}function B1(){let Q=kQ();return Q?G(Q):null}function j1(){let Q=f0()??kQ();return Q?G(Q):null}function x1(Q){return G(Q)?.path??null}function v1(){return UZ(DQ())}var NZ="beacon_ws";function uZ(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 N1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=uZ(Q,NZ);if($&&G($))return $;return null}var M0="x-beacon-workspace-path";async function u1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(M0);if($&&PZ($)&&!jZ(VQ($))&&(!Z||VQ($)===Z)){let Y=xZ($);return await T0(Y.id),Y.id}let J=uZ(Q,NZ);if(J&&G(J))return J;return null}var GZ=new j0;function G1(Q,Z){return Q?GZ.run(Q,Z):Z()}function f0(){return GZ.getStore()??null}var bQ=new Set;function K1(Q){bQ.delete(N(zQ(Q),"db.sqlite"))}async function T0(Q){let Z=zQ(Q),$=N(Z,"db.sqlite"),J=UZ($);if(J&&bQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await qZ().then(() => zZ),V=await Y(K0(Q));return bQ.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();wQ();import{existsSync as qQ,readFileSync as w0,rmSync as g0}from"fs";import{join as F0}from"path";var KZ=process.argv.slice(3),CZ=KZ.includes("--yes")||KZ.includes("-y"),j=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,B=(Q)=>`\x1B[2m${Q}\x1B[0m`,C=(Q)=>`
|
|
249
|
+
\x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=LQ(),SQ=JZ();console.log(C(CZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(C("Global"));console.log(` ${qQ(K)?`wipe ${K} (${y.length} workspaces)`:`${B(`${K} \u2014 already gone`)}`}`);for(let Q of P)console.log(` ${SQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of O)console.log(` ${SQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${SQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":B("global CLAUDE.md block \u2014 already gone")}`);var XQ=fQ();console.log(C("Codex"));for(let Q of P)console.log(` ${XQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of T)console.log(` ${XQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${XQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":B("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${XQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":B("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(C(`Per-repo (${y.length})`));for(let Q of y){if(!qQ(Q.path)){console.log(` ${B(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${B("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!CZ)console.log(C("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
|
|
250
|
+
`),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=TQ();if(u.skillsRemoved.length)console.log(` ${j(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${j(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${j("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${MZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of y){if(!qQ(Q.path))continue;let Z=jQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${j(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var R0=F0(K,"server.json");try{let{pid:Q}=JSON.parse(w0(R0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${j(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(qQ(K))g0(K,{recursive:!0,force:!0}),console.log(` ${j(`removed ${K}`)}`);console.log(C("Done."));console.log(` ${MZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
|
|
251
251
|
`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var uq=Object.defineProperty;var Xq=(q)=>q;function Gq(q,z){this[q]=Xq.bind(null,z)}var l=(q,z)=>{for(var J in z)uq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Gq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var d={};l(d,{removeRepoAssets:()=>fq,installRefreshSkill:()=>wq,installPlanSkill:()=>gq,installInitSkill:()=>bq,installCodexRepoSkills:()=>Cq,ensureWorkflowDoc:()=>Nq,ensureMcp:()=>Kq,auditRepo:()=>Mq,REFRESH_SKILL:()=>
|
|
2
|
+
var uq=Object.defineProperty;var Xq=(q)=>q;function Gq(q,z){this[q]=Xq.bind(null,z)}var l=(q,z)=>{for(var J in z)uq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Gq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var d={};l(d,{removeRepoAssets:()=>fq,installRefreshSkill:()=>wq,installPlanSkill:()=>gq,installInitSkill:()=>bq,installCodexRepoSkills:()=>Cq,ensureWorkflowDoc:()=>Nq,ensureMcp:()=>Kq,auditRepo:()=>Mq,REFRESH_SKILL:()=>k,PLAN_SKILL:()=>t,INIT_SKILL:()=>F});import{existsSync as v,mkdirSync as g,readFileSync as W,rmSync as w,writeFileSync as B}from"fs";import{join as $}from"path";function bq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,F),J}function wq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,k),J}function gq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,t),J}function Cq(q){let z=[];for(let J of jq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");B(V,J.body()),z.push(V)}return z}function Nq(q){let z=$(q,"AGENTS.md"),J="";try{J=W(z,"utf8")}catch{}let Q=new RegExp(`${j}[\\s\\S]*?${O}`);J=Q.test(J)?J.replace(Q,s):`${J.trim()}
|
|
3
3
|
|
|
4
4
|
${s}
|
|
5
5
|
`.trimStart(),B(z,J.endsWith(`
|
|
@@ -9,12 +9,12 @@ ${s}
|
|
|
9
9
|
`:""}@AGENTS.md
|
|
10
10
|
`)}function Kq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(W(z,"utf8"))}catch{}if(J.mcpServers=J.mcpServers??{},J.mcpServers.beacon)return{path:z,added:!1};return J.mcpServers.beacon={command:"beacon",args:["mcp"]},B(z,JSON.stringify(J,null,2)+`
|
|
11
11
|
`),{path:z,added:!0}}function Mq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(W(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=W($(q,"AGENTS.md"),"utf8").includes(j)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(W($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function fq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(W(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)w(Q,{force:!0});else B(Q,JSON.stringify(Z,null,2)+`
|
|
12
|
-
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=W(Y,"utf8"),P=new RegExp(`\\n?${j}[\\s\\S]*?${
|
|
12
|
+
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=W(Y,"utf8"),P=new RegExp(`\\n?${j}[\\s\\S]*?${O}\\n?`);if(P.test(Z)){let E=Z.replace(P,`
|
|
13
13
|
`).replace(/\n{3,}/g,`
|
|
14
14
|
|
|
15
|
-
`).trimStart();B(Y,
|
|
16
|
-
`)?
|
|
17
|
-
`),V=!0}}catch{}let U=!1,H=$(q,"CLAUDE.md");try{let Z=W(H,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())w(H,{force:!0});else B(H,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var
|
|
15
|
+
`).trimStart();B(Y,E.endsWith(`
|
|
16
|
+
`)?E:`${E}
|
|
17
|
+
`),V=!0}}catch{}let U=!1,H=$(q,"CLAUDE.md");try{let Z=W(H,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())w(H,{force:!0});else B(H,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var F=`---
|
|
18
18
|
name: beacon-init
|
|
19
19
|
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.
|
|
20
20
|
---
|
|
@@ -52,7 +52,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
52
52
|
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.
|
|
53
53
|
|
|
54
54
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
55
|
-
`,
|
|
55
|
+
`,k=`---
|
|
56
56
|
name: beacon-refresh
|
|
57
57
|
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.
|
|
58
58
|
---
|
|
@@ -141,7 +141,7 @@ If it returns feedback, revise and call it again.
|
|
|
141
141
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
142
142
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
143
143
|
run \`beacon\` in this repo once.
|
|
144
|
-
`,jq,j="<!-- beacon:workflow:start -->",
|
|
144
|
+
`,jq,j="<!-- beacon:workflow:start -->",O="<!-- beacon:workflow:end -->",s;var c=b(()=>{jq=[{name:"beacon-init",body:()=>F},{name:"beacon-refresh",body:()=>k}];s=`${j}
|
|
145
145
|
## Beacon \u2014 feature workflow
|
|
146
146
|
|
|
147
147
|
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:
|
|
@@ -199,18 +199,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
199
199
|
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.
|
|
200
200
|
|
|
201
201
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
202
|
-
${
|
|
203
|
-
`)}function e(q,z){let J=
|
|
202
|
+
${O}`});import{existsSync as n,mkdirSync as L,readFileSync as N,rmSync as Tq,writeFileSync as K}from"fs";import{dirname as r,join as C}from"path";function y(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function o(q,z){L(r(q),{recursive:!0}),K(q,JSON.stringify(z,null,2)+`
|
|
203
|
+
`)}function e(q,z){let J=y(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),o(q,J),!0}function qq(q,z){return(y(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function zq(q,z){let J=y(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let H=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==H)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return o(q,J),!0}function Jq(q,z,J,Q){let V=`${z}
|
|
204
204
|
${Q.trim()}
|
|
205
205
|
${J}`,Y="";try{Y=N(q,"utf8")}catch{}let U=new RegExp(`${z}[\\s\\S]*?${J}`);Y=U.test(Y)?Y.replace(U,V):Y.trim()?`${Y.trim()}
|
|
206
206
|
|
|
207
207
|
${V}
|
|
208
208
|
`:`${V}
|
|
209
|
-
`,
|
|
209
|
+
`,L(r(q),{recursive:!0}),K(q,Y.endsWith(`
|
|
210
210
|
`)?Y:`${Y}
|
|
211
|
-
`)}function
|
|
211
|
+
`)}function h(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Qq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
|
|
212
212
|
|
|
213
|
-
`).trimStart();return K(q,Y),!0}function Vq(q,z,J){let Q=C(q,z);
|
|
213
|
+
`).trimStart();return K(q,Y),!0}function Vq(q,z,J){let Q=C(q,z);L(Q,{recursive:!0});let V=C(Q,"SKILL.md");return K(V,J),V}function _(q,z){return n(C(q,z,"SKILL.md"))}function Yq(q,z){let J=C(q,z);if(!n(J))return!1;return Tq(J,{recursive:!0,force:!0}),!0}var M,i=`## Beacon (visual planning panel)
|
|
214
214
|
|
|
215
215
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
216
216
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -231,17 +231,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
231
231
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
232
232
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
233
233
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
234
|
-
verbatim. Do NOT implement until the tool returns approval.`;var Zq=b(()=>{M=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Iq,renameSync as Rq,rmSync as Aq,writeFileSync as Dq}from"fs";import{dirname as Eq}from"path";function
|
|
234
|
+
verbatim. Do NOT implement until the tool returns approval.`;var Zq=b(()=>{M=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Iq,renameSync as Rq,rmSync as Aq,writeFileSync as Dq}from"fs";import{dirname as Eq}from"path";function f(q,z){Iq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{Dq(J,z),Rq(J,q)}catch(Q){throw Aq(J,{force:!0}),Q}}function nq(q,z,J=!1){f(q,JSON.stringify(z,null,J?2:void 0))}var $q=()=>{};var _q={};l(_q,{setupCodexAssets:()=>Lq,removeCodexMcp:()=>xq,removeCodexArtifacts:()=>hq,hasCodexMcp:()=>a,ensureCodexMcp:()=>vq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>yq,CODEX_HOOKS:()=>D});import{readFileSync as A}from"fs";import{homedir as Fq}from"os";import{join as G}from"path";function Uq(){return process.env.HOME||process.env.USERPROFILE||Fq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(m===void 0)m=Bun.which("codex")!==null;return m}function X(q){try{return Bun.TOML.parse(q)}catch{return null}}function a(){try{return Boolean(X(A(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=A(x(),"utf8")}catch{return null}let z=X(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function vq(){let q="",z=!1;try{q=A(x(),"utf8"),z=!0}catch{}if(z){let Y=X(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};if(Y.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 ${u}`}}let J=!q?"":q.endsWith(`
|
|
235
235
|
`)?`
|
|
236
236
|
`:`
|
|
237
237
|
|
|
238
|
-
`,Q=q+J+kq;if(X(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return
|
|
238
|
+
`,Q=q+J+kq;if(X(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return f(x(),Q),{added:!0}}function xq(){let q="";try{q=A(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
|
|
239
239
|
`),J=z.indexOf(Wq);if(J===-1)return{removed:!1,skipped:a()};let Q=z.indexOf(Hq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
|
|
240
240
|
`).replace(/\n{3,}/g,`
|
|
241
241
|
|
|
242
|
-
`).replace(/^\n+/,"");if(X(V)===null)return{removed:!1,skipped:!0};return
|
|
242
|
+
`).replace(/^\n+/,"");if(X(V)===null)return{removed:!1,skipped:!0};return f(x(),V),{removed:!0}}async function Lq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (c(),d)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of M){if(!_(I(),Z))V.push(Z);Vq(I(),Z,Q[Z])}let Y=0;for(let Z of D)if(e(p(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=h(T(),R);Jq(T(),R,Pq,i);let H=vq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:H}}function yq(){let q={};for(let J of M)q[J]=_(I(),J);let z={};for(let J of D)z[J.event]=qq(p(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:h(T(),R),mcp:a()}}function hq(){let q=[];for(let V of M)if(Yq(I(),V))q.push(V);let z=0;for(let V of D)if(zq(p(),{event:V.event,command:V.command}))z++;let J=Qq(T(),R,Pq),Q=xq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var S=()=>G(Uq(),".codex"),p=()=>G(S(),"hooks.json"),x=()=>G(S(),"config.toml"),T=()=>G(S(),"AGENTS.md"),I=()=>G(Uq(),".agents","skills"),R="<!-- beacon:global:start -->",Pq="<!-- beacon:global:end -->",D,m,Wq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Hq="# beacon:end",kq,u="add it manually: codex mcp add beacon -- beacon mcp";var mq=b(()=>{Zq();$q();D=[{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."}];kq=`${Wq}
|
|
243
243
|
[mcp_servers.beacon]
|
|
244
244
|
command = "beacon"
|
|
245
245
|
args = ["mcp"]
|
|
246
246
|
${Hq}
|
|
247
|
-
`});mq();export{Lq as setupCodexAssets,xq as removeCodexMcp,hq as removeCodexArtifacts,a as hasCodexMcp,vq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,yq as auditCodex,
|
|
247
|
+
`});mq();export{Lq as setupCodexAssets,xq as removeCodexMcp,hq as removeCodexArtifacts,a as hasCodexMcp,vq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,yq as auditCodex,D as CODEX_HOOKS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Fq=Object.defineProperty;var Tq=(q)=>q;function Rq(q,z){this[q]=Tq.bind(null,z)}var Pq=(q,z)=>{for(var J in z)Fq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Rq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var
|
|
2
|
+
var Fq=Object.defineProperty;var Tq=(q)=>q;function Rq(q,z){this[q]=Tq.bind(null,z)}var Pq=(q,z)=>{for(var J in z)Fq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Rq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var r={};Pq(r,{removeRepoAssets:()=>_q,installRefreshSkill:()=>Eq,installPlanSkill:()=>yq,installInitSkill:()=>Iq,installCodexRepoSkills:()=>Dq,ensureWorkflowDoc:()=>Oq,ensureMcp:()=>hq,auditRepo:()=>kq,REFRESH_SKILL:()=>d,PLAN_SKILL:()=>Uq,INIT_SKILL:()=>c});import{existsSync as H,mkdirSync as f,readFileSync as X,rmSync as G,writeFileSync as x}from"fs";import{join as $}from"path";function Iq(q){let z=$(q,".claude","skills","beacon-init");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,c),J}function Eq(q){let z=$(q,".claude","skills","beacon-refresh");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,d),J}function yq(q){let z=$(q,".claude","skills","beacon-plan");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,Uq),J}function Dq(q){let z=[];for(let J of Aq){let Q=$(q,".agents","skills",J.name);f(Q,{recursive:!0});let V=$(Q,"SKILL.md");x(V,J.body()),z.push(V)}return z}function Oq(q){let z=$(q,"AGENTS.md"),J="";try{J=X(z,"utf8")}catch{}let Q=new RegExp(`${C}[\\s\\S]*?${n}`);J=Q.test(J)?J.replace(Q,Wq):`${J.trim()}
|
|
3
3
|
|
|
4
4
|
${Wq}
|
|
5
5
|
`.trimStart(),x(z,J.endsWith(`
|
|
@@ -9,12 +9,12 @@ ${Wq}
|
|
|
9
9
|
`:""}@AGENTS.md
|
|
10
10
|
`)}function hq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(X(z,"utf8"))}catch{}if(J.mcpServers=J.mcpServers??{},J.mcpServers.beacon)return{path:z,added:!1};return J.mcpServers.beacon={command:"beacon",args:["mcp"]},x(z,JSON.stringify(J,null,2)+`
|
|
11
11
|
`),{path:z,added:!0}}function kq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(X(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=X($(q,"AGENTS.md"),"utf8").includes(C)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(X($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":H($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":H($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":H($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":H($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function _q(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=$(q,".claude","skills",Z);if(H(U))G(U,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let U=$(q,".agents","skills",Z);if(H(U))G(U,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(X(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)G(Q,{force:!0});else x(Q,JSON.stringify(Z,null,2)+`
|
|
12
|
-
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=X(Y,"utf8"),U=new RegExp(`\\n?${C}[\\s\\S]*?${
|
|
12
|
+
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=X(Y,"utf8"),U=new RegExp(`\\n?${C}[\\s\\S]*?${n}\\n?`);if(U.test(Z)){let t=Z.replace(U,`
|
|
13
13
|
`).replace(/\n{3,}/g,`
|
|
14
14
|
|
|
15
|
-
`).trimStart();x(Y,
|
|
16
|
-
`)?
|
|
17
|
-
`),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=X(W,"utf8"),U=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==Z){if(!U.trim())G(W,{force:!0});else x(W,U);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var
|
|
15
|
+
`).trimStart();x(Y,t.endsWith(`
|
|
16
|
+
`)?t:`${t}
|
|
17
|
+
`),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=X(W,"utf8"),U=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==Z){if(!U.trim())G(W,{force:!0});else x(W,U);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var c=`---
|
|
18
18
|
name: beacon-init
|
|
19
19
|
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.
|
|
20
20
|
---
|
|
@@ -52,7 +52,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
52
52
|
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.
|
|
53
53
|
|
|
54
54
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
55
|
-
`,
|
|
55
|
+
`,d=`---
|
|
56
56
|
name: beacon-refresh
|
|
57
57
|
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.
|
|
58
58
|
---
|
|
@@ -141,7 +141,7 @@ If it returns feedback, revise and call it again.
|
|
|
141
141
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
142
142
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
143
143
|
run \`beacon\` in this repo once.
|
|
144
|
-
`,Aq,C="<!-- beacon:workflow:start -->",
|
|
144
|
+
`,Aq,C="<!-- beacon:workflow:start -->",n="<!-- beacon:workflow:end -->",Wq;var s=b(()=>{Aq=[{name:"beacon-init",body:()=>c},{name:"beacon-refresh",body:()=>d}];Wq=`${C}
|
|
145
145
|
## Beacon \u2014 feature workflow
|
|
146
146
|
|
|
147
147
|
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:
|
|
@@ -199,18 +199,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
199
199
|
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.
|
|
200
200
|
|
|
201
201
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
202
|
-
${
|
|
203
|
-
`)}function R(q,z){let J=
|
|
202
|
+
${n}`});import{existsSync as xq,mkdirSync as l,readFileSync as M,rmSync as Lq,writeFileSync as F}from"fs";import{dirname as Xq,join as K}from"path";function i(q){try{return JSON.parse(M(q,"utf8"))}catch{return{}}}function wq(q,z){l(Xq(q),{recursive:!0}),F(q,JSON.stringify(z,null,2)+`
|
|
203
|
+
`)}function R(q,z){let J=i(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((P)=>P.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),wq(q,J),!0}function I(q,z){return(i(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function E(q,z){let J=i(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((P)=>{let W=P.hooks?.length??0,Z=(P.hooks??[]).filter((U)=>U.command!==z.command);if(Z.length!==W)V=!0;return{...P,hooks:Z}}).filter((P)=>(P.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return wq(q,J),!0}function y(q,z,J,Q){let V=`${z}
|
|
204
204
|
${Q.trim()}
|
|
205
205
|
${J}`,Y="";try{Y=M(q,"utf8")}catch{}let P=new RegExp(`${z}[\\s\\S]*?${J}`);Y=P.test(Y)?Y.replace(P,V):Y.trim()?`${Y.trim()}
|
|
206
206
|
|
|
207
207
|
${V}
|
|
208
208
|
`:`${V}
|
|
209
|
-
`,
|
|
209
|
+
`,l(Xq(q),{recursive:!0}),F(q,Y.endsWith(`
|
|
210
210
|
`)?Y:`${Y}
|
|
211
211
|
`)}function v(q,z){try{return M(q,"utf8").includes(z)}catch{return!1}}function A(q,z,J){let Q="";try{Q=M(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
|
|
212
212
|
|
|
213
|
-
`).trimStart();return F(q,Y),!0}function D(q,z,J){let Q=K(q,z);
|
|
213
|
+
`).trimStart();return F(q,Y),!0}function D(q,z,J){let Q=K(q,z);l(Q,{recursive:!0});let V=K(Q,"SKILL.md");return F(V,J),V}function j(q,z){return xq(K(q,z,"SKILL.md"))}function O(q,z){let J=K(q,z);if(!xq(J))return!1;return Lq(J,{recursive:!0,force:!0}),!0}var w,T=`## Beacon (visual planning panel)
|
|
214
214
|
|
|
215
215
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
216
216
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -231,17 +231,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
231
231
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
232
232
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
233
233
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
234
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
234
|
+
verbatim. Do NOT implement until the tool returns approval.`;var o=b(()=>{w=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as mq,renameSync as pq,rmSync as Sq,writeFileSync as aq}from"fs";import{dirname as tq}from"path";function h(q,z){mq(tq(q),{recursive:!0});let J=`${q}.tmp`;try{aq(J,z),pq(J,q)}catch(Q){throw Sq(J,{force:!0}),Q}}function jz(q,z,J=!1){h(q,JSON.stringify(z,null,J?2:void 0))}var Hq=()=>{};var Gq={};Pq(Gq,{setupCodexAssets:()=>rq,removeCodexMcp:()=>bq,removeCodexArtifacts:()=>lq,hasCodexMcp:()=>Jq,ensureCodexMcp:()=>Nq,codexMcpProblem:()=>nq,codexDetected:()=>jq,auditCodex:()=>sq,CODEX_HOOKS:()=>p});import{readFileSync as m}from"fs";import{homedir as cq}from"os";import{join as N}from"path";function gq(){return process.env.HOME||process.env.USERPROFILE||cq()}function jq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(e===void 0)e=Bun.which("codex")!==null;return e}function u(q){try{return Bun.TOML.parse(q)}catch{return null}}function Jq(){try{return Boolean(u(m(g(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function nq(){let q="";try{q=m(g(),"utf8")}catch{return null}let z=u(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${B}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${B}`;return null}function Nq(){let q="",z=!1;try{q=m(g(),"utf8"),z=!0}catch{}if(z){let Y=u(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${B}`};if(Y.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 ${B}`}}let J=!q?"":q.endsWith(`
|
|
235
235
|
`)?`
|
|
236
236
|
`:`
|
|
237
237
|
|
|
238
|
-
`,Q=q+J+dq;if(u(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${B}`};return
|
|
238
|
+
`,Q=q+J+dq;if(u(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${B}`};return h(g(),Q),{added:!0}}function bq(){let q="";try{q=m(g(),"utf8")}catch{return{removed:!1}}let z=q.split(`
|
|
239
239
|
`),J=z.indexOf(Bq);if(J===-1)return{removed:!1,skipped:Jq()};let Q=z.indexOf(uq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
|
|
240
240
|
`).replace(/\n{3,}/g,`
|
|
241
241
|
|
|
242
|
-
`).replace(/^\n+/,"");if(u(V)===null)return{removed:!1,skipped:!0};return
|
|
242
|
+
`).replace(/^\n+/,"");if(u(V)===null)return{removed:!1,skipped:!0};return h(g(),V),{removed:!0}}async function rq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of w){if(!j(_(),Z))V.push(Z);D(_(),Z,Q[Z])}let Y=0;for(let Z of p)if(R(zq(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let P=v(k(),L);y(k(),L,vq,T);let W=Nq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!P,mcp:W}}function sq(){let q={};for(let J of w)q[J]=j(_(),J);let z={};for(let J of p)z[J.event]=I(zq(),{event:J.event,command:J.command});return{detected:jq(),skills:q,hooks:z,agentsMdBlock:v(k(),L),mcp:Jq()}}function lq(){let q=[];for(let V of w)if(O(_(),V))q.push(V);let z=0;for(let V of p)if(E(zq(),{event:V.event,command:V.command}))z++;let J=A(k(),L,vq),Q=bq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var qq=()=>N(gq(),".codex"),zq=()=>N(qq(),"hooks.json"),g=()=>N(qq(),"config.toml"),k=()=>N(qq(),"AGENTS.md"),_=()=>N(gq(),".agents","skills"),L="<!-- beacon:global:start -->",vq="<!-- beacon:global:end -->",p,e,Bq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",uq="# beacon:end",dq,B="add it manually: codex mcp add beacon -- beacon mcp";var fq=b(()=>{o();Hq();p=[{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."}];dq=`${Bq}
|
|
243
243
|
[mcp_servers.beacon]
|
|
244
244
|
command = "beacon"
|
|
245
245
|
args = ["mcp"]
|
|
246
246
|
${uq}
|
|
247
|
-
`});
|
|
247
|
+
`});o();import{existsSync as iq}from"fs";import{homedir as oq}from"os";import{join as S}from"path";function eq(){return process.env.HOME||process.env.USERPROFILE||oq()}var a=()=>S(eq(),".claude"),Qq=()=>S(a(),"skills"),Vq=()=>S(a(),"settings.json"),Yq=()=>S(a(),"CLAUDE.md"),Zq="<!-- beacon:global:start -->",Cq="<!-- beacon:global:end -->";var qz=T,$q=[{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 zz(q,z){return D(Qq(),q,z)}function Kq(q){return j(Qq(),q)}function Jz(q){return O(Qq(),q)}function Qz(q){return R(Vq(),q)}function Vz(q){return I(Vq(),q)}function Yz(q){return E(Vq(),q)}function Zz(q){y(Yq(),Zq,Cq,q)}function Mq(){return v(Yq(),Zq)}function $z(){return A(Yq(),Zq,Cq)}function Tz(){let q={};for(let J of w)q[J]=Kq(J);let z={};for(let J of $q)z[J.event]=Vz({event:J.event,command:J.command});return{homeExists:iq(a()),skills:q,hooks:z,claudeMdBlock:Mq()}}async function Pz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of w){if(!Kq(W))V.push(W);zz(W,Q[W])}let Y=0;for(let W of $q)if(Qz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Mq();return Zz(qz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function Rz(){let q;try{q={ok:!0,...await Pz()}}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(() => (fq(),Gq));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 Iz(){let q=[];for(let Q of w)if(Jz(Q))q.push(Q);let z=0;for(let Q of $q)if(Yz(Q))z++;let J=$z();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Pz as setupGlobalAssets,Rz as selfHealGlobal,Jz as removeGlobalSkill,Yz as removeGlobalHook,$z as removeGlobalClaudeMdBlock,Iz as removeBeaconArtifacts,Kq as isGlobalSkillInstalled,zz as installGlobalSkill,Vz as hasGlobalHook,Mq as hasGlobalClaudeMdBlock,Qz as ensureGlobalHook,Zz as ensureGlobalClaudeMdBlock,Tz as auditGlobal,w as GLOBAL_SKILLS,$q as GLOBAL_HOOKS,qz as GLOBAL_CLAUDE_MD_BLOCK};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var r=Object.defineProperty;var a=(Q)=>Q;function i(Q,X){this[Q]=a.bind(null,X)}var t=(Q,X)=>{for(var Z in X)r(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:i.bind(X,Z)})};var R=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var I={};t(I,{provisionDb:()=>NQ});import{createClient as e}from"@libsql/client";import{drizzle as QQ}from"drizzle-orm/libsql";import{migrate as XQ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as ZQ}from"drizzle-orm/migrator";import{dirname as C,join as $Q}from"path";import{fileURLToPath as YQ}from"url";async function M(Q,X){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[X]})).rows.length>0}async function KQ(Q,X){let Z=await Q.execute(`PRAGMA table_info("${X}")`);return new Set(Z.rows.map(($)=>String($.name)))}async function A(Q){if(!await M(Q,"__drizzle_migrations"))return 0;let X=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(X.rows[0]?.n??0)}async function VQ(Q){for(let[X,Z]of Object.entries(BQ)){if(!await M(Q,X))continue;let $=await KQ(Q,X);for(let Y of Z){if(!$.has(Y))continue;await Q.execute(`UPDATE "${X}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function NQ(Q,X=JQ){let Z=e({url:Q});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let $=await M(Z,"__drizzle_migrations"),Y=await M(Z,"Node"),J=!1;if(Y&&!$){let N=ZQ({migrationsFolder:X})[0];if(N)await Z.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await Z.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[N.hash,N.folderMillis]}),J=!0}let j=await A(Z);if(await XQ(QQ(Z),{migrationsFolder:X}),await A(Z)>j)J=!0;return await VQ(Z),{migrated:J}}finally{Z.close()}}var GQ,JQ,BQ;var f=R(async()=>{GQ=C(C(C(YQ(import.meta.url)))),JQ=process.env.BEACON_MIGRATIONS_DIR||$Q(GQ,"drizzle"),BQ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});import{mkdirSync as RQ,renameSync as AQ,rmSync as IQ,writeFileSync as fQ}from"fs";import{dirname as PQ}from"path";function SQ(Q,X){RQ(PQ(Q),{recursive:!0});let Z=`${Q}.tmp`;try{fQ(Z,X),AQ(Z,Q)}catch($){throw IQ(Z,{force:!0}),$}}function o(Q,X,Z=!1){SQ(Q,JSON.stringify(X,null,Z?2:void 0))}var d=()=>{};import{AsyncLocalStorage as LQ}from"async_hooks";import{spawnSync as UQ}from"child_process";import{createHash as jQ}from"crypto";import{existsSync as S,mkdirSync as L,readFileSync as T,writeFileSync as W}from"fs";import{homedir as v}from"os";import{basename as MQ,join as B,parse as zQ,resolve as P}from"path";function G(){return process.env.BEACON_HOME||B(v(),".beacon")}function D(){return B(G(),"workspaces.json")}function z(Q){return jQ("sha256").update(Q).digest("hex").slice(0,12)}function GX(Q=process.cwd()){let X=UQ("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(X.status===0){let Z=X.stdout?.toString().trim();if(Z)return Z}return Q}function k(Q){let X=P(Q);return X!==P(v())&&X!==zQ(X).root}function y(){return B(G(),"deleted.json")}function u(){try{let Q=JSON.parse(T(y(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function g(Q){L(G(),{recursive:!0}),W(y(),JSON.stringify(Q,null,2))}function w(Q){return u().includes(Q)}function JX(Q){let X=u();if(!X.includes(Q))g([...X,Q])}function OQ(Q){let X=u();if(X.includes(Q))g(X.filter((Z)=>Z!==Q))}function O(Q){return B(G(),Q)}function qQ(Q){return`file:${B(O(Q),"db.sqlite")}`}function U(){try{let Q=JSON.parse(T(D(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function x(Q){L(G(),{recursive:!0}),W(D(),JSON.stringify(Q,null,2))}function CQ(){return U().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function K(Q){return U().find((X)=>X.id===Q)??null}function b(Q,X,Z=new Date().toISOString()){if(!k(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let $=z(Q);if(w($))throw Error(`beacon: workspace ${$} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=U(),J=Y.find((q)=>q.id===$),j={id:$,path:Q,name:X||J?.name||MQ(Q),lastOpenedAt:Z},N=[j,...Y.filter((q)=>q.id!==$)];return L(O($),{recursive:!0}),x(N),j}function BX(Q,X){return OQ(z(Q)),b(Q,X)}function KX(Q,X=new Date().toISOString()){let Z=U(),$=Z.find((Y)=>Y.id===Q);if(!$)return;$.lastOpenedAt=X,x(Z)}function VX(Q){if(x(U().filter((X)=>X.id!==Q)),E()===Q)_Q(CQ()[0]?.id??null)}function m(){return B(G(),"active")}function E(){try{return T(m(),"utf8").trim()||null}catch{return null}}function _Q(Q){L(G(),{recursive:!0}),W(m(),Q??"")}function NX(){let Q=E();return Q?K(Q):null}function LX(){let Q=WQ()??E();return Q?K(Q):null}function UX(Q){return K(Q)?.path??null}function jX(){return S(D())}var h="beacon_ws";function p(Q,X){let Z=Q.headers.get("cookie");if(!Z)return null;for(let $ of Z.split(";")){let Y=$.indexOf("=");if(Y===-1)continue;if($.slice(0,Y).trim()===X)return decodeURIComponent($.slice(Y+1).trim())}return null}function MX(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&K(X))return X;let Z=p(Q,h);if(Z&&K(Z))return Z;return null}var TQ="x-beacon-workspace-path";async function zX(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&K(X))return X;let Z=Q.headers.get(TQ);if(Z&&k(Z)&&!w(z(Z))&&(!X||z(Z)===X)){let Y=b(Z);return await DQ(Y.id),Y.id}let $=p(Q,h);if($&&K($))return $;return null}var l=new LQ;function OX(Q,X){return Q?l.run(Q,X):X()}function WQ(){return l.getStore()??null}var _=new Set;function qX(Q){_.delete(B(O(Q),"db.sqlite"))}async function DQ(Q){let X=O(Q),Z=B(X,"db.sqlite"),$=S(Z);if($&&_.has(Z))return{ok:!0,created:!1,migrated:!1};try{L(X,{recursive:!0});let{provisionDb:Y}=await f().then(() => I),J=await Y(qQ(Q));return _.add(Z),{ok:!0,created:!$,migrated:$&&J.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}var _X="wenzorithelly/beacon",TX="trybeacon",WX="https://registry.npmjs.org/trybeacon/latest",F=(process.env.NEXT_PUBLIC_BEACON_SITE_URL??"https://www.trybeacon.sh").replace(/\/$/,""),DX=`curl -fsSL ${F}/install.sh | sh`;import{randomUUID as vQ}from"crypto";import{readFileSync as kQ}from"fs";import{join as yQ}from"path";import{mkdirSync as xQ,readFileSync as EQ,writeFileSync as FQ}from"fs";import{join as HQ}from"path";var uQ=["default","acceptEdits","bypassPermissions","auto"];function c(Q){return typeof Q==="string"&&uQ.includes(Q)}function xX(Q,X){let Z={behavior:"allow"};if(Q)Z.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let $={hookEventName:"PermissionRequest",decision:Z};if(X?.trim())$.additionalContext=X;return{hookSpecificOutput:$}}function s(){return HQ(G(),"preferences.json")}function V(){try{let Q=JSON.parse(EQ(s(),"utf8"));return{planApprovalMode:c(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function H(Q){let X={...V(),...Q};return xQ(G(),{recursive:!0}),FQ(s(),JSON.stringify(X,null,2)),X}d();var gQ=43200000,wQ=3600000;function bQ(){let Q=V().telemetryUuid;if(Q)return Q;let X=vQ();return H({telemetryUuid:X}),X}function mQ(Q=process.env){if(Q.BEACON_TELEMETRY_DISABLED==="1")return!1;let X=Q.DO_NOT_TRACK;if(X!==void 0&&X!==""&&X!=="0"&&X!=="false")return!1;return V().telemetryEnabled!==!1}function hX(Q){bQ(),H({telemetryEnabled:Q})}function pX(Q=process.env){let X=V().telemetryUuid??null;if(Q.BEACON_TELEMETRY_DISABLED==="1")return{enabled:!1,reason:"env:BEACON_TELEMETRY_DISABLED",machineId:X};let Z=Q.DO_NOT_TRACK;if(Z!==void 0&&Z!==""&&Z!=="0"&&Z!=="false")return{enabled:!1,reason:"env:DO_NOT_TRACK",machineId:X};if(V().telemetryEnabled===!1)return{enabled:!1,reason:"preference",machineId:X};return{enabled:!0,reason:"default",machineId:X}}function n(){return yQ(G(),"telemetry.json")}function hQ(){try{let Q=JSON.parse(kQ(n(),"utf8"));return{lastHeartbeatAt:typeof Q.lastHeartbeatAt==="string"?Q.lastHeartbeatAt:void 0}}catch{return{}}}function pQ(Q){o(n(),Q)}function lQ(Q,X){if(!Q)return!0;let Z=Date.parse(Q);if(Number.isNaN(Z))return!0;return X.getTime()-Z>=gQ}function cQ(Q,X=process.env){return{machineId:V().telemetryUuid??"",version:Q,platform:process.platform,arch:process.arch,ci:Boolean(X.CI&&X.CI!=="false")}}async function sQ(Q,X={}){let Z=X.env??process.env;try{if(!mQ(Z))return;let $=cQ(Q,Z);if(Z.BEACON_TELEMETRY_DEBUG==="1"){console.log(`[beacon-telemetry] debug \u2014 would send: ${JSON.stringify($)}`);return}if(!$.machineId)return;if((await(X.fetchImpl??fetch)(`${F}/api/telemetry`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify($),signal:AbortSignal.timeout(3000)})).ok)pQ({lastHeartbeatAt:(X.now??new Date).toISOString()})}catch{}}function lX(Q){let X=globalThis;if(X.__beaconTelemetry)return;X.__beaconTelemetry=!0;let Z=()=>{try{if(!lQ(hQ().lastHeartbeatAt,new Date))return;sQ(Q)}catch{}};Z(),setInterval(Z,wQ).unref()}export{pQ as writeHeartbeatState,pX as telemetryStatus,lX as startTelemetry,lQ as shouldHeartbeat,hX as setTelemetryEnabled,sQ as sendHeartbeat,hQ as readHeartbeatState,mQ as isTelemetryEnabled,cQ as heartbeatPayload,bQ as ensureTelemetryId};
|