trybeacon 0.1.71 → 0.1.73
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/.claude-plugin/plugin.json +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +25 -21
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +30 -6
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +11 -11
- package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/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/changes/comment/claim/route.js +1 -0
- package/.next/server/app/api/changes/comment/claim/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/comment/claim/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/comment/route.js +1 -0
- package/.next/server/app/api/changes/comment/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/comment/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/quality/route.js +1 -0
- package/.next/server/app/api/changes/quality/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/quality/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/route.js +1 -0
- package/.next/server/app/api/{flags → changes}/route.js.nft.json +1 -1
- package/.next/server/app/api/changes/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/viewed/route.js +1 -0
- package/.next/server/app/api/changes/viewed/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/viewed/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/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 +1 -9
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/position/route.js.nft.json +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/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/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/edges/route.js.nft.json +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/ingest/route.js +1 -9
- package/.next/server/app/api/ingest/route.js.nft.json +1 -1
- package/.next/server/app/api/init/route.js +1 -9
- package/.next/server/app/api/init/route.js.nft.json +1 -1
- package/.next/server/app/api/lesson/close/route.js +1 -1
- package/.next/server/app/api/lesson/presence/route.js +1 -1
- package/.next/server/app/api/lesson/questions/route.js +1 -1
- package/.next/server/app/api/lesson/route.js +1 -1
- package/.next/server/app/api/lesson/save/route.js +1 -1
- package/.next/server/app/api/lesson/verdict/route.js +1 -1
- package/.next/server/app/api/map/describe/route.js +1 -9
- package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/files/route.js.nft.json +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/route.js.nft.json +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/start/route.js.nft.json +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
- package/.next/server/app/api/mention-search/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +3 -3
- package/.next/server/app/api/plan/approve/route.js +1 -9
- package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/history/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/presence/route.js +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-meta/route.js +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -1
- package/.next/server/app/api/share/create/route.js +1 -1
- package/.next/server/app/api/share/create/route.js.nft.json +1 -1
- package/.next/server/app/api/share/route.js +1 -1
- package/.next/server/app/api/stream/route.js +2 -2
- package/.next/server/app/api/tab/nav/route.js +1 -1
- package/.next/server/app/api/tab/presence/route.js +1 -1
- package/.next/server/app/api/telemetry/route.js +1 -1
- package/.next/server/app/api/telemetry/stats/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/apple-icon.png/route.js +1 -1
- package/.next/server/app/docs/page.js +2 -2
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +11 -11
- package/.next/server/app/docs.segments/_full.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs.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 +11 -11
- package/.next/server/app/help.segments/_full.segment.rsc +11 -11
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +11 -11
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +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 +11 -11
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/learn/page.js +4 -4
- package/.next/server/app/learn/page.js.nft.json +1 -1
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +12 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +2 -2
- package/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/server/app/s/[token]/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 +25 -21
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/2025.js +1 -1
- package/.next/server/chunks/230.js +1 -0
- package/.next/server/chunks/2693.js +5 -0
- package/.next/server/chunks/4307.js +1 -1
- package/.next/server/chunks/6469.js +10 -0
- package/.next/server/chunks/8190.js +1 -0
- package/.next/server/chunks/8227.js +1 -0
- package/.next/server/chunks/8674.js +7 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/4853-0082a1e1b820a293.js +1 -0
- package/.next/static/chunks/5909-387573cddda35a48.js +1 -0
- package/.next/static/chunks/654-8e68a43e4c589e9c.js +1 -0
- package/.next/static/chunks/app/_global-error/page-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/claim/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/quality/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/viewed/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/edges/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/entities/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/init/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/close/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/questions/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/save/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/verdict/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/mention-search/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/notes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/open/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/reset/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/share/create/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/share/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/stream/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/version/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/{layout-d3b7276f116dce46.js → layout-6e934a2850efd223.js} +1 -1
- package/.next/static/chunks/app/learn/page-a14eaf5143e2df55.js +7 -0
- package/.next/static/chunks/app/map/{page-5d73cd85ed62df7a.js → page-06282017c592fb3c.js} +1 -1
- package/.next/static/chunks/app/plan/page-41a3990cb858c5f2.js +11 -0
- package/.next/static/chunks/app/s/[token]/{page-4d3ed0a6a420eb44.js → page-a4deb16beff21840.js} +1 -1
- package/.next/static/chunks/app/settings/page-67cab634be8bfef2.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/{webpack-de4a0d9611ec2cad.js → webpack-6c27b0ed1ac1459c.js} +1 -1
- package/.next/static/css/95dc31edc34789a7.css +1 -0
- package/.next/static/css/a5d17568738ef1e9.css +1 -0
- package/.next/static/mB9lqGEsIvB7tTvv9GU48/_buildManifest.js +1 -0
- package/.next/trace +45 -43
- package/.next/trace-build +1 -1
- package/.next/types/app/api/changes/comment/claim/route.ts +351 -0
- package/.next/types/app/api/changes/comment/route.ts +351 -0
- package/.next/types/app/api/changes/quality/route.ts +351 -0
- package/.next/types/app/api/{flags → changes}/route.ts +3 -3
- package/.next/types/app/api/changes/viewed/route.ts +351 -0
- package/.next/types/routes.d.ts +6 -2
- package/.next/types/validator.ts +45 -9
- package/bun.lock +54 -0
- package/dist/bin/doctor.js +33 -32
- package/dist/bin/guard.js +1 -1
- package/dist/bin/hook.js +33 -32
- package/dist/bin/mcp.js +43 -42
- package/dist/bin/plan.js +35 -34
- package/dist/bin/uninstall.js +34 -33
- package/dist/lib/assets.js +25 -24
- package/dist/lib/codex-install.js +32 -31
- package/dist/lib/global-install.js +33 -32
- package/package.json +3 -1
- package/plugin/skills/beacon-plan/SKILL.md +5 -4
- package/.next/server/app/api/flags/route.js +0 -1
- package/.next/server/app/api/flags/route_client-reference-manifest.js +0 -1
- package/.next/server/chunks/3098.js +0 -1
- package/.next/server/chunks/3221.js +0 -5
- package/.next/server/chunks/6810.js +0 -1
- package/.next/static/GjuqgbaZr9M0AGKgnA2hT/_buildManifest.js +0 -1
- package/.next/static/chunks/1052-151437e30240c959.js +0 -1
- package/.next/static/chunks/4853-946597034e74be36.js +0 -1
- package/.next/static/chunks/app/_global-error/page-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/edges/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/entities/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/flags/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/init/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/close/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/questions/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/save/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/verdict/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/mention-search/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/notes/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/open/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/reset/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/scope-guard/check/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/share/create/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/share/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/stream/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/version/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/learn/page-bb7141041f6b6e08.js +0 -7
- package/.next/static/chunks/app/plan/page-6b546f1602bd1108.js +0 -1
- package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-93569b5eb93a61e9.js +0 -1
- package/.next/static/css/b51708465127fded.css +0 -1
- /package/.next/static/{GjuqgbaZr9M0AGKgnA2hT → mB9lqGEsIvB7tTvv9GU48}/_ssgManifest.js +0 -0
package/dist/bin/plan.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`)}function
|
|
12
|
-
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:
|
|
13
|
-
`),{path:Z,added:!0,updated:!1}}function
|
|
14
|
-
`)}}catch{}let J=!1,V=
|
|
3
|
+
var fZ=Object.defineProperty;var IZ=(Q)=>Q;function bZ(Q,Z){this[Q]=IZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:bZ.bind(Z,$)})};var M=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var LQ=1500,kQ=480000,C1=1800000,f=3600000,M1=3000;var zQ=()=>{};var HQ={};VQ(HQ,{stripAgentsPointer:()=>mQ,removeRepoAssets:()=>lZ,installRefreshSkill:()=>LZ,installPlanSkill:()=>kZ,installInitSkill:()=>yZ,installExplainSkill:()=>_Z,installCodexRepoSkills:()=>hZ,ensureWorkflowDoc:()=>mZ,ensureMcp:()=>pZ,contextDocTargets:()=>WQ,auditRepo:()=>cZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>SQ,INIT_SKILL:()=>qQ,EXPLAIN_SKILL:()=>hQ});import{existsSync as j,mkdirSync as R,readFileSync as K,rmSync as I,writeFileSync as B}from"fs";import{join as U}from"path";function yZ(Q){let Z=U(Q,".claude","skills","beacon-init");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function LZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function kZ(Q){let Z=U(Q,".claude","skills","beacon-plan");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,SQ),$}function _Z(Q){let Z=U(Q,".claude","skills","beacon-explain");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,hQ),$}function hZ(Q){let Z=[];for(let $ of SZ){let Y=U(Q,".agents","skills",$.name);R(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function WQ(Q){let Z=U(Q,"AGENTS.md"),$=U(Q,"CLAUDE.md"),Y=j(Z),J=j($);if(!Y&&!J)return[Z,$];let V=[];if(Y)V.push(Z);if(J)V.push($);return V}function mQ(Q){let Z=U(Q,"CLAUDE.md");if(!j(Z))return;let $=K(Z,"utf8"),Y=$.split(`
|
|
4
|
+
`).filter((J)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(J)).join(`
|
|
5
|
+
`).trim();if(Y&&Y!==$.trim())B(Z,`${Y}
|
|
6
|
+
`)}function mZ(Q){let Z=new RegExp(`${b}[\\s\\S]*?${UQ}`);for(let $ of WQ(Q)){let Y="";try{Y=K($,"utf8")}catch{}Y=Z.test(Y)?Y.replace(Z,_Q):`${Y.trim()}
|
|
7
|
+
|
|
8
|
+
${_Q}
|
|
9
|
+
`.trimStart(),B($,Y.endsWith(`
|
|
10
|
+
`)?Y:`${Y}
|
|
11
|
+
`)}mQ(Q)}function pZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(K(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<f)return Y.timeout=f,B(Z,JSON.stringify($,null,2)+`
|
|
12
|
+
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:f},B(Z,JSON.stringify($,null,2)+`
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function cZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(K(Z,"utf8")).mcpServers?.beacon}catch{}let Y=WQ(Q).some((J)=>{try{return K(J,"utf8").includes(b)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:Y,skills:{"beacon-init":j(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":j(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":j(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":j(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function lZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=U(Q,".claude","skills",z);if(j(X))I(X,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let X=U(Q,".agents","skills",z);if(j(X))I(X,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(K(Y,"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)I(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let J=!1,V=new RegExp(`\\n?${b}[\\s\\S]*?${UQ}\\n?`);for(let z of[U(Q,"AGENTS.md"),U(Q,"CLAUDE.md")])try{let X=K(z,"utf8");if(V.test(X)){let H=X.replace(V,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
|
-
`).trimStart();B(
|
|
17
|
+
`).trimStart();B(z,H.endsWith(`
|
|
18
18
|
`)?H:`${H}
|
|
19
|
-
`),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=
|
|
19
|
+
`),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=K(W,"utf8"),X=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==z){if(!X.trim())I(W,{force:!0});else B(W,X);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
|
|
20
20
|
name: beacon-init
|
|
21
21
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
22
22
|
---
|
|
@@ -110,7 +110,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
110
110
|
If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
|
|
111
111
|
|
|
112
112
|
After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
|
|
113
|
-
`,
|
|
113
|
+
`,SQ=`---
|
|
114
114
|
name: beacon-plan
|
|
115
115
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
116
116
|
---
|
|
@@ -139,10 +139,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
|
|
|
139
139
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
140
140
|
|
|
141
141
|
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
142
|
-
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`).
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
|
|
143
|
+
frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
|
|
144
|
+
for the user's authorization (which then adds it to the contract), and the /plan Changes view
|
|
145
|
+
groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
|
|
146
|
+
(if omitted, the scope is inferred from the files you name in backticks).
|
|
146
147
|
|
|
147
148
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
148
149
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
@@ -158,7 +159,7 @@ If it returns feedback, revise and call it again.
|
|
|
158
159
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
159
160
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
160
161
|
run \`beacon\` in this repo once.
|
|
161
|
-
`,
|
|
162
|
+
`,hQ=`---
|
|
162
163
|
name: beacon-explain
|
|
163
164
|
description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
|
|
164
165
|
---
|
|
@@ -228,7 +229,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
|
|
|
228
229
|
Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
|
|
229
230
|
the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
|
|
230
231
|
the lesson.
|
|
231
|
-
`,
|
|
232
|
+
`,SZ,b="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",_Q;var BQ=M(()=>{zQ();SZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];_Q=`${b}
|
|
232
233
|
## Beacon \u2014 feature workflow
|
|
233
234
|
|
|
234
235
|
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:
|
|
@@ -300,18 +301,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
300
301
|
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.
|
|
301
302
|
|
|
302
303
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
303
|
-
${UQ}`});import{existsSync as y,mkdirSync as
|
|
304
|
-
`)}function _(Q,Z){let $=
|
|
304
|
+
${UQ}`});import{existsSync as y,mkdirSync as GQ,readdirSync as dZ,readFileSync as T,rmSync as nZ,writeFileSync as L}from"fs";import{dirname as pQ,join as N}from"path";function cQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function lQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=N(Q,".claude","plugins");if(!y(Z))return null;let $=[Z];for(let Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=N(V,".claude-plugin","plugin.json");try{if(y(q)&&JSON.parse(T(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of dZ(V,{withFileTypes:!0}))if(W.isDirectory())J.push(N(V,W.name))}catch{}}$=J}return null}function dQ(Q){return lQ(Q)!==null}function aZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function sZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(T(N(Q,".claude","plugins","installed_plugins.json"),"utf8"));for(let $ of Object.keys(Z.plugins??{}))if(/^beacon@/.test($))return{key:$,marketplace:$.split("@")[1]??""}}catch{}return null}function jQ(Q){try{return JSON.parse(T(Q,"utf8"))}catch{return{}}}function nQ(Q,Z){GQ(pQ(Q),{recursive:!0}),L(Q,JSON.stringify(Z,null,2)+`
|
|
305
|
+
`)}function _(Q,Z){let $=jQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),nQ(Q,$),!0}function S(Q,Z){return(jQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function h(Q,Z){let $=jQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((X)=>X.command!==Z.command);if(z.length!==W)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return nQ(Q,$),!0}function m(Q,Z,$,Y){let J=`${Z}
|
|
305
306
|
${Y.trim()}
|
|
306
307
|
${$}`,V="";try{V=T(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
|
|
307
308
|
|
|
308
309
|
${J}
|
|
309
310
|
`:`${J}
|
|
310
|
-
`,
|
|
311
|
+
`,GQ(pQ(Q),{recursive:!0}),L(Q,V.endsWith(`
|
|
311
312
|
`)?V:`${V}
|
|
312
313
|
`)}function w(Q,Z){try{return T(Q,"utf8").includes(Z)}catch{return!1}}function p(Q,Z,$){let Y="";try{Y=T(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
|
|
313
314
|
|
|
314
|
-
`).trimStart();return L(Q,V),!0}function c(Q,Z,$){let Y=
|
|
315
|
+
`).trimStart();return L(Q,V),!0}function c(Q,Z,$){let Y=N(Q,Z);GQ(Y,{recursive:!0});let J=N(Y,"SKILL.md");return L(J,$),J}function u(Q,Z){return y(N(Q,Z,"SKILL.md"))}function l(Q,Z){let $=N(Q,Z);if(!y($))return!1;return nZ($,{recursive:!0,force:!0}),!0}var x,k=`## Beacon (visual planning panel)
|
|
315
316
|
|
|
316
317
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
317
318
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -335,24 +336,24 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
335
336
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
336
337
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
337
338
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
338
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
339
|
+
verbatim. Do NOT implement until the tool returns approval.`;var KQ=M(()=>{x=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as tZ,renameSync as rZ,rmSync as oZ,writeFileSync as iZ}from"fs";import{dirname as eZ}from"path";function d(Q,Z){tZ(eZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{iZ($,Z),rZ($,Q)}catch(Y){throw oZ($,{force:!0}),Y}}function A1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var aQ=()=>{};var ZZ={};VQ(ZZ,{setupCodexAssets:()=>Y0,removeCodexMcp:()=>QZ,removeCodexArtifacts:()=>V0,hasCodexMcp:()=>vQ,ensureCodexMcp:()=>eQ,codexMcpProblem:()=>$0,codexDetected:()=>rQ,auditCodex:()=>J0,CODEX_HOOKS:()=>r});import{readFileSync as t}from"fs";import{homedir as Q0}from"os";import{join as O}from"path";function sQ(){return process.env.HOME||process.env.USERPROFILE||Q0()}function rQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(NQ===void 0)NQ=Bun.which("codex")!==null;return NQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function vQ(){try{return Boolean(D(t(F(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function $0(){let Q="";try{Q=t(F(),"utf8")}catch{return null}let Z=D(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${g}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${g}`;return null}function eQ(){let Q="",Z=!1;try{Q=t(F(),"utf8"),Z=!0}catch{}if(Z){let V=D(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${g}`};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 ${g}`}}let $=!Q?"":Q.endsWith(`
|
|
339
340
|
`)?`
|
|
340
341
|
`:`
|
|
341
342
|
|
|
342
|
-
`,Y=Q+$+
|
|
343
|
-
`),$=Z.indexOf(
|
|
343
|
+
`,Y=Q+$+Z0;if(D(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${g}`};return d(F(),Y),{added:!0}}function QZ(){let Q="";try{Q=t(F(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
344
|
+
`),$=Z.indexOf(oQ);if($===-1)return{removed:!1,skipped:vQ()};let Y=Z.indexOf(iQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
|
|
344
345
|
`).replace(/\n{3,}/g,`
|
|
345
346
|
|
|
346
|
-
`).replace(/^\n+/,"");if(D(J)===null)return{removed:!1,skipped:!0};return d(
|
|
347
|
+
`).replace(/^\n+/,"");if(D(J)===null)return{removed:!1,skipped:!0};return d(F(),J),{removed:!0}}async function Y0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (BQ(),HQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let X of x){if(!u(a(),X))V.push(X);c(a(),X,J[X])}let q=0;for(let X of r)if(_(PQ(),{event:X.event,matcher:X.matcher,command:X.command}))q++;let W=w(n(),s);m(n(),s,tQ,k);let z=eQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function J0(){let Q={};for(let $ of x)Q[$]=u(a(),$);let Z={};for(let $ of r)Z[$.event]=S(PQ(),{event:$.event,command:$.command});return{detected:rQ(),skills:Q,hooks:Z,agentsMdBlock:w(n(),s),mcp:vQ()}}function V0(){let Q=[];for(let J of x)if(l(a(),J))Q.push(J);let Z=0;for(let J of r)if(h(PQ(),{event:J.event,command:J.command}))Z++;let $=p(n(),s,tQ),Y=QZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var xQ=()=>O(sQ(),".codex"),PQ=()=>O(xQ(),"hooks.json"),F=()=>O(xQ(),"config.toml"),n=()=>O(xQ(),"AGENTS.md"),a=()=>O(sQ(),".agents","skills"),s="<!-- beacon:global:start -->",tQ="<!-- beacon:global:end -->",r,NQ,oQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",iQ="# beacon:end",Z0,g="add it manually: codex mcp add beacon -- beacon mcp";var $Z=M(()=>{KQ();aQ();r=[{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."}];Z0=`${oQ}
|
|
347
348
|
[mcp_servers.beacon]
|
|
348
349
|
command = "beacon"
|
|
349
350
|
args = ["mcp"]
|
|
350
|
-
${
|
|
351
|
-
`});var zZ={};VQ(zZ,{provisionDb:()=>D0});import{createClient as N0}from"@libsql/client";import{drizzle as P0}from"drizzle-orm/libsql";import{migrate as v0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as C0}from"drizzle-orm/migrator";import{dirname as FQ,join as M0}from"path";import{fileURLToPath as T0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function u0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function VZ(Q){if(!await e(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 g0(Q){for(let[Z,$]of Object.entries(w0)){if(!await e(Q,Z))continue;let Y=await u0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function D0(Q,Z=F0){let $=N0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let W=C0({migrationsFolder:Z})[0];if(W)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:[W.hash,W.folderMillis]}),V=!0}let q=await VZ($);if(await v0(P0($),{migrationsFolder:Z}),await VZ($)>q)V=!0;return await g0($),{migrated:V}}finally{$.close()}}var R0,F0,w0;var qZ=C(async()=>{R0=FQ(FQ(FQ(T0(import.meta.url)))),F0=process.env.BEACON_MIGRATIONS_DIR||M0(R0,"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"]}});jQ();import{existsSync as J0}from"fs";import{homedir as V0}from"os";import{join as o}from"path";function z0(){return process.env.HOME||process.env.USERPROFILE||V0()}var i=()=>o(z0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",ZZ="<!-- beacon:global:end -->";var q0=k,RQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function X0(Q,Z){return c(vQ(),Q,Z)}function $Z(Q){return u(vQ(),Q)}function U0(Q){return l(vQ(),Q)}function W0(Q){return _(CQ(),Q)}function H0(Q){return S(CQ(),Q)}function B0(Q){return h(CQ(),Q)}function G0(Q){m(MQ(),TQ,ZZ,Q)}function YZ(){return w(MQ(),TQ)}function j0(){return p(MQ(),TQ,ZZ)}function h1(){let Q={};for(let $ of x)Q[$]=$Z($);let Z={};for(let $ of RQ)Z[$.event]=H0({event:$.event,command:$.command});return{homeExists:J0(i()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function K0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of x){if(!$Z(z))V.push(z);X0(z,J[z])}let q=0;for(let z of RQ)if(W0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=YZ();return G0(q0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function JZ(){if(mQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(cQ()){try{x0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await K0()}}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(() => (QZ(),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 x0(){let Q=[];for(let Y of x)if(U0(Y))Q.push(Y);let Z=0;for(let Y of RQ)if(B0(Y))Z++;let $=j0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as f0}from"async_hooks";import{spawnSync as O0}from"child_process";import{createHash as A0}from"crypto";import{existsSync as UZ,mkdirSync as O,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as WZ}from"os";import{basename as E0,join as N,parse as b0,resolve as XZ}from"path";function G(){return process.env.BEACON_HOME||N(WZ(),".beacon")}function DQ(){return N(G(),"workspaces.json")}function QQ(Q){return A0("sha256").update(Q).digest("hex").slice(0,12)}function Q2(Q=process.cwd()){let Z=O0("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 HZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==b0(Z).root}function BZ(){return N(G(),"deleted.json")}function fQ(){try{let Q=JSON.parse(uQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function GZ(Q){O(G(),{recursive:!0}),gQ(BZ(),JSON.stringify(Q,null,2))}function jZ(Q){return fQ().includes(Q)}function Z2(Q){let Z=fQ();if(!Z.includes(Q))GZ([...Z,Q])}function I0(Q){let Z=fQ();if(Z.includes(Q))GZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return N(G(),Q)}function y0(Q){return`file:${N(ZQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function OQ(Q){O(G(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function KZ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return A().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!HZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||E0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return O(ZQ(Y),{recursive:!0}),OQ(W),q}function $2(Q,Z){return I0(QQ(Q)),xZ(Q,Z)}function Y2(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,OQ($)}function J2(Q){if(OQ(A().filter((Z)=>Z.id!==Q)),AQ()===Q)L0(KZ()[0]?.id??null)}function NZ(){return N(G(),"active")}function AQ(){try{return uQ(NZ(),"utf8").trim()||null}catch{return null}}function L0(Q){O(G(),{recursive:!0}),gQ(NZ(),Q??"")}function V2(){let Q=AQ();return Q?P(Q):null}function z2(){let Q=S0()??AQ();return Q?P(Q):null}function q2(Q){return P(Q)?.path??null}function X2(){return UZ(DQ())}var PZ="beacon_ws";function vZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function U2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=vZ(Q,PZ);if($&&P($))return $;return k0()}function k0(){let Q=KZ();return Q.length===1?Q[0].id:null}var _0="x-beacon-workspace-path";async function W2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(_0);if($&&HZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=xZ($);return await h0(J.id),J.id}let Y=vZ(Q,PZ);if(Y&&P(Y))return Y;return null}var CZ=new f0;function H2(Q,Z){return Q?CZ.run(Q,Z):Z()}function S0(){return CZ.getStore()??null}var wQ=new Set;function B2(Q){wQ.delete(N(ZQ(Q),"db.sqlite"))}async function h0(Q){let Z=ZQ(Q),$=N(Z,"db.sqlite"),Y=UZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{O(Z,{recursive:!0});let{provisionDb:J}=await qZ().then(() => zZ),V=await J(y0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as m0}from"net";var K2=4319;function p0(Q,Z,$=400){return new Promise((Y)=>{let J=m0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function c0(Q){for(let Z of["127.0.0.1","::1"])if(await p0(Z,Q))return!1;return!0}async function MZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await c0($))return $;return Q}import{execSync as o0,spawn as i0}from"child_process";import{mkdirSync as e0,openSync as Q1,readFileSync as Z1,writeFileSync as $1}from"fs";import{homedir as Y1}from"os";import{dirname as J1,join as YQ}from"path";import{fileURLToPath as V1}from"url";import{createHash as z1}from"crypto";zQ();import{mkdirSync as d0,readFileSync as a0,writeFileSync as n0}from"fs";import{join as t0}from"path";var l0=["default","acceptEdits","bypassPermissions","auto"];function TZ(Q){return typeof Q==="string"&&l0.includes(Q)}function RZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function FZ(){return t0(G(),"preferences.json")}function EQ(){try{let Q=JSON.parse(a0(FZ(),"utf8"));return{planApprovalMode:TZ(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 T2(Q){let Z={...EQ(),...Q};return d0(G(),{recursive:!0}),n0(FZ(),JSON.stringify(Z,null,2)),Z}function wZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
|
|
351
|
+
${iQ}
|
|
352
|
+
`});var XZ={};VQ(XZ,{provisionDb:()=>E0});import{createClient as v0}from"@libsql/client";import{drizzle as C0}from"drizzle-orm/libsql";import{migrate as M0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as T0}from"drizzle-orm/migrator";import{dirname as wQ,join as F0}from"path";import{fileURLToPath as R0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function D0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function qZ(Q){if(!await e(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 O0(Q){for(let[Z,$]of Object.entries(g0)){if(!await e(Q,Z))continue;let Y=await D0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function E0(Q,Z=u0){let $=v0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let W=T0({migrationsFolder:Z})[0];if(W)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:[W.hash,W.folderMillis]}),V=!0}let q=await qZ($);if(await M0(C0($),{migrationsFolder:Z}),await qZ($)>q)V=!0;return await O0($),{migrated:V}}finally{$.close()}}var w0,u0,g0;var UZ=M(async()=>{w0=wQ(wQ(wQ(R0(import.meta.url)))),u0=process.env.BEACON_MIGRATIONS_DIR||F0(w0,"drizzle"),g0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});KQ();import{existsSync as z0}from"fs";import{homedir as q0}from"os";import{join as o}from"path";function X0(){return process.env.HOME||process.env.USERPROFILE||q0()}var i=()=>o(X0(),".claude"),CQ=()=>o(i(),"skills"),MQ=()=>o(i(),"settings.json"),TQ=()=>o(i(),"CLAUDE.md"),FQ="<!-- beacon:global:start -->",YZ="<!-- beacon:global:end -->";var U0=k,RQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract: in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. Fail-open when there's no active contract."},{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 W0(Q,Z){return c(CQ(),Q,Z)}function JZ(Q){return u(CQ(),Q)}function H0(Q){return l(CQ(),Q)}function B0(Q){return _(MQ(),Q)}function G0(Q){return S(MQ(),Q)}function j0(Q){return h(MQ(),Q)}function K0(Q){m(TQ(),FQ,YZ,Q)}function VZ(){return w(TQ(),FQ)}function N0(){return p(TQ(),FQ,YZ)}function p1(){let Q={};for(let $ of x)Q[$]=JZ($);let Z={};for(let $ of RQ)Z[$.event]=G0({event:$.event,command:$.command});return{homeExists:z0(i()),skills:Q,hooks:Z,claudeMdBlock:VZ()}}async function x0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (BQ(),HQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of x){if(!JZ(z))V.push(z);W0(z,J[z])}let q=0;for(let z of RQ)if(B0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=VZ();return K0(U0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function zZ(){if(cQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(dQ()){try{P0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await x0()}}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(() => ($Z(),ZZ));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 P0(){let Q=[];for(let Y of x)if(H0(Y))Q.push(Y);let Z=0;for(let Y of RQ)if(j0(Y))Z++;let $=N0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as A0}from"async_hooks";import{spawnSync as f0}from"child_process";import{createHash as I0}from"crypto";import{existsSync as HZ,mkdirSync as E,readFileSync as gQ,writeFileSync as DQ}from"fs";import{homedir as BZ}from"os";import{basename as b0,join as P,parse as y0,resolve as WZ}from"path";function G(){return process.env.BEACON_HOME||P(BZ(),".beacon")}function OQ(){return P(G(),"workspaces.json")}function QQ(Q){return I0("sha256").update(Q).digest("hex").slice(0,12)}function $2(Q=process.cwd()){let Z=f0("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 GZ(Q){let Z=WZ(Q);return Z!==WZ(BZ())&&Z!==y0(Z).root}function jZ(){return P(G(),"deleted.json")}function EQ(){try{let Q=JSON.parse(gQ(jZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function KZ(Q){E(G(),{recursive:!0}),DQ(jZ(),JSON.stringify(Q,null,2))}function NZ(Q){return EQ().includes(Q)}function Y2(Q){let Z=EQ();if(!Z.includes(Q))KZ([...Z,Q])}function L0(Q){let Z=EQ();if(Z.includes(Q))KZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return P(G(),Q)}function k0(Q){return`file:${P(ZQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(gQ(OQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function AQ(Q){E(G(),{recursive:!0}),DQ(OQ(),JSON.stringify(Q,null,2))}function xZ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function v(Q){return A().find((Z)=>Z.id===Q)??null}function PZ(Q,Z,$=new Date().toISOString()){if(!GZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(NZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||b0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return E(ZQ(Y),{recursive:!0}),AQ(W),q}function J2(Q,Z){return L0(QQ(Q)),PZ(Q,Z)}function V2(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,AQ($)}function z2(Q){if(AQ(A().filter((Z)=>Z.id!==Q)),fQ()===Q)_0(xZ()[0]?.id??null)}function vZ(){return P(G(),"active")}function fQ(){try{return gQ(vZ(),"utf8").trim()||null}catch{return null}}function _0(Q){E(G(),{recursive:!0}),DQ(vZ(),Q??"")}function q2(){let Q=fQ();return Q?v(Q):null}function X2(){let Q=m0()??fQ();return Q?v(Q):null}function U2(Q){return v(Q)?.path??null}function W2(){return HZ(OQ())}var CZ="beacon_ws";function MZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function H2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&v(Z))return Z;let $=MZ(Q,CZ);if($&&v($))return $;return S0()}function S0(){let Q=xZ();return Q.length===1?Q[0].id:null}var h0="x-beacon-workspace-path";async function B2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&v(Z))return Z;let $=Q.headers.get(h0);if($&&GZ($)&&!NZ(QQ($))&&(!Z||QQ($)===Z)){let J=PZ($);return await p0(J.id),J.id}let Y=MZ(Q,CZ);if(Y&&v(Y))return Y;return null}var TZ=new A0;function G2(Q,Z){return Q?TZ.run(Q,Z):Z()}function m0(){return TZ.getStore()??null}var uQ=new Set;function j2(Q){uQ.delete(P(ZQ(Q),"db.sqlite"))}async function p0(Q){let Z=ZQ(Q),$=P(Z,"db.sqlite"),Y=HZ($);if(Y&&uQ.has($))return{ok:!0,created:!1,migrated:!1};try{E(Z,{recursive:!0});let{provisionDb:J}=await UZ().then(() => XZ),V=await J(k0(Q));return uQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as c0}from"net";var x2=4319;function l0(Q,Z,$=400){return new Promise((Y)=>{let J=c0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function d0(Q){for(let Z of["127.0.0.1","::1"])if(await l0(Z,Q))return!1;return!0}async function FZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await d0($))return $;return Q}import{execSync as e0,spawn as Q1}from"child_process";import{mkdirSync as Z1,openSync as $1,readFileSync as Y1,writeFileSync as J1}from"fs";import{homedir as V1}from"os";import{dirname as z1,join as YQ}from"path";import{fileURLToPath as q1}from"url";import{createHash as X1}from"crypto";zQ();import{mkdirSync as a0,readFileSync as s0,writeFileSync as t0}from"fs";import{join as r0}from"path";var n0=["default","acceptEdits","bypassPermissions","auto"];function RZ(Q){return typeof Q==="string"&&n0.includes(Q)}function wZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function uZ(){return r0(G(),"preferences.json")}function IQ(){try{let Q=JSON.parse(s0(uZ(),"utf8"));return{planApprovalMode:RZ(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 R2(Q){let Z={...IQ(),...Q};return a0(G(),{recursive:!0}),t0(uZ(),JSON.stringify(Z,null,2)),Z}function gZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
|
|
352
353
|
|
|
353
354
|
This plan created these roadmap feature(s):
|
|
354
355
|
`+Z.join(`
|
|
355
|
-
`)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as
|
|
356
|
-
`,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));
|
|
356
|
+
`)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as o0}from"child_process";import{platform as DZ}from"os";function i0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=DZ()==="darwin"?"open":DZ()==="win32"?"start":"xdg-open";try{o0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function OZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);i0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var U1=YQ(z1(q1(import.meta.url)),".."),yQ=process.env.BEACON_HOME||YQ(V1(),".beacon"),EZ=YQ(yQ,"server.json"),W1=process.env.PORT||"4319";function H1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function B1(Q){try{return JSON.parse(Y1(Q,"utf8"))}catch{return null}}async function AZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function G1(Q,Z=60){for(let $=0;$<Z;$++){if(await AZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function j1(Q){Z1(yQ,{recursive:!0});let Z=$1(YQ(yQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=Q1("bun",["run","dev"],{cwd:U1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return J1(EZ,JSON.stringify(J)),J}async function K1(){let Q=B1(EZ);if(Q&&H1(Q.pid)&&await AZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await FZ(Number(W1))),{port:$}=j1(Z);return await G1(`http://localhost:${$}/api/workspace`),$}function N1(){try{return e0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function x1(Q){return X1("sha256").update(Q).digest("hex").slice(0,12)}async function P1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function bQ(Q,Z){return wZ(Q,Z)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function C(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await zZ();let Z=(await P1())?.tool_input?.plan;if(!Z||!Z.trim())C(bQ());let Y=`http://localhost:${await K1()}`,J=N1()||process.cwd(),V=x1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
|
|
357
|
+
`,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));C($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!W.ok)C(bQ());await OZ(Y,V);let z=Date.now()+kQ,X=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await X(LQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")C(bQ(IQ().planApprovalMode,gZ(H.features)));if(H.kind==="discarded")C($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")C($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
|
|
357
358
|
|
|
358
|
-
`+H.feedback))}
|
|
359
|
+
`+H.feedback))}C($Q("\u23F3 Still awaiting your review in Beacon \u2014 the plan is open on /plan and nothing was lost. "+"Claude Code caps a single plan-review hook at ~10 minutes, so to keep waiting you MUST call ExitPlanMode again now with the SAME plan. Re-presenting resumes the same review (your in-progress annotations and any decision are preserved). Do NOT implement, and do "+"NOT ask in the terminal \u2014 just re-present."))})();
|
package/dist/bin/uninstall.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`)}function
|
|
3
|
+
var DZ=Object.defineProperty;var OZ=(Q)=>Q;function bZ(Q,Z){this[Q]=OZ.bind(null,Z)}var jQ=(Q,Z)=>{for(var $ in Z)DZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:bZ.bind(Z,$)})};var T=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var c0=1500,l0=480000,n0=1800000,S=3600000,d0=3000;var lQ=()=>{};var KQ={};jQ(KQ,{stripAgentsPointer:()=>aQ,removeRepoAssets:()=>xQ,installRefreshSkill:()=>yZ,installPlanSkill:()=>LZ,installInitSkill:()=>AZ,installExplainSkill:()=>_Z,installCodexRepoSkills:()=>SZ,ensureWorkflowDoc:()=>hZ,ensureMcp:()=>mZ,contextDocTargets:()=>NQ,auditRepo:()=>pZ,REFRESH_SKILL:()=>GQ,PLAN_SKILL:()=>dQ,INIT_SKILL:()=>PQ,EXPLAIN_SKILL:()=>tQ});import{existsSync as G,mkdirSync as E,readFileSync as N,rmSync as h,writeFileSync as H}from"fs";import{join as X}from"path";function AZ(Q){let Z=X(Q,".claude","skills","beacon-init");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,PQ),$}function yZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,GQ),$}function LZ(Q){let Z=X(Q,".claude","skills","beacon-plan");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,dQ),$}function _Z(Q){let Z=X(Q,".claude","skills","beacon-explain");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,tQ),$}function SZ(Q){let Z=[];for(let $ of kZ){let J=X(Q,".agents","skills",$.name);E(J,{recursive:!0});let Y=X(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function NQ(Q){let Z=X(Q,"AGENTS.md"),$=X(Q,"CLAUDE.md"),J=G(Z),Y=G($);if(!J&&!Y)return[Z,$];let V=[];if(J)V.push(Z);if(Y)V.push($);return V}function aQ(Q){let Z=X(Q,"CLAUDE.md");if(!G(Z))return;let $=N(Z,"utf8"),J=$.split(`
|
|
4
|
+
`).filter((Y)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Y)).join(`
|
|
5
|
+
`).trim();if(J&&J!==$.trim())H(Z,`${J}
|
|
6
|
+
`)}function hZ(Q){let Z=new RegExp(`${m}[\\s\\S]*?${vQ}`);for(let $ of NQ(Q)){let J="";try{J=N($,"utf8")}catch{}J=Z.test(J)?J.replace(Z,nQ):`${J.trim()}
|
|
7
|
+
|
|
8
|
+
${nQ}
|
|
9
|
+
`.trimStart(),H($,J.endsWith(`
|
|
10
|
+
`)?J:`${J}
|
|
11
|
+
`)}aQ(Q)}function mZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(N(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<S)return J.timeout=S,H(Z,JSON.stringify($,null,2)+`
|
|
12
12
|
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:S},H(Z,JSON.stringify($,null,2)+`
|
|
13
|
-
`),{path:Z,added:!0,updated:!1}}function
|
|
14
|
-
`)}}catch{}let Y=!1,V=
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function pZ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(N(Z,"utf8")).mcpServers?.beacon}catch{}let J=NQ(Q).some((Y)=>{try{return N(Y,"utf8").includes(m)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:J,skills:{"beacon-init":G(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":G(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":G(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":G(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(G(U))h(U,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",z);if(G(U))h(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(N(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)h(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let Y=!1,V=new RegExp(`\\n?${m}[\\s\\S]*?${vQ}\\n?`);for(let z of[X(Q,"AGENTS.md"),X(Q,"CLAUDE.md")])try{let U=N(z,"utf8");if(V.test(U)){let BQ=U.replace(V,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
|
-
`).trimStart();H(
|
|
17
|
+
`).trimStart();H(z,BQ.endsWith(`
|
|
18
18
|
`)?BQ:`${BQ}
|
|
19
|
-
`),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=
|
|
19
|
+
`),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=N(W,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())h(W,{force:!0});else H(W,U);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var PQ=`---
|
|
20
20
|
name: beacon-init
|
|
21
21
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
22
22
|
---
|
|
@@ -63,7 +63,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
|
|
|
63
63
|
That one command wires the repo (writes \`.mcp.json\` + skills so your NEXT session gets the \`beacon_*\` tools natively, heals the global install), starts the Beacon daemon if it isn't running, registers + provisions this workspace, and POSTs your analysis to the same \`/api/init\` endpoint the MCP tool uses \u2014 so init completes in THIS session. Read the counts it prints and report them.
|
|
64
64
|
|
|
65
65
|
After the tool (or \`beacon init-persist\`) returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
66
|
-
`,
|
|
66
|
+
`,GQ=`---
|
|
67
67
|
name: beacon-refresh
|
|
68
68
|
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.
|
|
69
69
|
---
|
|
@@ -110,7 +110,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
110
110
|
If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
|
|
111
111
|
|
|
112
112
|
After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
|
|
113
|
-
`,
|
|
113
|
+
`,dQ=`---
|
|
114
114
|
name: beacon-plan
|
|
115
115
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
116
116
|
---
|
|
@@ -139,10 +139,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
|
|
|
139
139
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
140
140
|
|
|
141
141
|
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
142
|
-
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`).
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
|
|
143
|
+
frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
|
|
144
|
+
for the user's authorization (which then adds it to the contract), and the /plan Changes view
|
|
145
|
+
groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
|
|
146
|
+
(if omitted, the scope is inferred from the files you name in backticks).
|
|
146
147
|
|
|
147
148
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
148
149
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
@@ -228,7 +229,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
|
|
|
228
229
|
Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
|
|
229
230
|
the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
|
|
230
231
|
the lesson.
|
|
231
|
-
`,
|
|
232
|
+
`,kZ,m="<!-- beacon:workflow:start -->",vQ="<!-- beacon:workflow:end -->",nQ;var p=T(()=>{lQ();kZ=[{name:"beacon-init",body:()=>PQ},{name:"beacon-refresh",body:()=>GQ}];nQ=`${m}
|
|
232
233
|
## Beacon \u2014 feature workflow
|
|
233
234
|
|
|
234
235
|
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:
|
|
@@ -300,18 +301,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
300
301
|
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.
|
|
301
302
|
|
|
302
303
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
303
|
-
${vQ}`});import{existsSync as c,mkdirSync as
|
|
304
|
-
`)}function
|
|
304
|
+
${vQ}`});import{existsSync as c,mkdirSync as uQ,readdirSync as cZ,readFileSync as w,rmSync as lZ,writeFileSync as l}from"fs";import{dirname as sQ,join as x}from"path";function rQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function oQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=x(Q,".claude","plugins");if(!c(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=x(V,".claude-plugin","plugin.json");try{if(c(q)&&JSON.parse(w(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of cZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(x(V,W.name))}catch{}}$=Y}return null}function iQ(Q){return oQ(Q)!==null}function nZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function dZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(w(x(Q,".claude","plugins","installed_plugins.json"),"utf8"));for(let $ of Object.keys(Z.plugins??{}))if(/^beacon@/.test($))return{key:$,marketplace:$.split("@")[1]??""}}catch{}return null}function MQ(Q){try{return JSON.parse(w(Q,"utf8"))}catch{return{}}}function eQ(Q,Z){uQ(sQ(Q),{recursive:!0}),l(Q,JSON.stringify(Z,null,2)+`
|
|
305
|
+
`)}function d(Q,Z){let $=MQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),eQ(Q,$),!0}function t(Q,Z){return(MQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function a(Q,Z){let $=MQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((U)=>U.command!==Z.command);if(z.length!==W)Y=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return eQ(Q,$),!0}function s(Q,Z,$,J){let Y=`${Z}
|
|
305
306
|
${J.trim()}
|
|
306
307
|
${$}`,V="";try{V=w(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
|
|
307
308
|
|
|
308
309
|
${Y}
|
|
309
310
|
`:`${Y}
|
|
310
|
-
`,
|
|
311
|
+
`,uQ(sQ(Q),{recursive:!0}),l(Q,V.endsWith(`
|
|
311
312
|
`)?V:`${V}
|
|
312
|
-
`)}function
|
|
313
|
+
`)}function I(Q,Z){try{return w(Q,"utf8").includes(Z)}catch{return!1}}function r(Q,Z,$){let J="";try{J=w(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,`
|
|
313
314
|
|
|
314
|
-
`).trimStart();return l(Q,V),!0}function o(Q,Z,$){let J=
|
|
315
|
+
`).trimStart();return l(Q,V),!0}function o(Q,Z,$){let J=x(Q,Z);uQ(J,{recursive:!0});let Y=x(J,"SKILL.md");return l(Y,$),Y}function D(Q,Z){return c(x(Q,Z,"SKILL.md"))}function i(Q,Z){let $=x(Q,Z);if(!c($))return!1;return lZ($,{recursive:!0,force:!0}),!0}var B,n=`## Beacon (visual planning panel)
|
|
315
316
|
|
|
316
317
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
317
318
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -335,20 +336,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
335
336
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
336
337
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
337
338
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
338
|
-
verbatim. Do NOT implement until the tool returns approval.`;var CQ=
|
|
339
|
+
verbatim. Do NOT implement until the tool returns approval.`;var CQ=T(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as tZ,renameSync as aZ,rmSync as sZ,writeFileSync as rZ}from"fs";import{dirname as oZ}from"path";function e(Q,Z){tZ(oZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{rZ($,Z),aZ($,Q)}catch(J){throw sZ($,{force:!0}),J}}function $1(Q,Z,$=!1){e(Q,JSON.stringify(Z,null,$?2:void 0))}var QZ=()=>{};var XZ={};jQ(XZ,{setupCodexAssets:()=>Z0,removeCodexMcp:()=>qZ,removeCodexArtifacts:()=>gQ,hasCodexMcp:()=>RQ,ensureCodexMcp:()=>zZ,codexMcpProblem:()=>Q0,codexDetected:()=>JZ,auditCodex:()=>FQ,CODEX_HOOKS:()=>F});import{readFileSync as JQ}from"fs";import{homedir as iZ}from"os";import{join as A}from"path";function ZZ(){return process.env.HOME||process.env.USERPROFILE||iZ()}function JZ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(fQ===void 0)fQ=Bun.which("codex")!==null;return fQ}function b(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function RQ(){try{return Boolean(b(JQ(R(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Q0(){let Q="";try{Q=JQ(R(),"utf8")}catch{return null}let Z=b(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${O}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${O}`;return null}function zZ(){let Q="",Z=!1;try{Q=JQ(R(),"utf8"),Z=!0}catch{}if(Z){let V=b(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${O}`};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 ${O}`}}let $=!Q?"":Q.endsWith(`
|
|
339
340
|
`)?`
|
|
340
341
|
`:`
|
|
341
342
|
|
|
342
|
-
`,J=Q+$+
|
|
343
|
-
`),$=Z.indexOf(
|
|
343
|
+
`,J=Q+$+eZ;if(b(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${O}`};return e(R(),J),{added:!0}}function qZ(){let Q="";try{Q=JQ(R(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
344
|
+
`),$=Z.indexOf(YZ);if($===-1)return{removed:!1,skipped:RQ()};let J=Z.indexOf(VZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
344
345
|
`).replace(/\n{3,}/g,`
|
|
345
346
|
|
|
346
|
-
`).replace(/^\n+/,"");if(
|
|
347
|
+
`).replace(/^\n+/,"");if(b(Y)===null)return{removed:!1,skipped:!0};return e(R(),Y),{removed:!0}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of B){if(!D(ZQ(),U))V.push(U);o(ZQ(),U,Y[U])}let q=0;for(let U of F)if(d(wQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let W=I(QQ(),$Q);s(QQ(),$Q,$Z,n);let z=zZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function FQ(){let Q={};for(let $ of B)Q[$]=D(ZQ(),$);let Z={};for(let $ of F)Z[$.event]=t(wQ(),{event:$.event,command:$.command});return{detected:JZ(),skills:Q,hooks:Z,agentsMdBlock:I(QQ(),$Q),mcp:RQ()}}function gQ(){let Q=[];for(let Y of B)if(i(ZQ(),Y))Q.push(Y);let Z=0;for(let Y of F)if(a(wQ(),{event:Y.event,command:Y.command}))Z++;let $=r(QQ(),$Q,$Z),J=qZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var TQ=()=>A(ZZ(),".codex"),wQ=()=>A(TQ(),"hooks.json"),R=()=>A(TQ(),"config.toml"),QQ=()=>A(TQ(),"AGENTS.md"),ZQ=()=>A(ZZ(),".agents","skills"),$Q="<!-- beacon:global:start -->",$Z="<!-- beacon:global:end -->",F,fQ,YZ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",VZ="# beacon:end",eZ,O="add it manually: codex mcp add beacon -- beacon mcp";var EQ=T(()=>{CQ();QZ();F=[{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."}];eZ=`${YZ}
|
|
347
348
|
[mcp_servers.beacon]
|
|
348
349
|
command = "beacon"
|
|
349
350
|
args = ["mcp"]
|
|
350
|
-
${
|
|
351
|
-
`});var
|
|
352
|
-
\x1B[1m${Q}\x1B[0m`,
|
|
353
|
-
`),process.exit(0);console.log(
|
|
351
|
+
${VZ}
|
|
352
|
+
`});var PZ={};jQ(PZ,{provisionDb:()=>w0});import{createClient as P0}from"@libsql/client";import{drizzle as G0}from"drizzle-orm/libsql";import{migrate as v0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as N0}from"drizzle-orm/migrator";import{dirname as yQ,join as x0}from"path";import{fileURLToPath as K0}from"url";async function zQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function f0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function jZ(Q){if(!await zQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function T0(Q){for(let[Z,$]of Object.entries(C0)){if(!await zQ(Q,Z))continue;let J=await f0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function w0(Q,Z=M0){let $=P0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await zQ($,"__drizzle_migrations"),Y=await zQ($,"Node"),V=!1;if(Y&&!J){let W=N0({migrationsFolder:Z})[0];if(W)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:[W.hash,W.folderMillis]}),V=!0}let q=await jZ($);if(await v0(G0($),{migrationsFolder:Z}),await jZ($)>q)V=!0;return await T0($),{migrated:V}}finally{$.close()}}var u0,M0,C0;var GZ=T(async()=>{u0=yQ(yQ(yQ(K0(import.meta.url)))),M0=process.env.BEACON_MIGRATIONS_DIR||x0(u0,"drizzle"),C0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});CQ();import{existsSync as $0}from"fs";import{homedir as J0}from"os";import{join as YQ}from"path";function Y0(){return process.env.HOME||process.env.USERPROFILE||J0()}var VQ=()=>YQ(Y0(),".claude"),IQ=()=>YQ(VQ(),"skills"),DQ=()=>YQ(VQ(),"settings.json"),OQ=()=>YQ(VQ(),"CLAUDE.md"),bQ="<!-- beacon:global:start -->",UZ="<!-- beacon:global:end -->";var V0=n,y=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract: in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. Fail-open when there's no active contract."},{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 z0(Q,Z){return o(IQ(),Q,Z)}function WZ(Q){return D(IQ(),Q)}function q0(Q){return i(IQ(),Q)}function X0(Q){return d(DQ(),Q)}function U0(Q){return t(DQ(),Q)}function W0(Q){return a(DQ(),Q)}function H0(Q){s(OQ(),bQ,UZ,Q)}function HZ(){return I(OQ(),bQ)}function B0(){return r(OQ(),bQ,UZ)}function BZ(){let Q={};for(let $ of B)Q[$]=WZ($);let Z={};for(let $ of y)Z[$.event]=U0({event:$.event,command:$.command});return{homeExists:$0(VQ()),skills:Q,hooks:Z,claudeMdBlock:HZ()}}async function j0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of B){if(!WZ(z))V.push(z);z0(z,Y[z])}let q=0;for(let z of y)if(X0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=HZ();return H0(V0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function j1(){if(rQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(iQ()){try{AQ()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await j0()}}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(() => (EQ(),XZ));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 AQ(){let Q=[];for(let J of B)if(q0(J))Q.push(J);let Z=0;for(let J of y)if(W0(J))Z++;let $=B0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as R0}from"async_hooks";import{spawnSync as F0}from"child_process";import{createHash as g0}from"crypto";import{existsSync as NZ,mkdirSync as L,readFileSync as _Q,writeFileSync as kQ}from"fs";import{homedir as xZ}from"os";import{basename as E0,join as K,parse as I0,resolve as vZ}from"path";function v(){return process.env.BEACON_HOME||K(xZ(),".beacon")}function SQ(){return K(v(),"workspaces.json")}function qQ(Q){return g0("sha256").update(Q).digest("hex").slice(0,12)}function F1(Q=process.cwd()){let Z=F0("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 KZ(Q){let Z=vZ(Q);return Z!==vZ(xZ())&&Z!==I0(Z).root}function uZ(){return K(v(),"deleted.json")}function hQ(){try{let Q=JSON.parse(_Q(uZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function MZ(Q){L(v(),{recursive:!0}),kQ(uZ(),JSON.stringify(Q,null,2))}function CZ(Q){return hQ().includes(Q)}function g1(Q){let Z=hQ();if(!Z.includes(Q))MZ([...Z,Q])}function D0(Q){let Z=hQ();if(Z.includes(Q))MZ(Z.filter(($)=>$!==Q))}function XQ(Q){return K(v(),Q)}function O0(Q){return`file:${K(XQ(Q),"db.sqlite")}`}function _(){try{let Q=JSON.parse(_Q(SQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function mQ(Q){L(v(),{recursive:!0}),kQ(SQ(),JSON.stringify(Q,null,2))}function UQ(){return _().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function M(Q){return _().find((Z)=>Z.id===Q)??null}function fZ(Q,Z,$=new Date().toISOString()){if(!KZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=qQ(Q);if(CZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=_(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||E0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return L(XQ(J),{recursive:!0}),mQ(W),q}function E1(Q,Z){return D0(qQ(Q)),fZ(Q,Z)}function I1(Q,Z=new Date().toISOString()){let $=_(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,mQ($)}function D1(Q){if(mQ(_().filter((Z)=>Z.id!==Q)),pQ()===Q)b0(UQ()[0]?.id??null)}function TZ(){return K(v(),"active")}function pQ(){try{return _Q(TZ(),"utf8").trim()||null}catch{return null}}function b0(Q){L(v(),{recursive:!0}),kQ(TZ(),Q??"")}function O1(){let Q=pQ();return Q?M(Q):null}function b1(){let Q=L0()??pQ();return Q?M(Q):null}function A1(Q){return M(Q)?.path??null}function y1(){return NZ(SQ())}var wZ="beacon_ws";function RZ(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 L1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=RZ(Q,wZ);if($&&M($))return $;return A0()}function A0(){let Q=UQ();return Q.length===1?Q[0].id:null}var y0="x-beacon-workspace-path";async function _1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=Q.headers.get(y0);if($&&KZ($)&&!CZ(qQ($))&&(!Z||qQ($)===Z)){let Y=fZ($);return await _0(Y.id),Y.id}let J=RZ(Q,wZ);if(J&&M(J))return J;return null}var FZ=new R0;function k1(Q,Z){return Q?FZ.run(Q,Z):Z()}function L0(){return FZ.getStore()??null}var LQ=new Set;function S1(Q){LQ.delete(K(XQ(Q),"db.sqlite"))}async function _0(Q){let Z=XQ(Q),$=K(Z,"db.sqlite"),J=NZ($);if(J&&LQ.has($))return{ok:!0,created:!1,migrated:!1};try{L(Z,{recursive:!0});let{provisionDb:Y}=await GZ().then(() => PZ),V=await Y(O0(Q));return LQ.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)}}}p();EQ();import{existsSync as WQ,readFileSync as k0,rmSync as S0}from"fs";import{join as h0}from"path";var gZ=process.argv.slice(3),EZ=gZ.includes("--yes")||gZ.includes("-y"),P=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[2m${Q}\x1B[0m`,f=(Q)=>`
|
|
353
|
+
\x1B[1m${Q}\x1B[0m`,IZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,C=v(),k=UQ(),cQ=BZ();console.log(f(EZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(f("Global"));console.log(` ${WQ(C)?`wipe ${C} (${k.length} workspaces)`:`${j(`${C} \u2014 already gone`)}`}`);for(let Q of B)console.log(` ${cQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of y)console.log(` ${cQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${cQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":j("global CLAUDE.md block \u2014 already gone")}`);var HQ=FQ();console.log(f("Codex"));for(let Q of B)console.log(` ${HQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of F)console.log(` ${HQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${HQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":j("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${HQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":j("config.toml beacon entry \u2014 already gone")}`);if(k.length){console.log(f(`Per-repo (${k.length})`));for(let Q of k){if(!WQ(Q.path)){console.log(` ${j(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${j("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!EZ)console.log(f("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.
|
|
354
|
+
`),process.exit(0);console.log(f("Applying\u2026"));var g=AQ();if(g.skillsRemoved.length)console.log(` ${P(`removed skills: ${g.skillsRemoved.join(", ")}`)}`);if(g.hooksRemoved)console.log(` ${P(`removed ${g.hooksRemoved} hook${g.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(g.claudeMdBlockRemoved)console.log(` ${P("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=gQ();if(u.skillsRemoved.length)console.log(` ${P(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${P(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${P("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${P("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${IZ("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 k){if(!WQ(Q.path))continue;let Z=xQ(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(` ${P(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var m0=h0(C,"server.json");try{let{pid:Q}=JSON.parse(k0(m0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${P(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(WQ(C))S0(C,{recursive:!0,force:!0}),console.log(` ${P(`removed ${C}`)}`);console.log(f("Done."));console.log(` ${IZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
|
|
354
355
|
`);
|