trybeacon 0.1.20 → 0.1.22
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 +15 -15
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +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_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/init/route.js +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/plan/annotations/route.js +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +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_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_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/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_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_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +15 -15
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/249.js +1 -1
- package/.next/server/chunks/5680.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/4779-6218ea303266aff3.js +1 -0
- package/.next/static/chunks/app/map/{page-d7c8e5236784398e.js → page-bd036db25a148fb3.js} +1 -1
- package/.next/static/chunks/app/plan/page-2aa7eb766eb1c2e3.js +1 -0
- package/.next/static/css/d41569044c50aaaf.css +1 -0
- package/.next/trace +37 -37
- package/.next/trace-build +1 -1
- package/dist/bin/doctor.js +4 -2
- package/dist/bin/hook.js +4 -2
- package/dist/bin/mcp.js +14 -12
- package/dist/bin/plan.js +4 -2
- package/dist/bin/uninstall.js +4 -2
- package/dist/lib/assets.js +4 -2
- package/dist/lib/codex-install.js +4 -2
- package/dist/lib/global-install.js +4 -2
- package/package.json +1 -1
- package/.next/server/chunks/9419.js +0 -1
- package/.next/static/chunks/8207-ec49c6e4ab8a4bab.js +0 -1
- package/.next/static/chunks/app/plan/page-64a53d9f43b74c26.js +0 -1
- package/.next/static/css/13ab752f24b58903.css +0 -1
- /package/.next/static/{gS_xE1cqbYifs05Z7A-hH → 08EMrNjd1iA9NlOduqVQX}/_buildManifest.js +0 -0
- /package/.next/static/{gS_xE1cqbYifs05Z7A-hH → 08EMrNjd1iA9NlOduqVQX}/_ssgManifest.js +0 -0
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":30383545,"timestamp":54287127,"id":14,"parentId":1,"tags":{},"startTime":1781121092897,"traceId":"a93769a884306cf4"},{"name":"run-typescript","duration":12063252,"timestamp":84673593,"id":3923,"parentId":1,"tags":{},"startTime":1781121123283,"traceId":"a93769a884306cf4"},{"name":"static-check","duration":726268,"timestamp":96834788,"id":3926,"parentId":1,"tags":{},"startTime":1781121135444,"traceId":"a93769a884306cf4"},{"name":"static-generation","duration":4255964,"timestamp":98132288,"id":4062,"parentId":1,"tags":{},"startTime":1781121136742,"traceId":"a93769a884306cf4"},{"name":"collect-build-traces","duration":12257549,"timestamp":97564078,"id":4059,"parentId":1,"tags":{},"startTime":1781121136174,"traceId":"a93769a884306cf4"},{"name":"telemetry-flush","duration":56,"timestamp":109825176,"id":4071,"parentId":1,"tags":{},"startTime":1781121148435,"traceId":"a93769a884306cf4"},{"name":"next-build","duration":55738101,"timestamp":54087142,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781121092697,"traceId":"a93769a884306cf4"}]
|
package/dist/bin/doctor.js
CHANGED
|
@@ -29,7 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
32
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
32
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
33
33
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
34
34
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
35
35
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -170,6 +170,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
170
170
|
|
|
171
171
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
172
172
|
|
|
173
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
174
|
+
|
|
173
175
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
174
176
|
|
|
175
177
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -192,7 +194,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
192
194
|
|
|
193
195
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
194
196
|
|
|
195
|
-
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.
|
|
197
|
+
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.
|
|
196
198
|
|
|
197
199
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
198
200
|
${WQ}`});import{existsSync as _Q,mkdirSync as jQ,readFileSync as S,rmSync as wZ,writeFileSync as m}from"fs";import{dirname as kQ,join as h}from"path";function vQ(Q){try{return JSON.parse(S(Q,"utf8"))}catch{return{}}}function LQ(Q,Z){jQ(kQ(Q),{recursive:!0}),m(Q,JSON.stringify(Z,null,2)+`
|
package/dist/bin/hook.js
CHANGED
|
@@ -29,7 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
32
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
32
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
33
33
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
34
34
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
35
35
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -170,6 +170,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
170
170
|
|
|
171
171
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
172
172
|
|
|
173
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
174
|
+
|
|
173
175
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
174
176
|
|
|
175
177
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -192,7 +194,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
192
194
|
|
|
193
195
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
194
196
|
|
|
195
|
-
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.
|
|
197
|
+
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.
|
|
196
198
|
|
|
197
199
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
198
200
|
${QQ}`});import{existsSync as wQ,mkdirSync as JQ,readFileSync as D,rmSync as xZ,writeFileSync as I}from"fs";import{dirname as gQ,join as b}from"path";function YQ(Q){try{return JSON.parse(D(Q,"utf8"))}catch{return{}}}function TQ(Q,Z){JQ(gQ(Q),{recursive:!0}),I(Q,JSON.stringify(Z,null,2)+`
|
package/dist/bin/mcp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var M9=Object.defineProperty;var q9=($)=>$;function w9($,Q){this[$]=q9.bind(null,Q)}var
|
|
3
|
+
var M9=Object.defineProperty;var q9=($)=>$;function w9($,Q){this[$]=q9.bind(null,Q)}var d=($,Q)=>{for(var Z in Q)M9($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:w9.bind(Q,Z)})};var o=($,Q)=>()=>($&&(Q=$($=0)),Q);var S0={};d(S0,{removeRepoAssets:()=>I9,installRefreshSkill:()=>v9,installPlanSkill:()=>O9,installInitSkill:()=>C9,installCodexRepoSkills:()=>R9,ensureWorkflowDoc:()=>D9,ensureMcp:()=>A9,auditRepo:()=>E9,REFRESH_SKILL:()=>h0,PLAN_SKILL:()=>w5,INIT_SKILL:()=>x0});import{existsSync as f,mkdirSync as W0,readFileSync as L,rmSync as H0,writeFileSync as I}from"fs";import{join as B}from"path";function C9($){let Q=B($,".claude","skills","beacon-init");W0(Q,{recursive:!0});let Z=B(Q,"SKILL.md");return I(Z,x0),Z}function v9($){let Q=B($,".claude","skills","beacon-refresh");W0(Q,{recursive:!0});let Z=B(Q,"SKILL.md");return I(Z,h0),Z}function O9($){let Q=B($,".claude","skills","beacon-plan");W0(Q,{recursive:!0});let Z=B(Q,"SKILL.md");return I(Z,w5),Z}function R9($){let Q=[];for(let Z of F9){let Y=B($,".agents","skills",Z.name);W0(Y,{recursive:!0});let X=B(Y,"SKILL.md");I(X,Z.body()),Q.push(X)}return Q}function D9($){let Q=B($,"AGENTS.md"),Z="";try{Z=L(Q,"utf8")}catch{}let Y=new RegExp(`${U0}[\\s\\S]*?${z0}`);Z=Y.test(Z)?Z.replace(Y,q5):`${Z.trim()}
|
|
4
4
|
|
|
5
5
|
${q5}
|
|
6
6
|
`.trimStart(),I(Q,Z.endsWith(`
|
|
@@ -10,11 +10,11 @@ ${q5}
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
11
|
`)}function A9($){let Q=B($,".mcp.json"),Z={};try{Z=JSON.parse(L(Q,"utf8"))}catch{}if(Z.mcpServers=Z.mcpServers??{},Z.mcpServers.beacon)return{path:Q,added:!1};return Z.mcpServers.beacon={command:"beacon",args:["mcp"]},I(Q,JSON.stringify(Z,null,2)+`
|
|
12
12
|
`),{path:Q,added:!0}}function E9($){let Q=B($,".mcp.json"),Z=!1;try{Z=!!JSON.parse(L(Q,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=L(B($,"AGENTS.md"),"utf8").includes(U0)}catch{}let X=!1;try{X=/@AGENTS\.md/.test(L(B($,"CLAUDE.md"),"utf8"))}catch{}return{repo:$,mcpRegistered:Z,agentsMdBlock:Y,claudeMdImport:X,skills:{"beacon-init":f(B($,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":f(B($,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":f(B($,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":f(B($,".agents","skills","beacon-refresh","SKILL.md"))}}}function I9($){let Q=[];for(let U of["beacon-init","beacon-refresh","beacon-db-design"]){let w=B($,".claude","skills",U);if(f(w))H0(w,{recursive:!0,force:!0}),Q.push(U)}for(let U of["beacon-init","beacon-refresh"]){let w=B($,".agents","skills",U);if(f(w))H0(w,{recursive:!0,force:!0}),Q.push(`codex:${U}`)}let Z=!1,Y=B($,".mcp.json");try{let U=JSON.parse(L(Y,"utf8"));if(U.mcpServers?.beacon){if(delete U.mcpServers.beacon,Z=!0,U.mcpServers&&Object.keys(U.mcpServers).length===0)delete U.mcpServers;if(Object.keys(U).length===0)H0(Y,{force:!0});else I(Y,JSON.stringify(U,null,2)+`
|
|
13
|
-
`)}}catch{}let X=!1,H=B($,"AGENTS.md");try{let U=L(H,"utf8"),w=new RegExp(`\\n?${U0}[\\s\\S]*?${z0}\\n?`);if(w.test(U)){let
|
|
13
|
+
`)}}catch{}let X=!1,H=B($,"AGENTS.md");try{let U=L(H,"utf8"),w=new RegExp(`\\n?${U0}[\\s\\S]*?${z0}\\n?`);if(w.test(U)){let s=U.replace(w,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();I(H,
|
|
17
|
-
`)?
|
|
16
|
+
`).trimStart();I(H,s.endsWith(`
|
|
17
|
+
`)?s:`${s}
|
|
18
18
|
`),X=!0}}catch{}let W=!1,P=B($,"CLAUDE.md");try{let U=L(P,"utf8"),w=U.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(w!==U){if(!w.trim())H0(P,{force:!0});else I(P,w);W=!0}}catch{}return{skillsRemoved:Q,mcpUnregistered:Z,agentsBlockRemoved:X,claudeImportRemoved:W}}var x0=`---
|
|
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.
|
|
@@ -29,7 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
32
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
32
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
33
33
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
34
34
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
35
35
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -170,6 +170,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
170
170
|
|
|
171
171
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
172
172
|
|
|
173
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
174
|
+
|
|
173
175
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
174
176
|
|
|
175
177
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -192,7 +194,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
192
194
|
|
|
193
195
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
194
196
|
|
|
195
|
-
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.
|
|
197
|
+
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.
|
|
196
198
|
|
|
197
199
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
198
200
|
${z0}`});import{existsSync as C5,mkdirSync as f0,readFileSync as P0,rmSync as L9,writeFileSync as G0}from"fs";import{dirname as v5,join as j0}from"path";function b0($){try{return JSON.parse(P0($,"utf8"))}catch{return{}}}function O5($,Q){f0(v5($),{recursive:!0}),G0($,JSON.stringify(Q,null,2)+`
|
|
@@ -227,29 +229,29 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
227
229
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
228
230
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
229
231
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
230
|
-
verbatim. Do NOT implement until the tool returns approval.`;var m0=o(()=>{k=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as T9,renameSync as _9,rmSync as k9,writeFileSync as g9}from"fs";import{dirname as y9}from"path";function p0($,Q){T9(y9($),{recursive:!0});let Z=`${$}.tmp`;try{g9(Z,Q),_9(Z,$)}catch(Y){throw k9(Z,{force:!0}),Y}}var F5=()=>{};var _5={};
|
|
232
|
+
verbatim. Do NOT implement until the tool returns approval.`;var m0=o(()=>{k=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as T9,renameSync as _9,rmSync as k9,writeFileSync as g9}from"fs";import{dirname as y9}from"path";function p0($,Q){T9(y9($),{recursive:!0});let Z=`${$}.tmp`;try{g9(Z,Q),_9(Z,$)}catch(Y){throw k9(Z,{force:!0}),Y}}var F5=()=>{};var _5={};d(_5,{setupCodexAssets:()=>S9,removeCodexMcp:()=>T5,removeCodexArtifacts:()=>f9,hasCodexMcp:()=>d0,ensureCodexMcp:()=>L5,codexMcpProblem:()=>z9,codexDetected:()=>A5,auditCodex:()=>u9,CODEX_HOOKS:()=>A0});import{readFileSync as D0}from"fs";import{homedir as x9}from"os";import{join as t}from"path";function R5(){return process.env.HOME||process.env.USERPROFILE||x9()}function A5(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(c0===void 0)c0=Bun.which("codex")!==null;return c0}function i($){try{return Bun.TOML.parse($)}catch{return null}}function d0(){try{return Boolean(i(D0(b(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function z9(){let $="";try{$=D0(b(),"utf8")}catch{return null}let Q=i($);if(!Q)return`~/.codex/config.toml does not parse \u2014 ${r}`;if(Q.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test($))return`mcp_servers is an inline table \u2014 ${r}`;return null}function L5(){let $="",Q=!1;try{$=D0(b(),"utf8"),Q=!0}catch{}if(Q){let H=i($);if(!H)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${r}`};if(H.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test($))return{added:!1,error:`mcp_servers is an inline table \u2014 ${r}`}}let Z=!$?"":$.endsWith(`
|
|
231
233
|
`)?`
|
|
232
234
|
`:`
|
|
233
235
|
|
|
234
236
|
`,Y=$+Z+h9;if(i(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${r}`};return p0(b(),Y),{added:!0}}function T5(){let $="";try{$=D0(b(),"utf8")}catch{return{removed:!1}}let Q=$.split(`
|
|
235
|
-
`),Z=Q.indexOf(E5);if(Z===-1)return{removed:!1,skipped:
|
|
237
|
+
`),Z=Q.indexOf(E5);if(Z===-1)return{removed:!1,skipped:d0()};let Y=Q.indexOf(I5,Z);if(Y===-1)return{removed:!1,skipped:!0};Q.splice(Z,Y-Z+1);let X=Q.join(`
|
|
236
238
|
`).replace(/\n{3,}/g,`
|
|
237
239
|
|
|
238
|
-
`).replace(/^\n+/,"");if(i(X)===null)return{removed:!1,skipped:!0};return p0(b(),X),{removed:!0}}async function S9(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (u0(),S0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let U of k){if(!a(F0(),U))X.push(U);C0(F0(),U,Y[U])}let H=0;for(let U of A0)if(K0(
|
|
240
|
+
`).replace(/^\n+/,"");if(i(X)===null)return{removed:!1,skipped:!0};return p0(b(),X),{removed:!0}}async function S9(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (u0(),S0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let U of k){if(!a(F0(),U))X.push(U);C0(F0(),U,Y[U])}let H=0;for(let U of A0)if(K0(s0(),{event:U.event,matcher:U.matcher,command:U.command}))H++;let W=n(O0(),R0);q0(O0(),R0,D5,B0);let P=L5();return{skillsAdded:X,hooksAdded:H,agentsMdBlockTouched:!W,mcp:P}}function u9(){let $={};for(let Z of k)$[Z]=a(F0(),Z);let Q={};for(let Z of A0)Q[Z.event]=N0(s0(),{event:Z.event,command:Z.command});return{detected:A5(),skills:$,hooks:Q,agentsMdBlock:n(O0(),R0),mcp:d0()}}function f9(){let $=[];for(let X of k)if(v0(F0(),X))$.push(X);let Q=0;for(let X of A0)if(M0(s0(),{event:X.event,command:X.command}))Q++;let Z=w0(O0(),R0,D5),Y=T5();return{skillsRemoved:$,hooksRemoved:Q,agentsMdBlockRemoved:Z,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var l0=()=>t(R5(),".codex"),s0=()=>t(l0(),"hooks.json"),b=()=>t(l0(),"config.toml"),O0=()=>t(l0(),"AGENTS.md"),F0=()=>t(R5(),".agents","skills"),R0="<!-- beacon:global:start -->",D5="<!-- beacon:global:end -->",A0,c0,E5="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",I5="# beacon:end",h9,r="add it manually: codex mcp add beacon -- beacon mcp";var k5=o(()=>{m0();F5();A0=[{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."}];h9=`${E5}
|
|
239
241
|
[mcp_servers.beacon]
|
|
240
242
|
command = "beacon"
|
|
241
243
|
args = ["mcp"]
|
|
242
244
|
${I5}
|
|
243
|
-
`});var S5={};s(S5,{provisionDb:()=>U$});import{createClient as t9}from"@libsql/client";import{drizzle as e9}from"drizzle-orm/libsql";import{migrate as $$}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as Q$}from"drizzle-orm/migrator";import{dirname as t0,join as Z$}from"path";import{fileURLToPath as J$}from"url";async function L0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function H$($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((Y)=>String(Y.name)))}async function z5($){if(!await L0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function W$($){for(let[Q,Z]of Object.entries(X$)){if(!await L0($,Q))continue;let Y=await H$($,Q);for(let X of Z){if(!Y.has(X))continue;await $.execute(`UPDATE "${Q}" SET "${X}" = CAST((julianday("${X}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${X}") = 'text'`)}}}async function U$($,Q=V$){let Z=t9({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;");let Y=await L0(Z,"__drizzle_migrations"),X=await L0(Z,"Node"),H=!1;if(X&&!Y){let P=Q$({migrationsFolder:Q})[0];if(P)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:[P.hash,P.folderMillis]}),H=!0}let W=await z5(Z);if(await $$(e9(Z),{migrationsFolder:Q}),await z5(Z)>W)H=!0;return await W$(Z),{migrated:H}}finally{Z.close()}}var Y$,V$,X$;var u5=o(async()=>{Y$=t0(t0(t0(J$(import.meta.url)))),V$=process.env.BEACON_MIGRATIONS_DIR||Z$(Y$,"drizzle"),X$={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});m0();import{existsSync as b9}from"fs";import{homedir as m9}from"os";import{join as E0}from"path";function p9(){return process.env.HOME||process.env.USERPROFILE||m9()}var I0=()=>E0(p9(),".claude"),o0=()=>E0(I0(),"skills"),n0=()=>E0(I0(),"settings.json"),a0=()=>E0(I0(),"CLAUDE.md"),r0="<!-- beacon:global:start -->",g5="<!-- beacon:global:end -->";var c9=B0,i0=[{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 l9($,Q){return C0(o0(),$,Q)}function y5($){return a(o0(),$)}function d9($){return v0(o0(),$)}function s9($){return K0(n0(),$)}function o9($){return N0(n0(),$)}function n9($){return M0(n0(),$)}function a9($){q0(a0(),r0,g5,$)}function x5(){return n(a0(),r0)}function r9(){return w0(a0(),r0,g5)}function CQ(){let $={};for(let Z of k)$[Z]=y5(Z);let Q={};for(let Z of i0)Q[Z.event]=o9({event:Z.event,command:Z.command});return{homeExists:b9(I0()),skills:$,hooks:Q,claudeMdBlock:x5()}}async function i9(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (u0(),S0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let P of k){if(!y5(P))X.push(P);l9(P,Y[P])}let H=0;for(let P of i0)if(s9({event:P.event,matcher:P.matcher,command:P.command}))H++;let W=x5();return a9(c9),{skillsAdded:X,hooksAdded:H,claudeMdBlockTouched:!W}}async function h5(){let $;try{$={ok:!0,...await i9()}}catch(Q){$={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Q=await Promise.resolve().then(() => (k5(),_5));if(Q.codexDetected())$.codex={ok:!0,...await Q.setupCodexAssets()}}catch(Q){$.codex={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return $}function vQ(){let $=[];for(let Y of k)if(d9(Y))$.push(Y);let Q=0;for(let Y of i0)if(n9(Y))Q++;let Z=r9();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as j$}from"async_hooks";import{spawnSync as P$}from"child_process";import{createHash as G$}from"crypto";import{existsSync as b5,mkdirSync as T0,readFileSync as m5,writeFileSync as p5}from"fs";import{homedir as B$}from"os";import{basename as K$,join as m}from"path";function e(){return process.env.BEACON_HOME||m(B$(),".beacon")}function e0(){return m(e(),"workspaces.json")}function _0($){return G$("sha256").update($).digest("hex").slice(0,12)}function c5($=process.cwd()){let Q=P$("git",["rev-parse","--show-toplevel"],{cwd:$,stdio:["ignore","pipe","ignore"]});if(Q.status===0){let Z=Q.stdout?.toString().trim();if(Z)return Z}return $}function $5($){return m(e(),$)}function Q5($){return`file:${m($5($),"db.sqlite")}`}function $0(){try{let $=JSON.parse(m5(e0(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function Z5($){T0(e(),{recursive:!0}),p5(e0(),JSON.stringify($,null,2))}function N$(){return $0().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function y($){return $0().find((Q)=>Q.id===$)??null}function J5($,Q,Z=new Date().toISOString()){let Y=_0($),X=$0(),H=X.find((U)=>U.id===Y),W={id:Y,path:$,name:Q||H?.name||K$($),lastOpenedAt:Z},P=[W,...X.filter((U)=>U.id!==Y)];return T0($5(Y),{recursive:!0}),Z5(P),W}function xQ($,Q=new Date().toISOString()){let Z=$0(),Y=Z.find((X)=>X.id===$);if(!Y)return;Y.lastOpenedAt=Q,Z5(Z)}function hQ($){if(Z5($0().filter((Q)=>Q.id!==$)),Q0()===$)M$(N$()[0]?.id??null)}function l5(){return m(e(),"active")}function Q0(){try{return m5(l5(),"utf8").trim()||null}catch{return null}}function M$($){T0(e(),{recursive:!0}),p5(l5(),$??"")}function zQ(){let $=Q0();return $?y($):null}function SQ(){let $=V5()??Q0();return $?y($):null}function uQ($){return y($)?.path??null}function fQ(){return b5(e0())}var d5="beacon_ws";function s5($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let Y of Z.split(";")){let X=Y.indexOf("=");if(X===-1)continue;if(Y.slice(0,X).trim()===Q)return decodeURIComponent(Y.slice(X+1).trim())}return null}function bQ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&y(Q))return Q;let Z=s5($,d5);if(Z&&y(Z))return Z;return null}var Y5="x-beacon-workspace-path";async function mQ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&y(Q))return Q;let Z=$.headers.get(Y5);if(Z&&(!Q||_0(Z)===Q)){let X=J5(Z);return await X5(X.id),X.id}let Y=s5($,d5);if(Y&&y(Y))return Y;return null}var o5=new j$;function q$($,Q){return $?o5.run($,Q):Q()}function V5(){return o5.getStore()??null}var f5=new Set;async function X5($){let Q=$5($),Z=m(Q,"db.sqlite"),Y=b5(Z);if(Y&&f5.has(Z))return{ok:!0,created:!1,migrated:!1};try{T0(Q,{recursive:!0});let{provisionDb:X}=await u5().then(() => S5),H=await X(Q5($));return f5.add(Z),{ok:!0,created:!Y,migrated:Y&&H.migrated}}catch(X){return{ok:!1,created:!1,migrated:!1,error:X instanceof Error?X.message:String(X)}}}import{McpServer as e$,ResourceTemplate as K5}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as $Q}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as G}from"zod";var w$=new Set(["GET","HEAD","OPTIONS"]);function n5($){return w$.has($.trim().toUpperCase())?"read":"write"}var C$=G.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},G.object({name:G.string().trim().min(1),type:G.string().trim().min(1),isPk:G.boolean().optional(),isFk:G.boolean().optional(),nullable:G.boolean().optional(),note:G.string().nullish()})),a5=G.object({name:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),columns:G.array(C$).default([])}),r5=G.object({fromTable:G.string(),fromColumn:G.string(),toTable:G.string(),toColumn:G.string(),label:G.string().nullish()}),i5=G.object({method:G.string().trim().min(1),path:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),uses:G.array(G.object({table:G.string().trim().min(1),access:G.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??n5($.method)}))})),sQ=G.object({tables:G.array(a5).default([]),relations:G.array(r5).default([]),endpoints:G.array(i5).default([])});import{z as A}from"zod";import{and as BZ,eq as KZ,inArray as NZ}from"drizzle-orm";import{drizzle as c$}from"drizzle-orm/libsql";import{createClient as l$}from"@libsql/client";var H5={};s(H5,{tag:()=>p,syncState:()=>D$,projectMeta:()=>E$,note:()=>F$,nodeTags:()=>x,nodeFile:()=>Z0,node:()=>K,endpointTable:()=>z,endpoint:()=>c,edge:()=>g,draftTable:()=>D,draftRelation:()=>S,draftColumn:()=>V0,dbTable:()=>v,dbRelation:()=>h,dbColumn:()=>Y0,codeFileEdge:()=>u,codeFile:()=>T,bugFlag:()=>J0,boardAnnotation:()=>R$,appSetting:()=>A$});import{sqliteTable as q,index as N,foreignKey as v$,text as V,integer as j,real as R,uniqueIndex as _,primaryKey as O$}from"drizzle-orm/sqlite-core";import{createId as O}from"@paralleldrive/cuid2";var K=q("Node",{id:V().primaryKey().$defaultFn(()=>O()),view:V().notNull(),kind:V().default("FEATURE").notNull(),cluster:V(),title:V().notNull(),role:V(),plain:V(),status:V().default("PENDING").notNull(),priority:j().default(2).notNull(),progress:j().default(0).notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),sourceRef:V(),externalId:V(),source:V().default("MANUAL").notNull(),parentId:V(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Node_cluster_idx").on($.cluster),N("Node_parentId_idx").on($.parentId),N("Node_view_idx").on($.view),v$(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),Z0=q("NodeFile",{id:V().primaryKey().$defaultFn(()=>O()),nodeId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),path:V().notNull()},($)=>[_("NodeFile_nodeId_path_key").on($.nodeId,$.path),N("NodeFile_nodeId_idx").on($.nodeId)]),p=q("Tag",{id:V().primaryKey().$defaultFn(()=>O()),label:V().notNull(),color:V()},($)=>[_("Tag_label_key").on($.label)]),g=q("Edge",{id:V().primaryKey().$defaultFn(()=>O()),fromId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:V().default("DEPENDS").notNull(),label:V(),sourceHandle:V(),targetHandle:V()},($)=>[_("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),N("Edge_toId_idx").on($.toId),N("Edge_fromId_idx").on($.fromId)]),x=q("_NodeTags",{a:V("A").notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),b:V("B").notNull().references(()=>p.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[_("_NodeTags_AB_unique").on($.a,$.b),N("_NodeTags_B_index").on($.b)]),F$=q("Note",{id:V().primaryKey().$defaultFn(()=>O()),title:V().default("Untitled").notNull(),body:V().default("").notNull(),ord:R().default(0).notNull(),pinned:j({mode:"boolean"}).default(!1).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Note_updatedAt_idx").on($.updatedAt)]),R$=q("BoardAnnotation",{id:V().primaryKey().$defaultFn(()=>O()),targetKind:V().notNull(),targetId:V().notNull(),columnName:V(),body:V().default("").notNull(),x:R(),y:R(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("BoardAnnotation_target_idx").on($.targetId)]),J0=q("BugFlag",{id:V().primaryKey().$defaultFn(()=>O()),nodeId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),by:V().notNull(),note:V().notNull(),resolvedAt:j({mode:"timestamp_ms"}),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[N("BugFlag_nodeId_idx").on($.nodeId)]),v=q("DbTable",{id:V().primaryKey().$defaultFn(()=>O()),name:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("DbTable_domain_idx").on($.domain),_("DbTable_name_key").on($.name)]),Y0=q("DbColumn",{id:V().primaryKey().$defaultFn(()=>O()),tableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:V(),ord:j().default(0).notNull()},($)=>[_("DbColumn_tableId_name_key").on($.tableId,$.name),N("DbColumn_tableId_idx").on($.tableId)]),h=q("DbRelation",{id:V().primaryKey().$defaultFn(()=>O()),fromTableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DbRelation_toTableId_idx").on($.toTableId),N("DbRelation_fromTableId_idx").on($.fromTableId)]),c=q("Endpoint",{id:V().primaryKey().$defaultFn(()=>O()),method:V().notNull(),path:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[_("Endpoint_method_path_key").on($.method,$.path),N("Endpoint_domain_idx").on($.domain)]),z=q("EndpointTable",{id:V().primaryKey().$defaultFn(()=>O()),endpointId:V().notNull().references(()=>c.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),access:V().default("read").notNull()},($)=>[_("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),N("EndpointTable_tableId_idx").on($.tableId)]),D=q("DraftTable",{id:V().primaryKey().$defaultFn(()=>O()),name:V().notNull(),domain:V(),description:V(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[_("DraftTable_name_key").on($.name)]),V0=q("DraftColumn",{id:V().primaryKey().$defaultFn(()=>O()),tableId:V().notNull().references(()=>D.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:V(),ord:j().default(0).notNull()},($)=>[N("DraftColumn_tableId_idx").on($.tableId)]),S=q("DraftRelation",{id:V().primaryKey().$defaultFn(()=>O()),fromTableId:V().notNull().references(()=>D.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>D.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DraftRelation_toTableId_idx").on($.toTableId),N("DraftRelation_fromTableId_idx").on($.fromTableId)]),T=q("CodeFile",{path:V().primaryKey(),root:V(),lang:V(),x:R().default(0).notNull(),y:R().default(0).notNull(),mtimeMs:R(),size:j(),inDegree:j().default(0).notNull(),outDegree:j().default(0).notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),u=q("CodeFileEdge",{fromPath:V().notNull().references(()=>T.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:V().notNull().references(()=>T.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:j({mode:"boolean"}).default(!1).notNull()},($)=>[N("CodeFileEdge_circular_idx").on($.circular),N("CodeFileEdge_toPath_idx").on($.toPath),N("CodeFileEdge_fromPath_idx").on($.fromPath),O$({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),D$=q("SyncState",{id:V().primaryKey().default("singleton"),version:j().default(0).notNull(),codeGraphSyncedAt:j({mode:"timestamp_ms"}),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),A$=q("AppSetting",{id:V().primaryKey().default("singleton"),editor:V().default("auto").notNull(),currentFeatureId:V(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),E$=q("ProjectMeta",{id:V().primaryKey().default("singleton"),overview:V(),conventions:V().default("[]").notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)});var W5={};s(W5,{tagRelations:()=>_$,nodeTagsRelations:()=>k$,nodeRelations:()=>I$,nodeFileRelations:()=>L$,endpointTableRelations:()=>S$,endpointRelations:()=>z$,edgeRelations:()=>g$,draftTableRelations:()=>u$,draftRelationRelations:()=>b$,draftColumnRelations:()=>f$,dbTableRelations:()=>y$,dbRelationRelations:()=>h$,dbColumnRelations:()=>x$,codeFileRelations:()=>m$,codeFileEdgeRelations:()=>p$,bugFlagRelations:()=>T$});import{relations as C}from"drizzle-orm";var I$=C(K,({one:$,many:Q})=>({files:Q(Z0),bugFlags:Q(J0),nodeTags:Q(x),edgesOut:Q(g,{relationName:"EdgeFrom"}),edgesIn:Q(g,{relationName:"EdgeTo"}),parent:$(K,{fields:[K.parentId],references:[K.id],relationName:"NodeTree"}),children:Q(K,{relationName:"NodeTree"})})),L$=C(Z0,({one:$})=>({node:$(K,{fields:[Z0.nodeId],references:[K.id]})})),T$=C(J0,({one:$})=>({node:$(K,{fields:[J0.nodeId],references:[K.id]})})),_$=C(p,({many:$})=>({nodeTags:$(x)})),k$=C(x,({one:$})=>({node:$(K,{fields:[x.a],references:[K.id]}),tag:$(p,{fields:[x.b],references:[p.id]})})),g$=C(g,({one:$})=>({from:$(K,{fields:[g.fromId],references:[K.id],relationName:"EdgeFrom"}),to:$(K,{fields:[g.toId],references:[K.id],relationName:"EdgeTo"})})),y$=C(v,({many:$})=>({columns:$(Y0),fksOut:$(h,{relationName:"FkFrom"}),fksIn:$(h,{relationName:"FkTo"}),usages:$(z)})),x$=C(Y0,({one:$})=>({table:$(v,{fields:[Y0.tableId],references:[v.id]})})),h$=C(h,({one:$})=>({fromTable:$(v,{fields:[h.fromTableId],references:[v.id],relationName:"FkFrom"}),toTable:$(v,{fields:[h.toTableId],references:[v.id],relationName:"FkTo"})})),z$=C(c,({many:$})=>({tables:$(z)})),S$=C(z,({one:$})=>({endpoint:$(c,{fields:[z.endpointId],references:[c.id]}),table:$(v,{fields:[z.tableId],references:[v.id]})})),u$=C(D,({many:$})=>({columns:$(V0),fksOut:$(S,{relationName:"DraftFkFrom"}),fksIn:$(S,{relationName:"DraftFkTo"})})),f$=C(V0,({one:$})=>({table:$(D,{fields:[V0.tableId],references:[D.id]})})),b$=C(S,({one:$})=>({fromTable:$(D,{fields:[S.fromTableId],references:[D.id],relationName:"DraftFkFrom"}),toTable:$(D,{fields:[S.toTableId],references:[D.id],relationName:"DraftFkTo"})})),m$=C(T,({many:$})=>({edgesOut:$(u,{relationName:"CFEFrom"}),edgesIn:$(u,{relationName:"CFETo"})})),p$=C(u,({one:$})=>({fromFile:$(T,{fields:[u.fromPath],references:[T.path],relationName:"CFEFrom"}),toFile:$(T,{fields:[u.toPath],references:[T.path],relationName:"CFETo"})}));var d$={...H5,...W5};function s$(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var o$=s$();function e5($){let Q=l$({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),c$(Q,{schema:d$})}var j5=globalThis,U5=j5.dzDefault??e5(o$);j5.dzDefault=U5;var t5=j5.dzByUrl??=new Map;function n$($){let Q=t5.get($);if(!Q)Q=e5($),t5.set($,Q);return Q}function a$(){if(process.env.BEACON_REPO)return U5;let $=V5()??Q0();if(!$)return U5;return n$(Q5($))}var r$=new Proxy({},{get($,Q){let Z=a$(),Y=Z[Q];return typeof Y==="function"?Y.bind(Z):Y}});import{forceCenter as YZ,forceCollide as VZ,forceLink as XZ,forceManyBody as HZ,forceSimulation as WZ}from"d3-force";var $9=A.object({title:A.string().trim().min(1),role:A.string().nullish(),plain:A.string().nullish(),cluster:A.string().nullish(),category:A.string().nullish(),domain:A.string().nullish(),priority:A.number().nullish(),dependsOn:A.array(A.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,...Y})=>({...Y,cluster:Y.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z)))})),CZ=A.object({features:A.array($9).default([])});var i$=/(\bmigrations?\b|\balembic\b|make revision|prisma migrate|unique\s?constraint|foreign\s?keys?|primary\s?keys?|\bFKs?\b|\bJSONB\b|create\s+table|alter\s+table|add\s+(a\s+)?column|new\s+(table|model|column)|app\/models\/|\bBaseModel\b|DeclarativeBase|schema\.prisma|@@unique|natural\s+keys?|\bpgvector\b|\bTSVECTOR\b|\bDbTable\b)/i;function Q9($){return!!$&&i$.test($)}function t$($){return $.cluster??$.category??$.domain??null}function Z9($){let Q=$.map((Z)=>{let Y=[],X=t$(Z);if(!X||!X.trim())Y.push("category");if(Z.priority==null)Y.push("priority");return Y.length?` \u2022 "${Z.title?.trim()||"(untitled)"}" \u2014 missing ${Y.join(" + ")}`:null}).filter((Z)=>Z!==null);if(Q.length===0)return null;return"\u26D4 Every roadmap feature needs a category AND a priority \u2014 they drive grouping and ordering "+`on the board, and the user shouldn't have to add them by hand. Missing:
|
|
245
|
+
`});var S5={};d(S5,{provisionDb:()=>U$});import{createClient as t9}from"@libsql/client";import{drizzle as e9}from"drizzle-orm/libsql";import{migrate as $$}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as Q$}from"drizzle-orm/migrator";import{dirname as t0,join as Z$}from"path";import{fileURLToPath as J$}from"url";async function L0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function H$($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((Y)=>String(Y.name)))}async function z5($){if(!await L0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function W$($){for(let[Q,Z]of Object.entries(X$)){if(!await L0($,Q))continue;let Y=await H$($,Q);for(let X of Z){if(!Y.has(X))continue;await $.execute(`UPDATE "${Q}" SET "${X}" = CAST((julianday("${X}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${X}") = 'text'`)}}}async function U$($,Q=V$){let Z=t9({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;");let Y=await L0(Z,"__drizzle_migrations"),X=await L0(Z,"Node"),H=!1;if(X&&!Y){let P=Q$({migrationsFolder:Q})[0];if(P)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:[P.hash,P.folderMillis]}),H=!0}let W=await z5(Z);if(await $$(e9(Z),{migrationsFolder:Q}),await z5(Z)>W)H=!0;return await W$(Z),{migrated:H}}finally{Z.close()}}var Y$,V$,X$;var u5=o(async()=>{Y$=t0(t0(t0(J$(import.meta.url)))),V$=process.env.BEACON_MIGRATIONS_DIR||Z$(Y$,"drizzle"),X$={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});m0();import{existsSync as b9}from"fs";import{homedir as m9}from"os";import{join as E0}from"path";function p9(){return process.env.HOME||process.env.USERPROFILE||m9()}var I0=()=>E0(p9(),".claude"),o0=()=>E0(I0(),"skills"),n0=()=>E0(I0(),"settings.json"),a0=()=>E0(I0(),"CLAUDE.md"),r0="<!-- beacon:global:start -->",g5="<!-- beacon:global:end -->";var c9=B0,i0=[{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 l9($,Q){return C0(o0(),$,Q)}function y5($){return a(o0(),$)}function s9($){return v0(o0(),$)}function d9($){return K0(n0(),$)}function o9($){return N0(n0(),$)}function n9($){return M0(n0(),$)}function a9($){q0(a0(),r0,g5,$)}function x5(){return n(a0(),r0)}function r9(){return w0(a0(),r0,g5)}function CQ(){let $={};for(let Z of k)$[Z]=y5(Z);let Q={};for(let Z of i0)Q[Z.event]=o9({event:Z.event,command:Z.command});return{homeExists:b9(I0()),skills:$,hooks:Q,claudeMdBlock:x5()}}async function i9(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (u0(),S0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let P of k){if(!y5(P))X.push(P);l9(P,Y[P])}let H=0;for(let P of i0)if(d9({event:P.event,matcher:P.matcher,command:P.command}))H++;let W=x5();return a9(c9),{skillsAdded:X,hooksAdded:H,claudeMdBlockTouched:!W}}async function h5(){let $;try{$={ok:!0,...await i9()}}catch(Q){$={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Q=await Promise.resolve().then(() => (k5(),_5));if(Q.codexDetected())$.codex={ok:!0,...await Q.setupCodexAssets()}}catch(Q){$.codex={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return $}function vQ(){let $=[];for(let Y of k)if(s9(Y))$.push(Y);let Q=0;for(let Y of i0)if(n9(Y))Q++;let Z=r9();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as j$}from"async_hooks";import{spawnSync as P$}from"child_process";import{createHash as G$}from"crypto";import{existsSync as b5,mkdirSync as T0,readFileSync as m5,writeFileSync as p5}from"fs";import{homedir as B$}from"os";import{basename as K$,join as m}from"path";function e(){return process.env.BEACON_HOME||m(B$(),".beacon")}function e0(){return m(e(),"workspaces.json")}function _0($){return G$("sha256").update($).digest("hex").slice(0,12)}function c5($=process.cwd()){let Q=P$("git",["rev-parse","--show-toplevel"],{cwd:$,stdio:["ignore","pipe","ignore"]});if(Q.status===0){let Z=Q.stdout?.toString().trim();if(Z)return Z}return $}function $5($){return m(e(),$)}function Q5($){return`file:${m($5($),"db.sqlite")}`}function $0(){try{let $=JSON.parse(m5(e0(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function Z5($){T0(e(),{recursive:!0}),p5(e0(),JSON.stringify($,null,2))}function N$(){return $0().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function y($){return $0().find((Q)=>Q.id===$)??null}function J5($,Q,Z=new Date().toISOString()){let Y=_0($),X=$0(),H=X.find((U)=>U.id===Y),W={id:Y,path:$,name:Q||H?.name||K$($),lastOpenedAt:Z},P=[W,...X.filter((U)=>U.id!==Y)];return T0($5(Y),{recursive:!0}),Z5(P),W}function xQ($,Q=new Date().toISOString()){let Z=$0(),Y=Z.find((X)=>X.id===$);if(!Y)return;Y.lastOpenedAt=Q,Z5(Z)}function hQ($){if(Z5($0().filter((Q)=>Q.id!==$)),Q0()===$)M$(N$()[0]?.id??null)}function l5(){return m(e(),"active")}function Q0(){try{return m5(l5(),"utf8").trim()||null}catch{return null}}function M$($){T0(e(),{recursive:!0}),p5(l5(),$??"")}function zQ(){let $=Q0();return $?y($):null}function SQ(){let $=V5()??Q0();return $?y($):null}function uQ($){return y($)?.path??null}function fQ(){return b5(e0())}var s5="beacon_ws";function d5($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let Y of Z.split(";")){let X=Y.indexOf("=");if(X===-1)continue;if(Y.slice(0,X).trim()===Q)return decodeURIComponent(Y.slice(X+1).trim())}return null}function bQ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&y(Q))return Q;let Z=d5($,s5);if(Z&&y(Z))return Z;return null}var Y5="x-beacon-workspace-path";async function mQ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&y(Q))return Q;let Z=$.headers.get(Y5);if(Z&&(!Q||_0(Z)===Q)){let X=J5(Z);return await X5(X.id),X.id}let Y=d5($,s5);if(Y&&y(Y))return Y;return null}var o5=new j$;function q$($,Q){return $?o5.run($,Q):Q()}function V5(){return o5.getStore()??null}var f5=new Set;async function X5($){let Q=$5($),Z=m(Q,"db.sqlite"),Y=b5(Z);if(Y&&f5.has(Z))return{ok:!0,created:!1,migrated:!1};try{T0(Q,{recursive:!0});let{provisionDb:X}=await u5().then(() => S5),H=await X(Q5($));return f5.add(Z),{ok:!0,created:!Y,migrated:Y&&H.migrated}}catch(X){return{ok:!1,created:!1,migrated:!1,error:X instanceof Error?X.message:String(X)}}}import{McpServer as e$,ResourceTemplate as K5}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as $Q}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as G}from"zod";var w$=new Set(["GET","HEAD","OPTIONS"]);function n5($){return w$.has($.trim().toUpperCase())?"read":"write"}var C$=G.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},G.object({name:G.string().trim().min(1),type:G.string().trim().min(1),isPk:G.boolean().optional(),isFk:G.boolean().optional(),nullable:G.boolean().optional(),note:G.string().nullish()})),a5=G.object({name:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),columns:G.array(C$).default([])}),r5=G.object({fromTable:G.string(),fromColumn:G.string(),toTable:G.string(),toColumn:G.string(),label:G.string().nullish()}),i5=G.object({method:G.string().trim().min(1),path:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),uses:G.array(G.object({table:G.string().trim().min(1),access:G.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??n5($.method)}))})),dQ=G.object({tables:G.array(a5).default([]),relations:G.array(r5).default([]),endpoints:G.array(i5).default([])});import{z as D}from"zod";import{and as BZ,eq as KZ,inArray as NZ}from"drizzle-orm";import{drizzle as c$}from"drizzle-orm/libsql";import{createClient as l$}from"@libsql/client";var H5={};d(H5,{tag:()=>p,syncState:()=>D$,projectMeta:()=>E$,note:()=>F$,nodeTags:()=>x,nodeFile:()=>Z0,node:()=>K,endpointTable:()=>z,endpoint:()=>c,edge:()=>g,draftTable:()=>A,draftRelation:()=>S,draftColumn:()=>V0,dbTable:()=>v,dbRelation:()=>h,dbColumn:()=>Y0,codeFileEdge:()=>u,codeFile:()=>T,bugFlag:()=>J0,boardAnnotation:()=>R$,appSetting:()=>A$});import{sqliteTable as q,index as N,foreignKey as v$,text as V,integer as j,real as R,uniqueIndex as _,primaryKey as O$}from"drizzle-orm/sqlite-core";import{createId as O}from"@paralleldrive/cuid2";var K=q("Node",{id:V().primaryKey().$defaultFn(()=>O()),view:V().notNull(),kind:V().default("FEATURE").notNull(),cluster:V(),title:V().notNull(),role:V(),plain:V(),status:V().default("PENDING").notNull(),priority:j().default(2).notNull(),progress:j().default(0).notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),sourceRef:V(),externalId:V(),source:V().default("MANUAL").notNull(),parentId:V(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Node_cluster_idx").on($.cluster),N("Node_parentId_idx").on($.parentId),N("Node_view_idx").on($.view),v$(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),Z0=q("NodeFile",{id:V().primaryKey().$defaultFn(()=>O()),nodeId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),path:V().notNull()},($)=>[_("NodeFile_nodeId_path_key").on($.nodeId,$.path),N("NodeFile_nodeId_idx").on($.nodeId)]),p=q("Tag",{id:V().primaryKey().$defaultFn(()=>O()),label:V().notNull(),color:V()},($)=>[_("Tag_label_key").on($.label)]),g=q("Edge",{id:V().primaryKey().$defaultFn(()=>O()),fromId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:V().default("DEPENDS").notNull(),label:V(),sourceHandle:V(),targetHandle:V()},($)=>[_("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),N("Edge_toId_idx").on($.toId),N("Edge_fromId_idx").on($.fromId)]),x=q("_NodeTags",{a:V("A").notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),b:V("B").notNull().references(()=>p.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[_("_NodeTags_AB_unique").on($.a,$.b),N("_NodeTags_B_index").on($.b)]),F$=q("Note",{id:V().primaryKey().$defaultFn(()=>O()),title:V().default("Untitled").notNull(),body:V().default("").notNull(),ord:R().default(0).notNull(),pinned:j({mode:"boolean"}).default(!1).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Note_updatedAt_idx").on($.updatedAt)]),R$=q("BoardAnnotation",{id:V().primaryKey().$defaultFn(()=>O()),targetKind:V().notNull(),targetId:V().notNull(),columnName:V(),body:V().default("").notNull(),x:R(),y:R(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("BoardAnnotation_target_idx").on($.targetId)]),J0=q("BugFlag",{id:V().primaryKey().$defaultFn(()=>O()),nodeId:V().notNull().references(()=>K.id,{onDelete:"cascade",onUpdate:"cascade"}),by:V().notNull(),note:V().notNull(),resolvedAt:j({mode:"timestamp_ms"}),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[N("BugFlag_nodeId_idx").on($.nodeId)]),v=q("DbTable",{id:V().primaryKey().$defaultFn(()=>O()),name:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("DbTable_domain_idx").on($.domain),_("DbTable_name_key").on($.name)]),Y0=q("DbColumn",{id:V().primaryKey().$defaultFn(()=>O()),tableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:V(),ord:j().default(0).notNull()},($)=>[_("DbColumn_tableId_name_key").on($.tableId,$.name),N("DbColumn_tableId_idx").on($.tableId)]),h=q("DbRelation",{id:V().primaryKey().$defaultFn(()=>O()),fromTableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DbRelation_toTableId_idx").on($.toTableId),N("DbRelation_fromTableId_idx").on($.fromTableId)]),c=q("Endpoint",{id:V().primaryKey().$defaultFn(()=>O()),method:V().notNull(),path:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[_("Endpoint_method_path_key").on($.method,$.path),N("Endpoint_domain_idx").on($.domain)]),z=q("EndpointTable",{id:V().primaryKey().$defaultFn(()=>O()),endpointId:V().notNull().references(()=>c.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:V().notNull().references(()=>v.id,{onDelete:"cascade",onUpdate:"cascade"}),access:V().default("read").notNull()},($)=>[_("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),N("EndpointTable_tableId_idx").on($.tableId)]),A=q("DraftTable",{id:V().primaryKey().$defaultFn(()=>O()),name:V().notNull(),domain:V(),description:V(),x:R().default(0).notNull(),y:R().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[_("DraftTable_name_key").on($.name)]),V0=q("DraftColumn",{id:V().primaryKey().$defaultFn(()=>O()),tableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:V(),ord:j().default(0).notNull()},($)=>[N("DraftColumn_tableId_idx").on($.tableId)]),S=q("DraftRelation",{id:V().primaryKey().$defaultFn(()=>O()),fromTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DraftRelation_toTableId_idx").on($.toTableId),N("DraftRelation_fromTableId_idx").on($.fromTableId)]),T=q("CodeFile",{path:V().primaryKey(),root:V(),lang:V(),x:R().default(0).notNull(),y:R().default(0).notNull(),mtimeMs:R(),size:j(),inDegree:j().default(0).notNull(),outDegree:j().default(0).notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),u=q("CodeFileEdge",{fromPath:V().notNull().references(()=>T.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:V().notNull().references(()=>T.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:j({mode:"boolean"}).default(!1).notNull()},($)=>[N("CodeFileEdge_circular_idx").on($.circular),N("CodeFileEdge_toPath_idx").on($.toPath),N("CodeFileEdge_fromPath_idx").on($.fromPath),O$({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),D$=q("SyncState",{id:V().primaryKey().default("singleton"),version:j().default(0).notNull(),codeGraphSyncedAt:j({mode:"timestamp_ms"}),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),A$=q("AppSetting",{id:V().primaryKey().default("singleton"),editor:V().default("auto").notNull(),currentFeatureId:V(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),E$=q("ProjectMeta",{id:V().primaryKey().default("singleton"),overview:V(),conventions:V().default("[]").notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)});var W5={};d(W5,{tagRelations:()=>_$,nodeTagsRelations:()=>k$,nodeRelations:()=>I$,nodeFileRelations:()=>L$,endpointTableRelations:()=>S$,endpointRelations:()=>z$,edgeRelations:()=>g$,draftTableRelations:()=>u$,draftRelationRelations:()=>b$,draftColumnRelations:()=>f$,dbTableRelations:()=>y$,dbRelationRelations:()=>h$,dbColumnRelations:()=>x$,codeFileRelations:()=>m$,codeFileEdgeRelations:()=>p$,bugFlagRelations:()=>T$});import{relations as C}from"drizzle-orm";var I$=C(K,({one:$,many:Q})=>({files:Q(Z0),bugFlags:Q(J0),nodeTags:Q(x),edgesOut:Q(g,{relationName:"EdgeFrom"}),edgesIn:Q(g,{relationName:"EdgeTo"}),parent:$(K,{fields:[K.parentId],references:[K.id],relationName:"NodeTree"}),children:Q(K,{relationName:"NodeTree"})})),L$=C(Z0,({one:$})=>({node:$(K,{fields:[Z0.nodeId],references:[K.id]})})),T$=C(J0,({one:$})=>({node:$(K,{fields:[J0.nodeId],references:[K.id]})})),_$=C(p,({many:$})=>({nodeTags:$(x)})),k$=C(x,({one:$})=>({node:$(K,{fields:[x.a],references:[K.id]}),tag:$(p,{fields:[x.b],references:[p.id]})})),g$=C(g,({one:$})=>({from:$(K,{fields:[g.fromId],references:[K.id],relationName:"EdgeFrom"}),to:$(K,{fields:[g.toId],references:[K.id],relationName:"EdgeTo"})})),y$=C(v,({many:$})=>({columns:$(Y0),fksOut:$(h,{relationName:"FkFrom"}),fksIn:$(h,{relationName:"FkTo"}),usages:$(z)})),x$=C(Y0,({one:$})=>({table:$(v,{fields:[Y0.tableId],references:[v.id]})})),h$=C(h,({one:$})=>({fromTable:$(v,{fields:[h.fromTableId],references:[v.id],relationName:"FkFrom"}),toTable:$(v,{fields:[h.toTableId],references:[v.id],relationName:"FkTo"})})),z$=C(c,({many:$})=>({tables:$(z)})),S$=C(z,({one:$})=>({endpoint:$(c,{fields:[z.endpointId],references:[c.id]}),table:$(v,{fields:[z.tableId],references:[v.id]})})),u$=C(A,({many:$})=>({columns:$(V0),fksOut:$(S,{relationName:"DraftFkFrom"}),fksIn:$(S,{relationName:"DraftFkTo"})})),f$=C(V0,({one:$})=>({table:$(A,{fields:[V0.tableId],references:[A.id]})})),b$=C(S,({one:$})=>({fromTable:$(A,{fields:[S.fromTableId],references:[A.id],relationName:"DraftFkFrom"}),toTable:$(A,{fields:[S.toTableId],references:[A.id],relationName:"DraftFkTo"})})),m$=C(T,({many:$})=>({edgesOut:$(u,{relationName:"CFEFrom"}),edgesIn:$(u,{relationName:"CFETo"})})),p$=C(u,({one:$})=>({fromFile:$(T,{fields:[u.fromPath],references:[T.path],relationName:"CFEFrom"}),toFile:$(T,{fields:[u.toPath],references:[T.path],relationName:"CFETo"})}));var s$={...H5,...W5};function d$(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var o$=d$();function e5($){let Q=l$({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),c$(Q,{schema:s$})}var j5=globalThis,U5=j5.dzDefault??e5(o$);j5.dzDefault=U5;var t5=j5.dzByUrl??=new Map;function n$($){let Q=t5.get($);if(!Q)Q=e5($),t5.set($,Q);return Q}function a$(){if(process.env.BEACON_REPO)return U5;let $=V5()??Q0();if(!$)return U5;return n$(Q5($))}var r$=new Proxy({},{get($,Q){let Z=a$(),Y=Z[Q];return typeof Y==="function"?Y.bind(Z):Y}});import{forceCenter as YZ,forceCollide as VZ,forceLink as XZ,forceManyBody as HZ,forceSimulation as WZ}from"d3-force";var $9=D.object({title:D.string().trim().min(1),role:D.string().nullish(),plain:D.string().nullish(),cluster:D.string().nullish(),category:D.string().nullish(),domain:D.string().nullish(),priority:D.number().nullish(),kind:D.string().nullish(),dependsOn:D.array(D.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,kind:Y,...X})=>({...X,cluster:X.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z))),kind:Y?.trim().toUpperCase()==="BUG"?"BUG":"FEATURE"})),CZ=D.object({features:D.array($9).default([])});var i$=/(\bmigrations?\b|\balembic\b|make revision|prisma migrate|unique\s?constraint|foreign\s?keys?|primary\s?keys?|\bFKs?\b|\bJSONB\b|create\s+table|alter\s+table|add\s+(a\s+)?column|new\s+(table|model|column)|app\/models\/|\bBaseModel\b|DeclarativeBase|schema\.prisma|@@unique|natural\s+keys?|\bpgvector\b|\bTSVECTOR\b|\bDbTable\b)/i;function Q9($){return!!$&&i$.test($)}function t$($){return $.cluster??$.category??$.domain??null}function Z9($){let Q=$.map((Z)=>{let Y=[],X=t$(Z);if(!X||!X.trim())Y.push("category");if(Z.priority==null)Y.push("priority");return Y.length?` \u2022 "${Z.title?.trim()||"(untitled)"}" \u2014 missing ${Y.join(" + ")}`:null}).filter((Z)=>Z!==null);if(Q.length===0)return null;return"\u26D4 Every roadmap feature needs a category AND a priority \u2014 they drive grouping and ordering "+`on the board, and the user shouldn't have to add them by hand. Missing:
|
|
244
246
|
`+Q.join(`
|
|
245
247
|
`)+"\n\nRe-present with each feature carrying its category as `category` (or `cluster` \u2014 both "+"work; e.g. AUTH, SEARCH, DATA, INTEL, BILLING \u2026) and `priority` (0 = P0 critical, 1 = P1 "+"high, 2 = P2 medium, 3 = P3 low). Set BOTH on EVERY feature; don't rely on defaults."}function P5($){if(!$?.length)return"";let Q=$.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),Z=$.some((Y)=>Y.id);return`
|
|
246
248
|
|
|
247
249
|
This plan created these roadmap feature(s):
|
|
248
250
|
`+Q.join(`
|
|
249
251
|
`)+"\n\nWhen the work ships, register them in ONE call: `beacon_describe_feature` with a "+"`features` array \u2014 one entry per feature"+(Z?", 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."}var G5=1500,TZ=345600000,B5=1800000,J9=3000;function X0($){return $.toLowerCase().normalize("NFD").replace(/[\u0300-\u036F]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50)||"item"}function Y9($){return`${X0($.title)}-${$.id.slice(-6)}`}function V9($){return{resources:$.map((Q)=>({uri:`note://${Y9(Q)}`,name:Q.title||"Untitled",description:`${Q.title||"Untitled"}${Q.pinned?" \xB7 pinned":""} \xB7 note`,mimeType:"text/markdown"}))}}function X9($,Q){return $.find((Z)=>Y9(Z)===Q)}function H9($){let Q=$.body.trim()||"(this note is empty)";return[`# ${$.title||"Untitled"}`,"","_User note from Beacon. To turn it into roadmap work, call `beacon_propose_plan` \u2014"+" checkbox `- [ ]` / `- [x]` items become subtasks, and order the features with `dependsOn`. Do NOT implement until it returns approval._","","---","",Q].join(`
|
|
250
|
-
`)}await h5();var N5=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`,M5=c5(),y0=_0(M5);try{J5(M5);let $=await X5(y0);if(!$.ok)console.error(`[beacon mcp] db provisioning failed: ${$.error}`)}catch($){console.error(`[beacon mcp] workspace registration failed: ${$ instanceof Error?$.message:$}`)}async function E($,Q){let Z=new Headers(Q?.headers);Z.set("x-beacon-workspace",y0),Z.set(Y5,M5);let Y=await fetch(`${N5}${$}`,{...Q,headers:Z}),X=await Y.text();if(!Y.ok)throw Error(`Beacon ${$} -> ${Y.status} ${X}`);return X?JSON.parse(X):null}function l($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function j9($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let Y=JSON.parse(Z[0]);if(Y?.error)return{content:[{type:"text",text:Y.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var F=new e$({name:"beacon",version:"0.1.0"});F.registerTool("beacon_map",{description:"List existing features on the roadmap. Call before starting work."},async()=>{let $=await E("/api/map");return{content:[{type:"text",text:JSON.stringify($)}]}});F.registerTool("beacon_start_feature",{description:"Flag that you're working on a feature. If the title matches an existing feature it just marks it IN_PROGRESS (no category needed); if it's NEW it creates the node \u2014 and a new feature REQUIRES a `category`. Call beacon_map first so you reuse an existing feature/category instead of duplicating one.",inputSchema:{title:J.string(),id:J.string().optional().describe("node id from beacon_map (preferred)"),category:J.string().optional().describe("Domain lane for a NEW feature: AUTH | SEARCH | DATA | INTEL | BILLING | INFRA | UI | \u2026 REQUIRED when this creates a new top-level feature; reuse a category already on the board. Ignored when flagging an existing feature or nesting under a `front` (inherits the parent's)."),front:J.string().optional().describe("Title of an EXISTING parent feature to nest this under (draws the parent \u2192 child edge). It must match a real feature \u2014 it is NOT a domain tag (use `category` for the domain). A `front` that matches nothing is REJECTED; create the parent first via beacon_propose_plan."),detail:J.string().optional().describe("One-line plain-language description shown on the canvas card. Replaced later by beacon_describe_feature's markdown when the work is done.")}},async({title:$,id:Q,front:Z,detail:Y,category:X})=>{try{let H=await l("/api/map/start",{title:$,id:Q,front:Z,detail:Y,category:X});return{content:[{type:"text",text:JSON.stringify(H)}]}}catch(H){return j9(H)}});F.registerTool("beacon_add_subtasks",{description:"Add N sub-tasks under an existing feature in one call. Use when the user says 'add these as subtasks to <feature>' or you want to record follow-ups discovered during work. Parent resolves by `parentId` (preferred \u2014 get it from beacon_map / beacon_entities) or by `parentTitle` (fuzzy-matched against top-level features). Children inherit the parent's view and cluster and land in a row beneath it; bumps the sync version so an open /map canvas refreshes.",inputSchema:{parentId:J.string().optional().describe("node id of the parent feature (preferred)"),parentTitle:J.string().optional().describe("fuzzy title of the parent feature; ignored if parentId is provided"),items:J.array(J.object({title:J.string().describe("short sub-task title"),plain:J.string().optional().describe("one-paragraph description / why / acceptance hint")})).describe("the sub-tasks to add")}},async({parentId:$,parentTitle:Q,items:Z})=>{try{let Y=await l("/api/nodes/subtasks",{parentId:$,parentTitle:Q,items:Z});return{content:[{type:"text",text:JSON.stringify(Y)}]}}catch(Y){return j9(Y)}});var W9=J.array(J.object({title:J.string().describe("real component/subsystem name (e.g. 'Plan review loop') \u2014 NEVER a file"),domain:J.string().describe("uppercase lane: PLAN | DATA | UI | MCP | INTEL | \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),status:J.enum(["KEEP","REBUILD","REPLACE","DROP"]).optional(),files:J.array(J.string()).optional(),depends:J.array(J.string()).optional().describe("titles of components this one depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found in this component's code \u2014 flagged on the node (by=agent); identical open flags are not duplicated")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file");F.registerTool("beacon_describe_feature",{description:"Register shipped feature(s) at the end of the work: marks status=DONE, records the files touched (kept on the FEATURE for context), and replaces each node's description with your markdown. Subsumes touch_files + finish_feature. A feature's unfinished SUB-TASKS are completed along with it (cascade; reported as `subtasksCompleted`) \u2014 if a sub-task is genuinely NOT done, set it BLOCKED or CANCELLED via the nodes API/board FIRST, those are left alone (`subtasksBlocked` lists what stayed). REGISTER ALL FEATURES A PLAN CREATED IN ONE CALL via the `features` array (one entry per feature) \u2014 do NOT call this once per feature. Pass each feature's `id` (returned to you at plan approval) so no title-matching is needed. For a single feature you may pass the top-level fields instead. Pass `architecture` only when a feature added/changed a REAL subsystem (never a file).",inputSchema:{features:J.array(J.object({id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),description:J.string().describe("Markdown: ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches"),architecture:W9})).optional().describe("Register many features at once \u2014 one entry per feature, each id-keyed. Use this instead of N separate calls."),description:J.string().optional().describe("Single-feature markdown (omit when using `features`): ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches (single form)"),id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),architecture:W9}},async({features:$,description:Q,files:Z,id:Y,title:X,architecture:H})=>{let W=$?.length?{features:$}:{description:Q,files:Z,id:Y,title:X,architecture:H},P=await l("/api/map/describe",W);return{content:[{type:"text",text:JSON.stringify(P)}]}});F.registerTool("beacon_init_persist",{description:"Use ONLY inside the `beacon-init` skill. After YOU (Claude Code) have read the repo and built the architecture analysis, call this once to persist it into Beacon. Replaces any prior init-derived map. Same DB shape as `beacon_propose_plan` for tables/endpoints, but it commits directly (no /plan review step) because the user explicitly invoked init.",inputSchema:{overview:J.string().optional().describe("one-paragraph summary of the project \u2014 written to ProjectMeta + AGENTS.md"),conventions:J.array(J.string()).optional().describe("3-8 concrete conventions/gotchas a contributor must follow"),components:J.array(J.object({title:J.string(),domain:J.string().describe("short UPPERCASE area: AUTH, API, DATA, UI, JOBS, INFRA, \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),files:J.array(J.string()).optional().describe("repo-relative key files"),depends:J.array(J.string()).optional().describe("titles of other components it depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found while examining this component \u2014 flagged on the node (by=agent)")})).describe("8-25 main building blocks, not every file"),roadmap:J.array(J.object({title:J.string(),why:J.string().optional(),category:J.string().optional().describe("category for the board (AUTH | SEARCH | DATA | INTEL | \u2026) \u2014 set it so the item isn't category-less"),priority:J.number().int().min(0).max(3).optional().describe("0=P0 critical .. 3=P3 low")})).optional().describe("3-6 broad strategic directions (NOT detailed tasks); each with a `category` + `priority`. Re-runs DEDUPE roadmap features by title, so re-persisting won't double up existing ones."),snapshot:J.object({tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string(),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}).optional().describe("optional: also seed /db with the schema you discovered from prisma/SQLAlchemy/etc.")}},async($)=>{let Q=await l("/api/init",$);return{content:[{type:"text",text:JSON.stringify(Q)}]}});F.registerTool("beacon_context_for_feature",{description:"Use BEFORE Glob/Grep/Read when starting work on a feature. Returns a single bundle of everything Beacon knows about it: attached files, what those files import + what imports them (1-hop blast radius from the live code graph), endpoints in the feature's domain + the tables each touches, those tables' FK relations, sibling architecture components, and the project's conventions. Saves an entire discovery-phase round of file reads. Match by id (preferred), exact title, or a natural-language query.",inputSchema:{id:J.string().optional().describe("node id from beacon_map (preferred)"),title:J.string().optional().describe("feature title (case-insensitive contains)"),query:J.string().optional().describe("natural-language phrase \u2014 OR-matched against title + plain description")}},async({id:$,title:Q,query:Z})=>{let Y=new URLSearchParams;if($)Y.set("id",$);if(Q)Y.set("title",Q);if(Z)Y.set("query",Z);let X=await E(`/api/context/feature?${Y.toString()}`);return{content:[{type:"text",text:JSON.stringify(X)}]}});F.registerTool("beacon_blast_radius",{description:"For 'if I change this file, what else cares?' \u2014 returns the file's 1-hop imports + importedBy, the TRANSITIVE blast radius both directions (downstream = who depends on it, upstream = what it depends on, grouped by depth), hub/centrality scoring (inDegree/outDegree + isHub), and every feature/component that has the file attached. Use mid-feature when deciding the impact of a change, or before refactoring a hub file.",inputSchema:{path:J.string().describe("repo-relative POSIX file path"),depth:J.number().optional().describe("how far to walk the transitive graph (default 2, capped at 5)")}},async({path:$,depth:Q})=>{let Z=new URLSearchParams({path:$});if(Q!=null)Z.set("depth",String(Q));let Y=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(Y)}]}});F.registerTool("beacon_entities",{description:"Read planning data. `features` = roadmap, `architecture` = components, `tables`/`endpoints` = DB map.",inputSchema:{kind:J.enum(["features","architecture","tables","endpoints"])}},async({kind:$})=>{let Q=await E(`/api/entities?kind=${$}`);return{content:[{type:"text",text:JSON.stringify(Q)}]}});F.registerTool("beacon_propose_plan",{description:"BLOCKS until the user reviews. Pushes a feature plan (top-level roadmap features + DB tables + endpoints) to Beacon's /plan page. Use when the user asks you to plan a feature. EVERY feature MUST include `cluster` (its category) and `priority` (0=P0 critical .. 3=P3 low) \u2014 the tool REJECTS a plan whose features omit either, so set both on every feature. Do not implement code or migrations until this returns approval. If it returns inline feedback, revise and call again.",inputSchema:{description:J.string().describe("Short summary the user will see in the review header"),features:J.array(J.object({title:J.string(),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence for the user"),category:J.string().optional().describe("REQUIRED category for the board (AUTH | SEARCH | BILLING | DATA | INTEL | \u2026)"),cluster:J.string().optional().describe("alias for `category`"),domain:J.string().optional().describe("alias for `category`"),priority:J.number().int().min(0).max(3).optional().describe("REQUIRED priority: 0=P0 critical, 1=P1 high, 2=P2 medium, 3=P3 low"),dependsOn:J.array(J.string()).optional().describe("titles of other features in THIS plan that must ship first \u2014 drawn as 'depends on' links so the board shows the dependency chain, not loose cards")})).optional().describe("the top-level roadmap features this plan adds"),tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string().describe("GET|POST|PUT|PATCH|DELETE"),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}},async({description:$,features:Q,tables:Z,relations:Y,endpoints:X})=>{let H=(M)=>new Promise((N9)=>setTimeout(N9,M)),W=(M)=>({content:[{type:"text",text:M}]}),P=(Z?.length??0)>0,U=(Q??[]).map((M)=>`${M.title} ${M.role??""} ${M.plain??""}`).join(`
|
|
252
|
+
`)}await h5();var N5=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`,M5=c5(),y0=_0(M5);try{J5(M5);let $=await X5(y0);if(!$.ok)console.error(`[beacon mcp] db provisioning failed: ${$.error}`)}catch($){console.error(`[beacon mcp] workspace registration failed: ${$ instanceof Error?$.message:$}`)}async function E($,Q){let Z=new Headers(Q?.headers);Z.set("x-beacon-workspace",y0),Z.set(Y5,M5);let Y=await fetch(`${N5}${$}`,{...Q,headers:Z}),X=await Y.text();if(!Y.ok)throw Error(`Beacon ${$} -> ${Y.status} ${X}`);return X?JSON.parse(X):null}function l($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function j9($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let Y=JSON.parse(Z[0]);if(Y?.error)return{content:[{type:"text",text:Y.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var F=new e$({name:"beacon",version:"0.1.0"});F.registerTool("beacon_map",{description:"List existing features on the roadmap. Call before starting work."},async()=>{let $=await E("/api/map");return{content:[{type:"text",text:JSON.stringify($)}]}});F.registerTool("beacon_start_feature",{description:"Flag that you're working on a feature. If the title matches an existing feature it just marks it IN_PROGRESS (no category needed); if it's NEW it creates the node \u2014 and a new feature REQUIRES a `category`. Call beacon_map first so you reuse an existing feature/category instead of duplicating one.",inputSchema:{title:J.string(),id:J.string().optional().describe("node id from beacon_map (preferred)"),category:J.string().optional().describe("Domain lane for a NEW feature: AUTH | SEARCH | DATA | INTEL | BILLING | INFRA | UI | \u2026 REQUIRED when this creates a new top-level feature; reuse a category already on the board. Ignored when flagging an existing feature or nesting under a `front` (inherits the parent's)."),front:J.string().optional().describe("Title of an EXISTING parent feature to nest this under (draws the parent \u2192 child edge). It must match a real feature \u2014 it is NOT a domain tag (use `category` for the domain). A `front` that matches nothing is REJECTED; create the parent first via beacon_propose_plan."),detail:J.string().optional().describe("One-line plain-language description shown on the canvas card. Replaced later by beacon_describe_feature's markdown when the work is done."),kind:J.enum(["FEATURE","BUG"]).optional().describe("Card type when this CREATES a new node: BUG renders a typed bug card on the roadmap (use when the user is starting work on a bug, not a feature). Defaults to FEATURE; ignored when flagging an existing node.")}},async({title:$,id:Q,front:Z,detail:Y,category:X,kind:H})=>{try{let W=await l("/api/map/start",{title:$,id:Q,front:Z,detail:Y,category:X,kind:H});return{content:[{type:"text",text:JSON.stringify(W)}]}}catch(W){return j9(W)}});F.registerTool("beacon_add_subtasks",{description:"Add N sub-tasks under an existing feature in one call. Use when the user says 'add these as subtasks to <feature>' or you want to record follow-ups discovered during work. Parent resolves by `parentId` (preferred \u2014 get it from beacon_map / beacon_entities) or by `parentTitle` (fuzzy-matched against top-level features). Children inherit the parent's view and cluster and land in a row beneath it; bumps the sync version so an open /map canvas refreshes.",inputSchema:{parentId:J.string().optional().describe("node id of the parent feature (preferred)"),parentTitle:J.string().optional().describe("fuzzy title of the parent feature; ignored if parentId is provided"),items:J.array(J.object({title:J.string().describe("short sub-task title"),plain:J.string().optional().describe("one-paragraph description / why / acceptance hint"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG for a bug discovered during work \u2014 renders as a typed bug card; defaults to FEATURE")})).describe("the sub-tasks to add")}},async({parentId:$,parentTitle:Q,items:Z})=>{try{let Y=await l("/api/nodes/subtasks",{parentId:$,parentTitle:Q,items:Z});return{content:[{type:"text",text:JSON.stringify(Y)}]}}catch(Y){return j9(Y)}});var W9=J.array(J.object({title:J.string().describe("real component/subsystem name (e.g. 'Plan review loop') \u2014 NEVER a file"),domain:J.string().describe("uppercase lane: PLAN | DATA | UI | MCP | INTEL | \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),status:J.enum(["KEEP","REBUILD","REPLACE","DROP"]).optional(),files:J.array(J.string()).optional(),depends:J.array(J.string()).optional().describe("titles of components this one depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found in this component's code \u2014 flagged on the node (by=agent); identical open flags are not duplicated")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file");F.registerTool("beacon_describe_feature",{description:"Register shipped feature(s) at the end of the work: marks status=DONE, records the files touched (kept on the FEATURE for context), and replaces each node's description with your markdown. Subsumes touch_files + finish_feature. A feature's unfinished SUB-TASKS are completed along with it (cascade; reported as `subtasksCompleted`) \u2014 if a sub-task is genuinely NOT done, set it BLOCKED or CANCELLED via the nodes API/board FIRST, those are left alone (`subtasksBlocked` lists what stayed). REGISTER ALL FEATURES A PLAN CREATED IN ONE CALL via the `features` array (one entry per feature) \u2014 do NOT call this once per feature. Pass each feature's `id` (returned to you at plan approval) so no title-matching is needed. For a single feature you may pass the top-level fields instead. Pass `architecture` only when a feature added/changed a REAL subsystem (never a file).",inputSchema:{features:J.array(J.object({id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),description:J.string().describe("Markdown: ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches"),architecture:W9})).optional().describe("Register many features at once \u2014 one entry per feature, each id-keyed. Use this instead of N separate calls."),description:J.string().optional().describe("Single-feature markdown (omit when using `features`): ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches (single form)"),id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),architecture:W9}},async({features:$,description:Q,files:Z,id:Y,title:X,architecture:H})=>{let W=$?.length?{features:$}:{description:Q,files:Z,id:Y,title:X,architecture:H},P=await l("/api/map/describe",W);return{content:[{type:"text",text:JSON.stringify(P)}]}});F.registerTool("beacon_init_persist",{description:"Use ONLY inside the `beacon-init` skill. After YOU (Claude Code) have read the repo and built the architecture analysis, call this once to persist it into Beacon. Replaces any prior init-derived map. Same DB shape as `beacon_propose_plan` for tables/endpoints, but it commits directly (no /plan review step) because the user explicitly invoked init.",inputSchema:{overview:J.string().optional().describe("one-paragraph summary of the project \u2014 written to ProjectMeta + AGENTS.md"),conventions:J.array(J.string()).optional().describe("3-8 concrete conventions/gotchas a contributor must follow"),components:J.array(J.object({title:J.string(),domain:J.string().describe("short UPPERCASE area: AUTH, API, DATA, UI, JOBS, INFRA, \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),files:J.array(J.string()).optional().describe("repo-relative key files"),depends:J.array(J.string()).optional().describe("titles of other components it depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found while examining this component \u2014 flagged on the node (by=agent)")})).describe("8-25 main building blocks, not every file"),roadmap:J.array(J.object({title:J.string(),why:J.string().optional(),category:J.string().optional().describe("category for the board (AUTH | SEARCH | DATA | INTEL | \u2026) \u2014 set it so the item isn't category-less"),priority:J.number().int().min(0).max(3).optional().describe("0=P0 critical .. 3=P3 low"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when the survey found a concrete bug to fix \u2014 renders as a typed bug card; defaults to FEATURE")})).optional().describe("3-6 broad strategic directions (NOT detailed tasks); each with a `category` + `priority`. Re-runs DEDUPE roadmap features by title, so re-persisting won't double up existing ones."),snapshot:J.object({tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string(),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}).optional().describe("optional: also seed /db with the schema you discovered from prisma/SQLAlchemy/etc.")}},async($)=>{let Q=await l("/api/init",$);return{content:[{type:"text",text:JSON.stringify(Q)}]}});F.registerTool("beacon_context_for_feature",{description:"Use BEFORE Glob/Grep/Read when starting work on a feature. Returns a single bundle of everything Beacon knows about it: attached files, what those files import + what imports them (1-hop blast radius from the live code graph), endpoints in the feature's domain + the tables each touches, those tables' FK relations, sibling architecture components, and the project's conventions. Saves an entire discovery-phase round of file reads. Match by id (preferred), exact title, or a natural-language query.",inputSchema:{id:J.string().optional().describe("node id from beacon_map (preferred)"),title:J.string().optional().describe("feature title (case-insensitive contains)"),query:J.string().optional().describe("natural-language phrase \u2014 OR-matched against title + plain description")}},async({id:$,title:Q,query:Z})=>{let Y=new URLSearchParams;if($)Y.set("id",$);if(Q)Y.set("title",Q);if(Z)Y.set("query",Z);let X=await E(`/api/context/feature?${Y.toString()}`);return{content:[{type:"text",text:JSON.stringify(X)}]}});F.registerTool("beacon_blast_radius",{description:"For 'if I change this file, what else cares?' \u2014 returns the file's 1-hop imports + importedBy, the TRANSITIVE blast radius both directions (downstream = who depends on it, upstream = what it depends on, grouped by depth), hub/centrality scoring (inDegree/outDegree + isHub), and every feature/component that has the file attached. Use mid-feature when deciding the impact of a change, or before refactoring a hub file.",inputSchema:{path:J.string().describe("repo-relative POSIX file path"),depth:J.number().optional().describe("how far to walk the transitive graph (default 2, capped at 5)")}},async({path:$,depth:Q})=>{let Z=new URLSearchParams({path:$});if(Q!=null)Z.set("depth",String(Q));let Y=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(Y)}]}});F.registerTool("beacon_entities",{description:"Read planning data. `features` = roadmap, `architecture` = components, `tables`/`endpoints` = DB map.",inputSchema:{kind:J.enum(["features","architecture","tables","endpoints"])}},async({kind:$})=>{let Q=await E(`/api/entities?kind=${$}`);return{content:[{type:"text",text:JSON.stringify(Q)}]}});F.registerTool("beacon_propose_plan",{description:"BLOCKS until the user reviews. Pushes a feature plan (top-level roadmap features + DB tables + endpoints) to Beacon's /plan page. Use when the user asks you to plan a feature. EVERY feature MUST include `cluster` (its category) and `priority` (0=P0 critical .. 3=P3 low) \u2014 the tool REJECTS a plan whose features omit either, so set both on every feature. Do not implement code or migrations until this returns approval. If it returns inline feedback, revise and call again.",inputSchema:{description:J.string().describe("Short summary the user will see in the review header"),features:J.array(J.object({title:J.string(),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence for the user"),category:J.string().optional().describe("REQUIRED category for the board (AUTH | SEARCH | BILLING | DATA | INTEL | \u2026)"),cluster:J.string().optional().describe("alias for `category`"),domain:J.string().optional().describe("alias for `category`"),priority:J.number().int().min(0).max(3).optional().describe("REQUIRED priority: 0=P0 critical, 1=P1 high, 2=P2 medium, 3=P3 low"),dependsOn:J.array(J.string()).optional().describe("titles of other features in THIS plan that must ship first \u2014 drawn as 'depends on' links so the board shows the dependency chain, not loose cards"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when this roadmap item is a bug to fix \u2014 renders as a typed bug card; defaults to FEATURE")})).optional().describe("the top-level roadmap features this plan adds"),tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string().describe("GET|POST|PUT|PATCH|DELETE"),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}},async({description:$,features:Q,tables:Z,relations:Y,endpoints:X})=>{let H=(M)=>new Promise((N9)=>setTimeout(N9,M)),W=(M)=>({content:[{type:"text",text:M}]}),P=(Z?.length??0)>0,U=(Q??[]).map((M)=>`${M.title} ${M.role??""} ${M.plain??""}`).join(`
|
|
251
253
|
`),w=(X?.length??0)>0||Q9(`${$}
|
|
252
|
-
${U}`);if(!P&&w)return W("\u26D4 This plan touches the database \u2014 it declares endpoints and/or its text describes "+"models/tables/migrations \u2014 but you passed NO `tables`. Beacon's schema board renders "+"ONLY from structured `tables`; prose is never parsed, so the /db tab would be empty and nothing would persist on approve.\n\nRe-call `beacon_propose_plan` with every table in `tables` (each with its `columns`), the `relations` (FKs), and keep the `endpoints` (each with `uses:[{table,access}]`). Mirror EVERY database entity your plan mentions into the structured fields.");if(Q?.length){let M=Z9(Q);if(M)return W(M)}let
|
|
254
|
+
${U}`);if(!P&&w)return W("\u26D4 This plan touches the database \u2014 it declares endpoints and/or its text describes "+"models/tables/migrations \u2014 but you passed NO `tables`. Beacon's schema board renders "+"ONLY from structured `tables`; prose is never parsed, so the /db tab would be empty and nothing would persist on approve.\n\nRe-call `beacon_propose_plan` with every table in `tables` (each with its `columns`), the `relations` (FKs), and keep the `endpoints` (each with `uses:[{table,access}]`). Mirror EVERY database entity your plan mentions into the structured fields.");if(Q?.length){let M=Z9(Q);if(M)return W(M)}let s=(Z?.length??0)+(X?.length??0)>0;await l("/api/plan",{description:$,draft:s?{tables:Z??[],relations:Y??[],endpoints:X??[]}:void 0,features:Q?.length?Q:void 0}),await fetch(`${N5}/api/workspace/activate?id=${y0}`).catch(()=>{});let K9=Date.now()+B5;while(Date.now()<K9){await H(G5);let M=await E("/api/plan/verdict").catch(()=>null);if(!M)continue;if(M.kind==="feedback")return W("\uD83D\uDCAC The user left feedback on the plan in Beacon \u2014 text comments and/or edits they "+"made directly on the /map and /db boards. Read everything below, revise the plan accordingly (matching the board changes verbatim), and call `beacon_propose_plan` "+`again with the revised version \u2014 DO NOT implement yet:
|
|
253
255
|
|
|
254
256
|
`+M.feedback);if(M.kind==="approved")return W(`\u2705 Plan approved by the user. ${M.summary}`+(M.detail?`
|
|
255
257
|
|
package/dist/bin/plan.js
CHANGED
|
@@ -29,7 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
32
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
32
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
33
33
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
34
34
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
35
35
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -170,6 +170,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
170
170
|
|
|
171
171
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
172
172
|
|
|
173
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
174
|
+
|
|
173
175
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
174
176
|
|
|
175
177
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -192,7 +194,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
192
194
|
|
|
193
195
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
194
196
|
|
|
195
|
-
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.
|
|
197
|
+
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.
|
|
196
198
|
|
|
197
199
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
198
200
|
${JQ}`});import{existsSync as bQ,mkdirSync as qQ,readFileSync as E,rmSync as RZ,writeFileSync as O}from"fs";import{dirname as DQ,join as A}from"path";function XQ(Q){try{return JSON.parse(E(Q,"utf8"))}catch{return{}}}function IQ(Q,Z){qQ(DQ(Q),{recursive:!0}),O(Q,JSON.stringify(Z,null,2)+`
|
package/dist/bin/uninstall.js
CHANGED
|
@@ -29,7 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
32
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
32
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
33
33
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
34
34
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
35
35
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -170,6 +170,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
170
170
|
|
|
171
171
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
172
172
|
|
|
173
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
174
|
+
|
|
173
175
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
174
176
|
|
|
175
177
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -192,7 +194,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
192
194
|
|
|
193
195
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
194
196
|
|
|
195
|
-
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.
|
|
197
|
+
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.
|
|
196
198
|
|
|
197
199
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
198
200
|
${PQ}`});import{existsSync as _Q,mkdirSync as jQ,readFileSync as S,rmSync as FZ,writeFileSync as p}from"fs";import{dirname as LQ,join as h}from"path";function BQ(Q){try{return JSON.parse(S(Q,"utf8"))}catch{return{}}}function hQ(Q,Z){jQ(LQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
|
package/dist/lib/assets.js
CHANGED
|
@@ -28,7 +28,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
28
28
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
29
29
|
|
|
30
30
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
31
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
31
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
32
32
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
33
33
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
34
34
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -169,6 +169,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
169
169
|
|
|
170
170
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
171
171
|
|
|
172
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
173
|
+
|
|
172
174
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
173
175
|
|
|
174
176
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -191,7 +193,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
191
193
|
|
|
192
194
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
193
195
|
|
|
194
|
-
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.
|
|
196
|
+
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.
|
|
195
197
|
|
|
196
198
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
197
199
|
${M}`});R();export{h as removeRepoAssets,W as installRefreshSkill,O as installPlanSkill,f as installInitSkill,j as installCodexRepoSkills,_ as ensureWorkflowDoc,g as ensureMcp,L as auditRepo,k as REFRESH_SKILL,b as PLAN_SKILL,v as INIT_SKILL};
|
|
@@ -28,7 +28,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
28
28
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
29
29
|
|
|
30
30
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
31
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
31
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
32
32
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
33
33
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
34
34
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -169,6 +169,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
169
169
|
|
|
170
170
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
171
171
|
|
|
172
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
173
|
+
|
|
172
174
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
173
175
|
|
|
174
176
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -191,7 +193,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
191
193
|
|
|
192
194
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
193
195
|
|
|
194
|
-
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.
|
|
196
|
+
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.
|
|
195
197
|
|
|
196
198
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
197
199
|
${k}`});import{existsSync as n,mkdirSync as O,readFileSync as N,rmSync as Tq,writeFileSync as K}from"fs";import{dirname as r,join as C}from"path";function L(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function o(q,z){O(r(q),{recursive:!0}),K(q,JSON.stringify(z,null,2)+`
|
|
@@ -28,7 +28,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
28
28
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
29
29
|
|
|
30
30
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
31
|
-
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`.
|
|
31
|
+
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
|
|
32
32
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
33
33
|
- **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
|
|
34
34
|
- **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
|
|
@@ -169,6 +169,8 @@ REUSE before you create. Call \`beacon_map\` to see the features + categories th
|
|
|
169
169
|
|
|
170
170
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
171
171
|
|
|
172
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_start_feature\` (when the user says they're starting on a bug), \`beacon_add_subtasks\` items (a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
173
|
+
|
|
172
174
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
173
175
|
|
|
174
176
|
In Codex (which has no ExitPlanMode), always present plans via \`beacon_present_plan\` / \`beacon_propose_plan\` instead \u2014 this section applies to Claude Code's plan mode only.
|
|
@@ -191,7 +193,7 @@ Key each entry by its node \`id\`: the ids are handed back to you when the plan
|
|
|
191
193
|
|
|
192
194
|
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_describe_feature\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
193
195
|
|
|
194
|
-
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.
|
|
196
|
+
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.
|
|
195
197
|
|
|
196
198
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
197
199
|
${d}`});import{existsSync as xq,mkdirSync as s,readFileSync as M,rmSync as Lq,writeFileSync as F}from"fs";import{dirname as Xq,join as K}from"path";function l(q){try{return JSON.parse(M(q,"utf8"))}catch{return{}}}function wq(q,z){s(Xq(q),{recursive:!0}),F(q,JSON.stringify(z,null,2)+`
|