trybeacon 0.1.65 → 0.1.66
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 +19 -12
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +42 -0
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +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/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 -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/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/route.js +1 -1
- package/.next/server/app/api/flags/route.js +1 -1
- package/.next/server/app/api/ingest/route.js +2 -2
- package/.next/server/app/api/init/route.js +2 -2
- package/.next/server/app/api/lesson/close/route.js +1 -0
- package/.next/server/app/api/lesson/close/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/close/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/lesson/presence/route.js +1 -0
- package/.next/server/app/api/lesson/presence/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/presence/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/lesson/questions/route.js +1 -0
- package/.next/server/app/api/lesson/questions/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/questions/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/lesson/route.js +1 -0
- package/.next/server/app/api/lesson/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/lesson/save/route.js +1 -0
- package/.next/server/app/api/lesson/save/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/save/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/lesson/verdict/route.js +1 -0
- package/.next/server/app/api/lesson/verdict/route.js.nft.json +1 -0
- package/.next/server/app/api/lesson/verdict/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/map/describe/route.js +2 -2
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/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]/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +3 -3
- package/.next/server/app/api/plan/approve/route.js +2 -2
- package/.next/server/app/api/plan/history/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js +1 -1
- package/.next/server/app/api/plan/presence/route.js +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-meta/route.js +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js +1 -1
- package/.next/server/app/api/share/create/route.js +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/feedback/page.js +2 -2
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +11 -11
- package/.next/server/app/feedback.segments/_full.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +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 +12 -12
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +12 -12
- 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 +6 -0
- package/.next/server/app/learn/page.js.nft.json +1 -0
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -0
- 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 +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/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 +19 -12
- package/.next/server/chunks/2050.js +1 -1
- package/.next/server/chunks/3584.js +154 -0
- package/.next/server/chunks/4307.js +1 -1
- package/.next/server/chunks/6024.js +2 -0
- package/.next/server/chunks/{2813.js → 7187.js} +1 -1
- package/.next/server/chunks/8035.js +1 -0
- package/.next/server/chunks/9338.js +8 -8
- 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/P3uXQySdS-m6_bxuiezYe/_buildManifest.js +1 -0
- package/.next/static/chunks/1936-7fea5225b5bfcfda.js +1 -0
- package/.next/static/chunks/2019-3be80edc82176878.js +1 -0
- package/.next/static/chunks/4549-591415d55ca009a3.js +62 -0
- package/.next/static/chunks/6638-4e53879181b1df75.js +1 -0
- package/.next/static/chunks/{4888-911c0da3c2d785d2.js → 7043-254590cf9891391f.js} +1 -1
- package/.next/static/chunks/7643-6c7ff4b9400f68fc.js +1 -0
- package/.next/static/chunks/app/_global-error/page-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/context/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/draft/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/edges/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/entities/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/flags/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/init/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/close/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/presence/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/questions/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/save/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/lesson/verdict/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/mention-search/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/notes/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/open/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/reset/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/share/create/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/share/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/stream/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/version/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/app/layout-0c993f55d3a798f4.js +1 -0
- package/.next/static/chunks/app/learn/page-797d74e02b98fa88.js +5 -0
- package/.next/static/chunks/app/map/page-634b6d5d98e921b3.js +1 -0
- package/.next/static/chunks/app/page-84dc684d45002cfb.js +1 -0
- package/.next/static/chunks/app/plan/page-df829b2054c40611.js +1 -0
- package/.next/static/chunks/app/s/[token]/page-f97dec75856a7952.js +1 -0
- package/.next/static/chunks/app/settings/page-59d90685cd17fc1f.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-2390ea0e69e5991f.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2390ea0e69e5991f.js +1 -0
- package/.next/static/css/b3d3212da726bbfb.css +1 -0
- package/.next/trace +43 -42
- package/.next/trace-build +1 -1
- package/.next/types/app/api/lesson/close/route.ts +351 -0
- package/.next/types/app/api/lesson/presence/route.ts +351 -0
- package/.next/types/app/api/lesson/questions/route.ts +351 -0
- package/.next/types/app/api/lesson/route.ts +351 -0
- package/.next/types/app/api/lesson/save/route.ts +351 -0
- package/.next/types/app/api/lesson/verdict/route.ts +351 -0
- package/.next/types/app/learn/page.ts +87 -0
- package/.next/types/routes.d.ts +9 -2
- package/.next/types/validator.ts +63 -0
- package/dist/bin/doctor.js +88 -22
- package/dist/bin/hook.js +87 -21
- package/dist/bin/mcp.js +103 -35
- package/dist/bin/plan.js +88 -22
- package/dist/bin/uninstall.js +91 -25
- package/dist/lib/assets.js +77 -14
- package/dist/lib/codex-install.js +88 -22
- package/dist/lib/global-install.js +89 -23
- package/package.json +1 -1
- package/plugin/skills/beacon-explain/SKILL.md +63 -0
- package/.next/server/chunks/2994.js +0 -2
- package/.next/server/chunks/3284.js +0 -154
- package/.next/server/chunks/5719.js +0 -1
- package/.next/static/chunks/4491-0cd79f4195f4b111.js +0 -1
- package/.next/static/chunks/5957-83f611fcd5a08b45.js +0 -1
- package/.next/static/chunks/766-242213d211df0afd.js +0 -1
- package/.next/static/chunks/8915-fa61a860c63a7c85.js +0 -62
- package/.next/static/chunks/8997-78a359d0d238622e.js +0 -1
- package/.next/static/chunks/app/_global-error/page-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/context/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/draft/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/edges/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/entities/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/flags/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/init/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/mention-search/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/notes/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/open/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/reset/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/scope-guard/check/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/share/create/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/share/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/stream/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/version/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-548a84d85e061550.js +0 -1
- package/.next/static/chunks/app/layout-3115f8503ff00902.js +0 -1
- package/.next/static/chunks/app/map/page-66ec4b62a4153de8.js +0 -1
- package/.next/static/chunks/app/page-d08947a671077569.js +0 -1
- package/.next/static/chunks/app/plan/page-008565f9049d55c9.js +0 -1
- package/.next/static/chunks/app/s/[token]/page-1c10b26b300faffc.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-548a84d85e061550.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-548a84d85e061550.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-548a84d85e061550.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-548a84d85e061550.js +0 -1
- package/.next/static/css/f871d81e526502c1.css +0 -1
- package/.next/static/fwNWsob4GcVUD5_xV0f1h/_buildManifest.js +0 -1
- /package/.next/static/{fwNWsob4GcVUD5_xV0f1h → P3uXQySdS-m6_bxuiezYe}/_ssgManifest.js +0 -0
package/dist/bin/plan.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
3
|
+
var OZ=Object.defineProperty;var AZ=(Q)=>Q;function EZ(Q,Z){this[Q]=AZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)OZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var yQ=1500,kQ=480000,x1=1800000,E=3600000,N1=3000;var zQ=()=>{};var WQ={};VQ(WQ,{removeRepoAssets:()=>pZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>yZ,installInitSkill:()=>bZ,installExplainSkill:()=>kZ,installCodexRepoSkills:()=>_Z,ensureWorkflowDoc:()=>SZ,ensureMcp:()=>hZ,auditRepo:()=>mZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>_Q,INIT_SKILL:()=>qQ,EXPLAIN_SKILL:()=>SQ});import{existsSync as M,mkdirSync as F,readFileSync as j,rmSync as b,writeFileSync as B}from"fs";import{join as U}from"path";function bZ(Q){let Z=U(Q,".claude","skills","beacon-init");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function IZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function yZ(Q){let Z=U(Q,".claude","skills","beacon-plan");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,_Q),$}function kZ(Q){let Z=U(Q,".claude","skills","beacon-explain");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,SQ),$}function _Z(Q){let Z=[];for(let $ of LZ){let Y=U(Q,".agents","skills",$.name);F(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function SZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=j(Z,"utf8")}catch{}let Y=new RegExp(`${I}[\\s\\S]*?${UQ}`);$=Y.test($)?$.replace(Y,LQ):`${$.trim()}
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${LQ}
|
|
6
6
|
`.trimStart(),B(Z,$.endsWith(`
|
|
7
7
|
`)?$:`${$}
|
|
8
|
-
`);let J=U(Q,"CLAUDE.md"),V="";try{V=
|
|
8
|
+
`);let J=U(Q,"CLAUDE.md"),V="";try{V=j(J,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))B(J,`${V?`${V.trim()}
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
|
-
`)}function
|
|
11
|
+
`)}function hZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(j(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<E)return Y.timeout=E,B(Z,JSON.stringify($,null,2)+`
|
|
12
12
|
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:E},B(Z,JSON.stringify($,null,2)+`
|
|
13
|
-
`),{path:Z,added:!0,updated:!1}}function
|
|
14
|
-
`)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function mZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(j(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=j(U(Q,"AGENTS.md"),"utf8").includes(I)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(j(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":M(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function pZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=U(Q,".claude","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let X=U(Q,".agents","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(j(Y,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)b(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=j(V,"utf8"),X=new RegExp(`\\n?${I}[\\s\\S]*?${UQ}\\n?`);if(X.test(z)){let H=z.replace(X,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
17
|
`).trimStart();B(V,H.endsWith(`
|
|
18
18
|
`)?H:`${H}
|
|
19
|
-
`),J=!0}}catch{}let q=!1,
|
|
19
|
+
`),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=j(W,"utf8"),X=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==z){if(!X.trim())b(W,{force:!0});else B(W,X);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
|
|
20
20
|
name: beacon-init
|
|
21
21
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
22
22
|
---
|
|
@@ -158,7 +158,70 @@ If it returns feedback, revise and call it again.
|
|
|
158
158
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
159
159
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
160
160
|
run \`beacon\` in this repo once.
|
|
161
|
-
`,
|
|
161
|
+
`,SQ=`---
|
|
162
|
+
name: beacon-explain
|
|
163
|
+
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
|
+
|
|
166
|
+
# Explain the codebase visually (/beacon-explain)
|
|
167
|
+
|
|
168
|
+
When the user wants to UNDERSTAND part of the code (not build something), don't dump prose in the
|
|
169
|
+
terminal and don't open a plan \u2014 plans are for building. Author an interactive **Lesson** and push it
|
|
170
|
+
with the \`beacon_explain\` MCP tool: a curated concept map (boxes + labeled arrows) beside a
|
|
171
|
+
plain-English narrative on Beacon's /learn page. The tool BLOCKS while the user reads, highlights text
|
|
172
|
+
to ask questions, and drops question notes; it returns their questions, you ANSWER and re-push, looping
|
|
173
|
+
until they Save the lesson. There is NO approve/discard \u2014 understanding, not building.
|
|
174
|
+
|
|
175
|
+
## 1. Load context first \u2014 don't explain blind
|
|
176
|
+
|
|
177
|
+
Before writing, call \`beacon_context_for_feature\` / \`beacon_map\` and read the relevant files so the
|
|
178
|
+
lesson is accurate. Name real files, functions, tables, and endpoints \u2014 never vague descriptions.
|
|
179
|
+
|
|
180
|
+
## 2. Write like a great teacher \u2014 the house style (this is the whole point)
|
|
181
|
+
|
|
182
|
+
Every lesson must read like a patient senior engineer explaining to a sharp newcomer:
|
|
183
|
+
|
|
184
|
+
- **Plain English, always.** Define any term the first time it appears. No unexplained jargon, no
|
|
185
|
+
wall of nouns.
|
|
186
|
+
- **Problem-first.** Open each component with the PROBLEM it solves \u2014 a concrete human scenario, the
|
|
187
|
+
tension that forced the design, then the decision and what it means. (e.g. "When a salesperson
|
|
188
|
+
confirms an order it must also land in the ERP \u2014 but the ERP can be slow or down, and you do *not*
|
|
189
|
+
want confirmation to hang. So the sync is *decoupled*: confirming succeeds immediately and the push
|
|
190
|
+
happens in the background, with retries.")
|
|
191
|
+
- **Concrete step-by-step flow.** Walk the real path as a numbered list. Each step is ONE clear
|
|
192
|
+
action and names the real identifier in backticks \u2014 file (\`order-placed-sync-erp.ts\`), function
|
|
193
|
+
(\`syncOrderToErpWorkflow\`), event (\`order.placed\`), column (\`erp_sync_record\`), value
|
|
194
|
+
(\`requires_human_action\`). Enumerate the cases (success / retryable / rejected / \u2026) with the plain
|
|
195
|
+
meaning of each.
|
|
196
|
+
- **Anticipate-and-answer "Why X?".** After the flow, add short sections that answer the confusions a
|
|
197
|
+
reader will actually have ("Why two status columns?", "Why is the ledger append-only?"). ALWAYS
|
|
198
|
+
explain why the alternative is worse ("claiming success could hide a real failure; claiming hard
|
|
199
|
+
failure could cause a duplicate order later").
|
|
200
|
+
- **A worked example with real data.** Show the mechanism running on one concrete case \u2014 ideally a
|
|
201
|
+
small markdown table of state transitions \u2014 and land the insight ("that's 8 rows for one order, and
|
|
202
|
+
that's the point").
|
|
203
|
+
- **Typographic discipline.** **Bold** the decisions, *italic* the concepts being introduced, and put
|
|
204
|
+
\`inline code\` around every real identifier \u2014 on /learn, backticked real file paths become clickable
|
|
205
|
+
to open in the user's editor.
|
|
206
|
+
|
|
207
|
+
## 3. Map the prose to the board
|
|
208
|
+
|
|
209
|
+
Every component/flow you NAME in the narrative becomes a \`node\` (title + a one-line \`summary\` for its
|
|
210
|
+
face + a fuller \`detail\` + the real \`files\` it maps to). Every "A does X to B" becomes an \`edge\` with
|
|
211
|
+
a relationship VERB \u2014 one of: imports, calls, persists to, reads from, writes to, routes to, depends
|
|
212
|
+
on, emits, returns, contains, extends \u2014 never a bare line. Keep the resting set small (~4\u20137 nodes);
|
|
213
|
+
push depth into \`detail\`, not the node face. Supply \`steps\` for the guided walkthrough: the first step
|
|
214
|
+
is the overview (empty \`focusIds\`), then teach one node (or a few) per step in order, each with its
|
|
215
|
+
\`focusIds\`.
|
|
216
|
+
|
|
217
|
+
## 4. Answer in the loop \u2014 don't stop after one round
|
|
218
|
+
|
|
219
|
+
\`beacon_explain\` returns the user's questions, each tagged \`[q:ID]\`. Answer EACH by calling
|
|
220
|
+
\`beacon_explain\` AGAIN with the SAME lesson plus \`answers: [{ questionId, answer }]\` (keyed by the id).
|
|
221
|
+
Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
|
|
222
|
+
the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
|
|
223
|
+
the lesson.
|
|
224
|
+
`,LZ,I="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",LQ;var HQ=C(()=>{zQ();LZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];LQ=`${I}
|
|
162
225
|
## Beacon \u2014 feature workflow
|
|
163
226
|
|
|
164
227
|
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:
|
|
@@ -230,18 +293,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
230
293
|
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.
|
|
231
294
|
|
|
232
295
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
233
|
-
${UQ}`});import{existsSync as y,mkdirSync as BQ,readdirSync as
|
|
234
|
-
`)}function _(Q,Z){let $=
|
|
296
|
+
${UQ}`});import{existsSync as y,mkdirSync as BQ,readdirSync as cZ,readFileSync as R,rmSync as lZ,writeFileSync as k}from"fs";import{dirname as hQ,join as N}from"path";function mQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function pQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=N(Q,".claude","plugins");if(!y(Z))return null;let $=[Z];for(let Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=N(V,".claude-plugin","plugin.json");try{if(y(q)&&JSON.parse(R(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of cZ(V,{withFileTypes:!0}))if(W.isDirectory())J.push(N(V,W.name))}catch{}}$=J}return null}function cQ(Q){return pQ(Q)!==null}function GQ(Q){try{return JSON.parse(R(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){BQ(hQ(Q),{recursive:!0}),k(Q,JSON.stringify(Z,null,2)+`
|
|
297
|
+
`)}function _(Q,Z){let $=GQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function S(Q,Z){return(GQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function h(Q,Z){let $=GQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((X)=>X.command!==Z.command);if(z.length!==W)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function m(Q,Z,$,Y){let J=`${Z}
|
|
235
298
|
${Y.trim()}
|
|
236
|
-
${$}`,V="";try{V=
|
|
299
|
+
${$}`,V="";try{V=R(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
|
|
237
300
|
|
|
238
301
|
${J}
|
|
239
302
|
`:`${J}
|
|
240
|
-
`,BQ(
|
|
303
|
+
`,BQ(hQ(Q),{recursive:!0}),k(Q,V.endsWith(`
|
|
241
304
|
`)?V:`${V}
|
|
242
|
-
`)}function
|
|
305
|
+
`)}function w(Q,Z){try{return R(Q,"utf8").includes(Z)}catch{return!1}}function p(Q,Z,$){let Y="";try{Y=R(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
|
|
243
306
|
|
|
244
|
-
`).trimStart();return
|
|
307
|
+
`).trimStart();return k(Q,V),!0}function c(Q,Z,$){let Y=N(Q,Z);BQ(Y,{recursive:!0});let J=N(Y,"SKILL.md");return k(J,$),J}function u(Q,Z){return y(N(Q,Z,"SKILL.md"))}function l(Q,Z){let $=N(Q,Z);if(!y($))return!1;return lZ($,{recursive:!0,force:!0}),!0}var K,L=`## Beacon (visual planning panel)
|
|
245
308
|
|
|
246
309
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
247
310
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -255,6 +318,9 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
255
318
|
- User asks to "refresh Beacon" / "update the map" / "bring Beacon up to date" \u2192 invoke
|
|
256
319
|
the \`beacon-refresh\` skill. Re-surveys the repo and updates init-derived nodes while
|
|
257
320
|
preserving anything the user added by hand.
|
|
321
|
+
- User asks to "explain" / "teach me" / "walk me through" / "how does X work" \u2192 if the
|
|
322
|
+
\`beacon_explain\` MCP tool is available, author an interactive Lesson (a concept map +
|
|
323
|
+
plain-English narrative on /learn the user questions back) via the \`beacon-explain\` skill.
|
|
258
324
|
- Run \`beacon doctor\` to audit what's wired (global hooks, repo's .mcp.json, AGENTS.md block).
|
|
259
325
|
|
|
260
326
|
**The plan feedback loop**
|
|
@@ -262,24 +328,24 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
262
328
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
263
329
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
264
330
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
265
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
331
|
+
verbatim. Do NOT implement until the tool returns approval.`;var jQ=C(()=>{K=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as dZ,renameSync as aZ,rmSync as nZ,writeFileSync as tZ}from"fs";import{dirname as sZ}from"path";function d(Q,Z){dZ(sZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{tZ($,Z),aZ($,Q)}catch(Y){throw nZ($,{force:!0}),Y}}function g1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var dQ=()=>{};var eQ={};VQ(eQ,{setupCodexAssets:()=>eZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>Z0,hasCodexMcp:()=>PQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>iZ,codexDetected:()=>tQ,auditCodex:()=>Q0,CODEX_HOOKS:()=>r});import{readFileSync as s}from"fs";import{homedir as rZ}from"os";import{join as f}from"path";function aQ(){return process.env.HOME||process.env.USERPROFILE||rZ()}function tQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function PQ(){try{return Boolean(D(s(T(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function iZ(){let Q="";try{Q=s(T(),"utf8")}catch{return null}let Z=D(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${g}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${g}`;return null}function oQ(){let Q="",Z=!1;try{Q=s(T(),"utf8"),Z=!0}catch{}if(Z){let V=D(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${g}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${g}`}}let $=!Q?"":Q.endsWith(`
|
|
266
332
|
`)?`
|
|
267
333
|
`:`
|
|
268
334
|
|
|
269
|
-
`,Y=Q+$+
|
|
270
|
-
`),$=Z.indexOf(
|
|
335
|
+
`,Y=Q+$+oZ;if(D(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${g}`};return d(T(),Y),{added:!0}}function iQ(){let Q="";try{Q=s(T(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
336
|
+
`),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:PQ()};let Y=Z.indexOf(rQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
|
|
271
337
|
`).replace(/\n{3,}/g,`
|
|
272
338
|
|
|
273
|
-
`).replace(/^\n+/,"");if(
|
|
339
|
+
`).replace(/^\n+/,"");if(D(J)===null)return{removed:!1,skipped:!0};return d(T(),J),{removed:!0}}async function eZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let X of K){if(!u(n(),X))V.push(X);c(n(),X,J[X])}let q=0;for(let X of r)if(_(NQ(),{event:X.event,matcher:X.matcher,command:X.command}))q++;let W=w(a(),t);m(a(),t,nQ,L);let z=oQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function Q0(){let Q={};for(let $ of K)Q[$]=u(n(),$);let Z={};for(let $ of r)Z[$.event]=S(NQ(),{event:$.event,command:$.command});return{detected:tQ(),skills:Q,hooks:Z,agentsMdBlock:w(a(),t),mcp:PQ()}}function Z0(){let Q=[];for(let J of K)if(l(n(),J))Q.push(J);let Z=0;for(let J of r)if(h(NQ(),{event:J.event,command:J.command}))Z++;let $=p(a(),t,nQ),Y=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var xQ=()=>f(aQ(),".codex"),NQ=()=>f(xQ(),"hooks.json"),T=()=>f(xQ(),"config.toml"),a=()=>f(xQ(),"AGENTS.md"),n=()=>f(aQ(),".agents","skills"),t="<!-- beacon:global:start -->",nQ="<!-- beacon:global:end -->",r,KQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",oZ,g="add it manually: codex mcp add beacon -- beacon mcp";var QZ=C(()=>{jQ();dQ();r=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];oZ=`${sQ}
|
|
274
340
|
[mcp_servers.beacon]
|
|
275
341
|
command = "beacon"
|
|
276
342
|
args = ["mcp"]
|
|
277
|
-
${
|
|
278
|
-
`});var VZ={};VQ(VZ,{provisionDb:()=>R0});import{createClient as j0}from"@libsql/client";import{drizzle as G0}from"drizzle-orm/libsql";import{migrate as K0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as x0}from"drizzle-orm/migrator";import{dirname as RQ,join as N0}from"path";import{fileURLToPath as P0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function T0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function JZ(Q){if(!await e(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function F0(Q){for(let[Z,$]of Object.entries(M0)){if(!await e(Q,Z))continue;let Y=await T0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function R0(Q,Z=C0){let $=j0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let X=x0({migrationsFolder:Z})[0];if(X)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:[X.hash,X.folderMillis]}),V=!0}let q=await JZ($);if(await K0(G0($),{migrationsFolder:Z}),await JZ($)>q)V=!0;return await F0($),{migrated:V}}finally{$.close()}}var v0,C0,M0;var zZ=C(async()=>{v0=RQ(RQ(RQ(P0(import.meta.url)))),C0=process.env.BEACON_MIGRATIONS_DIR||N0(v0,"drizzle"),M0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});GQ();import{existsSync as Q0}from"fs";import{homedir as Z0}from"os";import{join as o}from"path";function $0(){return process.env.HOME||process.env.USERPROFILE||Z0()}var i=()=>o($0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var Y0=k,FQ=[{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 J0(Q,Z){return c(vQ(),Q,Z)}function ZZ(Q){return w(vQ(),Q)}function V0(Q){return l(vQ(),Q)}function z0(Q){return _(CQ(),Q)}function q0(Q){return S(CQ(),Q)}function X0(Q){return h(CQ(),Q)}function U0(Q){m(MQ(),TQ,QZ,Q)}function $Z(){return R(MQ(),TQ)}function W0(){return p(MQ(),TQ,QZ)}function L1(){let Q={};for(let $ of K)Q[$]=ZZ($);let Z={};for(let $ of FQ)Z[$.event]=q0({event:$.event,command:$.command});return{homeExists:Q0(i()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function H0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (HQ(),WQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let X of K){if(!ZZ(X))J.push(X);J0(X,Y[X])}let V=0;for(let X of FQ)if(z0({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=$Z();return U0(Y0),{skillsAdded:J,hooksAdded:V,claudeMdBlockTouched:!q}}async function YZ(){if(hQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(pQ()){try{B0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await H0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (eQ(),iQ));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 B0(){let Q=[];for(let Y of K)if(V0(Y))Q.push(Y);let Z=0;for(let Y of FQ)if(X0(Y))Z++;let $=W0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as w0}from"async_hooks";import{spawnSync as u0}from"child_process";import{createHash as g0}from"crypto";import{existsSync as XZ,mkdirSync as A,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as UZ}from"os";import{basename as D0,join as x,parse as A0,resolve as qZ}from"path";function j(){return process.env.BEACON_HOME||x(UZ(),".beacon")}function DQ(){return x(j(),"workspaces.json")}function QQ(Q){return g0("sha256").update(Q).digest("hex").slice(0,12)}function r1(Q=process.cwd()){let Z=u0("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 WZ(Q){let Z=qZ(Q);return Z!==qZ(UZ())&&Z!==A0(Z).root}function HZ(){return x(j(),"deleted.json")}function AQ(){try{let Q=JSON.parse(uQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(j(),{recursive:!0}),gQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return AQ().includes(Q)}function o1(Q){let Z=AQ();if(!Z.includes(Q))BZ([...Z,Q])}function f0(Q){let Z=AQ();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return x(j(),Q)}function E0(Q){return`file:${x(ZQ(Q),"db.sqlite")}`}function f(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function fQ(Q){A(j(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function GZ(){return f().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return f().find((Z)=>Z.id===Q)??null}function KZ(Q,Z,$=new Date().toISOString()){if(!WZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=f(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||D0(Q),lastOpenedAt:$},X=[q,...J.filter((z)=>z.id!==Y)];return A(ZQ(Y),{recursive:!0}),fQ(X),q}function i1(Q,Z){return f0(QQ(Q)),KZ(Q,Z)}function e1(Q,Z=new Date().toISOString()){let $=f(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,fQ($)}function Q2(Q){if(fQ(f().filter((Z)=>Z.id!==Q)),EQ()===Q)I0(GZ()[0]?.id??null)}function xZ(){return x(j(),"active")}function EQ(){try{return uQ(xZ(),"utf8").trim()||null}catch{return null}}function I0(Q){A(j(),{recursive:!0}),gQ(xZ(),Q??"")}function Z2(){let Q=EQ();return Q?P(Q):null}function $2(){let Q=y0()??EQ();return Q?P(Q):null}function Y2(Q){return P(Q)?.path??null}function J2(){return XZ(DQ())}var NZ="beacon_ws";function PZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function V2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=PZ(Q,NZ);if($&&P($))return $;return O0()}function O0(){let Q=GZ();return Q.length===1?Q[0].id:null}var b0="x-beacon-workspace-path";async function z2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(b0);if($&&WZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=KZ($);return await L0(J.id),J.id}let Y=PZ(Q,NZ);if(Y&&P(Y))return Y;return null}var vZ=new w0;function q2(Q,Z){return Q?vZ.run(Q,Z):Z()}function y0(){return vZ.getStore()??null}var wQ=new Set;function X2(Q){wQ.delete(x(ZQ(Q),"db.sqlite"))}async function L0(Q){let Z=ZQ(Q),$=x(Z,"db.sqlite"),Y=XZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:J}=await zZ().then(() => VZ),V=await J(E0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as k0}from"net";var H2=4319;function _0(Q,Z,$=400){return new Promise((Y)=>{let J=k0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,J.destroy(),Y(X)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function S0(Q){for(let Z of["127.0.0.1","::1"])if(await _0(Z,Q))return!1;return!0}async function CZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await S0($))return $;return Q}import{execSync as n0,spawn as t0}from"child_process";import{mkdirSync as s0,openSync as r0,readFileSync as o0,writeFileSync as i0}from"fs";import{homedir as e0}from"os";import{dirname as Q1,join as YQ}from"path";import{fileURLToPath as Z1}from"url";import{createHash as $1}from"crypto";zQ();import{mkdirSync as m0,readFileSync as p0,writeFileSync as c0}from"fs";import{join as l0}from"path";var h0=["default","acceptEdits","bypassPermissions","auto"];function MZ(Q){return typeof Q==="string"&&h0.includes(Q)}function TZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function FZ(){return l0(j(),"preferences.json")}function IQ(){try{let Q=JSON.parse(p0(FZ(),"utf8"));return{planApprovalMode:MZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function P2(Q){let Z={...IQ(),...Q};return m0(j(),{recursive:!0}),c0(FZ(),JSON.stringify(Z,null,2)),Z}function RZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
|
|
343
|
+
${rQ}
|
|
344
|
+
`});var zZ={};VQ(zZ,{provisionDb:()=>u0});import{createClient as K0}from"@libsql/client";import{drizzle as x0}from"drizzle-orm/libsql";import{migrate as N0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as P0}from"drizzle-orm/migrator";import{dirname as RQ,join as v0}from"path";import{fileURLToPath as C0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function R0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function VZ(Q){if(!await e(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function w0(Q){for(let[Z,$]of Object.entries(F0)){if(!await e(Q,Z))continue;let Y=await R0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function u0(Q,Z=T0){let $=K0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let W=P0({migrationsFolder:Z})[0];if(W)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[W.hash,W.folderMillis]}),V=!0}let q=await VZ($);if(await N0(x0($),{migrationsFolder:Z}),await VZ($)>q)V=!0;return await w0($),{migrated:V}}finally{$.close()}}var M0,T0,F0;var qZ=C(async()=>{M0=RQ(RQ(RQ(C0(import.meta.url)))),T0=process.env.BEACON_MIGRATIONS_DIR||v0(M0,"drizzle"),F0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});jQ();import{existsSync as $0}from"fs";import{homedir as Y0}from"os";import{join as o}from"path";function J0(){return process.env.HOME||process.env.USERPROFILE||Y0()}var i=()=>o(J0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",ZZ="<!-- beacon:global:end -->";var V0=L,FQ=[{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 z0(Q,Z){return c(vQ(),Q,Z)}function $Z(Q){return u(vQ(),Q)}function q0(Q){return l(vQ(),Q)}function X0(Q){return _(CQ(),Q)}function U0(Q){return S(CQ(),Q)}function W0(Q){return h(CQ(),Q)}function H0(Q){m(MQ(),TQ,ZZ,Q)}function YZ(){return w(MQ(),TQ)}function B0(){return p(MQ(),TQ,ZZ)}function _1(){let Q={};for(let $ of K)Q[$]=$Z($);let Z={};for(let $ of FQ)Z[$.event]=U0({event:$.event,command:$.command});return{homeExists:$0(i()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function G0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of K){if(!$Z(z))V.push(z);z0(z,J[z])}let q=0;for(let z of FQ)if(X0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=YZ();return H0(V0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function JZ(){if(mQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(cQ()){try{j0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await G0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (QZ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function j0(){let Q=[];for(let Y of K)if(q0(Y))Q.push(Y);let Z=0;for(let Y of FQ)if(W0(Y))Z++;let $=B0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as g0}from"async_hooks";import{spawnSync as D0}from"child_process";import{createHash as f0}from"crypto";import{existsSync as UZ,mkdirSync as O,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as WZ}from"os";import{basename as O0,join as x,parse as A0,resolve as XZ}from"path";function G(){return process.env.BEACON_HOME||x(WZ(),".beacon")}function DQ(){return x(G(),"workspaces.json")}function QQ(Q){return f0("sha256").update(Q).digest("hex").slice(0,12)}function i1(Q=process.cwd()){let Z=D0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function HZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==A0(Z).root}function BZ(){return x(G(),"deleted.json")}function fQ(){try{let Q=JSON.parse(uQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function GZ(Q){O(G(),{recursive:!0}),gQ(BZ(),JSON.stringify(Q,null,2))}function jZ(Q){return fQ().includes(Q)}function e1(Q){let Z=fQ();if(!Z.includes(Q))GZ([...Z,Q])}function E0(Q){let Z=fQ();if(Z.includes(Q))GZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return x(G(),Q)}function b0(Q){return`file:${x(ZQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function OQ(Q){O(G(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function KZ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return A().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!HZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||O0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return O(ZQ(Y),{recursive:!0}),OQ(W),q}function Q2(Q,Z){return E0(QQ(Q)),xZ(Q,Z)}function Z2(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,OQ($)}function $2(Q){if(OQ(A().filter((Z)=>Z.id!==Q)),AQ()===Q)I0(KZ()[0]?.id??null)}function NZ(){return x(G(),"active")}function AQ(){try{return uQ(NZ(),"utf8").trim()||null}catch{return null}}function I0(Q){O(G(),{recursive:!0}),gQ(NZ(),Q??"")}function Y2(){let Q=AQ();return Q?P(Q):null}function J2(){let Q=L0()??AQ();return Q?P(Q):null}function V2(Q){return P(Q)?.path??null}function z2(){return UZ(DQ())}var PZ="beacon_ws";function vZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function q2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=vZ(Q,PZ);if($&&P($))return $;return y0()}function y0(){let Q=KZ();return Q.length===1?Q[0].id:null}var k0="x-beacon-workspace-path";async function X2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(k0);if($&&HZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=xZ($);return await _0(J.id),J.id}let Y=vZ(Q,PZ);if(Y&&P(Y))return Y;return null}var CZ=new g0;function U2(Q,Z){return Q?CZ.run(Q,Z):Z()}function L0(){return CZ.getStore()??null}var wQ=new Set;function W2(Q){wQ.delete(x(ZQ(Q),"db.sqlite"))}async function _0(Q){let Z=ZQ(Q),$=x(Z,"db.sqlite"),Y=UZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{O(Z,{recursive:!0});let{provisionDb:J}=await qZ().then(() => zZ),V=await J(b0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as S0}from"net";var G2=4319;function h0(Q,Z,$=400){return new Promise((Y)=>{let J=S0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function m0(Q){for(let Z of["127.0.0.1","::1"])if(await h0(Z,Q))return!1;return!0}async function MZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await m0($))return $;return Q}import{execSync as s0,spawn as r0}from"child_process";import{mkdirSync as o0,openSync as i0,readFileSync as e0,writeFileSync as Q1}from"fs";import{homedir as Z1}from"os";import{dirname as $1,join as YQ}from"path";import{fileURLToPath as Y1}from"url";import{createHash as J1}from"crypto";zQ();import{mkdirSync as c0,readFileSync as l0,writeFileSync as d0}from"fs";import{join as a0}from"path";var p0=["default","acceptEdits","bypassPermissions","auto"];function TZ(Q){return typeof Q==="string"&&p0.includes(Q)}function FZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function RZ(){return a0(G(),"preferences.json")}function EQ(){try{let Q=JSON.parse(l0(RZ(),"utf8"));return{planApprovalMode:TZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function C2(Q){let Z={...EQ(),...Q};return c0(G(),{recursive:!0}),d0(RZ(),JSON.stringify(Z,null,2)),Z}function wZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
|
|
279
345
|
|
|
280
346
|
This plan created these roadmap feature(s):
|
|
281
347
|
`+Z.join(`
|
|
282
|
-
`)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as
|
|
283
|
-
`,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",
|
|
348
|
+
`)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as n0}from"child_process";import{platform as uZ}from"os";function t0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=uZ()==="darwin"?"open":uZ()==="win32"?"start":"xdg-open";try{n0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function gZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);t0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var V1=YQ($1(Y1(import.meta.url)),".."),IQ=process.env.BEACON_HOME||YQ(Z1(),".beacon"),DZ=YQ(IQ,"server.json"),z1=process.env.PORT||"4319";function q1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function X1(Q){try{return JSON.parse(e0(Q,"utf8"))}catch{return null}}async function fZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function U1(Q,Z=60){for(let $=0;$<Z;$++){if(await fZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function W1(Q){o0(IQ,{recursive:!0});let Z=i0(YQ(IQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=r0("bun",["run","dev"],{cwd:V1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return Q1(DZ,JSON.stringify(J)),J}async function H1(){let Q=X1(DZ);if(Q&&q1(Q.pid)&&await fZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await MZ(Number(z1))),{port:$}=W1(Z);return await U1(`http://localhost:${$}/api/workspace`),$}function B1(){try{return s0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function G1(Q){return J1("sha256").update(Q).digest("hex").slice(0,12)}async function j1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function bQ(Q,Z){return FZ(Q,Z)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function v(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await JZ();let Z=(await j1())?.tool_input?.plan;if(!Z||!Z.trim())v(bQ());let Y=`http://localhost:${await H1()}`,J=B1()||process.cwd(),V=G1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
|
|
349
|
+
`,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));v($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!W.ok)v(bQ());await gZ(Y,V);let z=Date.now()+kQ,X=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await X(yQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")v(bQ(EQ().planApprovalMode,wZ(H.features)));if(H.kind==="discarded")v($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")v($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
|
|
284
350
|
|
|
285
351
|
`+H.feedback))}v($Q("\u23F3 Still awaiting your review in Beacon \u2014 the plan is open on /plan and nothing was lost. "+"Claude Code caps a single plan-review hook at ~10 minutes, so to keep waiting you MUST call ExitPlanMode again now with the SAME plan. Re-presenting resumes the same review (your in-progress annotations and any decision are preserved). Do NOT implement, and do "+"NOT ask in the terminal \u2014 just re-present."))})();
|