trybeacon 0.1.48 → 0.1.49

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 (105) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +8 -8
  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/db/arrange/route.js +1 -1
  24. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/docs.html +1 -1
  26. package/.next/server/app/docs.rsc +2 -2
  27. package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  28. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  29. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  30. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  31. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  32. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  33. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  34. package/.next/server/app/feedback.html +1 -1
  35. package/.next/server/app/feedback.rsc +2 -2
  36. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  37. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  38. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  39. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  40. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  41. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  42. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/help.html +1 -1
  44. package/.next/server/app/help.rsc +2 -2
  45. package/.next/server/app/help.segments/_full.segment.rsc +2 -2
  46. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  47. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  48. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  49. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  50. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  51. package/.next/server/app/index.html +1 -1
  52. package/.next/server/app/index.rsc +3 -3
  53. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  54. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  55. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  57. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  58. package/.next/server/app/map/page.js +2 -2
  59. package/.next/server/app/map/page.js.nft.json +1 -1
  60. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/page.js +1 -1
  62. package/.next/server/app/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app/plan/page.js +2 -2
  64. package/.next/server/app/plan/page.js.nft.json +1 -1
  65. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app-paths-manifest.json +8 -8
  68. package/.next/server/chunks/1341.js +1 -1
  69. package/.next/server/chunks/2933.js +1 -1
  70. package/.next/server/chunks/{7208.js → 2999.js} +3 -3
  71. package/.next/server/chunks/7331.js +1 -0
  72. package/.next/server/chunks/9734.js +1 -1
  73. package/.next/server/middleware-build-manifest.js +1 -1
  74. package/.next/server/pages/404.html +1 -1
  75. package/.next/server/pages/500.html +1 -1
  76. package/.next/server/server-reference-manifest.js +1 -1
  77. package/.next/server/server-reference-manifest.json +1 -1
  78. package/.next/static/chunks/3343-af1292b51a276724.js +1 -0
  79. package/.next/static/chunks/7323-480fb88e9d24f9e9.js +1 -0
  80. package/.next/static/chunks/app/map/page-66d71744ae3363d7.js +1 -0
  81. package/.next/static/chunks/app/page-541e900d67f17dae.js +1 -0
  82. package/.next/static/chunks/app/plan/page-e7d16fa2a3713a92.js +1 -0
  83. package/.next/static/css/629ab377241de9ca.css +1 -0
  84. package/.next/trace +39 -39
  85. package/.next/trace-build +1 -1
  86. package/dist/bin/beacon.js +7 -7
  87. package/dist/bin/doctor.js +27 -26
  88. package/dist/bin/hook.js +27 -26
  89. package/dist/bin/mcp.js +34 -33
  90. package/dist/bin/plan.js +29 -28
  91. package/dist/bin/remove.js +7 -7
  92. package/dist/bin/uninstall.js +26 -25
  93. package/dist/lib/assets.js +14 -13
  94. package/dist/lib/codex-install.js +24 -23
  95. package/dist/lib/global-install.js +24 -23
  96. package/package.json +1 -1
  97. package/.next/server/chunks/805.js +0 -1
  98. package/.next/static/chunks/8074-a6b2725786399e2c.js +0 -1
  99. package/.next/static/chunks/85-82015ecb44b65d3e.js +0 -1
  100. package/.next/static/chunks/app/map/page-c06fcf30d8172f82.js +0 -1
  101. package/.next/static/chunks/app/page-968dd5a6f667bff9.js +0 -1
  102. package/.next/static/chunks/app/plan/page-257d486640eadd7f.js +0 -1
  103. package/.next/static/css/5a58d83133d25695.css +0 -1
  104. /package/.next/static/{gNMdQmtkjPn6XQhRMDoMg → qeqVD-yeoYO_3C0pw9kHg}/_buildManifest.js +0 -0
  105. /package/.next/static/{gNMdQmtkjPn6XQhRMDoMg → qeqVD-yeoYO_3C0pw9kHg}/_ssgManifest.js +0 -0
@@ -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
  ---
@@ -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:
@@ -206,4 +207,4 @@ Register them all in that single batched call. If a plan added five features, th
206
207
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
207
208
 
208
209
  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};
210
+ ${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};
@@ -1,20 +1,21 @@
1
1
  // @bun
2
- var uq=Object.defineProperty;var Xq=(q)=>q;function Gq(q,z){this[q]=Xq.bind(null,z)}var l=(q,z)=>{for(var J in z)uq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Gq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var d={};l(d,{removeRepoAssets:()=>fq,installRefreshSkill:()=>wq,installPlanSkill:()=>gq,installInitSkill:()=>bq,installCodexRepoSkills:()=>Cq,ensureWorkflowDoc:()=>Nq,ensureMcp:()=>Kq,auditRepo:()=>Mq,REFRESH_SKILL:()=>k,PLAN_SKILL:()=>t,INIT_SKILL:()=>F});import{existsSync as v,mkdirSync as g,readFileSync as W,rmSync as w,writeFileSync as B}from"fs";import{join as $}from"path";function bq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,F),J}function wq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,k),J}function gq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,t),J}function Cq(q){let z=[];for(let J of jq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");B(V,J.body()),z.push(V)}return z}function Nq(q){let z=$(q,"AGENTS.md"),J="";try{J=W(z,"utf8")}catch{}let Q=new RegExp(`${j}[\\s\\S]*?${O}`);J=Q.test(J)?J.replace(Q,s):`${J.trim()}
2
+ var bq=Object.defineProperty;var uq=(q)=>q;function wq(q,z){this[q]=uq.bind(null,z)}var d=(q,z)=>{for(var J in z)bq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:wq.bind(z,J)})};var X=(q,z)=>()=>(q&&(z=q(q=0)),z);var lq=1500,dq=480000,sq=1800000,w=3600000,cq=3000;var s=()=>{};var n={};d(n,{removeRepoAssets:()=>Dq,installRefreshSkill:()=>gq,installPlanSkill:()=>Kq,installInitSkill:()=>jq,installCodexRepoSkills:()=>Nq,ensureWorkflowDoc:()=>Mq,ensureMcp:()=>fq,auditRepo:()=>Rq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>t,INIT_SKILL:()=>E});import{existsSync as v,mkdirSync as g,readFileSync as H,rmSync as j,writeFileSync as W}from"fs";import{join as $}from"path";function jq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,E),J}function gq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,L),J}function Kq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,t),J}function Nq(q){let z=[];for(let J of Cq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");W(V,J.body()),z.push(V)}return z}function Mq(q){let z=$(q,"AGENTS.md"),J="";try{J=H(z,"utf8")}catch{}let Q=new RegExp(`${K}[\\s\\S]*?${y}`);J=Q.test(J)?J.replace(Q,c):`${J.trim()}
3
3
 
4
- ${s}
5
- `.trimStart(),B(z,J.endsWith(`
4
+ ${c}
5
+ `.trimStart(),W(z,J.endsWith(`
6
6
  `)?J:`${J}
7
- `);let V=$(q,"CLAUDE.md"),Y="";try{Y=W(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))B(V,`${Y?`${Y.trim()}
7
+ `);let V=$(q,"CLAUDE.md"),Y="";try{Y=H(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))W(V,`${Y?`${Y.trim()}
8
8
 
9
9
  `:""}@AGENTS.md
10
- `)}function Kq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(W(z,"utf8"))}catch{}if(J.mcpServers=J.mcpServers??{},J.mcpServers.beacon)return{path:z,added:!1};return J.mcpServers.beacon={command:"beacon",args:["mcp"]},B(z,JSON.stringify(J,null,2)+`
11
- `),{path:z,added:!0}}function Mq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(W(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=W($(q,"AGENTS.md"),"utf8").includes(j)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(W($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function fq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(W(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)w(Q,{force:!0});else B(Q,JSON.stringify(Z,null,2)+`
12
- `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=W(Y,"utf8"),P=new RegExp(`\\n?${j}[\\s\\S]*?${O}\\n?`);if(P.test(Z)){let E=Z.replace(P,`
10
+ `)}function fq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(H(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<w)return Q.timeout=w,W(z,JSON.stringify(J,null,2)+`
11
+ `),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:w},W(z,JSON.stringify(J,null,2)+`
12
+ `),{path:z,added:!0,updated:!1}}function Rq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(H(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=H($(q,"AGENTS.md"),"utf8").includes(K)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(H($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function Dq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(H(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)j(Q,{force:!0});else W(Q,JSON.stringify(Z,null,2)+`
13
+ `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=H(Y,"utf8"),P=new RegExp(`\\n?${K}[\\s\\S]*?${y}\\n?`);if(P.test(Z)){let k=Z.replace(P,`
13
14
  `).replace(/\n{3,}/g,`
14
15
 
15
- `).trimStart();B(Y,E.endsWith(`
16
- `)?E:`${E}
17
- `),V=!0}}catch{}let U=!1,H=$(q,"CLAUDE.md");try{let Z=W(H,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())w(H,{force:!0});else B(H,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var F=`---
16
+ `).trimStart();W(Y,k.endsWith(`
17
+ `)?k:`${k}
18
+ `),V=!0}}catch{}let U=!1,B=$(q,"CLAUDE.md");try{let Z=H(B,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())j(B,{force:!0});else W(B,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var E=`---
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
+ `,L=`---
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
  ---
@@ -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
- `,jq,j="<!-- beacon:workflow:start -->",O="<!-- beacon:workflow:end -->",s;var c=b(()=>{jq=[{name:"beacon-init",body:()=>F},{name:"beacon-refresh",body:()=>k}];s=`${j}
152
+ `,Cq,K="<!-- beacon:workflow:start -->",y="<!-- beacon:workflow:end -->",c;var r=X(()=>{s();Cq=[{name:"beacon-init",body:()=>E},{name:"beacon-refresh",body:()=>L}];c=`${K}
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:
@@ -206,18 +207,18 @@ Register them all in that single batched call. If a plan added five features, th
206
207
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
207
208
 
208
209
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
209
- ${O}`});import{existsSync as n,mkdirSync as L,readFileSync as N,rmSync as Tq,writeFileSync as K}from"fs";import{dirname as r,join as C}from"path";function y(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function o(q,z){L(r(q),{recursive:!0}),K(q,JSON.stringify(z,null,2)+`
210
- `)}function e(q,z){let J=y(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),o(q,J),!0}function qq(q,z){return(y(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function zq(q,z){let J=y(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let H=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==H)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return o(q,J),!0}function Jq(q,z,J,Q){let V=`${z}
210
+ ${y}`});import{existsSync as i,mkdirSync as O,readFileSync as N,rmSync as Iq,writeFileSync as M}from"fs";import{dirname as o,join as C}from"path";function h(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function qq(q,z){O(o(q),{recursive:!0}),M(q,JSON.stringify(z,null,2)+`
211
+ `)}function zq(q,z){let J=h(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),qq(q,J),!0}function Jq(q,z){return(h(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function Qq(q,z){let J=h(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let B=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==B)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return qq(q,J),!0}function Vq(q,z,J,Q){let V=`${z}
211
212
  ${Q.trim()}
212
213
  ${J}`,Y="";try{Y=N(q,"utf8")}catch{}let U=new RegExp(`${z}[\\s\\S]*?${J}`);Y=U.test(Y)?Y.replace(U,V):Y.trim()?`${Y.trim()}
213
214
 
214
215
  ${V}
215
216
  `:`${V}
216
- `,L(r(q),{recursive:!0}),K(q,Y.endsWith(`
217
+ `,O(o(q),{recursive:!0}),M(q,Y.endsWith(`
217
218
  `)?Y:`${Y}
218
- `)}function h(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Qq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
219
+ `)}function _(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Yq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
219
220
 
220
- `).trimStart();return K(q,Y),!0}function Vq(q,z,J){let Q=C(q,z);L(Q,{recursive:!0});let V=C(Q,"SKILL.md");return K(V,J),V}function _(q,z){return n(C(q,z,"SKILL.md"))}function Yq(q,z){let J=C(q,z);if(!n(J))return!1;return Tq(J,{recursive:!0,force:!0}),!0}var M,i=`## Beacon (visual planning panel)
221
+ `).trimStart();return M(q,Y),!0}function Zq(q,z,J){let Q=C(q,z);O(Q,{recursive:!0});let V=C(Q,"SKILL.md");return M(V,J),V}function m(q,z){return i(C(q,z,"SKILL.md"))}function $q(q,z){let J=C(q,z);if(!i(J))return!1;return Iq(J,{recursive:!0,force:!0}),!0}var f,e=`## Beacon (visual planning panel)
221
222
 
222
223
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
223
224
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -238,17 +239,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
238
239
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
239
240
  on the /map and /db boards (added features, attached subtasks, edited columns, new
240
241
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
241
- verbatim. Do NOT implement until the tool returns approval.`;var Zq=b(()=>{M=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Iq,renameSync as Rq,rmSync as Aq,writeFileSync as Dq}from"fs";import{dirname as Eq}from"path";function f(q,z){Iq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{Dq(J,z),Rq(J,q)}catch(Q){throw Aq(J,{force:!0}),Q}}function nq(q,z,J=!1){f(q,JSON.stringify(z,null,J?2:void 0))}var $q=()=>{};var _q={};l(_q,{setupCodexAssets:()=>Lq,removeCodexMcp:()=>xq,removeCodexArtifacts:()=>hq,hasCodexMcp:()=>a,ensureCodexMcp:()=>vq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>yq,CODEX_HOOKS:()=>D});import{readFileSync as A}from"fs";import{homedir as Fq}from"os";import{join as G}from"path";function Uq(){return process.env.HOME||process.env.USERPROFILE||Fq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(m===void 0)m=Bun.which("codex")!==null;return m}function X(q){try{return Bun.TOML.parse(q)}catch{return null}}function a(){try{return Boolean(X(A(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=A(x(),"utf8")}catch{return null}let z=X(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function vq(){let q="",z=!1;try{q=A(x(),"utf8"),z=!0}catch{}if(z){let Y=X(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};if(Y.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 ${u}`}}let J=!q?"":q.endsWith(`
242
+ verbatim. Do NOT implement until the tool returns approval.`;var Uq=X(()=>{f=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Aq,renameSync as Tq,rmSync as Fq,writeFileSync as kq}from"fs";import{dirname as Eq}from"path";function R(q,z){Aq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{kq(J,z),Tq(J,q)}catch(Q){throw Fq(J,{force:!0}),Q}}function Qz(q,z,J=!1){R(q,JSON.stringify(z,null,J?2:void 0))}var Pq=()=>{};var Sq={};d(Sq,{setupCodexAssets:()=>hq,removeCodexMcp:()=>Gq,removeCodexArtifacts:()=>mq,hasCodexMcp:()=>l,ensureCodexMcp:()=>Xq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>_q,CODEX_HOOKS:()=>F});import{readFileSync as T}from"fs";import{homedir as Lq}from"os";import{join as u}from"path";function Wq(){return process.env.HOME||process.env.USERPROFILE||Lq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(S===void 0)S=Bun.which("codex")!==null;return S}function b(q){try{return Bun.TOML.parse(q)}catch{return null}}function l(){try{return Boolean(b(T(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=T(x(),"utf8")}catch{return null}let z=b(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${G}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${G}`;return null}function Xq(){let q="",z=!1;try{q=T(x(),"utf8"),z=!0}catch{}if(z){let Y=b(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${G}`};if(Y.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${G}`}}let J=!q?"":q.endsWith(`
242
243
  `)?`
243
244
  `:`
244
245
 
245
- `,Q=q+J+kq;if(X(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return f(x(),Q),{added:!0}}function xq(){let q="";try{q=A(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
246
- `),J=z.indexOf(Wq);if(J===-1)return{removed:!1,skipped:a()};let Q=z.indexOf(Hq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
246
+ `,Q=q+J+yq;if(b(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${G}`};return R(x(),Q),{added:!0}}function Gq(){let q="";try{q=T(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
247
+ `),J=z.indexOf(vq);if(J===-1)return{removed:!1,skipped:l()};let Q=z.indexOf(xq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
247
248
  `).replace(/\n{3,}/g,`
248
249
 
249
- `).replace(/^\n+/,"");if(X(V)===null)return{removed:!1,skipped:!0};return f(x(),V),{removed:!0}}async function Lq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (c(),d)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of M){if(!_(I(),Z))V.push(Z);Vq(I(),Z,Q[Z])}let Y=0;for(let Z of D)if(e(p(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=h(T(),R);Jq(T(),R,Pq,i);let H=vq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:H}}function yq(){let q={};for(let J of M)q[J]=_(I(),J);let z={};for(let J of D)z[J.event]=qq(p(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:h(T(),R),mcp:a()}}function hq(){let q=[];for(let V of M)if(Yq(I(),V))q.push(V);let z=0;for(let V of D)if(zq(p(),{event:V.event,command:V.command}))z++;let J=Qq(T(),R,Pq),Q=xq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var S=()=>G(Uq(),".codex"),p=()=>G(S(),"hooks.json"),x=()=>G(S(),"config.toml"),T=()=>G(S(),"AGENTS.md"),I=()=>G(Uq(),".agents","skills"),R="<!-- beacon:global:start -->",Pq="<!-- beacon:global:end -->",D,m,Wq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Hq="# beacon:end",kq,u="add it manually: codex mcp add beacon -- beacon mcp";var mq=b(()=>{Zq();$q();D=[{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."}];kq=`${Wq}
250
+ `).replace(/^\n+/,"");if(b(V)===null)return{removed:!1,skipped:!0};return R(x(),V),{removed:!0}}async function hq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (r(),n)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of f){if(!m(I(),Z))V.push(Z);Zq(I(),Z,Q[Z])}let Y=0;for(let Z of F)if(zq(a(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=_(D(),A);Vq(D(),A,Hq,e);let B=Xq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:B}}function _q(){let q={};for(let J of f)q[J]=m(I(),J);let z={};for(let J of F)z[J.event]=Jq(a(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:_(D(),A),mcp:l()}}function mq(){let q=[];for(let V of f)if($q(I(),V))q.push(V);let z=0;for(let V of F)if(Qq(a(),{event:V.event,command:V.command}))z++;let J=Yq(D(),A,Hq),Q=Gq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var p=()=>u(Wq(),".codex"),a=()=>u(p(),"hooks.json"),x=()=>u(p(),"config.toml"),D=()=>u(p(),"AGENTS.md"),I=()=>u(Wq(),".agents","skills"),A="<!-- beacon:global:start -->",Hq="<!-- beacon:global:end -->",F,S,vq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",xq="# beacon:end",yq,G="add it manually: codex mcp add beacon -- beacon mcp";var pq=X(()=>{Uq();Pq();F=[{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."}];yq=`${vq}
250
251
  [mcp_servers.beacon]
251
252
  command = "beacon"
252
253
  args = ["mcp"]
253
- ${Hq}
254
- `});mq();export{Lq as setupCodexAssets,xq as removeCodexMcp,hq as removeCodexArtifacts,a as hasCodexMcp,vq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,yq as auditCodex,D as CODEX_HOOKS};
254
+ ${xq}
255
+ `});pq();export{hq as setupCodexAssets,Gq as removeCodexMcp,mq as removeCodexArtifacts,l as hasCodexMcp,Xq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,_q as auditCodex,F as CODEX_HOOKS};
@@ -1,20 +1,21 @@
1
1
  // @bun
2
- var Fq=Object.defineProperty;var Tq=(q)=>q;function Rq(q,z){this[q]=Tq.bind(null,z)}var Pq=(q,z)=>{for(var J in z)Fq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Rq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var r={};Pq(r,{removeRepoAssets:()=>_q,installRefreshSkill:()=>Eq,installPlanSkill:()=>yq,installInitSkill:()=>Iq,installCodexRepoSkills:()=>Dq,ensureWorkflowDoc:()=>Oq,ensureMcp:()=>hq,auditRepo:()=>kq,REFRESH_SKILL:()=>d,PLAN_SKILL:()=>Uq,INIT_SKILL:()=>c});import{existsSync as H,mkdirSync as f,readFileSync as X,rmSync as G,writeFileSync as x}from"fs";import{join as $}from"path";function Iq(q){let z=$(q,".claude","skills","beacon-init");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,c),J}function Eq(q){let z=$(q,".claude","skills","beacon-refresh");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,d),J}function yq(q){let z=$(q,".claude","skills","beacon-plan");f(z,{recursive:!0});let J=$(z,"SKILL.md");return x(J,Uq),J}function Dq(q){let z=[];for(let J of Aq){let Q=$(q,".agents","skills",J.name);f(Q,{recursive:!0});let V=$(Q,"SKILL.md");x(V,J.body()),z.push(V)}return z}function Oq(q){let z=$(q,"AGENTS.md"),J="";try{J=X(z,"utf8")}catch{}let Q=new RegExp(`${C}[\\s\\S]*?${n}`);J=Q.test(J)?J.replace(Q,Wq):`${J.trim()}
2
+ var Tq=Object.defineProperty;var Iq=(q)=>q;function yq(q,z){this[q]=Iq.bind(null,z)}var Wq=(q,z)=>{for(var J in z)Tq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:yq.bind(z,J)})};var j=(q,z)=>()=>(q&&(z=q(q=0)),z);var xz=1500,Hz=480000,wz=1800000,b=3600000,vz=3000;var Xq=()=>{};var s={};Wq(s,{removeRepoAssets:()=>mq,installRefreshSkill:()=>Aq,installPlanSkill:()=>Eq,installInitSkill:()=>Dq,installCodexRepoSkills:()=>kq,ensureWorkflowDoc:()=>hq,ensureMcp:()=>Lq,auditRepo:()=>_q,REFRESH_SKILL:()=>n,PLAN_SKILL:()=>xq,INIT_SKILL:()=>d});import{existsSync as w,mkdirSync as f,readFileSync as x,rmSync as K,writeFileSync as U}from"fs";import{join as $}from"path";function Dq(q){let z=$(q,".claude","skills","beacon-init");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,d),J}function Aq(q){let z=$(q,".claude","skills","beacon-refresh");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,n),J}function Eq(q){let z=$(q,".claude","skills","beacon-plan");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,xq),J}function kq(q){let z=[];for(let J of Oq){let Q=$(q,".agents","skills",J.name);f(Q,{recursive:!0});let V=$(Q,"SKILL.md");U(V,J.body()),z.push(V)}return z}function hq(q){let z=$(q,"AGENTS.md"),J="";try{J=x(z,"utf8")}catch{}let Q=new RegExp(`${C}[\\s\\S]*?${r}`);J=Q.test(J)?J.replace(Q,Uq):`${J.trim()}
3
3
 
4
- ${Wq}
5
- `.trimStart(),x(z,J.endsWith(`
4
+ ${Uq}
5
+ `.trimStart(),U(z,J.endsWith(`
6
6
  `)?J:`${J}
7
- `);let V=$(q,"CLAUDE.md"),Y="";try{Y=X(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))x(V,`${Y?`${Y.trim()}
7
+ `);let V=$(q,"CLAUDE.md"),Y="";try{Y=x(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))U(V,`${Y?`${Y.trim()}
8
8
 
9
9
  `:""}@AGENTS.md
10
- `)}function hq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(X(z,"utf8"))}catch{}if(J.mcpServers=J.mcpServers??{},J.mcpServers.beacon)return{path:z,added:!1};return J.mcpServers.beacon={command:"beacon",args:["mcp"]},x(z,JSON.stringify(J,null,2)+`
11
- `),{path:z,added:!0}}function kq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(X(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=X($(q,"AGENTS.md"),"utf8").includes(C)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(X($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":H($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":H($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":H($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":H($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function _q(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=$(q,".claude","skills",Z);if(H(U))G(U,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let U=$(q,".agents","skills",Z);if(H(U))G(U,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(X(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)G(Q,{force:!0});else x(Q,JSON.stringify(Z,null,2)+`
12
- `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=X(Y,"utf8"),U=new RegExp(`\\n?${C}[\\s\\S]*?${n}\\n?`);if(U.test(Z)){let t=Z.replace(U,`
10
+ `)}function Lq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(x(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<b)return Q.timeout=b,U(z,JSON.stringify(J,null,2)+`
11
+ `),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:b},U(z,JSON.stringify(J,null,2)+`
12
+ `),{path:z,added:!0,updated:!1}}function _q(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(x(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=x($(q,"AGENTS.md"),"utf8").includes(C)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(x($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":w($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":w($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":w($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":w($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function mq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=$(q,".claude","skills",Z);if(w(X))K(X,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let X=$(q,".agents","skills",Z);if(w(X))K(X,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(x(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)K(Q,{force:!0});else U(Q,JSON.stringify(Z,null,2)+`
13
+ `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=x(Y,"utf8"),X=new RegExp(`\\n?${C}[\\s\\S]*?${r}\\n?`);if(X.test(Z)){let t=Z.replace(X,`
13
14
  `).replace(/\n{3,}/g,`
14
15
 
15
- `).trimStart();x(Y,t.endsWith(`
16
+ `).trimStart();U(Y,t.endsWith(`
16
17
  `)?t:`${t}
17
- `),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=X(W,"utf8"),U=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==Z){if(!U.trim())G(W,{force:!0});else x(W,U);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var c=`---
18
+ `),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=x(W,"utf8"),X=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==Z){if(!X.trim())K(W,{force:!0});else U(W,X);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var d=`---
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
- `,d=`---
57
+ `,n=`---
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
  ---
@@ -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
- `,Uq=`---
104
+ `,xq=`---
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
- `,Aq,C="<!-- beacon:workflow:start -->",n="<!-- beacon:workflow:end -->",Wq;var s=b(()=>{Aq=[{name:"beacon-init",body:()=>c},{name:"beacon-refresh",body:()=>d}];Wq=`${C}
152
+ `,Oq,C="<!-- beacon:workflow:start -->",r="<!-- beacon:workflow:end -->",Uq;var l=j(()=>{Xq();Oq=[{name:"beacon-init",body:()=>d},{name:"beacon-refresh",body:()=>n}];Uq=`${C}
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:
@@ -206,18 +207,18 @@ Register them all in that single batched call. If a plan added five features, th
206
207
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
207
208
 
208
209
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
209
- ${n}`});import{existsSync as xq,mkdirSync as l,readFileSync as M,rmSync as Lq,writeFileSync as F}from"fs";import{dirname as Xq,join as K}from"path";function i(q){try{return JSON.parse(M(q,"utf8"))}catch{return{}}}function wq(q,z){l(Xq(q),{recursive:!0}),F(q,JSON.stringify(z,null,2)+`
210
- `)}function R(q,z){let J=i(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((P)=>P.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),wq(q,J),!0}function I(q,z){return(i(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function E(q,z){let J=i(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((P)=>{let W=P.hooks?.length??0,Z=(P.hooks??[]).filter((U)=>U.command!==z.command);if(Z.length!==W)V=!0;return{...P,hooks:Z}}).filter((P)=>(P.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return wq(q,J),!0}function y(q,z,J,Q){let V=`${z}
210
+ ${r}`});import{existsSync as Hq,mkdirSync as i,readFileSync as M,rmSync as pq,writeFileSync as R}from"fs";import{dirname as wq,join as F}from"path";function o(q){try{return JSON.parse(M(q,"utf8"))}catch{return{}}}function vq(q,z){i(wq(q),{recursive:!0}),R(q,JSON.stringify(z,null,2)+`
211
+ `)}function I(q,z){let J=o(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((P)=>P.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),vq(q,J),!0}function y(q,z){return(o(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function D(q,z){let J=o(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((P)=>{let W=P.hooks?.length??0,Z=(P.hooks??[]).filter((X)=>X.command!==z.command);if(Z.length!==W)V=!0;return{...P,hooks:Z}}).filter((P)=>(P.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return vq(q,J),!0}function A(q,z,J,Q){let V=`${z}
211
212
  ${Q.trim()}
212
213
  ${J}`,Y="";try{Y=M(q,"utf8")}catch{}let P=new RegExp(`${z}[\\s\\S]*?${J}`);Y=P.test(Y)?Y.replace(P,V):Y.trim()?`${Y.trim()}
213
214
 
214
215
  ${V}
215
216
  `:`${V}
216
- `,l(Xq(q),{recursive:!0}),F(q,Y.endsWith(`
217
+ `,i(wq(q),{recursive:!0}),R(q,Y.endsWith(`
217
218
  `)?Y:`${Y}
218
- `)}function v(q,z){try{return M(q,"utf8").includes(z)}catch{return!1}}function A(q,z,J){let Q="";try{Q=M(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
219
+ `)}function g(q,z){try{return M(q,"utf8").includes(z)}catch{return!1}}function E(q,z,J){let Q="";try{Q=M(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
219
220
 
220
- `).trimStart();return F(q,Y),!0}function D(q,z,J){let Q=K(q,z);l(Q,{recursive:!0});let V=K(Q,"SKILL.md");return F(V,J),V}function j(q,z){return xq(K(q,z,"SKILL.md"))}function O(q,z){let J=K(q,z);if(!xq(J))return!1;return Lq(J,{recursive:!0,force:!0}),!0}var w,T=`## Beacon (visual planning panel)
221
+ `).trimStart();return R(q,Y),!0}function O(q,z,J){let Q=F(q,z);i(Q,{recursive:!0});let V=F(Q,"SKILL.md");return R(V,J),V}function B(q,z){return Hq(F(q,z,"SKILL.md"))}function k(q,z){let J=F(q,z);if(!Hq(J))return!1;return pq(J,{recursive:!0,force:!0}),!0}var H,T=`## Beacon (visual planning panel)
221
222
 
222
223
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
223
224
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -238,17 +239,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
238
239
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
239
240
  on the /map and /db boards (added features, attached subtasks, edited columns, new
240
241
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
241
- verbatim. Do NOT implement until the tool returns approval.`;var o=b(()=>{w=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as mq,renameSync as pq,rmSync as Sq,writeFileSync as aq}from"fs";import{dirname as tq}from"path";function h(q,z){mq(tq(q),{recursive:!0});let J=`${q}.tmp`;try{aq(J,z),pq(J,q)}catch(Q){throw Sq(J,{force:!0}),Q}}function jz(q,z,J=!1){h(q,JSON.stringify(z,null,J?2:void 0))}var Hq=()=>{};var Gq={};Pq(Gq,{setupCodexAssets:()=>rq,removeCodexMcp:()=>bq,removeCodexArtifacts:()=>lq,hasCodexMcp:()=>Jq,ensureCodexMcp:()=>Nq,codexMcpProblem:()=>nq,codexDetected:()=>jq,auditCodex:()=>sq,CODEX_HOOKS:()=>p});import{readFileSync as m}from"fs";import{homedir as cq}from"os";import{join as N}from"path";function gq(){return process.env.HOME||process.env.USERPROFILE||cq()}function jq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(e===void 0)e=Bun.which("codex")!==null;return e}function u(q){try{return Bun.TOML.parse(q)}catch{return null}}function Jq(){try{return Boolean(u(m(g(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function nq(){let q="";try{q=m(g(),"utf8")}catch{return null}let z=u(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${B}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${B}`;return null}function Nq(){let q="",z=!1;try{q=m(g(),"utf8"),z=!0}catch{}if(z){let Y=u(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${B}`};if(Y.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 ${B}`}}let J=!q?"":q.endsWith(`
242
+ verbatim. Do NOT implement until the tool returns approval.`;var e=j(()=>{H=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Sq,renameSync as aq,rmSync as cq,writeFileSync as tq}from"fs";import{dirname as dq}from"path";function h(q,z){Sq(dq(q),{recursive:!0});let J=`${q}.tmp`;try{tq(J,z),aq(J,q)}catch(Q){throw cq(J,{force:!0}),Q}}function Cz(q,z,J=!1){h(q,JSON.stringify(z,null,J?2:void 0))}var jq=()=>{};var fq={};Wq(fq,{setupCodexAssets:()=>lq,removeCodexMcp:()=>Kq,removeCodexArtifacts:()=>oq,hasCodexMcp:()=>Qq,ensureCodexMcp:()=>bq,codexMcpProblem:()=>sq,codexDetected:()=>uq,auditCodex:()=>iq,CODEX_HOOKS:()=>S});import{readFileSync as p}from"fs";import{homedir as nq}from"os";import{join as G}from"path";function gq(){return process.env.HOME||process.env.USERPROFILE||nq()}function uq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(qq===void 0)qq=Bun.which("codex")!==null;return qq}function N(q){try{return Bun.TOML.parse(q)}catch{return null}}function Qq(){try{return Boolean(N(p(v(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function sq(){let q="";try{q=p(v(),"utf8")}catch{return null}let z=N(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function bq(){let q="",z=!1;try{q=p(v(),"utf8"),z=!0}catch{}if(z){let Y=N(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};if(Y.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 ${u}`}}let J=!q?"":q.endsWith(`
242
243
  `)?`
243
244
  `:`
244
245
 
245
- `,Q=q+J+dq;if(u(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${B}`};return h(g(),Q),{added:!0}}function bq(){let q="";try{q=m(g(),"utf8")}catch{return{removed:!1}}let z=q.split(`
246
- `),J=z.indexOf(Bq);if(J===-1)return{removed:!1,skipped:Jq()};let Q=z.indexOf(uq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
246
+ `,Q=q+J+rq;if(N(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return h(v(),Q),{added:!0}}function Kq(){let q="";try{q=p(v(),"utf8")}catch{return{removed:!1}}let z=q.split(`
247
+ `),J=z.indexOf(Nq);if(J===-1)return{removed:!1,skipped:Qq()};let Q=z.indexOf(Gq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
247
248
  `).replace(/\n{3,}/g,`
248
249
 
249
- `).replace(/^\n+/,"");if(u(V)===null)return{removed:!1,skipped:!0};return h(g(),V),{removed:!0}}async function rq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of w){if(!j(_(),Z))V.push(Z);D(_(),Z,Q[Z])}let Y=0;for(let Z of p)if(R(zq(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let P=v(k(),L);y(k(),L,vq,T);let W=Nq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!P,mcp:W}}function sq(){let q={};for(let J of w)q[J]=j(_(),J);let z={};for(let J of p)z[J.event]=I(zq(),{event:J.event,command:J.command});return{detected:jq(),skills:q,hooks:z,agentsMdBlock:v(k(),L),mcp:Jq()}}function lq(){let q=[];for(let V of w)if(O(_(),V))q.push(V);let z=0;for(let V of p)if(E(zq(),{event:V.event,command:V.command}))z++;let J=A(k(),L,vq),Q=bq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var qq=()=>N(gq(),".codex"),zq=()=>N(qq(),"hooks.json"),g=()=>N(qq(),"config.toml"),k=()=>N(qq(),"AGENTS.md"),_=()=>N(gq(),".agents","skills"),L="<!-- beacon:global:start -->",vq="<!-- beacon:global:end -->",p,e,Bq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",uq="# beacon:end",dq,B="add it manually: codex mcp add beacon -- beacon mcp";var fq=b(()=>{o();Hq();p=[{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."}];dq=`${Bq}
250
+ `).replace(/^\n+/,"");if(N(V)===null)return{removed:!1,skipped:!0};return h(v(),V),{removed:!0}}async function lq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (l(),s)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of H){if(!B(_(),Z))V.push(Z);O(_(),Z,Q[Z])}let Y=0;for(let Z of S)if(I(Jq(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let P=g(L(),m);A(L(),m,Bq,T);let W=bq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!P,mcp:W}}function iq(){let q={};for(let J of H)q[J]=B(_(),J);let z={};for(let J of S)z[J.event]=y(Jq(),{event:J.event,command:J.command});return{detected:uq(),skills:q,hooks:z,agentsMdBlock:g(L(),m),mcp:Qq()}}function oq(){let q=[];for(let V of H)if(k(_(),V))q.push(V);let z=0;for(let V of S)if(D(Jq(),{event:V.event,command:V.command}))z++;let J=E(L(),m,Bq),Q=Kq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var zq=()=>G(gq(),".codex"),Jq=()=>G(zq(),"hooks.json"),v=()=>G(zq(),"config.toml"),L=()=>G(zq(),"AGENTS.md"),_=()=>G(gq(),".agents","skills"),m="<!-- beacon:global:start -->",Bq="<!-- beacon:global:end -->",S,qq,Nq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Gq="# beacon:end",rq,u="add it manually: codex mcp add beacon -- beacon mcp";var Cq=j(()=>{e();jq();S=[{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."}];rq=`${Nq}
250
251
  [mcp_servers.beacon]
251
252
  command = "beacon"
252
253
  args = ["mcp"]
253
- ${uq}
254
- `});o();import{existsSync as iq}from"fs";import{homedir as oq}from"os";import{join as S}from"path";function eq(){return process.env.HOME||process.env.USERPROFILE||oq()}var a=()=>S(eq(),".claude"),Qq=()=>S(a(),"skills"),Vq=()=>S(a(),"settings.json"),Yq=()=>S(a(),"CLAUDE.md"),Zq="<!-- beacon:global:start -->",Cq="<!-- beacon:global:end -->";var qz=T,$q=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function zz(q,z){return D(Qq(),q,z)}function Kq(q){return j(Qq(),q)}function Jz(q){return O(Qq(),q)}function Qz(q){return R(Vq(),q)}function Vz(q){return I(Vq(),q)}function Yz(q){return E(Vq(),q)}function Zz(q){y(Yq(),Zq,Cq,q)}function Mq(){return v(Yq(),Zq)}function $z(){return A(Yq(),Zq,Cq)}function Tz(){let q={};for(let J of w)q[J]=Kq(J);let z={};for(let J of $q)z[J.event]=Vz({event:J.event,command:J.command});return{homeExists:iq(a()),skills:q,hooks:z,claudeMdBlock:Mq()}}async function Pz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (s(),r)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of w){if(!Kq(W))V.push(W);zz(W,Q[W])}let Y=0;for(let W of $q)if(Qz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Mq();return Zz(qz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function Rz(){let q;try{q={ok:!0,...await Pz()}}catch(z){q={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let z=await Promise.resolve().then(() => (fq(),Gq));if(z.codexDetected())q.codex={ok:!0,...await z.setupCodexAssets()}}catch(z){q.codex={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return q}function Iz(){let q=[];for(let Q of w)if(Jz(Q))q.push(Q);let z=0;for(let Q of $q)if(Yz(Q))z++;let J=$z();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Pz as setupGlobalAssets,Rz as selfHealGlobal,Jz as removeGlobalSkill,Yz as removeGlobalHook,$z as removeGlobalClaudeMdBlock,Iz as removeBeaconArtifacts,Kq as isGlobalSkillInstalled,zz as installGlobalSkill,Vz as hasGlobalHook,Mq as hasGlobalClaudeMdBlock,Qz as ensureGlobalHook,Zz as ensureGlobalClaudeMdBlock,Tz as auditGlobal,w as GLOBAL_SKILLS,$q as GLOBAL_HOOKS,qz as GLOBAL_CLAUDE_MD_BLOCK};
254
+ ${Gq}
255
+ `});e();import{existsSync as eq}from"fs";import{homedir as qz}from"os";import{join as a}from"path";function zz(){return process.env.HOME||process.env.USERPROFILE||qz()}var c=()=>a(zz(),".claude"),Vq=()=>a(c(),"skills"),Yq=()=>a(c(),"settings.json"),Zq=()=>a(c(),"CLAUDE.md"),$q="<!-- beacon:global:start -->",Fq="<!-- beacon:global:end -->";var Jz=T,Pq=[{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 Qz(q,z){return O(Vq(),q,z)}function Mq(q){return B(Vq(),q)}function Vz(q){return k(Vq(),q)}function Yz(q){return I(Yq(),q)}function Zz(q){return y(Yq(),q)}function $z(q){return D(Yq(),q)}function Pz(q){A(Zq(),$q,Fq,q)}function Rq(){return g(Zq(),$q)}function Wz(){return E(Zq(),$q,Fq)}function kz(){let q={};for(let J of H)q[J]=Mq(J);let z={};for(let J of Pq)z[J.event]=Zz({event:J.event,command:J.command});return{homeExists:eq(c()),skills:q,hooks:z,claudeMdBlock:Rq()}}async function Xz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (l(),s)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of H){if(!Mq(W))V.push(W);Qz(W,Q[W])}let Y=0;for(let W of Pq)if(Yz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Rq();return Pz(Jz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function hz(){let q;try{q={ok:!0,...await Xz()}}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(() => (Cq(),fq));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 Lz(){let q=[];for(let Q of H)if(Vz(Q))q.push(Q);let z=0;for(let Q of Pq)if($z(Q))z++;let J=Wz();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Xz as setupGlobalAssets,hz as selfHealGlobal,Vz as removeGlobalSkill,$z as removeGlobalHook,Wz as removeGlobalClaudeMdBlock,Lz as removeBeaconArtifacts,Mq as isGlobalSkillInstalled,Qz as installGlobalSkill,Zz as hasGlobalHook,Rq as hasGlobalClaudeMdBlock,Yz as ensureGlobalHook,Pz as ensureGlobalClaudeMdBlock,kz as auditGlobal,H as GLOBAL_SKILLS,Pq as GLOBAL_HOOKS,Jz as GLOBAL_CLAUDE_MD_BLOCK};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trybeacon",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "The visual planning surface for the coding agent in your terminal.",
5
5
  "homepage": "https://trybeacon.sh",
6
6
  "bin": {