trybeacon 0.1.48 → 0.1.50

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.
Files changed (114) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +13 -13
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/api/context/feature/route.js +1 -1
  24. package/.next/server/app/api/db/arrange/route.js +1 -1
  25. package/.next/server/app/api/entities/route.js +1 -1
  26. package/.next/server/app/api/map/start/route.js +1 -1
  27. package/.next/server/app/docs/page.js +1 -1
  28. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/docs.html +1 -1
  30. package/.next/server/app/docs.rsc +3 -3
  31. package/.next/server/app/docs.segments/_full.segment.rsc +3 -3
  32. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  33. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  34. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  35. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
  36. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  37. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/feedback.html +1 -1
  39. package/.next/server/app/feedback.rsc +2 -2
  40. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  41. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  43. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  44. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  45. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  46. package/.next/server/app/help/page.js +1 -1
  47. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/help.html +1 -1
  49. package/.next/server/app/help.rsc +4 -4
  50. package/.next/server/app/help.segments/_full.segment.rsc +4 -4
  51. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  52. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  53. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +10 -12
  55. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  56. package/.next/server/app/index.html +1 -1
  57. package/.next/server/app/index.rsc +3 -3
  58. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  59. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  60. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  61. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  62. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  63. package/.next/server/app/map/page.js +2 -2
  64. package/.next/server/app/map/page.js.nft.json +1 -1
  65. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/page.js +1 -1
  67. package/.next/server/app/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/plan/page.js +2 -2
  69. package/.next/server/app/plan/page.js.nft.json +1 -1
  70. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app-paths-manifest.json +13 -13
  73. package/.next/server/chunks/1130.js +1 -1
  74. package/.next/server/chunks/1341.js +1 -1
  75. package/.next/server/chunks/2933.js +1 -1
  76. package/.next/server/chunks/{7208.js → 2999.js} +3 -3
  77. package/.next/server/chunks/3622.js +1 -1
  78. package/.next/server/chunks/9734.js +1 -1
  79. package/.next/server/chunks/9773.js +1 -0
  80. package/.next/server/middleware-build-manifest.js +1 -1
  81. package/.next/server/pages/404.html +1 -1
  82. package/.next/server/pages/500.html +1 -1
  83. package/.next/server/server-reference-manifest.js +1 -1
  84. package/.next/server/server-reference-manifest.json +1 -1
  85. package/.next/static/chunks/1487-13f43d25413ae041.js +1 -0
  86. package/.next/static/chunks/3343-af1292b51a276724.js +1 -0
  87. package/.next/static/chunks/app/docs/page-ae19d2e91ec24771.js +1 -0
  88. package/.next/static/chunks/app/map/page-5074176a5e746ffb.js +1 -0
  89. package/.next/static/chunks/app/page-541e900d67f17dae.js +1 -0
  90. package/.next/static/chunks/app/plan/{page-257d486640eadd7f.js → page-3c4c1fc03275299f.js} +1 -1
  91. package/.next/static/css/629ab377241de9ca.css +1 -0
  92. package/.next/trace +39 -39
  93. package/.next/trace-build +1 -1
  94. package/dist/bin/beacon.js +7 -7
  95. package/dist/bin/doctor.js +43 -32
  96. package/dist/bin/hook.js +43 -32
  97. package/dist/bin/mcp.js +49 -38
  98. package/dist/bin/plan.js +45 -34
  99. package/dist/bin/prompt.js +1 -1
  100. package/dist/bin/remove.js +7 -7
  101. package/dist/bin/uninstall.js +42 -31
  102. package/dist/lib/assets.js +30 -19
  103. package/dist/lib/codex-install.js +40 -29
  104. package/dist/lib/global-install.js +40 -29
  105. package/package.json +1 -1
  106. package/.next/server/chunks/805.js +0 -1
  107. package/.next/static/chunks/8074-a6b2725786399e2c.js +0 -1
  108. package/.next/static/chunks/85-82015ecb44b65d3e.js +0 -1
  109. package/.next/static/chunks/app/docs/page-0c841cb9a7aa2f9a.js +0 -1
  110. package/.next/static/chunks/app/map/page-c06fcf30d8172f82.js +0 -1
  111. package/.next/static/chunks/app/page-968dd5a6f667bff9.js +0 -1
  112. package/.next/static/css/5a58d83133d25695.css +0 -1
  113. /package/.next/static/{gNMdQmtkjPn6XQhRMDoMg → J1AU9kp6Vs1x9YOBkXMiR}/_buildManifest.js +0 -0
  114. /package/.next/static/{gNMdQmtkjPn6XQhRMDoMg → J1AU9kp6Vs1x9YOBkXMiR}/_ssgManifest.js +0 -0
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var vQ={};WQ(vQ,{removeRepoAssets:()=>xQ,installRefreshSkill:()=>FZ,installPlanSkill:()=>RZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>IZ,ensureWorkflowDoc:()=>bZ,ensureMcp:()=>OZ,auditRepo:()=>AZ,REFRESH_SKILL:()=>BQ,PLAN_SKILL:()=>mQ,INIT_SKILL:()=>HQ});import{existsSync as M,mkdirSync as L,readFileSync as x,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,HQ),$}function FZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,BQ),$}function RZ(Q){let Z=q(Q,".claude","skills","beacon-plan");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,mQ),$}function IZ(Q){let Z=[];for(let $ of EZ){let J=q(Q,".agents","skills",$.name);L(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function bZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${k}[\\s\\S]*?${jQ}`);$=J.test($)?$.replace(J,hQ):`${$.trim()}
3
+ var wZ=Object.defineProperty;var FZ=(Q)=>Q;function RZ(Q,Z){this[Q]=FZ.bind(null,Z)}var PQ=(Q,Z)=>{for(var $ in Z)wZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:RZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var A0=1500,O0=480000,y0=1800000,L=3600000,L0=3000;var mQ=()=>{};var NQ={};PQ(NQ,{removeRepoAssets:()=>xQ,installRefreshSkill:()=>IZ,installPlanSkill:()=>EZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>DZ,ensureWorkflowDoc:()=>AZ,ensureMcp:()=>OZ,auditRepo:()=>yZ,REFRESH_SKILL:()=>BQ,PLAN_SKILL:()=>cQ,INIT_SKILL:()=>jQ});import{existsSync as M,mkdirSync as k,readFileSync as v,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,jQ),$}function IZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,BQ),$}function EZ(Q){let Z=q(Q,".claude","skills","beacon-plan");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,cQ),$}function DZ(Q){let Z=[];for(let $ of bZ){let J=q(Q,".agents","skills",$.name);k(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function AZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=v(Z,"utf8")}catch{}let J=new RegExp(`${S}[\\s\\S]*?${vQ}`);$=J.test($)?$.replace(J,pQ):`${$.trim()}
4
4
 
5
- ${hQ}
5
+ ${pQ}
6
6
  `.trimStart(),H(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
- `);let Y=q(Q,"CLAUDE.md"),V="";try{V=x(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
8
+ `);let Y=q(Q,"CLAUDE.md"),V="";try{V=v(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},H(Z,JSON.stringify($,null,2)+`
12
- `),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=q(Q,".claude","skills",z);if(M(P))_(P,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let P=q(Q,".agents","skills",z);if(M(P))_(P,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(x(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
13
- `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),P=new RegExp(`\\n?${k}[\\s\\S]*?${jQ}\\n?`);if(P.test(z)){let PQ=z.replace(P,`
11
+ `)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(v(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<L)return J.timeout=L,H(Z,JSON.stringify($,null,2)+`
12
+ `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:L},H(Z,JSON.stringify($,null,2)+`
13
+ `),{path:Z,added:!0,updated:!1}}function yZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(v(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=v(q(Q,"AGENTS.md"),"utf8").includes(S)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(v(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=q(Q,".claude","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=q(Q,".agents","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(v(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=v(V,"utf8"),W=new RegExp(`\\n?${S}[\\s\\S]*?${vQ}\\n?`);if(W.test(z)){let HQ=z.replace(W,`
14
15
  `).replace(/\n{3,}/g,`
15
16
 
16
- `).trimStart();H(V,PQ.endsWith(`
17
- `)?PQ:`${PQ}
18
- `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),P=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==z){if(!P.trim())_(U,{force:!0});else H(U,P);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var HQ=`---
17
+ `).trimStart();H(V,HQ.endsWith(`
18
+ `)?HQ:`${HQ}
19
+ `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=v(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())_(U,{force:!0});else H(U,W);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var jQ=`---
19
20
  name: beacon-init
20
21
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
21
22
  ---
@@ -70,7 +71,7 @@ Beacon was already initialized in this repo (\`/beacon-init\` ran at some point)
70
71
 
71
72
  ## What gets preserved vs replaced
72
73
 
73
- The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`beacon_describe_feature\` or by hand) whose title matches a component in your refreshed analysis is **merged in place** \u2014 your fresh \`domain\`/\`role\`/\`plain\`/\`layer\`/\`files\` land on it, but it keeps its source, position, status, and bug flags, and no duplicate INIT node is created. Curated nodes your analysis does NOT mention survive untouched, as do hand-edited tables, custom positions, notes, and draft feature plans. So you can re-run this freely.
74
+ The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`beacon_feature\` action:done or by hand) whose title matches a component in your refreshed analysis is **merged in place** \u2014 your fresh \`domain\`/\`role\`/\`plain\`/\`layer\`/\`files\` land on it, but it keeps its source, position, status, and bug flags, and no duplicate INIT node is created. Curated nodes your analysis does NOT mention survive untouched, as do hand-edited tables, custom positions, notes, and draft feature plans. So you can re-run this freely.
74
75
 
75
76
  The one caveat: if the user manually edited an INIT-source node on the canvas (e.g., renamed it, rewrote its role), that edit IS overwritten when you re-persist \u2014 and a renamed node no longer title-matches, so it survives as its own card. If the user mentions hand-curated INIT nodes, ask whether they want those carried into the new analysis verbatim.
76
77
 
@@ -101,7 +102,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
101
102
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
102
103
 
103
104
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
104
- `,mQ=`---
105
+ `,cQ=`---
105
106
  name: beacon-plan
106
107
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
107
108
  ---
@@ -149,7 +150,7 @@ If it returns feedback, revise and call it again.
149
150
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
150
151
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
151
152
  run \`beacon\` in this repo once.
152
- `,EZ,k="<!-- beacon:workflow:start -->",jQ="<!-- beacon:workflow:end -->",hQ;var S=g(()=>{EZ=[{name:"beacon-init",body:()=>HQ},{name:"beacon-refresh",body:()=>BQ}];hQ=`${k}
153
+ `,bZ,S="<!-- beacon:workflow:start -->",vQ="<!-- beacon:workflow:end -->",pQ;var h=C(()=>{mQ();bZ=[{name:"beacon-init",body:()=>jQ},{name:"beacon-refresh",body:()=>BQ}];pQ=`${S}
153
154
  ## Beacon \u2014 feature workflow
154
155
 
155
156
  This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
@@ -174,13 +175,23 @@ When listing endpoints, give each \`uses: [{ table, access }]\` so the endpoint\
174
175
 
175
176
  EVERY feature MUST carry \`category\` (e.g. AUTH | SEARCH | DATA | INTEL | BILLING | \u2026; \`cluster\` is accepted as an alias) and \`priority\` (0 = P0 critical, 1 = P1 high, 2 = P2 medium, 3 = P3 low). Beacon REJECTS a plan whose features omit either \u2014 \`beacon_propose_plan\` returns the list of what's missing, and an ExitPlanMode \`\`\`beacon block is denied \u2014 so set both on every feature instead of relying on defaults.
176
177
 
177
- When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_start_feature\`, \`beacon_add_subtasks\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_describe_feature\` / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
178
+ When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_feature\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_feature\` action:done / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
178
179
 
179
- REUSE before you create. Call \`beacon_map\` to see the features + categories that already exist. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category \u2014 so don't re-create work that's already on the board, and reuse an existing category rather than a near-synonym. \`category\` is the ONLY domain field. \`front\` (in \`beacon_start_feature\`) nests a feature UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
180
+ ### Adding a card directly \u2014 \`beacon_feature\` (no review gate)
181
+
182
+ To put a card on the board WITHOUT the plan-review flow, call \`beacon_feature\` \u2014 ONE tool for a feature's whole lifecycle:
183
+ - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card returns \`exists\` (reuse it) \u2014 \`add\` never activates or demotes a card already on the board.
184
+ - \`{ action: "start" }\` marks an existing card IN_PROGRESS (create-or-flag).
185
+ - \`{ action: "subtasks" }\` adds child tasks under a card.
186
+ - \`{ action: "done" }\` completes feature(s) and registers the files/architecture touched.
187
+
188
+ A NEW card REQUIRES \`category\` + \`priority\` (and \`layer\` where the workspace has a frontend). Use \`beacon_propose_plan\` / \`beacon_present_plan\` only when you want the user to REVIEW before the card lands.
189
+
190
+ REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
180
191
 
181
192
  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.
182
193
 
183
- 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.
194
+ 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_feature\` (add/start when the user is working on a bug; or \`subtasks\` items for a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
184
195
 
185
196
  ### 2b. Presenting a plan in plan mode (ExitPlanMode)
186
197
 
@@ -198,27 +209,27 @@ Beacon extracts it deterministically and **strips the block from the prose** (it
198
209
 
199
210
  ### 3. At the end, register the work \u2014 in ONE call
200
211
 
201
- Call \`beacon_describe_feature\` **ONCE** with a \`features\` array \u2014 one entry per feature the plan created \u2014 each with the files you touched and a short markdown description. This flips each one to **Done** \u2014 including its sub-tasks (the cascade completes every PENDING/IN_PROGRESS child; a sub-task you did NOT finish must be set BLOCKED or CANCELLED before registering, so it survives visibly) \u2014 and keeps \`beacon_context_for_feature\` accurate for the next session.
212
+ Call \`beacon_feature({ action: "done" })\` **ONCE** with a \`features\` array \u2014 one entry per feature the plan created \u2014 each with the files you touched and a short markdown description. This flips each one to **Done** \u2014 including its sub-tasks (the cascade completes every PENDING/IN_PROGRESS child; a sub-task you did NOT finish must be set BLOCKED or CANCELLED before registering, so it survives visibly) \u2014 and keeps \`beacon_context_for_feature\` accurate for the next session.
202
213
 
203
214
  Key each entry by its node \`id\`: the ids are handed back to you when the plan is approved (in the approval message / additionalContext), so you don't fuzzy-match titles or pay a disambiguation round-trip. If you don't have an id, \`title\` still works.
204
215
 
205
- 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**.
216
+ Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_feature({ action: "done" })\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
206
217
 
207
218
  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.
208
219
 
209
220
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
210
- ${jQ}`});import{existsSync as pQ,mkdirSync as NQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as cQ,join as h}from"path";function uQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){NQ(cQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
211
- `)}function l(Q,Z){let $=uQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function n(Q,Z){return(uQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function t(Q,Z){let $=uQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((P)=>P.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function d(Q,Z,$,J){let Y=`${Z}
221
+ ${vQ}`});import{existsSync as lQ,mkdirSync as GQ,readFileSync as p,rmSync as LZ,writeFileSync as c}from"fs";import{dirname as nQ,join as m}from"path";function uQ(Q){try{return JSON.parse(p(Q,"utf8"))}catch{return{}}}function tQ(Q,Z){GQ(nQ(Q),{recursive:!0}),c(Q,JSON.stringify(Z,null,2)+`
222
+ `)}function n(Q,Z){let $=uQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),tQ(Q,$),!0}function t(Q,Z){return(uQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function d(Q,Z){let $=uQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return tQ(Q,$),!0}function a(Q,Z,$,J){let Y=`${Z}
212
223
  ${J.trim()}
213
- ${$}`,V="";try{V=m(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
224
+ ${$}`,V="";try{V=p(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
214
225
 
215
226
  ${Y}
216
227
  `:`${Y}
217
- `,NQ(cQ(Q),{recursive:!0}),p(Q,V.endsWith(`
228
+ `,GQ(nQ(Q),{recursive:!0}),c(Q,V.endsWith(`
218
229
  `)?V:`${V}
219
- `)}function F(Q,Z){try{return m(Q,"utf8").includes(Z)}catch{return!1}}function a(Q,Z,$){let J="";try{J=m(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
230
+ `)}function R(Q,Z){try{return p(Q,"utf8").includes(Z)}catch{return!1}}function s(Q,Z,$){let J="";try{J=p(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
220
231
 
221
- `).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);NQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function R(Q,Z){return pQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!pQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var W,c=`## Beacon (visual planning panel)
232
+ `).trimStart();return c(Q,V),!0}function r(Q,Z,$){let J=m(Q,Z);GQ(J,{recursive:!0});let Y=m(J,"SKILL.md");return c(Y,$),Y}function g(Q,Z){return lQ(m(Q,Z,"SKILL.md"))}function o(Q,Z){let $=m(Q,Z);if(!lQ($))return!1;return LZ($,{recursive:!0,force:!0}),!0}var P,l=`## Beacon (visual planning panel)
222
233
 
223
234
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
224
235
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -239,20 +250,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
239
250
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
240
251
  on the /map and /db boards (added features, attached subtasks, edited columns, new
241
252
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
242
- verbatim. Do NOT implement until the tool returns approval.`;var GQ=g(()=>{W=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as yZ,renameSync as _Z,rmSync as LZ,writeFileSync as kZ}from"fs";import{dirname as SZ}from"path";function o(Q,Z){yZ(SZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{kZ($,Z),_Z($,Q)}catch(J){throw LZ($,{force:!0}),J}}function k0(Q,Z,$=!1){o(Q,JSON.stringify(Z,null,$?2:void 0))}var nQ=()=>{};var eQ={};WQ(eQ,{setupCodexAssets:()=>cZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>wQ,hasCodexMcp:()=>fQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>pZ,codexDetected:()=>aQ,auditCodex:()=>TQ,CODEX_HOOKS:()=>T});import{readFileSync as ZQ}from"fs";import{homedir as hZ}from"os";import{join as b}from"path";function tQ(){return process.env.HOME||process.env.USERPROFILE||hZ()}function aQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function I(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function fQ(){try{return Boolean(I(ZQ(f(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function pZ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return null}let Z=I(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${E}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${E}`;return null}function oQ(){let Q="",Z=!1;try{Q=ZQ(f(),"utf8"),Z=!0}catch{}if(Z){let V=I(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${E}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${E}`}}let $=!Q?"":Q.endsWith(`
253
+ verbatim. Do NOT implement until the tool returns approval.`;var KQ=C(()=>{P=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as _Z,renameSync as kZ,rmSync as SZ,writeFileSync as hZ}from"fs";import{dirname as mZ}from"path";function i(Q,Z){_Z(mZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{hZ($,Z),kZ($,Q)}catch(J){throw SZ($,{force:!0}),J}}function t0(Q,Z,$=!1){i(Q,JSON.stringify(Z,null,$?2:void 0))}var dQ=()=>{};var ZZ={};PQ(ZZ,{setupCodexAssets:()=>nZ,removeCodexMcp:()=>QZ,removeCodexArtifacts:()=>FQ,hasCodexMcp:()=>TQ,ensureCodexMcp:()=>eQ,codexMcpProblem:()=>lZ,codexDetected:()=>rQ,auditCodex:()=>wQ,CODEX_HOOKS:()=>w});import{readFileSync as $Q}from"fs";import{homedir as pZ}from"os";import{join as b}from"path";function aQ(){return process.env.HOME||process.env.USERPROFILE||pZ()}function rQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(fQ===void 0)fQ=Bun.which("codex")!==null;return fQ}function E(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function TQ(){try{return Boolean(E($Q(T(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function lZ(){let Q="";try{Q=$Q(T(),"utf8")}catch{return null}let Z=E(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${I}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${I}`;return null}function eQ(){let Q="",Z=!1;try{Q=$Q(T(),"utf8"),Z=!0}catch{}if(Z){let V=E(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${I}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${I}`}}let $=!Q?"":Q.endsWith(`
243
254
  `)?`
244
255
  `:`
245
256
 
246
- `,J=Q+$+mZ;if(I(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${E}`};return o(f(),J),{added:!0}}function iQ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
247
- `),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:fQ()};let J=Z.indexOf(rQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
257
+ `,J=Q+$+cZ;if(E(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return i(T(),J),{added:!0}}function QZ(){let Q="";try{Q=$Q(T(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
258
+ `),$=Z.indexOf(oQ);if($===-1)return{removed:!1,skipped:TQ()};let J=Z.indexOf(iQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
248
259
  `).replace(/\n{3,}/g,`
249
260
 
250
- `).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return o(f(),Y),{removed:!0}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of W){if(!R(e(),z))Y.push(z);s(e(),z,J[z])}let V=0;for(let z of T)if(l(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=F(i(),QQ);d(i(),QQ,dQ,c);let U=oQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function TQ(){let Q={};for(let $ of W)Q[$]=R(e(),$);let Z={};for(let $ of T)Z[$.event]=n(MQ(),{event:$.event,command:$.command});return{detected:aQ(),skills:Q,hooks:Z,agentsMdBlock:F(i(),QQ),mcp:fQ()}}function wQ(){let Q=[];for(let Y of W)if(r(e(),Y))Q.push(Y);let Z=0;for(let Y of T)if(t(MQ(),{event:Y.event,command:Y.command}))Z++;let $=a(i(),QQ,dQ),J=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>b(tQ(),".codex"),MQ=()=>b(CQ(),"hooks.json"),f=()=>b(CQ(),"config.toml"),i=()=>b(CQ(),"AGENTS.md"),e=()=>b(tQ(),".agents","skills"),QQ="<!-- beacon:global:start -->",dQ="<!-- beacon:global:end -->",T,KQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",mZ,E="add it manually: codex mcp add beacon -- beacon mcp";var gQ=g(()=>{GQ();nQ();T=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];mZ=`${sQ}
261
+ `).replace(/^\n+/,"");if(E(Y)===null)return{removed:!1,skipped:!0};return i(T(),Y),{removed:!0}}async function nZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),NQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of P){if(!g(QQ(),z))Y.push(z);r(QQ(),z,J[z])}let V=0;for(let z of w)if(n(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=R(e(),ZQ);a(e(),ZQ,sQ,l);let U=eQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function wQ(){let Q={};for(let $ of P)Q[$]=g(QQ(),$);let Z={};for(let $ of w)Z[$.event]=t(MQ(),{event:$.event,command:$.command});return{detected:rQ(),skills:Q,hooks:Z,agentsMdBlock:R(e(),ZQ),mcp:TQ()}}function FQ(){let Q=[];for(let Y of P)if(o(QQ(),Y))Q.push(Y);let Z=0;for(let Y of w)if(d(MQ(),{event:Y.event,command:Y.command}))Z++;let $=s(e(),ZQ,sQ),J=QZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>b(aQ(),".codex"),MQ=()=>b(CQ(),"hooks.json"),T=()=>b(CQ(),"config.toml"),e=()=>b(CQ(),"AGENTS.md"),QQ=()=>b(aQ(),".agents","skills"),ZQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->",w,fQ,oQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",iQ="# beacon:end",cZ,I="add it manually: codex mcp add beacon -- beacon mcp";var RQ=C(()=>{KQ();dQ();w=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];cZ=`${oQ}
251
262
  [mcp_servers.beacon]
252
263
  command = "beacon"
253
264
  args = ["mcp"]
254
- ${rQ}
255
- `});var zZ={};WQ(zZ,{provisionDb:()=>B0});import{createClient as $0}from"@libsql/client";import{drizzle as J0}from"drizzle-orm/libsql";import{migrate as Y0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as V0}from"drizzle-orm/migrator";import{dirname as bQ,join as z0}from"path";import{fileURLToPath as q0}from"url";async function YQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function W0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function VZ(Q){if(!await YQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function H0(Q){for(let[Z,$]of Object.entries(P0)){if(!await YQ(Q,Z))continue;let J=await W0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function B0(Q,Z=U0){let $=$0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await YQ($,"__drizzle_migrations"),Y=await YQ($,"Node"),V=!1;if(Y&&!J){let U=V0({migrationsFolder:Z})[0];if(U)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[U.hash,U.folderMillis]}),V=!0}let X=await VZ($);if(await Y0(J0($),{migrationsFolder:Z}),await VZ($)>X)V=!0;return await H0($),{migrated:V}}finally{$.close()}}var X0,U0,P0;var qZ=g(async()=>{X0=bQ(bQ(bQ(q0(import.meta.url)))),U0=process.env.BEACON_MIGRATIONS_DIR||z0(X0,"drizzle"),P0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});GQ();import{existsSync as lZ}from"fs";import{homedir as nZ}from"os";import{join as $Q}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var JQ=()=>$Q(tZ(),".claude"),FQ=()=>$Q(JQ(),"skills"),RQ=()=>$Q(JQ(),"settings.json"),EQ=()=>$Q(JQ(),"CLAUDE.md"),IQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var dZ=c,O=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function aZ(Q,Z){return s(FQ(),Q,Z)}function ZZ(Q){return R(FQ(),Q)}function sZ(Q){return r(FQ(),Q)}function rZ(Q){return l(RQ(),Q)}function oZ(Q){return n(RQ(),Q)}function iZ(Q){return t(RQ(),Q)}function eZ(Q){d(EQ(),IQ,QZ,Q)}function $Z(){return F(EQ(),IQ)}function Q0(){return a(EQ(),IQ,QZ)}function JZ(){let Q={};for(let $ of W)Q[$]=ZZ($);let Z={};for(let $ of O)Z[$.event]=oZ({event:$.event,command:$.command});return{homeExists:lZ(JQ()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of W){if(!ZZ(U))Y.push(U);aZ(U,J[U])}let V=0;for(let U of O)if(rZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=$Z();return eZ(dZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function s0(){let Q;try{Q={ok:!0,...await Z0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (gQ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function YZ(){let Q=[];for(let J of W)if(sZ(J))Q.push(J);let Z=0;for(let J of O)if(iZ(J))Z++;let $=Q0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as j0}from"async_hooks";import{spawnSync as x0}from"child_process";import{createHash as v0}from"crypto";import{existsSync as UZ,mkdirSync as A,readFileSync as AQ,writeFileSync as DQ}from"fs";import{homedir as PZ}from"os";import{basename as N0,join as N,parse as u0,resolve as XZ}from"path";function v(){return process.env.BEACON_HOME||N(PZ(),".beacon")}function yQ(){return N(v(),"workspaces.json")}function VQ(Q){return v0("sha256").update(Q).digest("hex").slice(0,12)}function U1(Q=process.cwd()){let Z=x0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function WZ(Q){let Z=XZ(Q);return Z!==XZ(PZ())&&Z!==u0(Z).root}function HZ(){return N(v(),"deleted.json")}function _Q(){try{let Q=JSON.parse(AQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(v(),{recursive:!0}),DQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return _Q().includes(Q)}function P1(Q){let Z=_Q();if(!Z.includes(Q))BZ([...Z,Q])}function G0(Q){let Z=_Q();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function zQ(Q){return N(v(),Q)}function K0(Q){return`file:${N(zQ(Q),"db.sqlite")}`}function D(){try{let Q=JSON.parse(AQ(yQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function LQ(Q){A(v(),{recursive:!0}),DQ(yQ(),JSON.stringify(Q,null,2))}function qQ(){return D().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return D().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!WZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=VQ(Q);if(jZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=D(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||N0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(zQ(J),{recursive:!0}),LQ(U),X}function W1(Q,Z){return G0(VQ(Q)),xZ(Q,Z)}function H1(Q,Z=new Date().toISOString()){let $=D(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,LQ($)}function B1(Q){if(LQ(D().filter((Z)=>Z.id!==Q)),kQ()===Q)C0(qQ()[0]?.id??null)}function vZ(){return N(v(),"active")}function kQ(){try{return AQ(vZ(),"utf8").trim()||null}catch{return null}}function C0(Q){A(v(),{recursive:!0}),DQ(vZ(),Q??"")}function j1(){let Q=kQ();return Q?G(Q):null}function x1(){let Q=T0()??kQ();return Q?G(Q):null}function v1(Q){return G(Q)?.path??null}function N1(){return UZ(yQ())}var NZ="beacon_ws";function uZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function u1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=uZ(Q,NZ);if($&&G($))return $;return M0()}function M0(){let Q=qQ();return Q.length===1?Q[0].id:null}var f0="x-beacon-workspace-path";async function G1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(f0);if($&&WZ($)&&!jZ(VQ($))&&(!Z||VQ($)===Z)){let Y=xZ($);return await w0(Y.id),Y.id}let J=uZ(Q,NZ);if(J&&G(J))return J;return null}var GZ=new j0;function K1(Q,Z){return Q?GZ.run(Q,Z):Z()}function T0(){return GZ.getStore()??null}var OQ=new Set;function C1(Q){OQ.delete(N(zQ(Q),"db.sqlite"))}async function w0(Q){let Z=zQ(Q),$=N(Z,"db.sqlite"),J=UZ($);if(J&&OQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await qZ().then(() => zZ),V=await Y(K0(Q));return OQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}S();gQ();import{existsSync as XQ,readFileSync as g0,rmSync as F0}from"fs";import{join as R0}from"path";var KZ=process.argv.slice(3),CZ=KZ.includes("--yes")||KZ.includes("-y"),j=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,B=(Q)=>`\x1B[2m${Q}\x1B[0m`,C=(Q)=>`
256
- \x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=qQ(),SQ=JZ();console.log(C(CZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(C("Global"));console.log(` ${XQ(K)?`wipe ${K} (${y.length} workspaces)`:`${B(`${K} \u2014 already gone`)}`}`);for(let Q of W)console.log(` ${SQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of O)console.log(` ${SQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${SQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":B("global CLAUDE.md block \u2014 already gone")}`);var UQ=TQ();console.log(C("Codex"));for(let Q of W)console.log(` ${UQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of T)console.log(` ${UQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${UQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":B("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${UQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":B("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(C(`Per-repo (${y.length})`));for(let Q of y){if(!XQ(Q.path)){console.log(` ${B(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${B("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!CZ)console.log(C("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
257
- `),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=wQ();if(u.skillsRemoved.length)console.log(` ${j(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${j(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${j("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${MZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of y){if(!XQ(Q.path))continue;let Z=xQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${j(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var E0=R0(K,"server.json");try{let{pid:Q}=JSON.parse(g0(E0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${j(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(XQ(K))F0(K,{recursive:!0,force:!0}),console.log(` ${j(`removed ${K}`)}`);console.log(C("Done."));console.log(` ${MZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
265
+ ${iQ}
266
+ `});var XZ={};PQ(XZ,{provisionDb:()=>v0});import{createClient as Y0}from"@libsql/client";import{drizzle as V0}from"drizzle-orm/libsql";import{migrate as z0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as q0}from"drizzle-orm/migrator";import{dirname as DQ,join as X0}from"path";import{fileURLToPath as U0}from"url";async function VQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function j0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function qZ(Q){if(!await VQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function B0(Q){for(let[Z,$]of Object.entries(P0)){if(!await VQ(Q,Z))continue;let J=await j0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function v0(Q,Z=H0){let $=Y0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await VQ($,"__drizzle_migrations"),Y=await VQ($,"Node"),V=!1;if(Y&&!J){let U=q0({migrationsFolder:Z})[0];if(U)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[U.hash,U.folderMillis]}),V=!0}let X=await qZ($);if(await z0(V0($),{migrationsFolder:Z}),await qZ($)>X)V=!0;return await B0($),{migrated:V}}finally{$.close()}}var W0,H0,P0;var UZ=C(async()=>{W0=DQ(DQ(DQ(U0(import.meta.url)))),H0=process.env.BEACON_MIGRATIONS_DIR||X0(W0,"drizzle"),P0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});KQ();import{existsSync as tZ}from"fs";import{homedir as dZ}from"os";import{join as JQ}from"path";function aZ(){return process.env.HOME||process.env.USERPROFILE||dZ()}var YQ=()=>JQ(aZ(),".claude"),gQ=()=>JQ(YQ(),"skills"),IQ=()=>JQ(YQ(),"settings.json"),EQ=()=>JQ(YQ(),"CLAUDE.md"),bQ="<!-- beacon:global:start -->",$Z="<!-- beacon:global:end -->";var sZ=l,D=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function rZ(Q,Z){return r(gQ(),Q,Z)}function JZ(Q){return g(gQ(),Q)}function oZ(Q){return o(gQ(),Q)}function iZ(Q){return n(IQ(),Q)}function eZ(Q){return t(IQ(),Q)}function Q0(Q){return d(IQ(),Q)}function Z0(Q){a(EQ(),bQ,$Z,Q)}function YZ(){return R(EQ(),bQ)}function $0(){return s(EQ(),bQ,$Z)}function VZ(){let Q={};for(let $ of P)Q[$]=JZ($);let Z={};for(let $ of D)Z[$.event]=eZ({event:$.event,command:$.command});return{homeExists:tZ(YQ()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function J0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),NQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of P){if(!JZ(U))Y.push(U);rZ(U,J[U])}let V=0;for(let U of D)if(iZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=YZ();return Z0(sZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function J1(){let Q;try{Q={ok:!0,...await J0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (RQ(),ZZ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function zZ(){let Q=[];for(let J of P)if(oZ(J))Q.push(J);let Z=0;for(let J of D)if(Q0(J))Z++;let $=$0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as x0}from"async_hooks";import{spawnSync as N0}from"child_process";import{createHash as G0}from"crypto";import{existsSync as HZ,mkdirSync as A,readFileSync as OQ,writeFileSync as yQ}from"fs";import{homedir as PZ}from"os";import{basename as u0,join as N,parse as K0,resolve as WZ}from"path";function x(){return process.env.BEACON_HOME||N(PZ(),".beacon")}function LQ(){return N(x(),"workspaces.json")}function zQ(Q){return G0("sha256").update(Q).digest("hex").slice(0,12)}function N1(Q=process.cwd()){let Z=N0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function jZ(Q){let Z=WZ(Q);return Z!==WZ(PZ())&&Z!==K0(Z).root}function BZ(){return N(x(),"deleted.json")}function _Q(){try{let Q=JSON.parse(OQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function vZ(Q){A(x(),{recursive:!0}),yQ(BZ(),JSON.stringify(Q,null,2))}function xZ(Q){return _Q().includes(Q)}function G1(Q){let Z=_Q();if(!Z.includes(Q))vZ([...Z,Q])}function f0(Q){let Z=_Q();if(Z.includes(Q))vZ(Z.filter(($)=>$!==Q))}function qQ(Q){return N(x(),Q)}function C0(Q){return`file:${N(qQ(Q),"db.sqlite")}`}function O(){try{let Q=JSON.parse(OQ(LQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function kQ(Q){A(x(),{recursive:!0}),yQ(LQ(),JSON.stringify(Q,null,2))}function XQ(){return O().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function u(Q){return O().find((Z)=>Z.id===Q)??null}function NZ(Q,Z,$=new Date().toISOString()){if(!jZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=zQ(Q);if(xZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=O(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||u0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(qQ(J),{recursive:!0}),kQ(U),X}function u1(Q,Z){return f0(zQ(Q)),NZ(Q,Z)}function K1(Q,Z=new Date().toISOString()){let $=O(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,kQ($)}function f1(Q){if(kQ(O().filter((Z)=>Z.id!==Q)),SQ()===Q)M0(XQ()[0]?.id??null)}function GZ(){return N(x(),"active")}function SQ(){try{return OQ(GZ(),"utf8").trim()||null}catch{return null}}function M0(Q){A(x(),{recursive:!0}),yQ(GZ(),Q??"")}function C1(){let Q=SQ();return Q?u(Q):null}function M1(){let Q=F0()??SQ();return Q?u(Q):null}function T1(Q){return u(Q)?.path??null}function w1(){return HZ(LQ())}var uZ="beacon_ws";function KZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function F1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=KZ(Q,uZ);if($&&u($))return $;return T0()}function T0(){let Q=XQ();return Q.length===1?Q[0].id:null}var w0="x-beacon-workspace-path";async function R1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=Q.headers.get(w0);if($&&jZ($)&&!xZ(zQ($))&&(!Z||zQ($)===Z)){let Y=NZ($);return await R0(Y.id),Y.id}let J=KZ(Q,uZ);if(J&&u(J))return J;return null}var fZ=new x0;function g1(Q,Z){return Q?fZ.run(Q,Z):Z()}function F0(){return fZ.getStore()??null}var AQ=new Set;function I1(Q){AQ.delete(N(qQ(Q),"db.sqlite"))}async function R0(Q){let Z=qQ(Q),$=N(Z,"db.sqlite"),J=HZ($);if(J&&AQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await UZ().then(() => XZ),V=await Y(C0(Q));return AQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}h();RQ();import{existsSync as UQ,readFileSync as g0,rmSync as I0}from"fs";import{join as E0}from"path";var CZ=process.argv.slice(3),MZ=CZ.includes("--yes")||CZ.includes("-y"),B=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[2m${Q}\x1B[0m`,f=(Q)=>`
267
+ \x1B[1m${Q}\x1B[0m`,TZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=x(),y=XQ(),hQ=VZ();console.log(f(MZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(f("Global"));console.log(` ${UQ(K)?`wipe ${K} (${y.length} workspaces)`:`${j(`${K} \u2014 already gone`)}`}`);for(let Q of P)console.log(` ${hQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of D)console.log(` ${hQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${hQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":j("global CLAUDE.md block \u2014 already gone")}`);var WQ=wQ();console.log(f("Codex"));for(let Q of P)console.log(` ${WQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of w)console.log(` ${WQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${WQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":j("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${WQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":j("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(f(`Per-repo (${y.length})`));for(let Q of y){if(!UQ(Q.path)){console.log(` ${j(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${j("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!MZ)console.log(f("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
268
+ `),process.exit(0);console.log(f("Applying\u2026"));var F=zZ();if(F.skillsRemoved.length)console.log(` ${B(`removed skills: ${F.skillsRemoved.join(", ")}`)}`);if(F.hooksRemoved)console.log(` ${B(`removed ${F.hooksRemoved} hook${F.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(F.claudeMdBlockRemoved)console.log(` ${B("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var G=FQ();if(G.skillsRemoved.length)console.log(` ${B(`removed ~/.agents/skills: ${G.skillsRemoved.join(", ")}`)}`);if(G.hooksRemoved)console.log(` ${B(`removed ${G.hooksRemoved} hook${G.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(G.agentsMdBlockRemoved)console.log(` ${B("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(G.mcpRemoved)console.log(` ${B("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(G.mcpSkipped)console.log(` ${TZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of y){if(!UQ(Q.path))continue;let Z=xQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${B(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var b0=E0(K,"server.json");try{let{pid:Q}=JSON.parse(g0(b0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${B(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(UQ(K))I0(K,{recursive:!0,force:!0}),console.log(` ${B(`removed ${K}`)}`);console.log(f("Done."));console.log(` ${TZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
258
269
  `);
@@ -1,20 +1,21 @@
1
1
  // @bun
2
- var w=Object.defineProperty;var u=(q)=>q;function E(q,J){this[q]=u.bind(null,J)}var A=(q,J)=>{for(var z in J)w(q,z,{get:J[z],enumerable:!0,configurable:!0,set:E.bind(J,z)})};var I=(q,J)=>()=>(q&&(J=q(q=0)),J);var F={};A(F,{removeRepoAssets:()=>h,installRefreshSkill:()=>W,installPlanSkill:()=>O,installInitSkill:()=>f,installCodexRepoSkills:()=>j,ensureWorkflowDoc:()=>_,ensureMcp:()=>g,auditRepo:()=>L,REFRESH_SKILL:()=>k,PLAN_SKILL:()=>b,INIT_SKILL:()=>v});import{existsSync as H,mkdirSync as D,readFileSync as X,rmSync as B,writeFileSync as G}from"fs";import{join as Q}from"path";function f(q){let J=Q(q,".claude","skills","beacon-init");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,v),z}function W(q){let J=Q(q,".claude","skills","beacon-refresh");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,k),z}function O(q){let J=Q(q,".claude","skills","beacon-plan");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,b),z}function j(q){let J=[];for(let z of K){let Y=Q(q,".agents","skills",z.name);D(Y,{recursive:!0});let $=Q(Y,"SKILL.md");G($,z.body()),J.push($)}return J}function _(q){let J=Q(q,"AGENTS.md"),z="";try{z=X(J,"utf8")}catch{}let Y=new RegExp(`${U}[\\s\\S]*?${M}`);z=Y.test(z)?z.replace(Y,T):`${z.trim()}
2
+ var u=Object.defineProperty;var W=(z)=>z;function E(z,J){this[z]=W.bind(null,J)}var M=(z,J)=>{for(var q in J)u(z,q,{get:J[q],enumerable:!0,configurable:!0,set:E.bind(J,q)})};var A=(z,J)=>()=>(z&&(J=z(z=0)),J);var S=1500,s=480000,a=1800000,B=3600000,d=3000;var I=()=>{};var m={};M(m,{removeRepoAssets:()=>R,installRefreshSkill:()=>j,installPlanSkill:()=>L,installInitSkill:()=>K,installCodexRepoSkills:()=>g,ensureWorkflowDoc:()=>F,ensureMcp:()=>_,auditRepo:()=>h,REFRESH_SKILL:()=>P,PLAN_SKILL:()=>f,INIT_SKILL:()=>k});import{existsSync as D,mkdirSync as U,readFileSync as X,rmSync as C,writeFileSync as G}from"fs";import{join as Q}from"path";function K(z){let J=Q(z,".claude","skills","beacon-init");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,k),q}function j(z){let J=Q(z,".claude","skills","beacon-refresh");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,P),q}function L(z){let J=Q(z,".claude","skills","beacon-plan");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,f),q}function g(z){let J=[];for(let q of O){let Y=Q(z,".agents","skills",q.name);U(Y,{recursive:!0});let $=Q(Y,"SKILL.md");G($,q.body()),J.push($)}return J}function F(z){let J=Q(z,"AGENTS.md"),q="";try{q=X(J,"utf8")}catch{}let Y=new RegExp(`${v}[\\s\\S]*?${b}`);q=Y.test(q)?q.replace(Y,T):`${q.trim()}
3
3
 
4
4
  ${T}
5
- `.trimStart(),G(J,z.endsWith(`
6
- `)?z:`${z}
7
- `);let $=Q(q,"CLAUDE.md"),C="";try{C=X($,"utf8")}catch{}if(!/@AGENTS\.md/.test(C))G($,`${C?`${C.trim()}
5
+ `.trimStart(),G(J,q.endsWith(`
6
+ `)?q:`${q}
7
+ `);let $=Q(z,"CLAUDE.md"),H="";try{H=X($,"utf8")}catch{}if(!/@AGENTS\.md/.test(H))G($,`${H?`${H.trim()}
8
8
 
9
9
  `:""}@AGENTS.md
10
- `)}function g(q){let J=Q(q,".mcp.json"),z={};try{z=JSON.parse(X(J,"utf8"))}catch{}if(z.mcpServers=z.mcpServers??{},z.mcpServers.beacon)return{path:J,added:!1};return z.mcpServers.beacon={command:"beacon",args:["mcp"]},G(J,JSON.stringify(z,null,2)+`
11
- `),{path:J,added:!0}}function L(q){let J=Q(q,".mcp.json"),z=!1;try{z=!!JSON.parse(X(J,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=X(Q(q,"AGENTS.md"),"utf8").includes(U)}catch{}let $=!1;try{$=/@AGENTS\.md/.test(X(Q(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:z,agentsMdBlock:Y,claudeMdImport:$,skills:{"beacon-init":H(Q(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":H(Q(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":H(Q(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":H(Q(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function h(q){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let Z=Q(q,".claude","skills",V);if(H(Z))B(Z,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let Z=Q(q,".agents","skills",V);if(H(Z))B(Z,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let z=!1,Y=Q(q,".mcp.json");try{let V=JSON.parse(X(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,z=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)B(Y,{force:!0});else G(Y,JSON.stringify(V,null,2)+`
12
- `)}}catch{}let $=!1,C=Q(q,"AGENTS.md");try{let V=X(C,"utf8"),Z=new RegExp(`\\n?${U}[\\s\\S]*?${M}\\n?`);if(Z.test(V)){let N=V.replace(Z,`
10
+ `)}function _(z){let J=Q(z,".mcp.json"),q={};try{q=JSON.parse(X(J,"utf8"))}catch{}q.mcpServers=q.mcpServers??{};let Y=q.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<B)return Y.timeout=B,G(J,JSON.stringify(q,null,2)+`
11
+ `),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return q.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:B},G(J,JSON.stringify(q,null,2)+`
12
+ `),{path:J,added:!0,updated:!1}}function h(z){let J=Q(z,".mcp.json"),q=!1;try{q=!!JSON.parse(X(J,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=X(Q(z,"AGENTS.md"),"utf8").includes(v)}catch{}let $=!1;try{$=/@AGENTS\.md/.test(X(Q(z,"CLAUDE.md"),"utf8"))}catch{}return{repo:z,mcpRegistered:q,agentsMdBlock:Y,claudeMdImport:$,skills:{"beacon-init":D(Q(z,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":D(Q(z,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".agents","skills","beacon-refresh","SKILL.md"))}}}function R(z){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let Z=Q(z,".claude","skills",V);if(D(Z))C(Z,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let Z=Q(z,".agents","skills",V);if(D(Z))C(Z,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let q=!1,Y=Q(z,".mcp.json");try{let V=JSON.parse(X(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,q=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)C(Y,{force:!0});else G(Y,JSON.stringify(V,null,2)+`
13
+ `)}}catch{}let $=!1,H=Q(z,"AGENTS.md");try{let V=X(H,"utf8"),Z=new RegExp(`\\n?${v}[\\s\\S]*?${b}\\n?`);if(Z.test(V)){let N=V.replace(Z,`
13
14
  `).replace(/\n{3,}/g,`
14
15
 
15
- `).trimStart();G(C,N.endsWith(`
16
+ `).trimStart();G(H,N.endsWith(`
16
17
  `)?N:`${N}
17
- `),$=!0}}catch{}let P=!1,x=Q(q,"CLAUDE.md");try{let V=X(x,"utf8"),Z=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(Z!==V){if(!Z.trim())B(x,{force:!0});else G(x,Z);P=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:z,agentsBlockRemoved:$,claudeImportRemoved:P}}var v=`---
18
+ `),$=!0}}catch{}let w=!1,x=Q(z,"CLAUDE.md");try{let V=X(x,"utf8"),Z=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(Z!==V){if(!Z.trim())C(x,{force:!0});else G(x,Z);w=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:q,agentsBlockRemoved:$,claudeImportRemoved:w}}var k=`---
18
19
  name: beacon-init
19
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.
20
21
  ---
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
53
54
  If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
54
55
 
55
56
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
56
- `,k=`---
57
+ `,P=`---
57
58
  name: beacon-refresh
58
59
  description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
59
60
  ---
@@ -69,7 +70,7 @@ Beacon was already initialized in this repo (\`/beacon-init\` ran at some point)
69
70
 
70
71
  ## What gets preserved vs replaced
71
72
 
72
- The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`beacon_describe_feature\` or by hand) whose title matches a component in your refreshed analysis is **merged in place** \u2014 your fresh \`domain\`/\`role\`/\`plain\`/\`layer\`/\`files\` land on it, but it keeps its source, position, status, and bug flags, and no duplicate INIT node is created. Curated nodes your analysis does NOT mention survive untouched, as do hand-edited tables, custom positions, notes, and draft feature plans. So you can re-run this freely.
73
+ The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`beacon_feature\` action:done or by hand) whose title matches a component in your refreshed analysis is **merged in place** \u2014 your fresh \`domain\`/\`role\`/\`plain\`/\`layer\`/\`files\` land on it, but it keeps its source, position, status, and bug flags, and no duplicate INIT node is created. Curated nodes your analysis does NOT mention survive untouched, as do hand-edited tables, custom positions, notes, and draft feature plans. So you can re-run this freely.
73
74
 
74
75
  The one caveat: if the user manually edited an INIT-source node on the canvas (e.g., renamed it, rewrote its role), that edit IS overwritten when you re-persist \u2014 and a renamed node no longer title-matches, so it survives as its own card. If the user mentions hand-curated INIT nodes, ask whether they want those carried into the new analysis verbatim.
75
76
 
@@ -100,7 +101,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
100
101
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
101
102
 
102
103
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
103
- `,b=`---
104
+ `,f=`---
104
105
  name: beacon-plan
105
106
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
106
107
  ---
@@ -148,7 +149,7 @@ If it returns feedback, revise and call it again.
148
149
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
149
150
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
150
151
  run \`beacon\` in this repo once.
151
- `,K,U="<!-- beacon:workflow:start -->",M="<!-- beacon:workflow:end -->",T;var R=I(()=>{K=[{name:"beacon-init",body:()=>v},{name:"beacon-refresh",body:()=>k}];T=`${U}
152
+ `,O,v="<!-- beacon:workflow:start -->",b="<!-- beacon:workflow:end -->",T;var y=A(()=>{I();O=[{name:"beacon-init",body:()=>k},{name:"beacon-refresh",body:()=>P}];T=`${v}
152
153
  ## Beacon \u2014 feature workflow
153
154
 
154
155
  This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
@@ -173,13 +174,23 @@ When listing endpoints, give each \`uses: [{ table, access }]\` so the endpoint\
173
174
 
174
175
  EVERY feature MUST carry \`category\` (e.g. AUTH | SEARCH | DATA | INTEL | BILLING | \u2026; \`cluster\` is accepted as an alias) and \`priority\` (0 = P0 critical, 1 = P1 high, 2 = P2 medium, 3 = P3 low). Beacon REJECTS a plan whose features omit either \u2014 \`beacon_propose_plan\` returns the list of what's missing, and an ExitPlanMode \`\`\`beacon block is denied \u2014 so set both on every feature instead of relying on defaults.
175
176
 
176
- When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_start_feature\`, \`beacon_add_subtasks\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_describe_feature\` / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
177
+ When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_feature\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_feature\` action:done / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
177
178
 
178
- REUSE before you create. Call \`beacon_map\` to see the features + categories that already exist. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category \u2014 so don't re-create work that's already on the board, and reuse an existing category rather than a near-synonym. \`category\` is the ONLY domain field. \`front\` (in \`beacon_start_feature\`) nests a feature UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
179
+ ### Adding a card directly \u2014 \`beacon_feature\` (no review gate)
180
+
181
+ To put a card on the board WITHOUT the plan-review flow, call \`beacon_feature\` \u2014 ONE tool for a feature's whole lifecycle:
182
+ - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card returns \`exists\` (reuse it) \u2014 \`add\` never activates or demotes a card already on the board.
183
+ - \`{ action: "start" }\` marks an existing card IN_PROGRESS (create-or-flag).
184
+ - \`{ action: "subtasks" }\` adds child tasks under a card.
185
+ - \`{ action: "done" }\` completes feature(s) and registers the files/architecture touched.
186
+
187
+ A NEW card REQUIRES \`category\` + \`priority\` (and \`layer\` where the workspace has a frontend). Use \`beacon_propose_plan\` / \`beacon_present_plan\` only when you want the user to REVIEW before the card lands.
188
+
189
+ REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
179
190
 
180
191
  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.
181
192
 
182
- 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.
193
+ 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_feature\` (add/start when the user is working on a bug; or \`subtasks\` items for a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
183
194
 
184
195
  ### 2b. Presenting a plan in plan mode (ExitPlanMode)
185
196
 
@@ -197,13 +208,13 @@ Beacon extracts it deterministically and **strips the block from the prose** (it
197
208
 
198
209
  ### 3. At the end, register the work \u2014 in ONE call
199
210
 
200
- Call \`beacon_describe_feature\` **ONCE** with a \`features\` array \u2014 one entry per feature the plan created \u2014 each with the files you touched and a short markdown description. This flips each one to **Done** \u2014 including its sub-tasks (the cascade completes every PENDING/IN_PROGRESS child; a sub-task you did NOT finish must be set BLOCKED or CANCELLED before registering, so it survives visibly) \u2014 and keeps \`beacon_context_for_feature\` accurate for the next session.
211
+ Call \`beacon_feature({ action: "done" })\` **ONCE** with a \`features\` array \u2014 one entry per feature the plan created \u2014 each with the files you touched and a short markdown description. This flips each one to **Done** \u2014 including its sub-tasks (the cascade completes every PENDING/IN_PROGRESS child; a sub-task you did NOT finish must be set BLOCKED or CANCELLED before registering, so it survives visibly) \u2014 and keeps \`beacon_context_for_feature\` accurate for the next session.
201
212
 
202
213
  Key each entry by its node \`id\`: the ids are handed back to you when the plan is approved (in the approval message / additionalContext), so you don't fuzzy-match titles or pay a disambiguation round-trip. If you don't have an id, \`title\` still works.
203
214
 
204
- 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**.
215
+ Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_feature({ action: "done" })\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
205
216
 
206
217
  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.
207
218
 
208
219
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
209
- ${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};
220
+ ${b}`});y();export{R as removeRepoAssets,j as installRefreshSkill,L as installPlanSkill,K as installInitSkill,g as installCodexRepoSkills,F as ensureWorkflowDoc,_ as ensureMcp,h as auditRepo,P as REFRESH_SKILL,f as PLAN_SKILL,k as INIT_SKILL};