trybeacon 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +25 -21
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +30 -6
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +11 -11
- package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- package/.next/server/app/api/changes/comment/claim/route.js +1 -0
- package/.next/server/app/api/changes/comment/claim/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/comment/claim/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/comment/route.js +1 -0
- package/.next/server/app/api/changes/comment/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/comment/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/quality/route.js +1 -0
- package/.next/server/app/api/changes/quality/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/quality/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/route.js +1 -0
- package/.next/server/app/api/{flags → changes}/route.js.nft.json +1 -1
- package/.next/server/app/api/changes/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/changes/viewed/route.js +1 -0
- package/.next/server/app/api/changes/viewed/route.js.nft.json +1 -0
- package/.next/server/app/api/changes/viewed/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/route.js +1 -9
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/position/route.js.nft.json +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/edges/route.js.nft.json +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/ingest/route.js +1 -9
- package/.next/server/app/api/ingest/route.js.nft.json +1 -1
- package/.next/server/app/api/init/route.js +1 -9
- package/.next/server/app/api/init/route.js.nft.json +1 -1
- package/.next/server/app/api/lesson/close/route.js +1 -1
- package/.next/server/app/api/lesson/presence/route.js +1 -1
- package/.next/server/app/api/lesson/questions/route.js +1 -1
- package/.next/server/app/api/lesson/route.js +1 -1
- package/.next/server/app/api/lesson/save/route.js +1 -1
- package/.next/server/app/api/lesson/verdict/route.js +1 -1
- package/.next/server/app/api/map/describe/route.js +1 -9
- package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/files/route.js.nft.json +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/route.js.nft.json +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/start/route.js.nft.json +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
- package/.next/server/app/api/mention-search/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +3 -3
- package/.next/server/app/api/plan/approve/route.js +1 -9
- package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/history/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/presence/route.js +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-meta/route.js +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -1
- package/.next/server/app/api/share/create/route.js +1 -1
- package/.next/server/app/api/share/create/route.js.nft.json +1 -1
- package/.next/server/app/api/share/route.js +1 -1
- package/.next/server/app/api/stream/route.js +2 -2
- package/.next/server/app/api/tab/nav/route.js +1 -1
- package/.next/server/app/api/tab/presence/route.js +1 -1
- package/.next/server/app/api/telemetry/route.js +1 -1
- package/.next/server/app/api/telemetry/stats/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/apple-icon.png/route.js +1 -1
- package/.next/server/app/docs/page.js +2 -2
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +11 -11
- package/.next/server/app/docs.segments/_full.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +11 -11
- package/.next/server/app/help.segments/_full.segment.rsc +11 -11
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +11 -11
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +11 -11
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/learn/page.js +4 -4
- package/.next/server/app/learn/page.js.nft.json +1 -1
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +12 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +2 -2
- package/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +2 -2
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +25 -21
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/2025.js +1 -1
- package/.next/server/chunks/230.js +1 -0
- package/.next/server/chunks/2693.js +5 -0
- package/.next/server/chunks/4307.js +1 -1
- package/.next/server/chunks/6469.js +10 -0
- package/.next/server/chunks/8190.js +1 -0
- package/.next/server/chunks/8227.js +1 -0
- package/.next/server/chunks/8674.js +7 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/4853-0082a1e1b820a293.js +1 -0
- package/.next/static/chunks/5909-387573cddda35a48.js +1 -0
- package/.next/static/chunks/654-8e68a43e4c589e9c.js +1 -0
- package/.next/static/chunks/app/_global-error/page-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/claim/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/comment/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/quality/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/changes/viewed/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/context/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/edges/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/entities/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/init/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/close/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/questions/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/save/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/lesson/verdict/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/mention-search/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/notes/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/open/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/reset/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/share/create/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/share/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/stream/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/version/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/app/{layout-d3b7276f116dce46.js → layout-6e934a2850efd223.js} +1 -1
- package/.next/static/chunks/app/learn/page-a14eaf5143e2df55.js +7 -0
- package/.next/static/chunks/app/map/{page-5d73cd85ed62df7a.js → page-06282017c592fb3c.js} +1 -1
- package/.next/static/chunks/app/plan/page-41a3990cb858c5f2.js +11 -0
- package/.next/static/chunks/app/s/[token]/{page-4d3ed0a6a420eb44.js → page-a4deb16beff21840.js} +1 -1
- package/.next/static/chunks/app/settings/page-67cab634be8bfef2.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-5f4c3e6e9cc8e6c9.js +1 -0
- package/.next/static/chunks/{webpack-de4a0d9611ec2cad.js → webpack-6c27b0ed1ac1459c.js} +1 -1
- package/.next/static/css/95dc31edc34789a7.css +1 -0
- package/.next/static/css/a5d17568738ef1e9.css +1 -0
- package/.next/static/mB9lqGEsIvB7tTvv9GU48/_buildManifest.js +1 -0
- package/.next/trace +45 -43
- package/.next/trace-build +1 -1
- package/.next/types/app/api/changes/comment/claim/route.ts +351 -0
- package/.next/types/app/api/changes/comment/route.ts +351 -0
- package/.next/types/app/api/changes/quality/route.ts +351 -0
- package/.next/types/app/api/{flags → changes}/route.ts +3 -3
- package/.next/types/app/api/changes/viewed/route.ts +351 -0
- package/.next/types/routes.d.ts +6 -2
- package/.next/types/validator.ts +45 -9
- package/bun.lock +54 -0
- package/dist/bin/doctor.js +33 -32
- package/dist/bin/guard.js +1 -1
- package/dist/bin/hook.js +33 -32
- package/dist/bin/mcp.js +43 -42
- package/dist/bin/plan.js +35 -34
- package/dist/bin/uninstall.js +34 -33
- package/dist/lib/assets.js +25 -24
- package/dist/lib/codex-install.js +32 -31
- package/dist/lib/global-install.js +33 -32
- package/package.json +3 -1
- package/plugin/skills/beacon-plan/SKILL.md +5 -4
- package/.next/server/app/api/flags/route.js +0 -1
- package/.next/server/app/api/flags/route_client-reference-manifest.js +0 -1
- package/.next/server/chunks/3098.js +0 -1
- package/.next/server/chunks/3221.js +0 -5
- package/.next/server/chunks/6810.js +0 -1
- package/.next/static/GjuqgbaZr9M0AGKgnA2hT/_buildManifest.js +0 -1
- package/.next/static/chunks/1052-151437e30240c959.js +0 -1
- package/.next/static/chunks/4853-946597034e74be36.js +0 -1
- package/.next/static/chunks/app/_global-error/page-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/context/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/edges/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/entities/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/flags/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/init/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/close/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/questions/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/save/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/lesson/verdict/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/mention-search/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/notes/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/open/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/reset/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/scope-guard/check/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/share/create/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/share/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/stream/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/version/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/app/learn/page-bb7141041f6b6e08.js +0 -7
- package/.next/static/chunks/app/plan/page-6b546f1602bd1108.js +0 -1
- package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-93569b5eb93a61e9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-93569b5eb93a61e9.js +0 -1
- package/.next/static/css/b51708465127fded.css +0 -1
- /package/.next/static/{GjuqgbaZr9M0AGKgnA2hT → mB9lqGEsIvB7tTvv9GU48}/_ssgManifest.js +0 -0
package/dist/bin/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 I={};a(I,{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 C(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(($)=>String($.name)))}async function D(Q){if(!await C(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 C(Q,X))continue;let $=await GQ(Q,X);for(let J of Z){if(!$.has(J))continue;await Q.execute(`UPDATE "${X}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function 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 $=await C(Z,"__drizzle_migrations"),J=await C(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 D(Z);if(await e(i(Z),{migrationsFolder:X}),await D(Z)>G)Y=!0;return await VQ(Z),{migrated:Y}}finally{Z.close()}}var $Q,JQ,YQ;var u=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 NQ}from"child_process";import{createHash as MQ}from"crypto";import{existsSync as S,mkdirSync as L,readFileSync as T,writeFileSync as x}from"fs";import{homedir as v}from"os";import{basename as UQ,join as B,parse as LQ,resolve as W}from"path";function K(){return process.env.BEACON_HOME||B(v(),".beacon")}function E(){return B(K(),"workspaces.json")}function U(Q){return MQ("sha256").update(Q).digest("hex").slice(0,12)}function F(Q=process.cwd()){let X=NQ("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 P(Q){let X=W(Q);return X!==W(v())&&X!==LQ(X).root}function y(){return B(K(),"deleted.json")}function A(){try{let Q=JSON.parse(T(y(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function f(Q){L(K(),{recursive:!0}),x(y(),JSON.stringify(Q,null,2))}function k(Q){return A().includes(Q)}function mQ(Q){let X=A();if(!X.includes(Q))f([...X,Q])}function jQ(Q){let X=A();if(X.includes(Q))f(X.filter((Z)=>Z!==Q))}function H(Q){return B(K(),Q)}function zQ(Q){return`file:${B(H(Q),"db.sqlite")}`}function j(){try{let Q=JSON.parse(T(E(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function q(Q){L(K(),{recursive:!0}),x(E(),JSON.stringify(Q,null,2))}function g(){return j().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function N(Q){return j().find((X)=>X.id===Q)??null}function w(Q,X,Z=new Date().toISOString()){if(!P(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let $=U(Q);if(k($))throw Error(`beacon: workspace ${$} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=j(),Y=J.find((M)=>M.id===$),G={id:$,path:Q,name:X||Y?.name||UQ(Q),lastOpenedAt:Z},V=[G,...J.filter((M)=>M.id!==$)];return L(H($),{recursive:!0}),q(V),G}function hQ(Q,X){return jQ(U(Q)),w(Q,X)}function pQ(Q,X=new Date().toISOString()){let Z=j(),$=Z.find((J)=>J.id===Q);if(!$)return;$.lastOpenedAt=X,q(Z)}function cQ(Q){if(q(j().filter((X)=>X.id!==Q)),R()===Q)CQ(g()[0]?.id??null)}function b(){return B(K(),"active")}function R(){try{return T(b(),"utf8").trim()||null}catch{return null}}function CQ(Q){L(K(),{recursive:!0}),x(b(),Q??"")}function lQ(){let Q=R();return Q?N(Q):null}function nQ(){let Q=_Q()??R();return Q?N(Q):null}function sQ(Q){return N(Q)?.path??null}function dQ(){return S(E())}var m="beacon_ws";function h(Q,X){let Z=Q.headers.get("cookie");if(!Z)return null;for(let $ of Z.split(";")){let J=$.indexOf("=");if(J===-1)continue;if($.slice(0,J).trim()===X)return decodeURIComponent($.slice(J+1).trim())}return null}function oQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=h(Q,m);if(Z&&N(Z))return Z;return HQ()}function HQ(){let Q=g();return Q.length===1?Q[0].id:null}var OQ="x-beacon-workspace-path";async function aQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=Q.headers.get(OQ);if(Z&&P(Z)&&!k(U(Z))&&(!X||U(Z)===X)){let J=w(Z);return await TQ(J.id),J.id}let $=h(Q,m);if($&&N($))return $;return null}var p=new BQ;function tQ(Q,X){return Q?p.run(Q,X):X()}function _Q(){return p.getStore()??null}var _=new Set;function rQ(Q){_.delete(B(H(Q),"db.sqlite"))}async function TQ(Q){let X=H(Q),Z=B(X,"db.sqlite"),$=S(Z);if($&&_.has(Z))return{ok:!0,created:!1,migrated:!1};try{L(X,{recursive:!0});let{provisionDb:J}=await u().then(() => I),Y=await J(zQ(Q));return _.add(Z),{ok:!0,created:!$,migrated:$&&Y.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as xQ}from"net";var c=4319;function EQ(Q,X,Z=400){return new Promise(($)=>{let J=xQ({host:Q,port:X}),Y=!1,G=(V)=>{if(Y)return;Y=!0,J.destroy(),$(V)};J.once("connect",()=>G(!0)),J.once("error",()=>G(!1)),J.setTimeout(Z,()=>G(!1))})}async function AQ(Q){for(let X of["127.0.0.1","::1"])if(await EQ(X,Q))return!1;return!0}async function QX(Q,X=20){for(let Z=Q;Z<Q+X;Z++)if(await AQ(Z))return Z;return Q}import{readFileSync as qQ}from"fs";import{join as RQ}from"path";function DQ(){try{return JSON.parse(qQ(RQ(K(),"server.json"),"utf8"))}catch{return null}}function l(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${DQ()?.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=U(F(typeof Q.cwd==="string"?Q.cwd:void 0)),$=l(),J={"x-beacon-workspace":Z},Y={hookEventName:"PreToolUse"},G=Q?.permission_mode==="bypassPermissions",V=typeof Q.session_id==="string"?Q.session_id:"",M=await fetch(`${$}/api/scope-guard/check?claim=1&session=${encodeURIComponent(V)}&file=${encodeURIComponent(typeof X==="string"?X:"")}`,{headers:J}).catch(()=>null);if(M?.ok){let z=await M.json().catch(()=>null);if(!G&&z?.decision==="ask"&&typeof X==="string"&&X)Y.permissionDecision="ask",Y.permissionDecisionReason=z.reason??"This edit is outside the current plan's declared scope.";if(z?.additionalContext)Y.additionalContext=z.additionalContext}if(Y.permissionDecision||Y.additionalContext)process.stdout.write(JSON.stringify({hookSpecificOutput:Y}))}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 vZ=Object.defineProperty;var CZ=(Q)=>Q;function MZ(Q,Z){this[Q]=CZ.bind(null,Z)}var ZQ=(Q,Z)=>{for(var $ in Z)vZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:MZ.bind(Z,$)})};var v=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var m0=1500,p0=480000,c0=1800000,E=3600000,d0=3000;var OQ=()=>{};var zQ={};ZQ(zQ,{stripAgentsPointer:()=>IQ,removeRepoAssets:()=>EZ,installRefreshSkill:()=>wZ,installPlanSkill:()=>RZ,installInitSkill:()=>uZ,installExplainSkill:()=>TZ,installCodexRepoSkills:()=>gZ,ensureWorkflowDoc:()=>OZ,ensureMcp:()=>bZ,contextDocTargets:()=>VQ,auditRepo:()=>DZ,REFRESH_SKILL:()=>JQ,PLAN_SKILL:()=>DQ,INIT_SKILL:()=>$Q,EXPLAIN_SKILL:()=>EQ});import{existsSync as B,mkdirSync as w,readFileSync as x,rmSync as I,writeFileSync as H}from"fs";import{join as X}from"path";function uZ(Q){let Z=X(Q,".claude","skills","beacon-init");w(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,$Q),$}function wZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");w(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,JQ),$}function RZ(Q){let Z=X(Q,".claude","skills","beacon-plan");w(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,DQ),$}function TZ(Q){let Z=X(Q,".claude","skills","beacon-explain");w(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,EQ),$}function gZ(Q){let Z=[];for(let $ of FZ){let J=X(Q,".agents","skills",$.name);w(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 IQ(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 OZ(Q){let Z=new RegExp(`${f}[\\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
|
+
`)}IQ(Q)}function bZ(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<E)return J.timeout=E,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:E},H(Z,JSON.stringify($,null,2)+`
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function DZ(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(f)}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 EZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(B(U))I(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))I(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)I(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let Y=!1,V=new RegExp(`\\n?${f}[\\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())I(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
|
+
`,DQ=`---
|
|
114
114
|
name: beacon-plan
|
|
115
115
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
116
116
|
---
|
|
@@ -139,10 +139,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
|
|
|
139
139
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
140
140
|
|
|
141
141
|
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
142
|
-
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`).
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
|
|
143
|
+
frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
|
|
144
|
+
for the user's authorization (which then adds it to the contract), and the /plan Changes view
|
|
145
|
+
groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
|
|
146
|
+
(if omitted, the scope is inferred from the files you name in backticks).
|
|
146
147
|
|
|
147
148
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
148
149
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
@@ -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
|
+
`,EQ=`---
|
|
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
|
+
`,FZ,f="<!-- beacon:workflow:start -->",YQ="<!-- beacon:workflow:end -->",bQ;var qQ=v(()=>{OQ();FZ=[{name:"beacon-init",body:()=>$Q},{name:"beacon-refresh",body:()=>JQ}];bQ=`${f}
|
|
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 IZ,readFileSync as C,rmSync as fZ,writeFileSync as y}from"fs";import{dirname as fQ,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 IZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(G(V,W.name))}catch{}}$=Y}return null}function kQ(Q){return yQ(Q)!==null}function AZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function yZ(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(fQ(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 h(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(fQ(Q),{recursive:!0}),y(Q,V.endsWith(`
|
|
311
312
|
`)?V:`${V}
|
|
312
313
|
`)}function R(Q,Z){try{return C(Q,"utf8").includes(Z)}catch{return!1}}function m(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 T(Q,Z){return A(G(Q,Z,"SKILL.md"))}function c(Q,Z){let $=G(Q,Z);if(!A($))return!1;return fZ($,{recursive:!0,force:!0}),!0}var N,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(()=>{N=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as kZ,renameSync as LZ,rmSync as _Z,writeFileSync as SZ}from"fs";import{dirname as hZ}from"path";function d(Q,Z){kZ(hZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{SZ($,Z),LZ($,Q)}catch(J){throw _Z($,{force:!0}),J}}function Q1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var _Q=()=>{};var nQ={};ZQ(nQ,{setupCodexAssets:()=>dZ,removeCodexMcp:()=>lQ,removeCodexArtifacts:()=>nZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>dQ,codexMcpProblem:()=>cZ,codexDetected:()=>mQ,auditCodex:()=>lZ,CODEX_HOOKS:()=>t});import{readFileSync as s}from"fs";import{homedir as mZ}from"os";import{join as O}from"path";function SQ(){return process.env.HOME||process.env.USERPROFILE||mZ()}function mQ(){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 g(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(g(s(M(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function cZ(){let Q="";try{Q=s(M(),"utf8")}catch{return null}let Z=g(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${F}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${F}`;return null}function dQ(){let Q="",Z=!1;try{Q=s(M(),"utf8"),Z=!0}catch{}if(Z){let V=g(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${F}`};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 ${F}`}}let $=!Q?"":Q.endsWith(`
|
|
339
340
|
`)?`
|
|
340
341
|
`:`
|
|
341
342
|
|
|
342
|
-
`,J=Q+$+
|
|
343
|
-
`),$=Z.indexOf(
|
|
343
|
+
`,J=Q+$+pZ;if(g(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${F}`};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(
|
|
347
|
+
`).replace(/^\n+/,"");if(g(Y)===null)return{removed:!1,skipped:!0};return d(M(),Y),{removed:!0}}async function dZ(){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 N){if(!T(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=R(l(),a);h(l(),a,hQ,k);let z=dQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function lZ(){let Q={};for(let $ of N)Q[$]=T(n(),$);let Z={};for(let $ of t)Z[$.event]=_(jQ(),{event:$.event,command:$.command});return{detected:mQ(),skills:Q,hooks:Z,agentsMdBlock:R(l(),a),mcp:xQ()}}function nZ(){let Q=[];for(let Y of N)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 $=m(l(),a,hQ),J=lQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var BQ=()=>O(SQ(),".codex"),jQ=()=>O(BQ(),"hooks.json"),M=()=>O(BQ(),"config.toml"),l=()=>O(BQ(),"AGENTS.md"),n=()=>O(SQ(),".agents","skills"),a="<!-- beacon:global:start -->",hQ="<!-- beacon:global:end -->",t,HQ,pQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",cQ="# beacon:end",pZ,F="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."}];pZ=`${pQ}
|
|
347
348
|
[mcp_servers.beacon]
|
|
348
349
|
command = "beacon"
|
|
349
350
|
args = ["mcp"]
|
|
350
|
-
${
|
|
351
|
-
`});var
|
|
352
|
-
`)){let J=
|
|
351
|
+
${cQ}
|
|
352
|
+
`});var eQ={};ZQ(eQ,{provisionDb:()=>K0});import{createClient as z0}from"@libsql/client";import{drizzle as q0}from"drizzle-orm/libsql";import{migrate as X0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as U0}from"drizzle-orm/migrator";import{dirname as CQ,join as W0}from"path";import{fileURLToPath as H0}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 G0(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(x0)){if(!await i(Q,Z))continue;let J=await G0(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 K0(Q,Z=j0){let $=z0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await i($,"__drizzle_migrations"),Y=await i($,"Node"),V=!1;if(Y&&!J){let W=U0({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 X0(q0($),{migrationsFolder:Z}),await iQ($)>q)V=!0;return await N0($),{migrated:V}}finally{$.close()}}var B0,j0,x0;var QZ=v(async()=>{B0=CQ(CQ(CQ(H0(import.meta.url)))),j0=process.env.BEACON_MIGRATIONS_DIR||W0(B0,"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"]}});WQ();import{existsSync as aZ}from"fs";import{homedir as sZ}from"os";import{join as r}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||sZ()}var o=()=>r(tZ(),".claude"),GQ=()=>r(o(),"skills"),NQ=()=>r(o(),"settings.json"),KQ=()=>r(o(),"CLAUDE.md"),PQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->";var rZ=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:"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 oZ(Q,Z){return p(GQ(),Q,Z)}function tQ(Q){return T(GQ(),Q)}function iZ(Q){return c(GQ(),Q)}function eZ(Q){return L(NQ(),Q)}function Q0(Q){return _(NQ(),Q)}function Z0(Q){return S(NQ(),Q)}function $0(Q){h(KQ(),PQ,sQ,Q)}function rQ(){return R(KQ(),PQ)}function J0(){return m(KQ(),PQ,sQ)}function H1(){let Q={};for(let $ of N)Q[$]=tQ($);let Z={};for(let $ of vQ)Z[$.event]=Q0({event:$.event,command:$.command});return{homeExists:aZ(o()),skills:Q,hooks:Z,claudeMdBlock:rQ()}}async function Y0(){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 N){if(!tQ(z))V.push(z);oZ(z,Y[z])}let q=0;for(let z of vQ)if(eZ({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=rQ();return $0(rZ),{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{V0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await Y0()}}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 V0(){let Q=[];for(let J of N)if(iZ(J))Q.push(J);let Z=0;for(let J of vQ)if(Z0(J))Z++;let $=J0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as P0}from"async_hooks";import{spawnSync as v0}from"child_process";import{createHash as C0}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 M0,join as K,parse as u0,resolve as ZZ}from"path";function j(){return process.env.BEACON_HOME||K(JZ(),".beacon")}function RQ(){return K(j(),"workspaces.json")}function u(Q){return C0("sha256").update(Q).digest("hex").slice(0,12)}function YZ(Q=process.cwd()){let Z=v0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function VZ(Q){let Z=ZZ(Q);return Z!==ZZ(JZ())&&Z!==u0(Z).root}function zZ(){return K(j(),"deleted.json")}function TQ(){try{let Q=JSON.parse(uQ(zZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function qZ(Q){b(j(),{recursive:!0}),wQ(zZ(),JSON.stringify(Q,null,2))}function XZ(Q){return TQ().includes(Q)}function T1(Q){let Z=TQ();if(!Z.includes(Q))qZ([...Z,Q])}function w0(Q){let Z=TQ();if(Z.includes(Q))qZ(Z.filter(($)=>$!==Q))}function e(Q){return K(j(),Q)}function R0(Q){return`file:${K(e(Q),"db.sqlite")}`}function D(){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 UZ(){return D().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return D().find((Z)=>Z.id===Q)??null}function WZ(Q,Z,$=new Date().toISOString()){if(!VZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=u(Q);if(XZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=D(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||M0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return b(e(J),{recursive:!0}),FQ(W),q}function F1(Q,Z){return w0(u(Q)),WZ(Q,Z)}function g1(Q,Z=new Date().toISOString()){let $=D(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,FQ($)}function O1(Q){if(FQ(D().filter((Z)=>Z.id!==Q)),gQ()===Q)T0(UZ()[0]?.id??null)}function HZ(){return K(j(),"active")}function gQ(){try{return uQ(HZ(),"utf8").trim()||null}catch{return null}}function T0(Q){b(j(),{recursive:!0}),wQ(HZ(),Q??"")}function b1(){let Q=gQ();return Q?P(Q):null}function D1(){let Q=O0()??gQ();return Q?P(Q):null}function E1(Q){return P(Q)?.path??null}function I1(){return $Z(RQ())}var BZ="beacon_ws";function jZ(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 f1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=jZ(Q,BZ);if($&&P($))return $;return F0()}function F0(){let Q=UZ();return Q.length===1?Q[0].id:null}var g0="x-beacon-workspace-path";async function A1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(g0);if($&&VZ($)&&!XZ(u($))&&(!Z||u($)===Z)){let Y=WZ($);return await b0(Y.id),Y.id}let J=jZ(Q,BZ);if(J&&P(J))return J;return null}var xZ=new P0;function y1(Q,Z){return Q?xZ.run(Q,Z):Z()}function O0(){return xZ.getStore()??null}var MQ=new Set;function k1(Q){MQ.delete(K(e(Q),"db.sqlite"))}async function b0(Q){let Z=e(Q),$=K(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(R0(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 D0}from"net";var GZ=4319;function E0(Q,Z,$=400){return new Promise((J)=>{let Y=D0({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 I0(Q){for(let Z of["127.0.0.1","::1"])if(await E0(Z,Q))return!1;return!0}async function S1(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await I0($))return $;return Q}import{resolve as f0}from"path";var A0="*** Begin Patch",y0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function k0(Q){let Z=[];for(let $ of Q.split(`
|
|
353
|
+
`)){let J=y0.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(A0))continue;return k0(V).map((q)=>f0(Y,q))}return[]}import{readFileSync as L0}from"fs";import{join as _0}from"path";function S0(){try{return JSON.parse(L0(_0(j(),"server.json"),"utf8"))}catch{return null}}function KZ(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${S0()?.port||process.env.PORT||GZ}`}await oQ();var PZ="";for await(let Q of process.stdin)PZ+=Q;try{let Q=JSON.parse(PZ||"{}"),Z=NZ(Q);if(Z.length){let $=u(YZ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${KZ()}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z,session:typeof Q.session_id==="string"?Q.session_id:void 0})}).catch(()=>{})}}catch{}process.exit(0);
|