trybeacon 0.1.72 → 0.1.74
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 +17 -9
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +54 -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.js.nft.json +1 -1
- 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 +23 -22
- package/.next/server/app/_not-found.segments/_full.segment.rsc +23 -22
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +12 -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/ask/answer/route.js +1 -0
- package/.next/server/app/api/ask/answer/route.js.nft.json +1 -0
- package/.next/server/app/api/ask/answer/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/ask/route.js +1 -0
- package/.next/server/app/api/ask/route.js.nft.json +1 -0
- package/.next/server/app/api/ask/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/ask/verdict/route.js +1 -0
- package/.next/server/app/api/ask/verdict/route.js.nft.json +1 -0
- package/.next/server/app/api/ask/verdict/route_client-reference-manifest.js +1 -0
- 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/answer/route.js +4 -0
- package/.next/server/app/api/changes/comment/answer/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/comment/answer/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/comment/claim/route.js +4 -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 +4 -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 +2 -2
- 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 +4 -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.js.nft.json +1 -1
- 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 +24 -23
- package/.next/server/app/docs.segments/_full.segment.rsc +24 -23
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +12 -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.js.nft.json +1 -1
- 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 +32 -31
- package/.next/server/app/help.segments/_full.segment.rsc +32 -31
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +12 -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 +22 -21
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +22 -21
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +12 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/learn/page.js +3 -3
- 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.js.nft.json +1 -1
- 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.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +17 -9
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/2031.js +1 -0
- package/.next/server/chunks/230.js +1 -0
- package/.next/server/chunks/2693.js +8 -0
- package/.next/server/chunks/374.js +1 -0
- package/.next/server/chunks/5295.js +1 -0
- package/.next/server/chunks/{4700.js → 5704.js} +2 -2
- package/.next/server/chunks/6469.js +10 -0
- package/.next/server/chunks/6962.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/3151-861a6caa40f70f79.js +1 -0
- package/.next/static/chunks/3908-80efc60050779adf.js +1 -0
- package/.next/static/chunks/5697-5b9719b81806b4cf.js +1 -0
- package/.next/static/chunks/654-8e68a43e4c589e9c.js +1 -0
- package/.next/static/chunks/7424-d7fa15ef452064dd.js +1 -0
- package/.next/static/chunks/app/_global-error/page-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/ask/answer/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/ask/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/ask/verdict/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/answer/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/claim/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/quality/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/changes/viewed/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/context/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/draft/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/edges/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/entities/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/init/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/close/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/presence/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/questions/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/save/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/lesson/verdict/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/mention-search/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/notes/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/open/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/reset/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/share/create/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/share/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/stream/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/version/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/app/layout-f908dc26e06f4302.js +1 -0
- package/.next/static/chunks/app/learn/{page-e5bd3257170098e7.js → page-bc40746566d115e5.js} +1 -1
- package/.next/static/chunks/app/map/{page-5ab46e5ea28ecd79.js → page-233ccd830873114b.js} +1 -1
- package/.next/static/chunks/app/plan/page-8ec1e1d8ea40686a.js +11 -0
- package/.next/static/chunks/app/s/[token]/{page-8e4ffccdf7cd0309.js → page-2a3f04bc3f60ec49.js} +1 -1
- package/.next/static/chunks/app/settings/page-a751eabdd933f685.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d54a69e7dc6b4008.js +1 -0
- package/.next/static/chunks/{webpack-de4a0d9611ec2cad.js → webpack-6c27b0ed1ac1459c.js} +1 -1
- package/.next/static/css/60048003a8c96562.css +1 -0
- package/.next/static/css/a5d17568738ef1e9.css +1 -0
- package/.next/static/yescmIM6BeSzGgwZ-Dwpq/_buildManifest.js +1 -0
- package/.next/trace +46 -43
- package/.next/trace-build +1 -1
- package/.next/types/app/api/ask/answer/route.ts +351 -0
- package/.next/types/app/api/{flags → ask}/route.ts +3 -3
- package/.next/types/app/api/ask/verdict/route.ts +351 -0
- package/.next/types/app/api/changes/comment/answer/route.ts +351 -0
- 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/changes/route.ts +351 -0
- package/.next/types/app/api/changes/viewed/route.ts +351 -0
- package/.next/types/routes.d.ts +10 -2
- package/.next/types/validator.ts +81 -9
- package/bun.lock +54 -0
- package/dist/bin/answer.js +8 -0
- package/dist/bin/ask.js +5 -0
- package/dist/bin/beacon.js +5 -5
- package/dist/bin/doctor.js +36 -35
- package/dist/bin/guard.js +1 -1
- package/dist/bin/hook.js +33 -32
- package/dist/bin/mcp.js +45 -44
- package/dist/bin/plan.js +36 -35
- package/dist/bin/remove.js +6 -6
- package/dist/bin/stop-hook.js +7 -3
- package/dist/bin/uninstall.js +35 -34
- package/dist/lib/assets.js +25 -24
- package/dist/lib/codex-install.js +32 -31
- package/dist/lib/global-install.js +33 -32
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/workspaces.js +1 -1
- 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/4307.js +0 -1
- package/.next/server/chunks/5719.js +0 -1
- package/.next/server/chunks/7604.js +0 -1
- package/.next/static/chunks/2231-63ad38ec8fb7cb6f.js +0 -1
- package/.next/static/chunks/2416-dbbbff4e4c9abad1.js +0 -1
- package/.next/static/chunks/766-242213d211df0afd.js +0 -1
- package/.next/static/chunks/8997-78a359d0d238622e.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/layout-d3b7276f116dce46.js +0 -1
- package/.next/static/chunks/app/plan/page-948f3eca400e746a.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/446974879473fd01.css +0 -1
- package/.next/static/lnOOQsWRymiliRmMEQ95F/_buildManifest.js +0 -1
- /package/.next/static/{lnOOQsWRymiliRmMEQ95F → yescmIM6BeSzGgwZ-Dwpq}/_ssgManifest.js +0 -0
package/dist/bin/doctor.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 xQ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(
|
|
14
|
-
`)}}catch{}let Y=!1,V=
|
|
3
|
+
var IZ=Object.defineProperty;var DZ=(Q)=>Q;function OZ(Q,Z){this[Q]=DZ.bind(null,Z)}var BQ=(Q,Z)=>{for(var $ in Z)IZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:OZ.bind(Z,$)})};var F=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var a0=1500,d0=480000,r0=1800000,m=3600000,o0=3000;var cQ=()=>{};var CQ={};BQ(CQ,{stripAgentsPointer:()=>tQ,removeRepoAssets:()=>hZ,installRefreshSkill:()=>AZ,installPlanSkill:()=>bZ,installInitSkill:()=>yZ,installExplainSkill:()=>kZ,installCodexRepoSkills:()=>LZ,ensureWorkflowDoc:()=>SZ,ensureMcp:()=>mZ,contextDocTargets:()=>KQ,auditRepo:()=>xQ,REFRESH_SKILL:()=>GQ,PLAN_SKILL:()=>nQ,INIT_SKILL:()=>NQ,EXPLAIN_SKILL:()=>sQ});import{existsSync as x,mkdirSync as D,readFileSync as C,rmSync as h,writeFileSync as N}from"fs";import{join as X}from"path";function yZ(Q){let Z=X(Q,".claude","skills","beacon-init");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,NQ),$}function AZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,GQ),$}function bZ(Q){let Z=X(Q,".claude","skills","beacon-plan");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,nQ),$}function kZ(Q){let Z=X(Q,".claude","skills","beacon-explain");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,sQ),$}function LZ(Q){let Z=[];for(let $ of _Z){let J=X(Q,".agents","skills",$.name);D(J,{recursive:!0});let Y=X(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function KQ(Q){let Z=X(Q,"AGENTS.md"),$=X(Q,"CLAUDE.md"),J=x(Z),Y=x($);if(!J&&!Y)return[Z,$];let V=[];if(J)V.push(Z);if(Y)V.push($);return V}function tQ(Q){let Z=X(Q,"CLAUDE.md");if(!x(Z))return;let $=C(Z,"utf8"),J=$.split(`
|
|
4
|
+
`).filter((Y)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Y)).join(`
|
|
5
|
+
`).trim();if(J&&J!==$.trim())N(Z,`${J}
|
|
6
|
+
`)}function SZ(Q){let Z=new RegExp(`${p}[\\s\\S]*?${PQ}`);for(let $ of KQ(Q)){let J="";try{J=C($,"utf8")}catch{}J=Z.test(J)?J.replace(Z,lQ):`${J.trim()}
|
|
7
|
+
|
|
8
|
+
${lQ}
|
|
9
|
+
`.trimStart(),N($,J.endsWith(`
|
|
10
|
+
`)?J:`${J}
|
|
11
|
+
`)}tQ(Q)}function mZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(C(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<m)return J.timeout=m,N(Z,JSON.stringify($,null,2)+`
|
|
12
|
+
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:m},N(Z,JSON.stringify($,null,2)+`
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function xQ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(C(Z,"utf8")).mcpServers?.beacon}catch{}let J=KQ(Q).some((Y)=>{try{return C(Y,"utf8").includes(p)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:J,skills:{"beacon-init":x(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":x(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":x(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":x(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function hZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(x(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(x(U))h(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(C(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 N(J,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let Y=!1,V=new RegExp(`\\n?${p}[\\s\\S]*?${PQ}\\n?`);for(let z of[X(Q,"AGENTS.md"),X(Q,"CLAUDE.md")])try{let U=C(z,"utf8");if(V.test(U)){let vQ=U.replace(V,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
|
-
`).trimStart();N(
|
|
17
|
+
`).trimStart();N(z,vQ.endsWith(`
|
|
18
18
|
`)?vQ:`${vQ}
|
|
19
|
-
`),Y=!0}}catch{}let q=!1,H=X(Q,"CLAUDE.md");try{let z=
|
|
19
|
+
`),Y=!0}}catch{}let q=!1,H=X(Q,"CLAUDE.md");try{let z=C(H,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())h(H,{force:!0});else N(H,U);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var NQ=`---
|
|
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
|
+
`,nQ=`---
|
|
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
|
+
`,sQ=`---
|
|
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
|
+
`,_Z,p="<!-- beacon:workflow:start -->",PQ="<!-- beacon:workflow:end -->",lQ;var c=F(()=>{cQ();_Z=[{name:"beacon-init",body:()=>NQ},{name:"beacon-refresh",body:()=>GQ}];lQ=`${p}
|
|
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
|
-
${PQ}`});import{existsSync as
|
|
304
|
-
`)}function
|
|
304
|
+
${PQ}`});import{existsSync as l,mkdirSync as MQ,readdirSync as pZ,readFileSync as R,rmSync as cZ,writeFileSync as n}from"fs";import{dirname as aQ,join as M}from"path";function dQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function s(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=M(Q,".claude","plugins");if(!l(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=M(V,".claude-plugin","plugin.json");try{if(l(q)&&JSON.parse(R(q,"utf8")).name==="beacon")return V}catch{}try{for(let H of pZ(V,{withFileTypes:!0}))if(H.isDirectory())Y.push(M(V,H.name))}catch{}}$=Y}return null}function rQ(Q){return s(Q)!==null}function lZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function nZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(R(M(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 wQ(Q){try{return JSON.parse(R(Q,"utf8"))}catch{return{}}}function oQ(Q,Z){MQ(aQ(Q),{recursive:!0}),n(Q,JSON.stringify(Z,null,2)+`
|
|
305
|
+
`)}function a(Q,Z){let $=wQ(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}]}),oQ(Q,$),!0}function d(Q,Z){return(wQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function r(Q,Z){let $=wQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let H=q.hooks?.length??0,z=(q.hooks??[]).filter((U)=>U.command!==Z.command);if(z.length!==H)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 oQ(Q,$),!0}function o(Q,Z,$,J){let Y=`${Z}
|
|
305
306
|
${J.trim()}
|
|
306
|
-
${$}`,V="";try{V=
|
|
307
|
+
${$}`,V="";try{V=R(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
|
+
`,MQ(aQ(Q),{recursive:!0}),n(Q,V.endsWith(`
|
|
311
312
|
`)?V:`${V}
|
|
312
|
-
`)}function O(Q,Z){try{return
|
|
313
|
+
`)}function O(Q,Z){try{return R(Q,"utf8").includes(Z)}catch{return!1}}function i(Q,Z,$){let J="";try{J=R(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
|
|
315
|
+
`).trimStart();return n(Q,V),!0}function e(Q,Z,$){let J=M(Q,Z);MQ(J,{recursive:!0});let Y=M(J,"SKILL.md");return n(Y,$),Y}function y(Q,Z){return l(M(Q,Z,"SKILL.md"))}function QQ(Q,Z){let $=M(Q,Z);if(!l($))return!1;return cZ($,{recursive:!0,force:!0}),!0}var v,t=`## 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,19 +336,19 @@ 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 fQ=F(()=>{v=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as sZ,renameSync as tZ,rmSync as aZ,writeFileSync as dZ}from"fs";import{dirname as rZ}from"path";function ZQ(Q,Z){sZ(rZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{dZ($,Z),tZ($,Q)}catch(J){throw aZ($,{force:!0}),J}}function q1(Q,Z,$=!1){ZQ(Q,JSON.stringify(Z,null,$?2:void 0))}var iQ=()=>{};var VZ={};BQ(VZ,{setupCodexAssets:()=>eZ,removeCodexMcp:()=>YZ,removeCodexArtifacts:()=>Q0,hasCodexMcp:()=>RQ,ensureCodexMcp:()=>JZ,codexMcpProblem:()=>gQ,codexDetected:()=>zQ,auditCodex:()=>EQ,CODEX_HOOKS:()=>T});import{readFileSync as VQ}from"fs";import{homedir as oZ}from"os";import{join as k}from"path";function eQ(){return process.env.HOME||process.env.USERPROFILE||oZ()}function zQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(TQ===void 0)TQ=Bun.which("codex")!==null;return TQ}function b(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function RQ(){try{return Boolean(b(VQ(g(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function gQ(){let Q="";try{Q=VQ(g(),"utf8")}catch{return null}let Z=b(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${A}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${A}`;return null}function JZ(){let Q="",Z=!1;try{Q=VQ(g(),"utf8"),Z=!0}catch{}if(Z){let V=b(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${A}`};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 ${A}`}}let $=!Q?"":Q.endsWith(`
|
|
339
340
|
`)?`
|
|
340
341
|
`:`
|
|
341
342
|
|
|
342
|
-
`,J=Q+$+
|
|
343
|
-
`),$=Z.indexOf(
|
|
343
|
+
`,J=Q+$+iZ;if(b(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${A}`};return ZQ(g(),J),{added:!0}}function YZ(){let Q="";try{Q=VQ(g(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
344
|
+
`),$=Z.indexOf(ZZ);if($===-1)return{removed:!1,skipped:RQ()};let J=Z.indexOf($Z,$);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(b(Y)===null)return{removed:!1,skipped:!0};return
|
|
347
|
+
`).replace(/^\n+/,"");if(b(Y)===null)return{removed:!1,skipped:!0};return ZQ(g(),Y),{removed:!0}}async function eZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (c(),CQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of v){if(!y(JQ(),U))V.push(U);e(JQ(),U,Y[U])}let q=0;for(let U of T)if(a(FQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let H=O($Q(),YQ);o($Q(),YQ,QZ,t);let z=JZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!H,mcp:z}}function EQ(){let Q={};for(let $ of v)Q[$]=y(JQ(),$);let Z={};for(let $ of T)Z[$.event]=d(FQ(),{event:$.event,command:$.command});return{detected:zQ(),skills:Q,hooks:Z,agentsMdBlock:O($Q(),YQ),mcp:RQ()}}function Q0(){let Q=[];for(let Y of v)if(QQ(JQ(),Y))Q.push(Y);let Z=0;for(let Y of T)if(r(FQ(),{event:Y.event,command:Y.command}))Z++;let $=i($Q(),YQ,QZ),J=YZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var uQ=()=>k(eQ(),".codex"),FQ=()=>k(uQ(),"hooks.json"),g=()=>k(uQ(),"config.toml"),$Q=()=>k(uQ(),"AGENTS.md"),JQ=()=>k(eQ(),".agents","skills"),YQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->",T,TQ,ZZ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",$Z="# beacon:end",iZ,A="add it manually: codex mcp add beacon -- beacon mcp";var IQ=F(()=>{fQ();iQ();T=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];iZ=`${ZZ}
|
|
347
348
|
[mcp_servers.beacon]
|
|
348
349
|
command = "beacon"
|
|
349
350
|
args = ["mcp"]
|
|
350
|
-
${
|
|
351
|
-
`});var
|
|
352
|
-
\x1B[1m${Q}\x1B[0m`;function
|
|
353
|
-
${
|
|
351
|
+
${$Z}
|
|
352
|
+
`});var HZ={};BQ(HZ,{provisionDb:()=>u0});import{createClient as B0}from"@libsql/client";import{drizzle as N0}from"drizzle-orm/libsql";import{migrate as G0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as P0}from"drizzle-orm/migrator";import{dirname as bQ,join as K0}from"path";import{fileURLToPath as x0}from"url";async function UQ(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 WZ(Q){if(!await UQ(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(w0)){if(!await UQ(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 u0(Q,Z=M0){let $=B0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await UQ($,"__drizzle_migrations"),Y=await UQ($,"Node"),V=!1;if(Y&&!J){let H=P0({migrationsFolder:Z})[0];if(H)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:[H.hash,H.folderMillis]}),V=!0}let q=await WZ($);if(await G0(N0($),{migrationsFolder:Z}),await WZ($)>q)V=!0;return await T0($),{migrated:V}}finally{$.close()}}var C0,M0,w0;var jZ=F(async()=>{C0=bQ(bQ(bQ(x0(import.meta.url)))),M0=process.env.BEACON_MIGRATIONS_DIR||K0(C0,"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"]}});fQ();import{existsSync as Z0}from"fs";import{homedir as $0}from"os";import{join as qQ}from"path";function J0(){return process.env.HOME||process.env.USERPROFILE||$0()}var XQ=()=>qQ(J0(),".claude"),DQ=()=>qQ(XQ(),"skills"),OQ=()=>qQ(XQ(),"settings.json"),yQ=()=>qQ(XQ(),"CLAUDE.md"),AQ="<!-- beacon:global:start -->",zZ="<!-- beacon:global:end -->";var Y0=t,E=[{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:"PreToolUse",matcher:"AskUserQuestion",command:"beacon ask",description:"Surface the agent's AskUserQuestion in Beacon's modal; your pick flows back as the answer (falls through to the terminal if Beacon isn't open)."},{event:"PermissionRequest",matcher:"Edit|Write|MultiEdit|Bash|NotebookEdit",command:"beacon ask",description:"Surface edit/create/run approvals in Beacon's modal; your allow/deny flows back (falls through to the terminal prompt if Beacon isn't open)."},{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 V0(Q,Z){return e(DQ(),Q,Z)}function qZ(Q){return y(DQ(),Q)}function z0(Q){return QQ(DQ(),Q)}function q0(Q){return a(OQ(),Q)}function X0(Q){return d(OQ(),Q)}function U0(Q){return r(OQ(),Q)}function W0(Q){o(yQ(),AQ,zZ,Q)}function XZ(){return O(yQ(),AQ)}function H0(){return i(yQ(),AQ,zZ)}function UZ(){let Q={};for(let $ of v)Q[$]=qZ($);let Z={};for(let $ of E)Z[$.event]=X0({event:$.event,command:$.command});return{homeExists:Z0(XQ()),skills:Q,hooks:Z,claudeMdBlock:XZ()}}async function j0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (c(),CQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of v){if(!qZ(z))V.push(z);V0(z,Y[z])}let q=0;for(let z of E)if(q0({event:z.event,matcher:z.matcher,command:z.command}))q++;let H=XZ();return W0(Y0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!H}}async function K1(){if(dQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(rQ()){try{v0()}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(() => (IQ(),VZ));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 v0(){let Q=[];for(let J of v)if(z0(J))Q.push(J);let Z=0;for(let J of E)if(U0(J))Z++;let $=H0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as F0}from"async_hooks";import{spawnSync as R0}from"child_process";import{createHash as g0}from"crypto";import{existsSync as BZ,mkdirSync as L,readFileSync as _Q,writeFileSync as LQ}from"fs";import{homedir as NZ}from"os";import{basename as E0,join as w,parse as I0,resolve as vZ}from"path";function P(){return process.env.BEACON_HOME||w(NZ(),".beacon")}function SQ(){return w(P(),"workspaces.json")}function _(Q){return g0("sha256").update(Q).digest("hex").slice(0,12)}function D0(Q=process.cwd()){let Z=R0("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=vZ(Q);return Z!==vZ(NZ())&&Z!==I0(Z).root}function PZ(){return w(P(),"deleted.json")}function mQ(){try{let Q=JSON.parse(_Q(PZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function KZ(Q){L(P(),{recursive:!0}),LQ(PZ(),JSON.stringify(Q,null,2))}function xZ(Q){return mQ().includes(Q)}function O1(Q){let Z=mQ();if(!Z.includes(Q))KZ([...Z,Q])}function O0(Q){let Z=mQ();if(Z.includes(Q))KZ(Z.filter(($)=>$!==Q))}function WQ(Q){return w(P(),Q)}function y0(Q){return`file:${w(WQ(Q),"db.sqlite")}`}function S(){try{let Q=JSON.parse(_Q(SQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function hQ(Q){L(P(),{recursive:!0}),LQ(SQ(),JSON.stringify(Q,null,2))}function HQ(){return S().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function u(Q){return S().find((Z)=>Z.id===Q)??null}function CZ(Q,Z,$=new Date().toISOString()){if(!GZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=_(Q);if(xZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=S(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||E0(Q),lastOpenedAt:$},H=[q,...Y.filter((z)=>z.id!==J)];return L(WQ(J),{recursive:!0}),hQ(H),q}function y1(Q,Z){return O0(_(Q)),CZ(Q,Z)}function A1(Q,Z=new Date().toISOString()){let $=S(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,hQ($)}function b1(Q){if(hQ(S().filter((Z)=>Z.id!==Q)),pQ()===Q)A0(HQ()[0]?.id??null)}function MZ(){return w(P(),"active")}function pQ(){try{return _Q(MZ(),"utf8").trim()||null}catch{return null}}function A0(Q){L(P(),{recursive:!0}),LQ(MZ(),Q??"")}function k1(){let Q=pQ();return Q?u(Q):null}function _1(){let Q=k0()??pQ();return Q?u(Q):null}function L1(Q){return u(Q)?.path??null}function S1(){return BZ(SQ())}var wZ="beacon_ws";function fZ(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 m1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=fZ(Q,wZ);if($&&u($))return $;return b0()}function b0(){let Q=HQ();return Q.length===1?Q[0].id:null}var TZ="x-beacon-workspace-path";function h1(Q=process.cwd()){let Z=D0(Q);return{"x-beacon-workspace":_(Z),[TZ]:Z}}async function p1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=Q.headers.get(TZ);if($&&GZ($)&&!xZ(_($))&&(!Z||_($)===Z)){let Y=CZ($);return await _0(Y.id),Y.id}let J=fZ(Q,wZ);if(J&&u(J))return J;return null}var uZ=new F0;function c1(Q,Z){return Q?uZ.run(Q,Z):Z()}function k0(){return uZ.getStore()??null}var kQ=new Set;function l1(Q){kQ.delete(w(WQ(Q),"db.sqlite"))}async function _0(Q){let Z=WQ(Q),$=w(Z,"db.sqlite"),J=BZ($);if(J&&kQ.has($))return{ok:!0,created:!1,migrated:!1};try{L(Z,{recursive:!0});let{provisionDb:Y}=await jZ().then(() => HZ),V=await Y(y0(Q));return kQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}c();IQ();import{execSync as L0,spawnSync as RZ}from"child_process";import{existsSync as S0,readFileSync as m0}from"fs";import{join as gZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,K=(Q)=>`\x1B[2m${Q}\x1B[0m`,I=(Q)=>`
|
|
353
|
+
\x1B[1m${Q}\x1B[0m`;function h0(){try{return L0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function p0(){let Q=gZ(P(),"server.json");try{let Z=JSON.parse(m0(Q,"utf8"));if(!Z.pid)return j("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return j(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return j("daemon: no server.json (never started)")}}function c0(){let Q=RZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return j("bun NOT found on PATH (required to run Beacon)")}function l0(){return h0()||process.cwd()}var jQ=l0(),f=UZ(),EZ=HQ(),n0=EZ.some((Q)=>Q.path===jQ),B=n0||S0(gZ(jQ,".mcp.json"))?xQ(jQ):null;console.log(I("Beacon \xB7 doctor"));console.log(I("Runtime"));console.log(` ${c0()}`);console.log(` ${p0()}`);console.log(` ${W(`home: ${P()}`)}`);console.log(` ${W(`workspaces registered: ${EZ.length}`)}`);console.log(I("Global (~/.claude/)"));for(let Q of v)console.log(` ${f.skills[Q]?W(`skill ${Q}`):j(`skill ${Q} \u2014 missing`)}`);for(let Q of E)console.log(` ${f.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):j(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${K(Q.description)}`);console.log(` ${f.claudeMdBlock?W("global CLAUDE.md block"):j("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(I("Plugin (Claude Code)"));var FZ=s();if(FZ)if(console.log(` ${W(`installed as a Claude Code plugin \u2192 ${FZ}`)}`),console.log(` ${K("the plugin owns the Claude-side skills/hooks/MCP")}`),f.hooks.PostToolUse||v.some((Q)=>f.skills[Q]))console.log(` ${K("npm-global ~/.claude entries still present \u2014 they'll be removed automatically on the next `beacon` run (run `beacon` once to deconflict now).")}`);else console.log(` ${W("npm-global ~/.claude layer stepped aside \u2014 no double-registration")}`);else console.log(` ${K("not installed as a Claude Code plugin (using the npm `trybeacon` CLI).")}`);console.log(I("Codex (~/.codex/ + ~/.agents/)"));var G=zQ()?EQ():null;if(!G)console.log(` ${K("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=RZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):K("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of v)console.log(` ${G.skills[$]?W(`skill ${$} (~/.agents/skills)`):j(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of T)console.log(` ${G.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):j(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${K($.description)}`);console.log(` ${G.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):j("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=gQ();console.log(` ${G.mcp?W("config.toml has [mcp_servers.beacon]"):j(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(I(`Current repo (${jQ})`));if(!B)console.log(` ${K("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${B.mcpRegistered?W(".mcp.json has beacon entry"):j(".mcp.json missing beacon entry")}`),console.log(` ${B.workflowBlock?W("AGENTS.md / CLAUDE.md has Beacon workflow block"):j("AGENTS.md / CLAUDE.md missing Beacon workflow block")}`),console.log(` ${B.skills["beacon-init"]?W("skill beacon-init (repo)"):j("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${B.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):j("skill beacon-refresh (repo) \u2014 missing")}`),G)console.log(` ${B.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):j("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${B.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):j("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var s0=v.some((Q)=>!f.skills[Q])||E.some((Q)=>!f.hooks[Q.event])||!f.claudeMdBlock||(G?v.some((Q)=>!G.skills[Q])||T.some((Q)=>!G.hooks[Q.event])||!G.agentsMdBlock||!G.mcp:!1)||(B?!B.mcpRegistered||!B.workflowBlock||!B.skills["beacon-init"]||!B.skills["beacon-refresh"]||(G?!B.codexSkills["beacon-init"]||!B.codexSkills["beacon-refresh"]:!1):!1);if(s0)console.log(`
|
|
354
|
+
${K("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${K("in this repo.")}`);console.log();
|
package/dist/bin/guard.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
3
|
+
var s=Object.defineProperty;var d=(Q)=>Q;function o(Q,X){this[Q]=d.bind(null,X)}var a=(Q,X)=>{for(var Z in X)s(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:o.bind(X,Z)})};var t=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var R={};a(R,{provisionDb:()=>KQ});import{createClient as r}from"@libsql/client";import{drizzle as i}from"drizzle-orm/libsql";import{migrate as e}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as QQ}from"drizzle-orm/migrator";import{dirname as O,join as XQ}from"path";import{fileURLToPath as ZQ}from"url";async function z(Q,X){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[X]})).rows.length>0}async function GQ(Q,X){let Z=await Q.execute(`PRAGMA table_info("${X}")`);return new Set(Z.rows.map((J)=>String(J.name)))}async function I(Q){if(!await z(Q,"__drizzle_migrations"))return 0;let X=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(X.rows[0]?.n??0)}async function VQ(Q){for(let[X,Z]of Object.entries(YQ)){if(!await z(Q,X))continue;let J=await GQ(Q,X);for(let $ of Z){if(!J.has($))continue;await Q.execute(`UPDATE "${X}" SET "${$}" = CAST((julianday("${$}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${$}") = 'text'`)}}}async function KQ(Q,X=JQ){let Z=r({url:Q});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let J=await z(Z,"__drizzle_migrations"),$=await z(Z,"Node"),Y=!1;if($&&!J){let V=QQ({migrationsFolder:X})[0];if(V)await Z.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await Z.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[V.hash,V.folderMillis]}),Y=!0}let G=await I(Z);if(await e(i(Z),{migrationsFolder:X}),await I(Z)>G)Y=!0;return await VQ(Z),{migrated:Y}}finally{Z.close()}}var $Q,JQ,YQ;var D=t(async()=>{$Q=O(O(O(ZQ(import.meta.url)))),JQ=process.env.BEACON_MIGRATIONS_DIR||XQ($Q,"drizzle"),YQ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});import{AsyncLocalStorage as BQ}from"async_hooks";import{spawnSync as MQ}from"child_process";import{createHash as NQ}from"crypto";import{existsSync as v,mkdirSync as L,readFileSync as T,writeFileSync as x}from"fs";import{homedir as F}from"os";import{basename as UQ,join as M,parse as LQ,resolve as u}from"path";function K(){return process.env.BEACON_HOME||M(F(),".beacon")}function _(){return M(K(),"workspaces.json")}function U(Q){return NQ("sha256").update(Q).digest("hex").slice(0,12)}function jQ(Q=process.cwd()){let X=MQ("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(X.status===0){let Z=X.stdout?.toString().trim();if(Z)return Z}return Q}function S(Q){let X=u(Q);return X!==u(F())&&X!==LQ(X).root}function W(){return M(K(),"deleted.json")}function q(){try{let Q=JSON.parse(T(W(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function P(Q){L(K(),{recursive:!0}),x(W(),JSON.stringify(Q,null,2))}function y(Q){return q().includes(Q)}function mQ(Q){let X=q();if(!X.includes(Q))P([...X,Q])}function zQ(Q){let X=q();if(X.includes(Q))P(X.filter((Z)=>Z!==Q))}function C(Q){return M(K(),Q)}function CQ(Q){return`file:${M(C(Q),"db.sqlite")}`}function j(){try{let Q=JSON.parse(T(_(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function E(Q){L(K(),{recursive:!0}),x(_(),JSON.stringify(Q,null,2))}function f(){return j().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function N(Q){return j().find((X)=>X.id===Q)??null}function k(Q,X,Z=new Date().toISOString()){if(!S(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=U(Q);if(y(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let $=j(),Y=$.find((B)=>B.id===J),G={id:J,path:Q,name:X||Y?.name||UQ(Q),lastOpenedAt:Z},V=[G,...$.filter((B)=>B.id!==J)];return L(C(J),{recursive:!0}),E(V),G}function hQ(Q,X){return zQ(U(Q)),k(Q,X)}function pQ(Q,X=new Date().toISOString()){let Z=j(),J=Z.find(($)=>$.id===Q);if(!J)return;J.lastOpenedAt=X,E(Z)}function cQ(Q){if(E(j().filter((X)=>X.id!==Q)),A()===Q)OQ(f()[0]?.id??null)}function g(){return M(K(),"active")}function A(){try{return T(g(),"utf8").trim()||null}catch{return null}}function OQ(Q){L(K(),{recursive:!0}),x(g(),Q??"")}function lQ(){let Q=A();return Q?N(Q):null}function nQ(){let Q=TQ()??A();return Q?N(Q):null}function sQ(Q){return N(Q)?.path??null}function dQ(){return v(_())}var w="beacon_ws";function b(Q,X){let Z=Q.headers.get("cookie");if(!Z)return null;for(let J of Z.split(";")){let $=J.indexOf("=");if($===-1)continue;if(J.slice(0,$).trim()===X)return decodeURIComponent(J.slice($+1).trim())}return null}function oQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=b(Q,w);if(Z&&N(Z))return Z;return HQ()}function HQ(){let Q=f();return Q.length===1?Q[0].id:null}var m="x-beacon-workspace-path";function h(Q=process.cwd()){let X=jQ(Q);return{"x-beacon-workspace":U(X),[m]:X}}async function aQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=Q.headers.get(m);if(Z&&S(Z)&&!y(U(Z))&&(!X||U(Z)===X)){let $=k(Z);return await xQ($.id),$.id}let J=b(Q,w);if(J&&N(J))return J;return null}var p=new BQ;function tQ(Q,X){return Q?p.run(Q,X):X()}function TQ(){return p.getStore()??null}var H=new Set;function rQ(Q){H.delete(M(C(Q),"db.sqlite"))}async function xQ(Q){let X=C(Q),Z=M(X,"db.sqlite"),J=v(Z);if(J&&H.has(Z))return{ok:!0,created:!1,migrated:!1};try{L(X,{recursive:!0});let{provisionDb:$}=await D().then(() => R),Y=await $(CQ(Q));return H.add(Z),{ok:!0,created:!J,migrated:J&&Y.migrated}}catch($){return{ok:!1,created:!1,migrated:!1,error:$ instanceof Error?$.message:String($)}}}import{connect as _Q}from"net";var c=4319;function qQ(Q,X,Z=400){return new Promise((J)=>{let $=_Q({host:Q,port:X}),Y=!1,G=(V)=>{if(Y)return;Y=!0,$.destroy(),J(V)};$.once("connect",()=>G(!0)),$.once("error",()=>G(!1)),$.setTimeout(Z,()=>G(!1))})}async function EQ(Q){for(let X of["127.0.0.1","::1"])if(await qQ(X,Q))return!1;return!0}async function QX(Q,X=20){for(let Z=Q;Z<Q+X;Z++)if(await EQ(Z))return Z;return Q}import{readFileSync as AQ}from"fs";import{join as IQ}from"path";function RQ(){try{return JSON.parse(AQ(IQ(K(),"server.json"),"utf8"))}catch{return null}}function l(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${RQ()?.port||process.env.PORT||c}`}var n="";for await(let Q of process.stdin)n+=Q;try{let Q=JSON.parse(n||"{}"),X=Q?.tool_input?.file_path,Z=l(),J=h(typeof Q.cwd==="string"?Q.cwd:void 0),$={hookEventName:"PreToolUse"},Y=Q?.permission_mode==="bypassPermissions",G=typeof Q.session_id==="string"?Q.session_id:"",V=await fetch(`${Z}/api/scope-guard/check?claim=1&session=${encodeURIComponent(G)}&file=${encodeURIComponent(typeof X==="string"?X:"")}`,{headers:J}).catch(()=>null);if(V?.ok){let B=await V.json().catch(()=>null);if(!Y&&B?.decision==="ask"&&typeof X==="string"&&X)$.permissionDecision="ask",$.permissionDecisionReason=B.reason??"This edit is outside the current plan's declared scope.";if(B?.additionalContext)$.additionalContext=B.additionalContext}if($.permissionDecision||$.additionalContext)process.stdout.write(JSON.stringify({hookSpecificOutput:$}))}catch{}process.exit(0);
|
package/dist/bin/hook.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 Y=!1,V=
|
|
3
|
+
var CZ=Object.defineProperty;var MZ=(Q)=>Q;function uZ(Q,Z){this[Q]=MZ.bind(null,Z)}var ZQ=(Q,Z)=>{for(var $ in Z)CZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:uZ.bind(Z,$)})};var v=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var p0=1500,c0=480000,d0=1800000,f=3600000,l0=3000;var OQ=()=>{};var zQ={};ZQ(zQ,{stripAgentsPointer:()=>DQ,removeRepoAssets:()=>DZ,installRefreshSkill:()=>RZ,installPlanSkill:()=>TZ,installInitSkill:()=>wZ,installExplainSkill:()=>FZ,installCodexRepoSkills:()=>OZ,ensureWorkflowDoc:()=>bZ,ensureMcp:()=>IZ,contextDocTargets:()=>VQ,auditRepo:()=>fZ,REFRESH_SKILL:()=>JQ,PLAN_SKILL:()=>IQ,INIT_SKILL:()=>$Q,EXPLAIN_SKILL:()=>fQ});import{existsSync as B,mkdirSync as u,readFileSync as x,rmSync as D,writeFileSync as H}from"fs";import{join as X}from"path";function wZ(Q){let Z=X(Q,".claude","skills","beacon-init");u(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,$Q),$}function RZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");u(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,JQ),$}function TZ(Q){let Z=X(Q,".claude","skills","beacon-plan");u(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,IQ),$}function FZ(Q){let Z=X(Q,".claude","skills","beacon-explain");u(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,fQ),$}function OZ(Q){let Z=[];for(let $ of gZ){let J=X(Q,".agents","skills",$.name);u(J,{recursive:!0});let Y=X(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function VQ(Q){let Z=X(Q,"AGENTS.md"),$=X(Q,"CLAUDE.md"),J=B(Z),Y=B($);if(!J&&!Y)return[Z,$];let V=[];if(J)V.push(Z);if(Y)V.push($);return V}function DQ(Q){let Z=X(Q,"CLAUDE.md");if(!B(Z))return;let $=x(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 bZ(Q){let Z=new RegExp(`${E}[\\s\\S]*?${YQ}`);for(let $ of VQ(Q)){let J="";try{J=x($,"utf8")}catch{}J=Z.test(J)?J.replace(Z,bQ):`${J.trim()}
|
|
7
|
+
|
|
8
|
+
${bQ}
|
|
9
|
+
`.trimStart(),H($,J.endsWith(`
|
|
10
|
+
`)?J:`${J}
|
|
11
|
+
`)}DQ(Q)}function IZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<f)return J.timeout=f,H(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},H(Z,JSON.stringify($,null,2)+`
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function fZ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=VQ(Q).some((Y)=>{try{return x(Y,"utf8").includes(E)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:J,skills:{"beacon-init":B(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":B(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":B(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":B(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function DZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(B(U))D(U,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",z);if(B(U))D(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(x(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)D(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let Y=!1,V=new RegExp(`\\n?${E}[\\s\\S]*?${YQ}\\n?`);for(let z of[X(Q,"AGENTS.md"),X(Q,"CLAUDE.md")])try{let U=x(z,"utf8");if(V.test(U)){let QQ=U.replace(V,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
|
-
`).trimStart();H(
|
|
17
|
+
`).trimStart();H(z,QQ.endsWith(`
|
|
18
18
|
`)?QQ:`${QQ}
|
|
19
|
-
`),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=x(W,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())
|
|
19
|
+
`),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=x(W,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())D(W,{force:!0});else H(W,U);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var $Q=`---
|
|
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
|
+
`,IQ=`---
|
|
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
|
+
`,gZ,E="<!-- beacon:workflow:start -->",YQ="<!-- beacon:workflow:end -->",bQ;var qQ=v(()=>{OQ();gZ=[{name:"beacon-init",body:()=>$Q},{name:"beacon-refresh",body:()=>JQ}];bQ=`${E}
|
|
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
|
-
${YQ}`});import{existsSync as
|
|
304
|
-
`)}function L(Q,Z){let $=
|
|
304
|
+
${YQ}`});import{existsSync as A,mkdirSync as XQ,readdirSync as EZ,readFileSync as C,rmSync as AZ,writeFileSync as y}from"fs";import{dirname as EQ,join as G}from"path";function AQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function yQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=G(Q,".claude","plugins");if(!A(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=G(V,".claude-plugin","plugin.json");try{if(A(q)&&JSON.parse(C(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of EZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(G(V,W.name))}catch{}}$=Y}return null}function kQ(Q){return yQ(Q)!==null}function yZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function kZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(C(G(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 UQ(Q){try{return JSON.parse(C(Q,"utf8"))}catch{return{}}}function LQ(Q,Z){XQ(EQ(Q),{recursive:!0}),y(Q,JSON.stringify(Z,null,2)+`
|
|
305
|
+
`)}function L(Q,Z){let $=UQ(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}]}),LQ(Q,$),!0}function _(Q,Z){return(UQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function S(Q,Z){let $=UQ(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 LQ(Q,$),!0}function m(Q,Z,$,J){let Y=`${Z}
|
|
305
306
|
${J.trim()}
|
|
306
307
|
${$}`,V="";try{V=C(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
|
+
`,XQ(EQ(Q),{recursive:!0}),y(Q,V.endsWith(`
|
|
311
312
|
`)?V:`${V}
|
|
312
|
-
`)}function
|
|
313
|
+
`)}function w(Q,Z){try{return C(Q,"utf8").includes(Z)}catch{return!1}}function h(Q,Z,$){let J="";try{J=C(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 y(Q,V),!0}function p(Q,Z,$){let J=
|
|
315
|
+
`).trimStart();return y(Q,V),!0}function p(Q,Z,$){let J=G(Q,Z);XQ(J,{recursive:!0});let Y=G(J,"SKILL.md");return y(Y,$),Y}function R(Q,Z){return A(G(Q,Z,"SKILL.md"))}function c(Q,Z){let $=G(Q,Z);if(!A($))return!1;return AZ($,{recursive:!0,force:!0}),!0}var K,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,18 +336,18 @@ 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 WQ=v(()=>{K=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as LZ,renameSync as _Z,rmSync as SZ,writeFileSync as mZ}from"fs";import{dirname as hZ}from"path";function d(Q,Z){LZ(hZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{mZ($,Z),_Z($,Q)}catch(J){throw SZ($,{force:!0}),J}}function Z1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var _Q=()=>{};var nQ={};ZQ(nQ,{setupCodexAssets:()=>lZ,removeCodexMcp:()=>lQ,removeCodexArtifacts:()=>aZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>dQ,codexMcpProblem:()=>dZ,codexDetected:()=>hQ,auditCodex:()=>nZ,CODEX_HOOKS:()=>t});import{readFileSync as s}from"fs";import{homedir as pZ}from"os";import{join as g}from"path";function SQ(){return process.env.HOME||process.env.USERPROFILE||pZ()}function hQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(HQ===void 0)HQ=Bun.which("codex")!==null;return HQ}function F(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(F(s(M(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function dZ(){let Q="";try{Q=s(M(),"utf8")}catch{return null}let Z=F(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${T}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${T}`;return null}function dQ(){let Q="",Z=!1;try{Q=s(M(),"utf8"),Z=!0}catch{}if(Z){let V=F(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${T}`};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 ${T}`}}let $=!Q?"":Q.endsWith(`
|
|
339
340
|
`)?`
|
|
340
341
|
`:`
|
|
341
342
|
|
|
342
|
-
`,J=Q+$+
|
|
343
|
-
`),$=Z.indexOf(
|
|
343
|
+
`,J=Q+$+cZ;if(F(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${T}`};return d(M(),J),{added:!0}}function lQ(){let Q="";try{Q=s(M(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
344
|
+
`),$=Z.indexOf(pQ);if($===-1)return{removed:!1,skipped:xQ()};let J=Z.indexOf(cQ,$);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(F(Y)===null)return{removed:!1,skipped:!0};return
|
|
347
|
+
`).replace(/^\n+/,"");if(F(Y)===null)return{removed:!1,skipped:!0};return d(M(),Y),{removed:!0}}async function lZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (qQ(),zQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of K){if(!R(n(),U))V.push(U);p(n(),U,Y[U])}let q=0;for(let U of t)if(L(jQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let W=w(l(),a);m(l(),a,mQ,k);let z=dQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function nZ(){let Q={};for(let $ of K)Q[$]=R(n(),$);let Z={};for(let $ of t)Z[$.event]=_(jQ(),{event:$.event,command:$.command});return{detected:hQ(),skills:Q,hooks:Z,agentsMdBlock:w(l(),a),mcp:xQ()}}function aZ(){let Q=[];for(let Y of K)if(c(n(),Y))Q.push(Y);let Z=0;for(let Y of t)if(S(jQ(),{event:Y.event,command:Y.command}))Z++;let $=h(l(),a,mQ),J=lQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var BQ=()=>g(SQ(),".codex"),jQ=()=>g(BQ(),"hooks.json"),M=()=>g(BQ(),"config.toml"),l=()=>g(BQ(),"AGENTS.md"),n=()=>g(SQ(),".agents","skills"),a="<!-- beacon:global:start -->",mQ="<!-- beacon:global:end -->",t,HQ,pQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",cQ="# beacon:end",cZ,T="add it manually: codex mcp add beacon -- beacon mcp";var aQ=v(()=>{WQ();_Q();t=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];cZ=`${pQ}
|
|
347
348
|
[mcp_servers.beacon]
|
|
348
349
|
command = "beacon"
|
|
349
350
|
args = ["mcp"]
|
|
350
|
-
${
|
|
351
|
-
`});var oQ={};ZQ(oQ,{provisionDb:()=>G0});import{createClient as Y0}from"@libsql/client";import{drizzle as V0}from"drizzle-orm/libsql";import{migrate as z0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as q0}from"drizzle-orm/migrator";import{dirname as vQ,join as X0}from"path";import{fileURLToPath as U0}from"url";async function i(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function B0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function rQ(Q){if(!await i(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 j0(Q){for(let[Z,$]of Object.entries(x0)){if(!await i(Q,Z))continue;let J=await B0(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 G0(Q,Z=H0){let $=Y0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await i($,"__drizzle_migrations"),Y=await i($,"Node"),V=!1;if(Y&&!J){let W=q0({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 rQ($);if(await z0(V0($),{migrationsFolder:Z}),await rQ($)>q)V=!0;return await j0($),{migrated:V}}finally{$.close()}}var W0,H0,x0;var iQ=P(async()=>{W0=vQ(vQ(vQ(U0(import.meta.url)))),H0=process.env.BEACON_MIGRATIONS_DIR||X0(W0,"drizzle"),x0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});UQ();import{existsSync as dZ}from"fs";import{homedir as nZ}from"os";import{join as r}from"path";function aZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var o=()=>r(aZ(),".claude"),jQ=()=>r(o(),"skills"),GQ=()=>r(o(),"settings.json"),NQ=()=>r(o(),"CLAUDE.md"),KQ="<!-- beacon:global:start -->",nQ="<!-- beacon:global:end -->";var sZ=k,PQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function tZ(Q,Z){return p(jQ(),Q,Z)}function aQ(Q){return T(jQ(),Q)}function rZ(Q){return c(jQ(),Q)}function oZ(Q){return L(GQ(),Q)}function iZ(Q){return _(GQ(),Q)}function eZ(Q){return S(GQ(),Q)}function Q0(Q){h(NQ(),KQ,nQ,Q)}function sQ(){return R(NQ(),KQ)}function Z0(){return m(NQ(),KQ,nQ)}function U1(){let Q={};for(let $ of G)Q[$]=aQ($);let Z={};for(let $ of PQ)Z[$.event]=iZ({event:$.event,command:$.command});return{homeExists:dZ(o()),skills:Q,hooks:Z,claudeMdBlock:sQ()}}async function $0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (zQ(),VQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of G){if(!aQ(z))V.push(z);tZ(z,Y[z])}let q=0;for(let z of PQ)if(oZ({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=sQ();return Q0(sZ),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function tQ(){if(AQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(IQ()){try{J0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await $0()}}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(() => (dQ(),lQ));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 J0(){let Q=[];for(let J of G)if(rZ(J))Q.push(J);let Z=0;for(let J of PQ)if(eZ(J))Z++;let $=Z0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as N0}from"async_hooks";import{spawnSync as K0}from"child_process";import{createHash as P0}from"crypto";import{existsSync as QZ,mkdirSync as b,readFileSync as uQ,writeFileSync as MQ}from"fs";import{homedir as ZZ}from"os";import{basename as v0,join as N,parse as C0,resolve as eQ}from"path";function B(){return process.env.BEACON_HOME||N(ZZ(),".beacon")}function wQ(){return N(B(),"workspaces.json")}function M(Q){return P0("sha256").update(Q).digest("hex").slice(0,12)}function $Z(Q=process.cwd()){let Z=K0("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 JZ(Q){let Z=eQ(Q);return Z!==eQ(ZZ())&&Z!==C0(Z).root}function YZ(){return N(B(),"deleted.json")}function RQ(){try{let Q=JSON.parse(uQ(YZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function VZ(Q){b(B(),{recursive:!0}),MQ(YZ(),JSON.stringify(Q,null,2))}function zZ(Q){return RQ().includes(Q)}function w1(Q){let Z=RQ();if(!Z.includes(Q))VZ([...Z,Q])}function u0(Q){let Z=RQ();if(Z.includes(Q))VZ(Z.filter(($)=>$!==Q))}function e(Q){return N(B(),Q)}function M0(Q){return`file:${N(e(Q),"db.sqlite")}`}function f(){try{let Q=JSON.parse(uQ(wQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function TQ(Q){b(B(),{recursive:!0}),MQ(wQ(),JSON.stringify(Q,null,2))}function qZ(){return f().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function K(Q){return f().find((Z)=>Z.id===Q)??null}function XZ(Q,Z,$=new Date().toISOString()){if(!JZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=M(Q);if(zZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=f(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||v0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return b(e(J),{recursive:!0}),TQ(W),q}function R1(Q,Z){return u0(M(Q)),XZ(Q,Z)}function T1(Q,Z=new Date().toISOString()){let $=f(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,TQ($)}function g1(Q){if(TQ(f().filter((Z)=>Z.id!==Q)),gQ()===Q)w0(qZ()[0]?.id??null)}function UZ(){return N(B(),"active")}function gQ(){try{return uQ(UZ(),"utf8").trim()||null}catch{return null}}function w0(Q){b(B(),{recursive:!0}),MQ(UZ(),Q??"")}function F1(){let Q=gQ();return Q?K(Q):null}function O1(){let Q=g0()??gQ();return Q?K(Q):null}function b1(Q){return K(Q)?.path??null}function f1(){return QZ(wQ())}var WZ="beacon_ws";function HZ(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 D1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=HZ(Q,WZ);if($&&K($))return $;return R0()}function R0(){let Q=qZ();return Q.length===1?Q[0].id:null}var T0="x-beacon-workspace-path";async function A1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=Q.headers.get(T0);if($&&JZ($)&&!zZ(M($))&&(!Z||M($)===Z)){let Y=XZ($);return await F0(Y.id),Y.id}let J=HZ(Q,WZ);if(J&&K(J))return J;return null}var xZ=new N0;function E1(Q,Z){return Q?xZ.run(Q,Z):Z()}function g0(){return xZ.getStore()??null}var CQ=new Set;function I1(Q){CQ.delete(N(e(Q),"db.sqlite"))}async function F0(Q){let Z=e(Q),$=N(Z,"db.sqlite"),J=QZ($);if(J&&CQ.has($))return{ok:!0,created:!1,migrated:!1};try{b(Z,{recursive:!0});let{provisionDb:Y}=await iQ().then(() => oQ),V=await Y(M0(Q));return CQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}import{connect as O0}from"net";var BZ=4319;function b0(Q,Z,$=400){return new Promise((J)=>{let Y=O0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,Y.destroy(),J(W)};Y.once("connect",()=>q(!0)),Y.once("error",()=>q(!1)),Y.setTimeout($,()=>q(!1))})}async function f0(Q){for(let Z of["127.0.0.1","::1"])if(await b0(Z,Q))return!1;return!0}async function L1(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await f0($))return $;return Q}import{resolve as D0}from"path";var A0="*** Begin Patch",E0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function I0(Q){let Z=[];for(let $ of Q.split(`
|
|
352
|
-
`)){let J=
|
|
351
|
+
${cQ}
|
|
352
|
+
`});var eQ={};ZQ(eQ,{provisionDb:()=>P0});import{createClient as q0}from"@libsql/client";import{drizzle as X0}from"drizzle-orm/libsql";import{migrate as U0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as W0}from"drizzle-orm/migrator";import{dirname as CQ,join as H0}from"path";import{fileURLToPath as B0}from"url";async function i(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function K0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function iQ(Q){if(!await i(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 N0(Q){for(let[Z,$]of Object.entries(G0)){if(!await i(Q,Z))continue;let J=await K0(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 P0(Q,Z=x0){let $=q0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await i($,"__drizzle_migrations"),Y=await i($,"Node"),V=!1;if(Y&&!J){let W=W0({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 iQ($);if(await U0(X0($),{migrationsFolder:Z}),await iQ($)>q)V=!0;return await N0($),{migrated:V}}finally{$.close()}}var j0,x0,G0;var QZ=v(async()=>{j0=CQ(CQ(CQ(B0(import.meta.url)))),x0=process.env.BEACON_MIGRATIONS_DIR||H0(j0,"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"]}});WQ();import{existsSync as sZ}from"fs";import{homedir as tZ}from"os";import{join as r}from"path";function rZ(){return process.env.HOME||process.env.USERPROFILE||tZ()}var o=()=>r(rZ(),".claude"),GQ=()=>r(o(),"skills"),KQ=()=>r(o(),"settings.json"),NQ=()=>r(o(),"CLAUDE.md"),PQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->";var oZ=k,vQ=[{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:"PreToolUse",matcher:"AskUserQuestion",command:"beacon ask",description:"Surface the agent's AskUserQuestion in Beacon's modal; your pick flows back as the answer (falls through to the terminal if Beacon isn't open)."},{event:"PermissionRequest",matcher:"Edit|Write|MultiEdit|Bash|NotebookEdit",command:"beacon ask",description:"Surface edit/create/run approvals in Beacon's modal; your allow/deny flows back (falls through to the terminal prompt if Beacon isn't open)."},{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 iZ(Q,Z){return p(GQ(),Q,Z)}function tQ(Q){return R(GQ(),Q)}function eZ(Q){return c(GQ(),Q)}function Q0(Q){return L(KQ(),Q)}function Z0(Q){return _(KQ(),Q)}function $0(Q){return S(KQ(),Q)}function J0(Q){m(NQ(),PQ,sQ,Q)}function rQ(){return w(NQ(),PQ)}function Y0(){return h(NQ(),PQ,sQ)}function B1(){let Q={};for(let $ of K)Q[$]=tQ($);let Z={};for(let $ of vQ)Z[$.event]=Z0({event:$.event,command:$.command});return{homeExists:sZ(o()),skills:Q,hooks:Z,claudeMdBlock:rQ()}}async function V0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (qQ(),zQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of K){if(!tQ(z))V.push(z);iZ(z,Y[z])}let q=0;for(let z of vQ)if(Q0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=rQ();return J0(oZ),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function oQ(){if(AQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(kQ()){try{z0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await V0()}}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(() => (aQ(),nQ));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 z0(){let Q=[];for(let J of K)if(eZ(J))Q.push(J);let Z=0;for(let J of vQ)if($0(J))Z++;let $=Y0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as v0}from"async_hooks";import{spawnSync as C0}from"child_process";import{createHash as M0}from"crypto";import{existsSync as $Z,mkdirSync as b,readFileSync as uQ,writeFileSync as wQ}from"fs";import{homedir as JZ}from"os";import{basename as u0,join as N,parse as w0,resolve as ZZ}from"path";function j(){return process.env.BEACON_HOME||N(JZ(),".beacon")}function RQ(){return N(j(),"workspaces.json")}function O(Q){return M0("sha256").update(Q).digest("hex").slice(0,12)}function R0(Q=process.cwd()){let Z=C0("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 YZ(Q){let Z=ZZ(Q);return Z!==ZZ(JZ())&&Z!==w0(Z).root}function VZ(){return N(j(),"deleted.json")}function TQ(){try{let Q=JSON.parse(uQ(VZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function zZ(Q){b(j(),{recursive:!0}),wQ(VZ(),JSON.stringify(Q,null,2))}function qZ(Q){return TQ().includes(Q)}function F1(Q){let Z=TQ();if(!Z.includes(Q))zZ([...Z,Q])}function T0(Q){let Z=TQ();if(Z.includes(Q))zZ(Z.filter(($)=>$!==Q))}function e(Q){return N(j(),Q)}function F0(Q){return`file:${N(e(Q),"db.sqlite")}`}function I(){try{let Q=JSON.parse(uQ(RQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function FQ(Q){b(j(),{recursive:!0}),wQ(RQ(),JSON.stringify(Q,null,2))}function XZ(){return I().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return I().find((Z)=>Z.id===Q)??null}function UZ(Q,Z,$=new Date().toISOString()){if(!YZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=O(Q);if(qZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=I(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||u0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return b(e(J),{recursive:!0}),FQ(W),q}function g1(Q,Z){return T0(O(Q)),UZ(Q,Z)}function O1(Q,Z=new Date().toISOString()){let $=I(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,FQ($)}function b1(Q){if(FQ(I().filter((Z)=>Z.id!==Q)),gQ()===Q)g0(XZ()[0]?.id??null)}function WZ(){return N(j(),"active")}function gQ(){try{return uQ(WZ(),"utf8").trim()||null}catch{return null}}function g0(Q){b(j(),{recursive:!0}),wQ(WZ(),Q??"")}function I1(){let Q=gQ();return Q?P(Q):null}function f1(){let Q=b0()??gQ();return Q?P(Q):null}function D1(Q){return P(Q)?.path??null}function E1(){return $Z(RQ())}var HZ="beacon_ws";function BZ(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 A1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=BZ(Q,HZ);if($&&P($))return $;return O0()}function O0(){let Q=XZ();return Q.length===1?Q[0].id:null}var jZ="x-beacon-workspace-path";function xZ(Q=process.cwd()){let Z=R0(Q);return{"x-beacon-workspace":O(Z),[jZ]:Z}}async function y1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(jZ);if($&&YZ($)&&!qZ(O($))&&(!Z||O($)===Z)){let Y=UZ($);return await I0(Y.id),Y.id}let J=BZ(Q,HZ);if(J&&P(J))return J;return null}var GZ=new v0;function k1(Q,Z){return Q?GZ.run(Q,Z):Z()}function b0(){return GZ.getStore()??null}var MQ=new Set;function L1(Q){MQ.delete(N(e(Q),"db.sqlite"))}async function I0(Q){let Z=e(Q),$=N(Z,"db.sqlite"),J=$Z($);if(J&&MQ.has($))return{ok:!0,created:!1,migrated:!1};try{b(Z,{recursive:!0});let{provisionDb:Y}=await QZ().then(() => eQ),V=await Y(F0(Q));return MQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}import{connect as f0}from"net";var KZ=4319;function D0(Q,Z,$=400){return new Promise((J)=>{let Y=f0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,Y.destroy(),J(W)};Y.once("connect",()=>q(!0)),Y.once("error",()=>q(!1)),Y.setTimeout($,()=>q(!1))})}async function E0(Q){for(let Z of["127.0.0.1","::1"])if(await D0(Z,Q))return!1;return!0}async function m1(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await E0($))return $;return Q}import{resolve as A0}from"path";var y0="*** Begin Patch",k0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function L0(Q){let Z=[];for(let $ of Q.split(`
|
|
353
|
+
`)){let J=k0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function NZ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(y0))continue;return L0(V).map((q)=>A0(Y,q))}return[]}import{readFileSync as _0}from"fs";import{join as S0}from"path";function m0(){try{return JSON.parse(_0(S0(j(),"server.json"),"utf8"))}catch{return null}}function PZ(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${m0()?.port||process.env.PORT||KZ}`}await oQ();var vZ="";for await(let Q of process.stdin)vZ+=Q;try{let Q=JSON.parse(vZ||"{}"),Z=NZ(Q);if(Z.length)await fetch(`${PZ()}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json",...xZ(typeof Q.cwd==="string"?Q.cwd:void 0)},body:JSON.stringify({files:Z,session:typeof Q.session_id==="string"?Q.session_id:void 0})}).catch(()=>{})}catch{}process.exit(0);
|