trybeacon 0.1.47 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +16 -14
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -0
- package/.next/server/app/_global-error/page.js +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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/route.js +2 -2
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/route.js +1 -1
- package/.next/server/app/api/flags/route.js +1 -0
- package/.next/server/app/api/flags/route.js.nft.json +1 -0
- package/.next/server/app/api/flags/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/ingest/route.js +2 -2
- package/.next/server/app/api/init/route.js +1 -1
- package/.next/server/app/api/map/describe/route.js +2 -2
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +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 -0
- package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -0
- package/.next/server/app/api/scope-guard/check/route_client-reference-manifest.js +1 -0
- 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 +2 -2
- package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +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 +2 -2
- package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +2 -2
- package/.next/server/app/help.segments/_full.segment.rsc +2 -2
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +2 -2
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +2 -2
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +16 -14
- package/.next/server/chunks/249.js +1 -1
- package/.next/server/chunks/2933.js +1 -1
- package/.next/server/chunks/3221.js +2 -2
- package/.next/server/chunks/3622.js +1 -1
- package/.next/server/chunks/4378.js +1 -1
- package/.next/server/chunks/4940.js +1 -1
- package/.next/server/chunks/805.js +1 -0
- package/.next/server/chunks/9213.js +1 -1
- package/.next/server/chunks/9683.js +1 -1
- 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/85-82015ecb44b65d3e.js +1 -0
- package/.next/static/chunks/app/_global-error/page-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/edges/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/entities/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/flags/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/init/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/notes/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/open/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/reset/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/stream/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/version/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/map/{page-a0bcd15b8dbfb3d3.js → page-c06fcf30d8172f82.js} +1 -1
- package/.next/static/chunks/app/plan/{page-376f36858e187c73.js → page-257d486640eadd7f.js} +1 -1
- package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/css/5a58d83133d25695.css +1 -0
- package/.next/static/gNMdQmtkjPn6XQhRMDoMg/_buildManifest.js +1 -0
- package/.next/trace +39 -39
- package/.next/trace-build +1 -1
- package/.next/types/app/api/flags/route.ts +351 -0
- package/.next/types/app/api/scope-guard/check/route.ts +351 -0
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +18 -0
- package/dist/bin/beacon.js +1 -1
- package/dist/bin/doctor.js +24 -18
- package/dist/bin/guard.js +3 -0
- package/dist/bin/hook.js +24 -18
- package/dist/bin/mcp.js +41 -35
- package/dist/bin/plan.js +21 -15
- package/dist/bin/remove.js +7 -6
- package/dist/bin/uninstall.js +24 -18
- package/dist/lib/assets.js +6 -0
- package/dist/lib/codex-install.js +6 -0
- package/dist/lib/global-install.js +7 -1
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/workspaces.js +1 -1
- package/drizzle/0008_good_lucky_pierre.sql +21 -0
- package/drizzle/meta/0008_snapshot.json +1904 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/public/install.sh +37 -6
- package/.next/server/chunks/142.js +0 -1
- package/.next/static/OO5fwNXOYFYnu4W91Z44C/_buildManifest.js +0 -1
- package/.next/static/chunks/5811-4d1f942c37146b40.js +0 -1
- package/.next/static/chunks/app/_global-error/page-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/edges/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/entities/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/init/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/notes/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/open/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/reset/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/stream/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/version/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/settings/page-67cab634be8bfef2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/css/2d019ca6e0582481.css +0 -1
- /package/.next/static/{OO5fwNXOYFYnu4W91Z44C → gNMdQmtkjPn6XQhRMDoMg}/_ssgManifest.js +0 -0
package/dist/bin/uninstall.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var
|
|
3
|
+
var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var vQ={};WQ(vQ,{removeRepoAssets:()=>xQ,installRefreshSkill:()=>FZ,installPlanSkill:()=>RZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>IZ,ensureWorkflowDoc:()=>bZ,ensureMcp:()=>OZ,auditRepo:()=>AZ,REFRESH_SKILL:()=>BQ,PLAN_SKILL:()=>mQ,INIT_SKILL:()=>HQ});import{existsSync as M,mkdirSync as L,readFileSync as x,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,HQ),$}function FZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,BQ),$}function RZ(Q){let Z=q(Q,".claude","skills","beacon-plan");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,mQ),$}function IZ(Q){let Z=[];for(let $ of EZ){let J=q(Q,".agents","skills",$.name);L(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function bZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${k}[\\s\\S]*?${jQ}`);$=J.test($)?$.replace(J,hQ):`${$.trim()}
|
|
4
4
|
|
|
5
5
|
${hQ}
|
|
6
6
|
`.trimStart(),H(Z,$.endsWith(`
|
|
@@ -9,13 +9,13 @@ ${hQ}
|
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
11
|
`)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},H(Z,JSON.stringify($,null,2)+`
|
|
12
|
-
`),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function
|
|
13
|
-
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),
|
|
12
|
+
`),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=q(Q,".claude","skills",z);if(M(P))_(P,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let P=q(Q,".agents","skills",z);if(M(P))_(P,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(x(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
|
|
13
|
+
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),P=new RegExp(`\\n?${k}[\\s\\S]*?${jQ}\\n?`);if(P.test(z)){let PQ=z.replace(P,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();H(V,
|
|
17
|
-
`)?
|
|
18
|
-
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),
|
|
16
|
+
`).trimStart();H(V,PQ.endsWith(`
|
|
17
|
+
`)?PQ:`${PQ}
|
|
18
|
+
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),P=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==z){if(!P.trim())_(U,{force:!0});else H(U,P);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var HQ=`---
|
|
19
19
|
name: beacon-init
|
|
20
20
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
21
21
|
---
|
|
@@ -54,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
54
54
|
If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
|
|
55
55
|
|
|
56
56
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
57
|
-
`,
|
|
57
|
+
`,BQ=`---
|
|
58
58
|
name: beacon-refresh
|
|
59
59
|
description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
|
|
60
60
|
---
|
|
@@ -129,6 +129,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
|
|
|
129
129
|
board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
|
|
130
130
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
131
131
|
|
|
132
|
+
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
133
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
|
|
134
|
+
has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
|
|
135
|
+
implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
|
|
136
|
+
to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
|
|
137
|
+
|
|
132
138
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
133
139
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
134
140
|
If it returns feedback, revise and call it again.
|
|
@@ -143,7 +149,7 @@ If it returns feedback, revise and call it again.
|
|
|
143
149
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
144
150
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
145
151
|
run \`beacon\` in this repo once.
|
|
146
|
-
`,EZ,k="<!-- beacon:workflow:start -->",
|
|
152
|
+
`,EZ,k="<!-- beacon:workflow:start -->",jQ="<!-- beacon:workflow:end -->",hQ;var S=g(()=>{EZ=[{name:"beacon-init",body:()=>HQ},{name:"beacon-refresh",body:()=>BQ}];hQ=`${k}
|
|
147
153
|
## Beacon \u2014 feature workflow
|
|
148
154
|
|
|
149
155
|
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:
|
|
@@ -201,18 +207,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
201
207
|
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.
|
|
202
208
|
|
|
203
209
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
204
|
-
${
|
|
205
|
-
`)}function l(Q,Z){let $=
|
|
210
|
+
${jQ}`});import{existsSync as pQ,mkdirSync as NQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as cQ,join as h}from"path";function uQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){NQ(cQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
|
|
211
|
+
`)}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((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function n(Q,Z){return(uQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function t(Q,Z){let $=uQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((P)=>P.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function d(Q,Z,$,J){let Y=`${Z}
|
|
206
212
|
${J.trim()}
|
|
207
213
|
${$}`,V="";try{V=m(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
|
|
208
214
|
|
|
209
215
|
${Y}
|
|
210
216
|
`:`${Y}
|
|
211
|
-
`,
|
|
217
|
+
`,NQ(cQ(Q),{recursive:!0}),p(Q,V.endsWith(`
|
|
212
218
|
`)?V:`${V}
|
|
213
219
|
`)}function F(Q,Z){try{return m(Q,"utf8").includes(Z)}catch{return!1}}function a(Q,Z,$){let J="";try{J=m(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
|
|
214
220
|
|
|
215
|
-
`).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);
|
|
221
|
+
`).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);NQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function R(Q,Z){return pQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!pQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var W,c=`## Beacon (visual planning panel)
|
|
216
222
|
|
|
217
223
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
218
224
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -233,20 +239,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
233
239
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
234
240
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
235
241
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
236
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
242
|
+
verbatim. Do NOT implement until the tool returns approval.`;var GQ=g(()=>{W=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as yZ,renameSync as _Z,rmSync as LZ,writeFileSync as kZ}from"fs";import{dirname as SZ}from"path";function o(Q,Z){yZ(SZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{kZ($,Z),_Z($,Q)}catch(J){throw LZ($,{force:!0}),J}}function k0(Q,Z,$=!1){o(Q,JSON.stringify(Z,null,$?2:void 0))}var nQ=()=>{};var eQ={};WQ(eQ,{setupCodexAssets:()=>cZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>wQ,hasCodexMcp:()=>fQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>pZ,codexDetected:()=>aQ,auditCodex:()=>TQ,CODEX_HOOKS:()=>T});import{readFileSync as ZQ}from"fs";import{homedir as hZ}from"os";import{join as b}from"path";function tQ(){return process.env.HOME||process.env.USERPROFILE||hZ()}function aQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function I(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function fQ(){try{return Boolean(I(ZQ(f(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function pZ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return null}let Z=I(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${E}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${E}`;return null}function oQ(){let Q="",Z=!1;try{Q=ZQ(f(),"utf8"),Z=!0}catch{}if(Z){let V=I(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${E}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${E}`}}let $=!Q?"":Q.endsWith(`
|
|
237
243
|
`)?`
|
|
238
244
|
`:`
|
|
239
245
|
|
|
240
246
|
`,J=Q+$+mZ;if(I(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${E}`};return o(f(),J),{added:!0}}function iQ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
241
|
-
`),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:
|
|
247
|
+
`),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:fQ()};let J=Z.indexOf(rQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
242
248
|
`).replace(/\n{3,}/g,`
|
|
243
249
|
|
|
244
|
-
`).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return o(f(),Y),{removed:!0}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),
|
|
250
|
+
`).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return o(f(),Y),{removed:!0}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of W){if(!R(e(),z))Y.push(z);s(e(),z,J[z])}let V=0;for(let z of T)if(l(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=F(i(),QQ);d(i(),QQ,dQ,c);let U=oQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function TQ(){let Q={};for(let $ of W)Q[$]=R(e(),$);let Z={};for(let $ of T)Z[$.event]=n(MQ(),{event:$.event,command:$.command});return{detected:aQ(),skills:Q,hooks:Z,agentsMdBlock:F(i(),QQ),mcp:fQ()}}function wQ(){let Q=[];for(let Y of W)if(r(e(),Y))Q.push(Y);let Z=0;for(let Y of T)if(t(MQ(),{event:Y.event,command:Y.command}))Z++;let $=a(i(),QQ,dQ),J=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>b(tQ(),".codex"),MQ=()=>b(CQ(),"hooks.json"),f=()=>b(CQ(),"config.toml"),i=()=>b(CQ(),"AGENTS.md"),e=()=>b(tQ(),".agents","skills"),QQ="<!-- beacon:global:start -->",dQ="<!-- beacon:global:end -->",T,KQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",mZ,E="add it manually: codex mcp add beacon -- beacon mcp";var gQ=g(()=>{GQ();nQ();T=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];mZ=`${sQ}
|
|
245
251
|
[mcp_servers.beacon]
|
|
246
252
|
command = "beacon"
|
|
247
253
|
args = ["mcp"]
|
|
248
254
|
${rQ}
|
|
249
|
-
`});var zZ={};WQ(zZ,{provisionDb:()=>B0});import{createClient as $0}from"@libsql/client";import{drizzle as J0}from"drizzle-orm/libsql";import{migrate as Y0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as V0}from"drizzle-orm/migrator";import{dirname as
|
|
250
|
-
\x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=
|
|
251
|
-
`),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=
|
|
255
|
+
`});var zZ={};WQ(zZ,{provisionDb:()=>B0});import{createClient as $0}from"@libsql/client";import{drizzle as J0}from"drizzle-orm/libsql";import{migrate as Y0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as V0}from"drizzle-orm/migrator";import{dirname as bQ,join as z0}from"path";import{fileURLToPath as q0}from"url";async function YQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function W0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function VZ(Q){if(!await YQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function H0(Q){for(let[Z,$]of Object.entries(P0)){if(!await YQ(Q,Z))continue;let J=await W0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function B0(Q,Z=U0){let $=$0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await YQ($,"__drizzle_migrations"),Y=await YQ($,"Node"),V=!1;if(Y&&!J){let U=V0({migrationsFolder:Z})[0];if(U)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[U.hash,U.folderMillis]}),V=!0}let X=await VZ($);if(await Y0(J0($),{migrationsFolder:Z}),await VZ($)>X)V=!0;return await H0($),{migrated:V}}finally{$.close()}}var X0,U0,P0;var qZ=g(async()=>{X0=bQ(bQ(bQ(q0(import.meta.url)))),U0=process.env.BEACON_MIGRATIONS_DIR||z0(X0,"drizzle"),P0={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 lZ}from"fs";import{homedir as nZ}from"os";import{join as $Q}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var JQ=()=>$Q(tZ(),".claude"),FQ=()=>$Q(JQ(),"skills"),RQ=()=>$Q(JQ(),"settings.json"),EQ=()=>$Q(JQ(),"CLAUDE.md"),IQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var dZ=c,O=[{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 aZ(Q,Z){return s(FQ(),Q,Z)}function ZZ(Q){return R(FQ(),Q)}function sZ(Q){return r(FQ(),Q)}function rZ(Q){return l(RQ(),Q)}function oZ(Q){return n(RQ(),Q)}function iZ(Q){return t(RQ(),Q)}function eZ(Q){d(EQ(),IQ,QZ,Q)}function $Z(){return F(EQ(),IQ)}function Q0(){return a(EQ(),IQ,QZ)}function JZ(){let Q={};for(let $ of W)Q[$]=ZZ($);let Z={};for(let $ of O)Z[$.event]=oZ({event:$.event,command:$.command});return{homeExists:lZ(JQ()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of W){if(!ZZ(U))Y.push(U);aZ(U,J[U])}let V=0;for(let U of O)if(rZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=$Z();return eZ(dZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function s0(){let Q;try{Q={ok:!0,...await Z0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (gQ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function YZ(){let Q=[];for(let J of W)if(sZ(J))Q.push(J);let Z=0;for(let J of O)if(iZ(J))Z++;let $=Q0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as j0}from"async_hooks";import{spawnSync as x0}from"child_process";import{createHash as v0}from"crypto";import{existsSync as UZ,mkdirSync as A,readFileSync as AQ,writeFileSync as DQ}from"fs";import{homedir as PZ}from"os";import{basename as N0,join as N,parse as u0,resolve as XZ}from"path";function v(){return process.env.BEACON_HOME||N(PZ(),".beacon")}function yQ(){return N(v(),"workspaces.json")}function VQ(Q){return v0("sha256").update(Q).digest("hex").slice(0,12)}function U1(Q=process.cwd()){let Z=x0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function WZ(Q){let Z=XZ(Q);return Z!==XZ(PZ())&&Z!==u0(Z).root}function HZ(){return N(v(),"deleted.json")}function _Q(){try{let Q=JSON.parse(AQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(v(),{recursive:!0}),DQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return _Q().includes(Q)}function P1(Q){let Z=_Q();if(!Z.includes(Q))BZ([...Z,Q])}function G0(Q){let Z=_Q();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function zQ(Q){return N(v(),Q)}function K0(Q){return`file:${N(zQ(Q),"db.sqlite")}`}function D(){try{let Q=JSON.parse(AQ(yQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function LQ(Q){A(v(),{recursive:!0}),DQ(yQ(),JSON.stringify(Q,null,2))}function qQ(){return D().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return D().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!WZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=VQ(Q);if(jZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=D(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||N0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(zQ(J),{recursive:!0}),LQ(U),X}function W1(Q,Z){return G0(VQ(Q)),xZ(Q,Z)}function H1(Q,Z=new Date().toISOString()){let $=D(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,LQ($)}function B1(Q){if(LQ(D().filter((Z)=>Z.id!==Q)),kQ()===Q)C0(qQ()[0]?.id??null)}function vZ(){return N(v(),"active")}function kQ(){try{return AQ(vZ(),"utf8").trim()||null}catch{return null}}function C0(Q){A(v(),{recursive:!0}),DQ(vZ(),Q??"")}function j1(){let Q=kQ();return Q?G(Q):null}function x1(){let Q=T0()??kQ();return Q?G(Q):null}function v1(Q){return G(Q)?.path??null}function N1(){return UZ(yQ())}var NZ="beacon_ws";function uZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function u1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=uZ(Q,NZ);if($&&G($))return $;return M0()}function M0(){let Q=qQ();return Q.length===1?Q[0].id:null}var f0="x-beacon-workspace-path";async function G1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(f0);if($&&WZ($)&&!jZ(VQ($))&&(!Z||VQ($)===Z)){let Y=xZ($);return await w0(Y.id),Y.id}let J=uZ(Q,NZ);if(J&&G(J))return J;return null}var GZ=new j0;function K1(Q,Z){return Q?GZ.run(Q,Z):Z()}function T0(){return GZ.getStore()??null}var OQ=new Set;function C1(Q){OQ.delete(N(zQ(Q),"db.sqlite"))}async function w0(Q){let Z=zQ(Q),$=N(Z,"db.sqlite"),J=UZ($);if(J&&OQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await qZ().then(() => zZ),V=await Y(K0(Q));return OQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}S();gQ();import{existsSync as XQ,readFileSync as g0,rmSync as F0}from"fs";import{join as R0}from"path";var KZ=process.argv.slice(3),CZ=KZ.includes("--yes")||KZ.includes("-y"),j=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,B=(Q)=>`\x1B[2m${Q}\x1B[0m`,C=(Q)=>`
|
|
256
|
+
\x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=qQ(),SQ=JZ();console.log(C(CZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(C("Global"));console.log(` ${XQ(K)?`wipe ${K} (${y.length} workspaces)`:`${B(`${K} \u2014 already gone`)}`}`);for(let Q of W)console.log(` ${SQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of O)console.log(` ${SQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${SQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":B("global CLAUDE.md block \u2014 already gone")}`);var UQ=TQ();console.log(C("Codex"));for(let Q of W)console.log(` ${UQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of T)console.log(` ${UQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${UQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":B("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${UQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":B("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(C(`Per-repo (${y.length})`));for(let Q of y){if(!XQ(Q.path)){console.log(` ${B(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${B("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!CZ)console.log(C("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
|
|
257
|
+
`),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=wQ();if(u.skillsRemoved.length)console.log(` ${j(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${j(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${j("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${MZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of y){if(!XQ(Q.path))continue;let Z=xQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${j(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var E0=R0(K,"server.json");try{let{pid:Q}=JSON.parse(g0(E0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${j(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(XQ(K))F0(K,{recursive:!0,force:!0}),console.log(` ${j(`removed ${K}`)}`);console.log(C("Done."));console.log(` ${MZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
|
|
252
258
|
`);
|
package/dist/lib/assets.js
CHANGED
|
@@ -128,6 +128,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
|
|
|
128
128
|
board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
|
|
129
129
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
130
130
|
|
|
131
|
+
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
132
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
|
|
133
|
+
has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
|
|
134
|
+
implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
|
|
135
|
+
to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
|
|
136
|
+
|
|
131
137
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
132
138
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
133
139
|
If it returns feedback, revise and call it again.
|
|
@@ -128,6 +128,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
|
|
|
128
128
|
board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
|
|
129
129
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
130
130
|
|
|
131
|
+
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
132
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
|
|
133
|
+
has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
|
|
134
|
+
implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
|
|
135
|
+
to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
|
|
136
|
+
|
|
131
137
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
132
138
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
133
139
|
If it returns feedback, revise and call it again.
|
|
@@ -128,6 +128,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
|
|
|
128
128
|
board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
|
|
129
129
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
130
130
|
|
|
131
|
+
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
132
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
|
|
133
|
+
has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
|
|
134
|
+
implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
|
|
135
|
+
to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
|
|
136
|
+
|
|
131
137
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
132
138
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
133
139
|
If it returns feedback, revise and call it again.
|
|
@@ -245,4 +251,4 @@ verbatim. Do NOT implement until the tool returns approval.`;var o=b(()=>{w=["be
|
|
|
245
251
|
command = "beacon"
|
|
246
252
|
args = ["mcp"]
|
|
247
253
|
${uq}
|
|
248
|
-
`});o();import{existsSync as iq}from"fs";import{homedir as oq}from"os";import{join as S}from"path";function eq(){return process.env.HOME||process.env.USERPROFILE||oq()}var a=()=>S(eq(),".claude"),Qq=()=>S(a(),"skills"),Vq=()=>S(a(),"settings.json"),Yq=()=>S(a(),"CLAUDE.md"),Zq="<!-- beacon:global:start -->",Cq="<!-- beacon:global:end -->";var qz=T,$q=[{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function zz(q,z){return D(Qq(),q,z)}function Kq(q){return j(Qq(),q)}function Jz(q){return O(Qq(),q)}function Qz(q){return R(Vq(),q)}function Vz(q){return I(Vq(),q)}function Yz(q){return E(Vq(),q)}function Zz(q){y(Yq(),Zq,Cq,q)}function Mq(){return v(Yq(),Zq)}function $z(){return A(Yq(),Zq,Cq)}function Tz(){let q={};for(let J of w)q[J]=Kq(J);let z={};for(let J of $q)z[J.event]=Vz({event:J.event,command:J.command});return{homeExists:iq(a()),skills:q,hooks:z,claudeMdBlock:Mq()}}async function Pz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of w){if(!Kq(W))V.push(W);zz(W,Q[W])}let Y=0;for(let W of $q)if(Qz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Mq();return Zz(qz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function Rz(){let q;try{q={ok:!0,...await Pz()}}catch(z){q={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let z=await Promise.resolve().then(() => (fq(),Gq));if(z.codexDetected())q.codex={ok:!0,...await z.setupCodexAssets()}}catch(z){q.codex={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return q}function Iz(){let q=[];for(let Q of w)if(Jz(Q))q.push(Q);let z=0;for(let Q of $q)if(Yz(Q))z++;let J=$z();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Pz as setupGlobalAssets,Rz as selfHealGlobal,Jz as removeGlobalSkill,Yz as removeGlobalHook,$z as removeGlobalClaudeMdBlock,Iz as removeBeaconArtifacts,Kq as isGlobalSkillInstalled,zz as installGlobalSkill,Vz as hasGlobalHook,Mq as hasGlobalClaudeMdBlock,Qz as ensureGlobalHook,Zz as ensureGlobalClaudeMdBlock,Tz as auditGlobal,w as GLOBAL_SKILLS,$q as GLOBAL_HOOKS,qz as GLOBAL_CLAUDE_MD_BLOCK};
|
|
254
|
+
`});o();import{existsSync as iq}from"fs";import{homedir as oq}from"os";import{join as S}from"path";function eq(){return process.env.HOME||process.env.USERPROFILE||oq()}var a=()=>S(eq(),".claude"),Qq=()=>S(a(),"skills"),Vq=()=>S(a(),"settings.json"),Yq=()=>S(a(),"CLAUDE.md"),Zq="<!-- beacon:global:start -->",Cq="<!-- beacon:global:end -->";var qz=T,$q=[{event:"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 zz(q,z){return D(Qq(),q,z)}function Kq(q){return j(Qq(),q)}function Jz(q){return O(Qq(),q)}function Qz(q){return R(Vq(),q)}function Vz(q){return I(Vq(),q)}function Yz(q){return E(Vq(),q)}function Zz(q){y(Yq(),Zq,Cq,q)}function Mq(){return v(Yq(),Zq)}function $z(){return A(Yq(),Zq,Cq)}function Tz(){let q={};for(let J of w)q[J]=Kq(J);let z={};for(let J of $q)z[J.event]=Vz({event:J.event,command:J.command});return{homeExists:iq(a()),skills:q,hooks:z,claudeMdBlock:Mq()}}async function Pz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of w){if(!Kq(W))V.push(W);zz(W,Q[W])}let Y=0;for(let W of $q)if(Qz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Mq();return Zz(qz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function Rz(){let q;try{q={ok:!0,...await Pz()}}catch(z){q={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let z=await Promise.resolve().then(() => (fq(),Gq));if(z.codexDetected())q.codex={ok:!0,...await z.setupCodexAssets()}}catch(z){q.codex={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return q}function Iz(){let q=[];for(let Q of w)if(Jz(Q))q.push(Q);let z=0;for(let Q of $q)if(Yz(Q))z++;let J=$z();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Pz as setupGlobalAssets,Rz as selfHealGlobal,Jz as removeGlobalSkill,Yz as removeGlobalHook,$z as removeGlobalClaudeMdBlock,Iz as removeBeaconArtifacts,Kq as isGlobalSkillInstalled,zz as installGlobalSkill,Vz as hasGlobalHook,Mq as hasGlobalClaudeMdBlock,Qz as ensureGlobalHook,Zz as ensureGlobalClaudeMdBlock,Tz as auditGlobal,w as GLOBAL_SKILLS,$q as GLOBAL_HOOKS,qz as GLOBAL_CLAUDE_MD_BLOCK};
|
package/dist/lib/telemetry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var a=Object.defineProperty;var i=(Q)=>Q;function t(Q,X){this[Q]=i.bind(null,X)}var e=(Q,X)=>{for(var Z in X)a(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:t.bind(X,Z)})};var R=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var I={};e(I,{provisionDb:()=>LQ});import{createClient as QQ}from"@libsql/client";import{drizzle as XQ}from"drizzle-orm/libsql";import{migrate as ZQ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as $Q}from"drizzle-orm/migrator";import{dirname as C,join as YQ}from"path";import{fileURLToPath as GQ}from"url";async function M(Q,X){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[X]})).rows.length>0}async function VQ(Q,X){let Z=await Q.execute(`PRAGMA table_info("${X}")`);return new Set(Z.rows.map(($)=>String($.name)))}async function A(Q){if(!await M(Q,"__drizzle_migrations"))return 0;let X=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(X.rows[0]?.n??0)}async function NQ(Q){for(let[X,Z]of Object.entries(KQ)){if(!await M(Q,X))continue;let $=await VQ(Q,X);for(let Y of Z){if(!$.has(Y))continue;await Q.execute(`UPDATE "${X}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function LQ(Q,X=BQ){let Z=QQ({url:Q});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let $=await M(Z,"__drizzle_migrations"),Y=await M(Z,"Node"),J=!1;if(Y&&!$){let N=$Q({migrationsFolder:X})[0];if(N)await Z.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await Z.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[N.hash,N.folderMillis]}),J=!0}let j=await A(Z);if(await ZQ(XQ(Z),{migrationsFolder:X}),await A(Z)>j)J=!0;return await NQ(Z),{migrated:J}}finally{Z.close()}}var JQ,BQ,KQ;var f=R(async()=>{JQ=C(C(C(GQ(import.meta.url)))),BQ=process.env.BEACON_MIGRATIONS_DIR||YQ(JQ,"drizzle"),KQ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});import{mkdirSync as AQ,renameSync as IQ,rmSync as fQ,writeFileSync as PQ}from"fs";import{dirname as SQ}from"path";function vQ(Q,X){AQ(SQ(Q),{recursive:!0});let Z=`${Q}.tmp`;try{PQ(Z,X),IQ(Z,Q)}catch($){throw fQ(Z,{force:!0}),$}}function d(Q,X,Z=!1){vQ(Q,JSON.stringify(X,null,Z?2:void 0))}var n=()=>{};import{AsyncLocalStorage as UQ}from"async_hooks";import{spawnSync as jQ}from"child_process";import{createHash as MQ}from"crypto";import{existsSync as S,mkdirSync as L,readFileSync as T,writeFileSync as D}from"fs";import{homedir as v}from"os";import{basename as zQ,join as B,parse as OQ,resolve as P}from"path";function G(){return process.env.BEACON_HOME||B(v(),".beacon")}function u(){return B(G(),"workspaces.json")}function z(Q){return MQ("sha256").update(Q).digest("hex").slice(0,12)}function JX(Q=process.cwd()){let X=jQ("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(X.status===0){let Z=X.stdout?.toString().trim();if(Z)return Z}return Q}function k(Q){let X=P(Q);return X!==P(v())&&X!==OQ(X).root}function y(){return B(G(),"deleted.json")}function W(){try{let Q=JSON.parse(T(y(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function g(Q){L(G(),{recursive:!0}),D(y(),JSON.stringify(Q,null,2))}function w(Q){return W().includes(Q)}function BX(Q){let X=W();if(!X.includes(Q))g([...X,Q])}function qQ(Q){let X=W();if(X.includes(Q))g(X.filter((Z)=>Z!==Q))}function O(Q){return B(G(),Q)}function CQ(Q){return`file:${B(O(Q),"db.sqlite")}`}function U(){try{let Q=JSON.parse(T(u(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function x(Q){L(G(),{recursive:!0}),D(u(),JSON.stringify(Q,null,2))}function b(){return U().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function K(Q){return U().find((X)=>X.id===Q)??null}function m(Q,X,Z=new Date().toISOString()){if(!k(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let $=z(Q);if(w($))throw Error(`beacon: workspace ${$} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=U(),J=Y.find((q)=>q.id===$),j={id:$,path:Q,name:X||J?.name||zQ(Q),lastOpenedAt:Z},N=[j,...Y.filter((q)=>q.id!==$)];return L(O($),{recursive:!0}),x(N),j}function KX(Q,X){return qQ(z(Q)),m(Q,X)}function VX(Q,X=new Date().toISOString()){let Z=U(),$=Z.find((Y)=>Y.id===Q);if(!$)return;$.lastOpenedAt=X,x(Z)}function NX(Q){if(x(U().filter((X)=>X.id!==Q)),E()===Q)_Q(b()[0]?.id??null)}function h(){return B(G(),"active")}function E(){try{return T(h(),"utf8").trim()||null}catch{return null}}function _Q(Q){L(G(),{recursive:!0}),D(h(),Q??"")}function LX(){let Q=E();return Q?K(Q):null}function UX(){let Q=uQ()??E();return Q?K(Q):null}function jX(Q){return K(Q)?.path??null}function MX(){return S(u())}var p="beacon_ws";function l(Q,X){let Z=Q.headers.get("cookie");if(!Z)return null;for(let $ of Z.split(";")){let Y=$.indexOf("=");if(Y===-1)continue;if($.slice(0,Y).trim()===X)return decodeURIComponent($.slice(Y+1).trim())}return null}function zX(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&K(X))return X;let Z=l(Q,p);if(Z&&K(Z))return Z;return TQ()}function TQ(){let Q=b();return Q.length===1?Q[0].id:null}var DQ="x-beacon-workspace-path";async function OX(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&K(X))return X;let Z=Q.headers.get(DQ);if(Z&&k(Z)&&!w(z(Z))&&(!X||z(Z)===X)){let Y=m(Z);return await WQ(Y.id),Y.id}let $=l(Q,p);if($&&K($))return $;return null}var c=new UQ;function qX(Q,X){return Q?c.run(Q,X):X()}function uQ(){return c.getStore()??null}var _=new Set;function CX(Q){_.delete(B(O(Q),"db.sqlite"))}async function WQ(Q){let X=O(Q),Z=B(X,"db.sqlite"),$=S(Z);if($&&_.has(Z))return{ok:!0,created:!1,migrated:!1};try{L(X,{recursive:!0});let{provisionDb:Y}=await f().then(() => I),J=await Y(CQ(Q));return _.add(Z),{ok:!0,created:!$,migrated:$&&J.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}var TX="wenzorithelly/beacon",DX="trybeacon",uX="https://registry.npmjs.org/trybeacon/latest",F=(process.env.NEXT_PUBLIC_BEACON_SITE_URL??"https://www.trybeacon.sh").replace(/\/$/,""),WX=`curl -fsSL ${F}/install.sh | sh`;import{randomUUID as kQ}from"crypto";import{readFileSync as yQ}from"fs";import{join as gQ}from"path";import{mkdirSync as EQ,readFileSync as FQ,writeFileSync as HQ}from"fs";import{join as RQ}from"path";var xQ=["default","acceptEdits","bypassPermissions","auto"];function s(Q){return typeof Q==="string"&&xQ.includes(Q)}function EX(Q,X){let Z={behavior:"allow"};if(Q)Z.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let $={hookEventName:"PermissionRequest",decision:Z};if(X?.trim())$.additionalContext=X;return{hookSpecificOutput:$}}function o(){return RQ(G(),"preferences.json")}function V(){try{let Q=JSON.parse(FQ(o(),"utf8"));return{planApprovalMode:s(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function H(Q){let X={...V(),...Q};return EQ(G(),{recursive:!0}),HQ(o(),JSON.stringify(X,null,2)),X}n();var wQ=43200000,bQ=3600000;function mQ(){let Q=V().telemetryUuid;if(Q)return Q;let X=kQ();return H({telemetryUuid:X}),X}function hQ(Q=process.env){if(Q.BEACON_TELEMETRY_DISABLED==="1")return!1;let X=Q.DO_NOT_TRACK;if(X!==void 0&&X!==""&&X!=="0"&&X!=="false")return!1;return V().telemetryEnabled!==!1}function pX(Q){mQ(),H({telemetryEnabled:Q})}function lX(Q=process.env){let X=V().telemetryUuid??null;if(Q.BEACON_TELEMETRY_DISABLED==="1")return{enabled:!1,reason:"env:BEACON_TELEMETRY_DISABLED",machineId:X};let Z=Q.DO_NOT_TRACK;if(Z!==void 0&&Z!==""&&Z!=="0"&&Z!=="false")return{enabled:!1,reason:"env:DO_NOT_TRACK",machineId:X};if(V().telemetryEnabled===!1)return{enabled:!1,reason:"preference",machineId:X};return{enabled:!0,reason:"default",machineId:X}}function r(){return gQ(G(),"telemetry.json")}function pQ(){try{let Q=JSON.parse(yQ(r(),"utf8"));return{lastHeartbeatAt:typeof Q.lastHeartbeatAt==="string"?Q.lastHeartbeatAt:void 0}}catch{return{}}}function lQ(Q){d(r(),Q)}function cQ(Q,X){if(!Q)return!0;let Z=Date.parse(Q);if(Number.isNaN(Z))return!0;return X.getTime()-Z>=wQ}function sQ(Q,X=process.env){return{machineId:V().telemetryUuid??"",version:Q,platform:process.platform,arch:process.arch,ci:Boolean(X.CI&&X.CI!=="false")}}async function oQ(Q,X={}){let Z=X.env??process.env;try{if(!hQ(Z))return;let $=sQ(Q,Z);if(Z.BEACON_TELEMETRY_DEBUG==="1"){console.log(`[beacon-telemetry] debug \u2014 would send: ${JSON.stringify($)}`);return}if(!$.machineId)return;if((await(X.fetchImpl??fetch)(`${F}/api/telemetry`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify($),signal:AbortSignal.timeout(3000)})).ok)lQ({lastHeartbeatAt:(X.now??new Date).toISOString()})}catch{}}function cX(Q){let X=globalThis;if(X.__beaconTelemetry)return;X.__beaconTelemetry=!0;let Z=()=>{try{if(!cQ(pQ().lastHeartbeatAt,new Date))return;oQ(Q)}catch{}};Z(),setInterval(Z,bQ).unref()}export{lQ as writeHeartbeatState,lX as telemetryStatus,cX as startTelemetry,cQ as shouldHeartbeat,pX as setTelemetryEnabled,oQ as sendHeartbeat,pQ as readHeartbeatState,hQ as isTelemetryEnabled,sQ as heartbeatPayload,mQ as ensureTelemetryId};
|
package/dist/lib/workspaces.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var p=Object.defineProperty;var h=(Q)=>Q;function c(Q,X){this[Q]=h.bind(null,X)}var l=(Q,X)=>{for(var Z in X)p(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:c.bind(X,Z)})};var n=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var A={};l(A,{provisionDb:()=>$Q});import{createClient as s}from"@libsql/client";import{drizzle as o}from"drizzle-orm/libsql";import{migrate as d}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as t}from"drizzle-orm/migrator";import{dirname as C,join as a}from"path";import{fileURLToPath as r}from"url";async function U(Q,X){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[X]})).rows.length>0}async function XQ(Q,X){let Z=await Q.execute(`PRAGMA table_info("${X}")`);return new Set(Z.rows.map(($)=>String($.name)))}async function x(Q){if(!await U(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 ZQ(Q){for(let[X,Z]of Object.entries(QQ)){if(!await U(Q,X))continue;let $=await XQ(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 $Q(Q,X=e){let Z=s({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 U(Z,"__drizzle_migrations"),J=await U(Z,"Node"),G=!1;if(J&&!$){let K=t({migrationsFolder:X})[0];if(K)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:[K.hash,K.folderMillis]}),G=!0}let N=await x(Z);if(await d(o(Z),{migrationsFolder:X}),await x(Z)>N)G=!0;return await ZQ(Z),{migrated:G}}finally{Z.close()}}var i,e,QQ;var R=n(async()=>{i=C(C(C(r(import.meta.url)))),e=process.env.BEACON_MIGRATIONS_DIR||a(i,"drizzle"),QQ={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 JQ}from"async_hooks";import{spawnSync as YQ}from"child_process";import{createHash as GQ}from"crypto";import{existsSync as I,mkdirSync as M,readFileSync as O,writeFileSync as f}from"fs";import{homedir as D}from"os";import{basename as VQ,join as Y,parse as BQ,resolve as q}from"path";function B(){return process.env.BEACON_HOME||Y(D(),".beacon")}function T(){return Y(B(),"workspaces.json")}function j(Q){return GQ("sha256").update(Q).digest("hex").slice(0,12)}function IQ(Q=process.cwd()){let X=YQ("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 F(Q){let X=q(Q);return X!==q(D())&&X!==BQ(X).root}function S(){return Y(B(),"deleted.json")}function _(){try{let Q=JSON.parse(O(S(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function W(Q){M(B(),{recursive:!0}),f(S(),JSON.stringify(Q,null,2))}function P(Q){return _().includes(Q)}function DQ(Q){let X=_();if(!X.includes(Q))W([...X,Q])}function KQ(Q){let X=_();if(X.includes(Q))W(X.filter((Z)=>Z!==Q))}function u(Q){return Y(B(),Q)}function MQ(Q){return`file:${Y(u(Q),"db.sqlite")}`}function L(){try{let Q=JSON.parse(O(T(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function v(Q){M(B(),{recursive:!0}),f(T(),JSON.stringify(Q,null,2))}function y(){return L().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function V(Q){return L().find((X)=>X.id===Q)??null}function k(Q,X,Z=new Date().toISOString()){if(!F(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let $=j(Q);if(P($))throw Error(`beacon: workspace ${$} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=L(),G=J.find((z)=>z.id===$),N={id:$,path:Q,name:X||G?.name||VQ(Q),lastOpenedAt:Z},K=[N,...J.filter((z)=>z.id!==$)];return M(u($),{recursive:!0}),v(K),N}function FQ(Q,X){return KQ(j(Q)),k(Q,X)}function SQ(Q,X=new Date().toISOString()){let Z=L(),$=Z.find((J)=>J.id===Q);if(!$)return;$.lastOpenedAt=X,v(Z)}function WQ(Q){if(v(L().filter((X)=>X.id!==Q)),E()===Q)LQ(y()[0]?.id??null)}function w(){return Y(B(),"active")}function E(){try{return O(w(),"utf8").trim()||null}catch{return null}}function LQ(Q){M(B(),{recursive:!0}),f(w(),Q??"")}function PQ(){let Q=E();return Q?V(Q):null}function yQ(){let Q=jQ()??E();return Q?V(Q):null}function kQ(Q){return V(Q)?.path??null}function wQ(){return I(T())}var b="beacon_ws";function g(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 bQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&V(X))return X;let Z=g(Q,b);if(Z&&V(Z))return Z;return NQ()}function NQ(){let Q=y();return Q.length===1?Q[0].id:null}var UQ="x-beacon-workspace-path";async function gQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&V(X))return X;let Z=Q.headers.get(UQ);if(Z&&F(Z)&&!P(j(Z))&&(!X||j(Z)===X)){let J=k(Z);return await uQ(J.id),J.id}let $=g(Q,b);if($&&V($))return $;return null}var m=new JQ;function mQ(Q,X){return Q?m.run(Q,X):X()}function jQ(){return m.getStore()??null}var H=new Set;function pQ(Q){H.delete(Y(u(Q),"db.sqlite"))}async function uQ(Q){let X=u(Q),Z=Y(X,"db.sqlite"),$=I(Z);if($&&H.has(Z))return{ok:!0,created:!1,migrated:!1};try{M(X,{recursive:!0});let{provisionDb:J}=await R().then(() => A),G=await J(MQ(Q));return H.add(Z),{ok:!0,created:!$,migrated:$&&G.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}export{bQ as workspaceIdFromRequest,SQ as touchWorkspace,DQ as tombstoneWorkspace,LQ as setActiveId,mQ as runWithWorkspace,gQ as resolveRequestWorkspaceId,IQ as repoRootFrom,WQ as removeWorkspace,wQ as registryExists,FQ as registerWorkspaceExplicit,kQ as pathForWorkspace,y as listWorkspaces,P as isWorkspaceDeleted,F as isRegistrableWorkspacePath,j as idForPath,V as getWorkspace,jQ as getPinnedWorkspaceId,E as getActiveId,pQ as forgetWorkspaceDb,uQ as ensureWorkspaceDb,MQ as dbUrlFor,u as dataDirFor,yQ as currentWorkspace,KQ as clearWorkspaceTombstone,B as beaconHome,k as addWorkspace,PQ as activeWorkspace,UQ as BEACON_WS_PATH_HEADER,b as BEACON_WS_COOKIE};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
CREATE TABLE `PlanContract` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`planId` text NOT NULL,
|
|
4
|
+
`declaredFiles` text DEFAULT '[]' NOT NULL,
|
|
5
|
+
`authorizedExtras` text DEFAULT '[]' NOT NULL,
|
|
6
|
+
`active` integer DEFAULT false NOT NULL,
|
|
7
|
+
`createdAt` integer NOT NULL,
|
|
8
|
+
`updatedAt` integer NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE UNIQUE INDEX `PlanContract_planId_key` ON `PlanContract` (`planId`);--> statement-breakpoint
|
|
12
|
+
CREATE INDEX `PlanContract_active_idx` ON `PlanContract` (`active`);--> statement-breakpoint
|
|
13
|
+
CREATE TABLE `WorkspaceFlag` (
|
|
14
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
15
|
+
`key` text NOT NULL,
|
|
16
|
+
`enabled` integer DEFAULT false NOT NULL,
|
|
17
|
+
`config` text,
|
|
18
|
+
`updatedAt` integer NOT NULL
|
|
19
|
+
);
|
|
20
|
+
--> statement-breakpoint
|
|
21
|
+
CREATE UNIQUE INDEX `WorkspaceFlag_key_key` ON `WorkspaceFlag` (`key`);
|