trybeacon 0.1.42 → 0.1.44

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 (83) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +6 -6
  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 +1 -1
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  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 +1 -1
  23. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/docs.html +1 -1
  25. package/.next/server/app/docs.rsc +1 -1
  26. package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  27. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  28. package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  29. package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  30. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  31. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  32. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/feedback.html +1 -1
  34. package/.next/server/app/feedback.rsc +1 -1
  35. package/.next/server/app/feedback.segments/_full.segment.rsc +1 -1
  36. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  37. package/.next/server/app/feedback.segments/_index.segment.rsc +1 -1
  38. package/.next/server/app/feedback.segments/_tree.segment.rsc +1 -1
  39. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  40. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  41. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/help.html +1 -1
  43. package/.next/server/app/help.rsc +1 -1
  44. package/.next/server/app/help.segments/_full.segment.rsc +1 -1
  45. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  46. package/.next/server/app/help.segments/_index.segment.rsc +1 -1
  47. package/.next/server/app/help.segments/_tree.segment.rsc +1 -1
  48. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  49. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  50. package/.next/server/app/index.html +1 -1
  51. package/.next/server/app/index.rsc +1 -1
  52. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  53. package/.next/server/app/index.segments/_full.segment.rsc +1 -1
  54. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  55. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  56. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  57. package/.next/server/app/map/page.js +2 -2
  58. package/.next/server/app/map/page.js.nft.json +1 -1
  59. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/plan/page.js +1 -1
  62. package/.next/server/app/plan/page.js.nft.json +1 -1
  63. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app-paths-manifest.json +6 -6
  66. package/.next/server/chunks/8721.js +1 -0
  67. package/.next/server/middleware-build-manifest.js +1 -1
  68. package/.next/server/pages/404.html +1 -1
  69. package/.next/server/pages/500.html +1 -1
  70. package/.next/server/server-reference-manifest.js +1 -1
  71. package/.next/server/server-reference-manifest.json +1 -1
  72. package/.next/static/chunks/290-5152ea363823e8c1.js +1 -0
  73. package/.next/static/chunks/app/map/{page-cdcbd85c17284617.js → page-2a777af60269115f.js} +1 -1
  74. package/.next/static/chunks/app/plan/{page-b86df32f2e69c8ce.js → page-6410aff5b7e5824e.js} +1 -1
  75. package/.next/trace +38 -38
  76. package/.next/trace-build +1 -1
  77. package/dist/bin/mcp.js +32 -32
  78. package/dist/bin/plan.js +24 -24
  79. package/package.json +1 -1
  80. package/.next/server/chunks/6145.js +0 -1
  81. package/.next/static/chunks/6301-7faa9893c648f9d2.js +0 -1
  82. /package/.next/static/{5Rio8Aih0IGNDObFjghRl → mB1_GJSUQn5UQrUls82y3}/_buildManifest.js +0 -0
  83. /package/.next/static/{5Rio8Aih0IGNDObFjghRl → mB1_GJSUQn5UQrUls82y3}/_ssgManifest.js +0 -0
package/dist/bin/plan.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var FZ=Object.defineProperty;var uZ=(Q)=>Q;function RZ(Q,Z){this[Q]=uZ.bind(null,Z)}var JQ=(Q,Z)=>{for(var $ in Z)FZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:RZ.bind(Z,$)})};var T=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var XQ={};JQ(XQ,{removeRepoAssets:()=>yZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>bZ,installInitSkill:()=>wZ,installCodexRepoSkills:()=>AZ,ensureWorkflowDoc:()=>EZ,ensureMcp:()=>DZ,auditRepo:()=>OZ,REFRESH_SKILL:()=>zQ,PLAN_SKILL:()=>OQ,INIT_SKILL:()=>VQ});import{existsSync as v,mkdirSync as A,readFileSync as G,rmSync as f,writeFileSync as H}from"fs";import{join as U}from"path";function wZ(Q){let Z=U(Q,".claude","skills","beacon-init");A(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,VQ),$}function IZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");A(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,zQ),$}function bZ(Q){let Z=U(Q,".claude","skills","beacon-plan");A(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,OQ),$}function AZ(Q){let Z=[];for(let $ of fZ){let Y=U(Q,".agents","skills",$.name);A(Y,{recursive:!0});let J=U(Y,"SKILL.md");H(J,$.body()),Z.push(J)}return Z}function EZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=G(Z,"utf8")}catch{}let Y=new RegExp(`${E}[\\s\\S]*?${qQ}`);$=Y.test($)?$.replace(Y,DQ):`${$.trim()}
3
+ var gZ=Object.defineProperty;var FZ=(Q)=>Q;function RZ(Q,Z){this[Q]=FZ.bind(null,Z)}var YQ=(Q,Z)=>{for(var $ in Z)gZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:RZ.bind(Z,$)})};var M=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var qQ={};YQ(qQ,{removeRepoAssets:()=>bZ,installRefreshSkill:()=>wZ,installPlanSkill:()=>AZ,installInitSkill:()=>uZ,installCodexRepoSkills:()=>fZ,ensureWorkflowDoc:()=>DZ,ensureMcp:()=>IZ,auditRepo:()=>OZ,REFRESH_SKILL:()=>VQ,PLAN_SKILL:()=>OQ,INIT_SKILL:()=>JQ});import{existsSync as v,mkdirSync as f,readFileSync as G,rmSync as E,writeFileSync as H}from"fs";import{join as U}from"path";function uZ(Q){let Z=U(Q,".claude","skills","beacon-init");f(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,JQ),$}function wZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");f(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,VQ),$}function AZ(Q){let Z=U(Q,".claude","skills","beacon-plan");f(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,OQ),$}function fZ(Q){let Z=[];for(let $ of EZ){let Y=U(Q,".agents","skills",$.name);f(Y,{recursive:!0});let J=U(Y,"SKILL.md");H(J,$.body()),Z.push(J)}return Z}function DZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=G(Z,"utf8")}catch{}let Y=new RegExp(`${D}[\\s\\S]*?${zQ}`);$=Y.test($)?$.replace(Y,IQ):`${$.trim()}
4
4
 
5
- ${DQ}
5
+ ${IQ}
6
6
  `.trimStart(),H(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
8
  `);let J=U(Q,"CLAUDE.md"),V="";try{V=G(J,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(J,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function DZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(G(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 OZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(G(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=G(U(Q,"AGENTS.md"),"utf8").includes(E)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(G(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":v(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function yZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=U(Q,".claude","skills",z);if(v(W))f(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=U(Q,".agents","skills",z);if(v(W))f(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(G(Y,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)f(Y,{force:!0});else H(Y,JSON.stringify(z,null,2)+`
13
- `)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=G(V,"utf8"),W=new RegExp(`\\n?${E}[\\s\\S]*?${qQ}\\n?`);if(W.test(z)){let M=z.replace(W,`
11
+ `)}function IZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(G(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 OZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(G(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=G(U(Q,"AGENTS.md"),"utf8").includes(D)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(G(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":v(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function bZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=U(Q,".claude","skills",z);if(v(W))E(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=U(Q,".agents","skills",z);if(v(W))E(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(G(Y,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)E(Y,{force:!0});else H(Y,JSON.stringify(z,null,2)+`
13
+ `)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=G(V,"utf8"),W=new RegExp(`\\n?${D}[\\s\\S]*?${zQ}\\n?`);if(W.test(z)){let B=z.replace(W,`
14
14
  `).replace(/\n{3,}/g,`
15
15
 
16
- `).trimStart();H(V,M.endsWith(`
17
- `)?M:`${M}
18
- `),J=!0}}catch{}let q=!1,X=U(Q,"CLAUDE.md");try{let z=G(X,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())f(X,{force:!0});else H(X,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var VQ=`---
16
+ `).trimStart();H(V,B.endsWith(`
17
+ `)?B:`${B}
18
+ `),J=!0}}catch{}let q=!1,X=U(Q,"CLAUDE.md");try{let z=G(X,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())E(X,{force:!0});else H(X,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var JQ=`---
19
19
  name: beacon-init
20
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
21
21
  ---
@@ -54,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
54
54
  If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
55
55
 
56
56
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
57
- `,zQ=`---
57
+ `,VQ=`---
58
58
  name: beacon-refresh
59
59
  description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
60
60
  ---
@@ -143,7 +143,7 @@ If it returns feedback, revise and call it again.
143
143
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
144
144
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
145
145
  run \`beacon\` in this repo once.
146
- `,fZ,E="<!-- beacon:workflow:start -->",qQ="<!-- beacon:workflow:end -->",DQ;var UQ=T(()=>{fZ=[{name:"beacon-init",body:()=>VQ},{name:"beacon-refresh",body:()=>zQ}];DQ=`${E}
146
+ `,EZ,D="<!-- beacon:workflow:start -->",zQ="<!-- beacon:workflow:end -->",IQ;var XQ=M(()=>{EZ=[{name:"beacon-init",body:()=>JQ},{name:"beacon-refresh",body:()=>VQ}];IQ=`${D}
147
147
  ## Beacon \u2014 feature workflow
148
148
 
149
149
  This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
@@ -201,18 +201,18 @@ Register them all in that single batched call. If a plan added five features, th
201
201
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
202
202
 
203
203
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
204
- ${qQ}`});import{existsSync as yQ,mkdirSync as WQ,readFileSync as O,rmSync as LZ,writeFileSync as y}from"fs";import{dirname as LQ,join as D}from"path";function BQ(Q){try{return JSON.parse(O(Q,"utf8"))}catch{return{}}}function kQ(Q,Z){WQ(LQ(Q),{recursive:!0}),y(Q,JSON.stringify(Z,null,2)+`
205
- `)}function k(Q,Z){let $=BQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),kQ(Q,$),!0}function _(Q,Z){return(BQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function S(Q,Z){let $=BQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let X=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==X)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return kQ(Q,$),!0}function h(Q,Z,$,Y){let J=`${Z}
204
+ ${zQ}`});import{existsSync as bQ,mkdirSync as UQ,readFileSync as O,rmSync as yZ,writeFileSync as b}from"fs";import{dirname as yQ,join as I}from"path";function WQ(Q){try{return JSON.parse(O(Q,"utf8"))}catch{return{}}}function LQ(Q,Z){UQ(yQ(Q),{recursive:!0}),b(Q,JSON.stringify(Z,null,2)+`
205
+ `)}function L(Q,Z){let $=WQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),LQ(Q,$),!0}function k(Q,Z){return(WQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function _(Q,Z){let $=WQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let X=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==X)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return LQ(Q,$),!0}function S(Q,Z,$,Y){let J=`${Z}
206
206
  ${Y.trim()}
207
207
  ${$}`,V="";try{V=O(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
208
208
 
209
209
  ${J}
210
210
  `:`${J}
211
- `,WQ(LQ(Q),{recursive:!0}),y(Q,V.endsWith(`
211
+ `,UQ(yQ(Q),{recursive:!0}),b(Q,V.endsWith(`
212
212
  `)?V:`${V}
213
- `)}function g(Q,Z){try{return O(Q,"utf8").includes(Z)}catch{return!1}}function m(Q,Z,$){let Y="";try{Y=O(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
213
+ `)}function T(Q,Z){try{return O(Q,"utf8").includes(Z)}catch{return!1}}function h(Q,Z,$){let Y="";try{Y=O(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
214
214
 
215
- `).trimStart();return y(Q,V),!0}function p(Q,Z,$){let Y=D(Q,Z);WQ(Y,{recursive:!0});let J=D(Y,"SKILL.md");return y(J,$),J}function F(Q,Z){return yQ(D(Q,Z,"SKILL.md"))}function c(Q,Z){let $=D(Q,Z);if(!yQ($))return!1;return LZ($,{recursive:!0,force:!0}),!0}var x,L=`## Beacon (visual planning panel)
215
+ `).trimStart();return b(Q,V),!0}function m(Q,Z,$){let Y=I(Q,Z);UQ(Y,{recursive:!0});let J=I(Y,"SKILL.md");return b(J,$),J}function g(Q,Z){return bQ(I(Q,Z,"SKILL.md"))}function p(Q,Z){let $=I(Q,Z);if(!bQ($))return!1;return yZ($,{recursive:!0,force:!0}),!0}var x,y=`## Beacon (visual planning panel)
216
216
 
217
217
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
218
218
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -233,24 +233,24 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
233
233
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
234
234
  on the /map and /db boards (added features, attached subtasks, edited columns, new
235
235
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
236
- verbatim. Do NOT implement until the tool returns approval.`;var HQ=T(()=>{x=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as kZ,renameSync as _Z,rmSync as SZ,writeFileSync as hZ}from"fs";import{dirname as mZ}from"path";function l(Q,Z){kZ(mZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{hZ($,Z),_Z($,Q)}catch(Y){throw SZ($,{force:!0}),Y}}function H1(Q,Z,$=!1){l(Q,JSON.stringify(Z,null,$?2:void 0))}var _Q=()=>{};var nQ={};JQ(nQ,{setupCodexAssets:()=>dZ,removeCodexMcp:()=>dQ,removeCodexArtifacts:()=>aZ,hasCodexMcp:()=>PQ,ensureCodexMcp:()=>lQ,codexMcpProblem:()=>lZ,codexDetected:()=>mQ,auditCodex:()=>nZ,CODEX_HOOKS:()=>t});import{readFileSync as s}from"fs";import{homedir as pZ}from"os";import{join as w}from"path";function SQ(){return process.env.HOME||process.env.USERPROFILE||pZ()}function mQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(jQ===void 0)jQ=Bun.which("codex")!==null;return jQ}function R(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function PQ(){try{return Boolean(R(s(C(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function lZ(){let Q="";try{Q=s(C(),"utf8")}catch{return null}let Z=R(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 lQ(){let Q="",Z=!1;try{Q=s(C(),"utf8"),Z=!0}catch{}if(Z){let V=R(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};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 ${u}`}}let $=!Q?"":Q.endsWith(`
236
+ verbatim. Do NOT implement until the tool returns approval.`;var BQ=M(()=>{x=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as LZ,renameSync as kZ,rmSync as _Z,writeFileSync as SZ}from"fs";import{dirname as hZ}from"path";function c(Q,Z){LZ(hZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{SZ($,Z),kZ($,Q)}catch(Y){throw _Z($,{force:!0}),Y}}function j1(Q,Z,$=!1){c(Q,JSON.stringify(Z,null,$?2:void 0))}var kQ=()=>{};var dQ={};YQ(dQ,{setupCodexAssets:()=>lZ,removeCodexMcp:()=>lQ,removeCodexArtifacts:()=>nZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>cQ,codexMcpProblem:()=>cZ,codexDetected:()=>hQ,auditCodex:()=>dZ,CODEX_HOOKS:()=>s});import{readFileSync as a}from"fs";import{homedir as mZ}from"os";import{join as u}from"path";function _Q(){return process.env.HOME||process.env.USERPROFILE||mZ()}function hQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(HQ===void 0)HQ=Bun.which("codex")!==null;return HQ}function R(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(R(a(C(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function cZ(){let Q="";try{Q=a(C(),"utf8")}catch{return null}let Z=R(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${F}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${F}`;return null}function cQ(){let Q="",Z=!1;try{Q=a(C(),"utf8"),Z=!0}catch{}if(Z){let V=R(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${F}`};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 ${F}`}}let $=!Q?"":Q.endsWith(`
237
237
  `)?`
238
238
  `:`
239
239
 
240
- `,Y=Q+$+cZ;if(R(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return l(C(),Y),{added:!0}}function dQ(){let Q="";try{Q=s(C(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
241
- `),$=Z.indexOf(pQ);if($===-1)return{removed:!1,skipped:PQ()};let Y=Z.indexOf(cQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
240
+ `,Y=Q+$+pZ;if(R(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${F}`};return c(C(),Y),{added:!0}}function lQ(){let Q="";try{Q=a(C(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
241
+ `),$=Z.indexOf(mQ);if($===-1)return{removed:!1,skipped:xQ()};let Y=Z.indexOf(pQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
242
242
  `).replace(/\n{3,}/g,`
243
243
 
244
- `).replace(/^\n+/,"");if(R(J)===null)return{removed:!1,skipped:!0};return l(C(),J),{removed:!0}}async function dZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (UQ(),XQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let z of x){if(!F(n(),z))J.push(z);p(n(),z,Y[z])}let V=0;for(let z of t)if(k(xQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=g(d(),a);h(d(),a,hQ,L);let X=lQ();return{skillsAdded:J,hooksAdded:V,agentsMdBlockTouched:!q,mcp:X}}function nZ(){let Q={};for(let $ of x)Q[$]=F(n(),$);let Z={};for(let $ of t)Z[$.event]=_(xQ(),{event:$.event,command:$.command});return{detected:mQ(),skills:Q,hooks:Z,agentsMdBlock:g(d(),a),mcp:PQ()}}function aZ(){let Q=[];for(let J of x)if(c(n(),J))Q.push(J);let Z=0;for(let J of t)if(S(xQ(),{event:J.event,command:J.command}))Z++;let $=m(d(),a,hQ),Y=dQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var GQ=()=>w(SQ(),".codex"),xQ=()=>w(GQ(),"hooks.json"),C=()=>w(GQ(),"config.toml"),d=()=>w(GQ(),"AGENTS.md"),n=()=>w(SQ(),".agents","skills"),a="<!-- beacon:global:start -->",hQ="<!-- beacon:global:end -->",t,jQ,pQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",cQ="# beacon:end",cZ,u="add it manually: codex mcp add beacon -- beacon mcp";var aQ=T(()=>{HQ();_Q();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."}];cZ=`${pQ}
244
+ `).replace(/^\n+/,"");if(R(J)===null)return{removed:!1,skipped:!0};return c(C(),J),{removed:!0}}async function lZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (XQ(),qQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let z of x){if(!g(d(),z))J.push(z);m(d(),z,Y[z])}let V=0;for(let z of s)if(L(GQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=T(l(),n);S(l(),n,SQ,y);let X=cQ();return{skillsAdded:J,hooksAdded:V,agentsMdBlockTouched:!q,mcp:X}}function dZ(){let Q={};for(let $ of x)Q[$]=g(d(),$);let Z={};for(let $ of s)Z[$.event]=k(GQ(),{event:$.event,command:$.command});return{detected:hQ(),skills:Q,hooks:Z,agentsMdBlock:T(l(),n),mcp:xQ()}}function nZ(){let Q=[];for(let J of x)if(p(d(),J))Q.push(J);let Z=0;for(let J of s)if(_(GQ(),{event:J.event,command:J.command}))Z++;let $=h(l(),n,SQ),Y=lQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var jQ=()=>u(_Q(),".codex"),GQ=()=>u(jQ(),"hooks.json"),C=()=>u(jQ(),"config.toml"),l=()=>u(jQ(),"AGENTS.md"),d=()=>u(_Q(),".agents","skills"),n="<!-- beacon:global:start -->",SQ="<!-- beacon:global:end -->",s,HQ,mQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",pQ="# beacon:end",pZ,F="add it manually: codex mcp add beacon -- beacon mcp";var nQ=M(()=>{BQ();kQ();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."}];pZ=`${mQ}
245
245
  [mcp_servers.beacon]
246
246
  command = "beacon"
247
247
  args = ["mcp"]
248
- ${cQ}
249
- `});var eQ={};JQ(eQ,{provisionDb:()=>K0});import{createClient as z0}from"@libsql/client";import{drizzle as q0}from"drizzle-orm/libsql";import{migrate as X0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as U0}from"drizzle-orm/migrator";import{dirname as TQ,join as W0}from"path";import{fileURLToPath as B0}from"url";async function i(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function x0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function iQ(Q){if(!await i(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 P0(Q){for(let[Z,$]of Object.entries(G0)){if(!await i(Q,Z))continue;let Y=await x0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function K0(Q,Z=j0){let $=z0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await i($,"__drizzle_migrations"),J=await i($,"Node"),V=!1;if(J&&!Y){let X=U0({migrationsFolder:Z})[0];if(X)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[X.hash,X.folderMillis]}),V=!0}let q=await iQ($);if(await X0(q0($),{migrationsFolder:Z}),await iQ($)>q)V=!0;return await P0($),{migrated:V}}finally{$.close()}}var H0,j0,G0;var QZ=T(async()=>{H0=TQ(TQ(TQ(B0(import.meta.url)))),j0=process.env.BEACON_MIGRATIONS_DIR||W0(H0,"drizzle"),G0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});HQ();import{existsSync as sZ}from"fs";import{homedir as tZ}from"os";import{join as r}from"path";function rZ(){return process.env.HOME||process.env.USERPROFILE||tZ()}var o=()=>r(rZ(),".claude"),KQ=()=>r(o(),"skills"),NQ=()=>r(o(),"settings.json"),vQ=()=>r(o(),"CLAUDE.md"),CQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->";var oZ=L,MQ=[{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 iZ(Q,Z){return p(KQ(),Q,Z)}function tQ(Q){return F(KQ(),Q)}function eZ(Q){return c(KQ(),Q)}function Q0(Q){return k(NQ(),Q)}function Z0(Q){return _(NQ(),Q)}function $0(Q){return S(NQ(),Q)}function Y0(Q){h(vQ(),CQ,sQ,Q)}function rQ(){return g(vQ(),CQ)}function J0(){return m(vQ(),CQ,sQ)}function g1(){let Q={};for(let $ of x)Q[$]=tQ($);let Z={};for(let $ of MQ)Z[$.event]=Z0({event:$.event,command:$.command});return{homeExists:sZ(o()),skills:Q,hooks:Z,claudeMdBlock:rQ()}}async function V0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (UQ(),XQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let X of x){if(!tQ(X))J.push(X);iZ(X,Y[X])}let V=0;for(let X of MQ)if(Q0({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=rQ();return Y0(oZ),{skillsAdded:J,hooksAdded:V,claudeMdBlockTouched:!q}}async function oQ(){let Q;try{Q={ok:!0,...await V0()}}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(() => (aQ(),nQ));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 F1(){let Q=[];for(let Y of x)if(eZ(Y))Q.push(Y);let Z=0;for(let Y of MQ)if($0(Y))Z++;let $=J0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as N0}from"async_hooks";import{spawnSync as v0}from"child_process";import{createHash as C0}from"crypto";import{existsSync as $Z,mkdirSync as I,readFileSync as FQ,writeFileSync as uQ}from"fs";import{homedir as YZ}from"os";import{basename as M0,join as P,parse as T0,resolve as ZZ}from"path";function j(){return process.env.BEACON_HOME||P(YZ(),".beacon")}function RQ(){return P(j(),"workspaces.json")}function e(Q){return C0("sha256").update(Q).digest("hex").slice(0,12)}function _1(Q=process.cwd()){let Z=v0("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=ZZ(Q);return Z!==ZZ(YZ())&&Z!==T0(Z).root}function VZ(){return P(j(),"deleted.json")}function wQ(){try{let Q=JSON.parse(FQ(VZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function zZ(Q){I(j(),{recursive:!0}),uQ(VZ(),JSON.stringify(Q,null,2))}function qZ(Q){return wQ().includes(Q)}function S1(Q){let Z=wQ();if(!Z.includes(Q))zZ([...Z,Q])}function g0(Q){let Z=wQ();if(Z.includes(Q))zZ(Z.filter(($)=>$!==Q))}function QQ(Q){return P(j(),Q)}function F0(Q){return`file:${P(QQ(Q),"db.sqlite")}`}function b(){try{let Q=JSON.parse(FQ(RQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function IQ(Q){I(j(),{recursive:!0}),uQ(RQ(),JSON.stringify(Q,null,2))}function u0(){return b().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function K(Q){return b().find((Z)=>Z.id===Q)??null}function XZ(Q,Z,$=new Date().toISOString()){if(!JZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=e(Q);if(qZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=b(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||M0(Q),lastOpenedAt:$},X=[q,...J.filter((z)=>z.id!==Y)];return I(QQ(Y),{recursive:!0}),IQ(X),q}function h1(Q,Z){return g0(e(Q)),XZ(Q,Z)}function m1(Q,Z=new Date().toISOString()){let $=b(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,IQ($)}function p1(Q){if(IQ(b().filter((Z)=>Z.id!==Q)),bQ()===Q)R0(u0()[0]?.id??null)}function UZ(){return P(j(),"active")}function bQ(){try{return FQ(UZ(),"utf8").trim()||null}catch{return null}}function R0(Q){I(j(),{recursive:!0}),uQ(UZ(),Q??"")}function c1(){let Q=bQ();return Q?K(Q):null}function l1(){let Q=I0()??bQ();return Q?K(Q):null}function d1(Q){return K(Q)?.path??null}function n1(){return $Z(RQ())}var WZ="beacon_ws";function BZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function a1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=BZ(Q,WZ);if($&&K($))return $;return null}var w0="x-beacon-workspace-path";async function s1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=Q.headers.get(w0);if($&&JZ($)&&!qZ(e($))&&(!Z||e($)===Z)){let J=XZ($);return await b0(J.id),J.id}let Y=BZ(Q,WZ);if(Y&&K(Y))return Y;return null}var HZ=new N0;function t1(Q,Z){return Q?HZ.run(Q,Z):Z()}function I0(){return HZ.getStore()??null}var gQ=new Set;function r1(Q){gQ.delete(P(QQ(Q),"db.sqlite"))}async function b0(Q){let Z=QQ(Q),$=P(Z,"db.sqlite"),Y=$Z($);if(Y&&gQ.has($))return{ok:!0,created:!1,migrated:!1};try{I(Z,{recursive:!0});let{provisionDb:J}=await QZ().then(() => eQ),V=await J(F0(Q));return gQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as f0}from"net";var e1=4319;function A0(Q,Z,$=400){return new Promise((Y)=>{let J=f0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,J.destroy(),Y(X)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function E0(Q){for(let Z of["127.0.0.1","::1"])if(await A0(Z,Q))return!1;return!0}async function jZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await E0($))return $;return Q}import{execSync as MZ,spawn as _0}from"child_process";import{mkdirSync as S0,openSync as h0,readFileSync as m0,writeFileSync as p0}from"fs";import{homedir as c0,platform as CZ}from"os";import{dirname as l0,join as $Q}from"path";import{fileURLToPath as d0}from"url";import{createHash as n0}from"crypto";var GZ=1500,xZ=345600000,Z2=1800000,$2=3000;import{mkdirSync as O0,readFileSync as y0,writeFileSync as L0}from"fs";import{join as k0}from"path";var D0=["default","acceptEdits","bypassPermissions","auto"];function PZ(Q){return typeof Q==="string"&&D0.includes(Q)}function KZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function NZ(){return k0(j(),"preferences.json")}function fQ(){try{let Q=JSON.parse(y0(NZ(),"utf8"));return{planApprovalMode:PZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function U2(Q){let Z={...fQ(),...Q};return O0(j(),{recursive:!0}),L0(NZ(),JSON.stringify(Z,null,2)),Z}function vZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
248
+ ${pQ}
249
+ `});var iQ={};YQ(iQ,{provisionDb:()=>P0});import{createClient as V0}from"@libsql/client";import{drizzle as z0}from"drizzle-orm/libsql";import{migrate as q0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as X0}from"drizzle-orm/migrator";import{dirname as MQ,join as U0}from"path";import{fileURLToPath as W0}from"url";async function o(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function G0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function oQ(Q){if(!await o(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 x0(Q){for(let[Z,$]of Object.entries(j0)){if(!await o(Q,Z))continue;let Y=await G0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function P0(Q,Z=H0){let $=V0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await o($,"__drizzle_migrations"),J=await o($,"Node"),V=!1;if(J&&!Y){let X=X0({migrationsFolder:Z})[0];if(X)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[X.hash,X.folderMillis]}),V=!0}let q=await oQ($);if(await q0(z0($),{migrationsFolder:Z}),await oQ($)>q)V=!0;return await x0($),{migrated:V}}finally{$.close()}}var B0,H0,j0;var eQ=M(async()=>{B0=MQ(MQ(MQ(W0(import.meta.url)))),H0=process.env.BEACON_MIGRATIONS_DIR||U0(B0,"drizzle"),j0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});BQ();import{existsSync as aZ}from"fs";import{homedir as sZ}from"os";import{join as t}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||sZ()}var r=()=>t(tZ(),".claude"),PQ=()=>t(r(),"skills"),KQ=()=>t(r(),"settings.json"),NQ=()=>t(r(),"CLAUDE.md"),vQ="<!-- beacon:global:start -->",aQ="<!-- beacon:global:end -->";var rZ=y,CQ=[{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 oZ(Q,Z){return m(PQ(),Q,Z)}function sQ(Q){return g(PQ(),Q)}function iZ(Q){return p(PQ(),Q)}function eZ(Q){return L(KQ(),Q)}function Q0(Q){return k(KQ(),Q)}function Z0(Q){return _(KQ(),Q)}function $0(Q){S(NQ(),vQ,aQ,Q)}function tQ(){return T(NQ(),vQ)}function Y0(){return h(NQ(),vQ,aQ)}function F1(){let Q={};for(let $ of x)Q[$]=sQ($);let Z={};for(let $ of CQ)Z[$.event]=Q0({event:$.event,command:$.command});return{homeExists:aZ(r()),skills:Q,hooks:Z,claudeMdBlock:tQ()}}async function J0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (XQ(),qQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let X of x){if(!sQ(X))J.push(X);oZ(X,Y[X])}let V=0;for(let X of CQ)if(eZ({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=tQ();return $0(rZ),{skillsAdded:J,hooksAdded:V,claudeMdBlockTouched:!q}}async function rQ(){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(() => (nQ(),dQ));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 R1(){let Q=[];for(let Y of x)if(iZ(Y))Q.push(Y);let Z=0;for(let Y of CQ)if(Z0(Y))Z++;let $=Y0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as K0}from"async_hooks";import{spawnSync as N0}from"child_process";import{createHash as v0}from"crypto";import{existsSync as ZZ,mkdirSync as w,readFileSync as gQ,writeFileSync as FQ}from"fs";import{homedir as $Z}from"os";import{basename as C0,join as P,parse as M0,resolve as QZ}from"path";function j(){return process.env.BEACON_HOME||P($Z(),".beacon")}function RQ(){return P(j(),"workspaces.json")}function i(Q){return v0("sha256").update(Q).digest("hex").slice(0,12)}function S1(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 YZ(Q){let Z=QZ(Q);return Z!==QZ($Z())&&Z!==M0(Z).root}function JZ(){return P(j(),"deleted.json")}function uQ(){try{let Q=JSON.parse(gQ(JZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function VZ(Q){w(j(),{recursive:!0}),FQ(JZ(),JSON.stringify(Q,null,2))}function zZ(Q){return uQ().includes(Q)}function h1(Q){let Z=uQ();if(!Z.includes(Q))VZ([...Z,Q])}function T0(Q){let Z=uQ();if(Z.includes(Q))VZ(Z.filter(($)=>$!==Q))}function e(Q){return P(j(),Q)}function g0(Q){return`file:${P(e(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(gQ(RQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function wQ(Q){w(j(),{recursive:!0}),FQ(RQ(),JSON.stringify(Q,null,2))}function F0(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function K(Q){return A().find((Z)=>Z.id===Q)??null}function qZ(Q,Z,$=new Date().toISOString()){if(!YZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=i(Q);if(zZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||C0(Q),lastOpenedAt:$},X=[q,...J.filter((z)=>z.id!==Y)];return w(e(Y),{recursive:!0}),wQ(X),q}function m1(Q,Z){return T0(i(Q)),qZ(Q,Z)}function p1(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,wQ($)}function c1(Q){if(wQ(A().filter((Z)=>Z.id!==Q)),AQ()===Q)R0(F0()[0]?.id??null)}function XZ(){return P(j(),"active")}function AQ(){try{return gQ(XZ(),"utf8").trim()||null}catch{return null}}function R0(Q){w(j(),{recursive:!0}),FQ(XZ(),Q??"")}function l1(){let Q=AQ();return Q?K(Q):null}function d1(){let Q=w0()??AQ();return Q?K(Q):null}function n1(Q){return K(Q)?.path??null}function a1(){return ZZ(RQ())}var UZ="beacon_ws";function WZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function s1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=WZ(Q,UZ);if($&&K($))return $;return null}var u0="x-beacon-workspace-path";async function t1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&K(Z))return Z;let $=Q.headers.get(u0);if($&&YZ($)&&!zZ(i($))&&(!Z||i($)===Z)){let J=qZ($);return await A0(J.id),J.id}let Y=WZ(Q,UZ);if(Y&&K(Y))return Y;return null}var BZ=new K0;function r1(Q,Z){return Q?BZ.run(Q,Z):Z()}function w0(){return BZ.getStore()??null}var TQ=new Set;function o1(Q){TQ.delete(P(e(Q),"db.sqlite"))}async function A0(Q){let Z=e(Q),$=P(Z,"db.sqlite"),Y=ZZ($);if(Y&&TQ.has($))return{ok:!0,created:!1,migrated:!1};try{w(Z,{recursive:!0});let{provisionDb:J}=await eQ().then(() => iQ),V=await J(g0(Q));return TQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as E0}from"net";var Q2=4319;function f0(Q,Z,$=400){return new Promise((Y)=>{let J=E0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,J.destroy(),Y(X)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function D0(Q){for(let Z of["127.0.0.1","::1"])if(await f0(Z,Q))return!1;return!0}async function HZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await D0($))return $;return Q}import{execSync as S0,spawn as h0}from"child_process";import{mkdirSync as m0,openSync as p0,readFileSync as c0,writeFileSync as l0}from"fs";import{homedir as d0}from"os";import{dirname as n0,join as ZQ}from"path";import{fileURLToPath as a0}from"url";import{createHash as s0}from"crypto";var jZ=1500,GZ=345600000,$2=1800000,Y2=3000;import{mkdirSync as O0,readFileSync as b0,writeFileSync as y0}from"fs";import{join as L0}from"path";var I0=["default","acceptEdits","bypassPermissions","auto"];function xZ(Q){return typeof Q==="string"&&I0.includes(Q)}function PZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function KZ(){return L0(j(),"preferences.json")}function EQ(){try{let Q=JSON.parse(b0(KZ(),"utf8"));return{planApprovalMode:xZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function W2(Q){let Z={...EQ(),...Q};return O0(j(),{recursive:!0}),y0(KZ(),JSON.stringify(Z,null,2)),Z}function NZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
250
250
 
251
251
  This plan created these roadmap feature(s):
252
252
  `+Z.join(`
253
- `)+"\n\nWhen the work ships, register them in ONE call: `beacon_describe_feature` with a "+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}var a0=$Q(l0(d0(import.meta.url)),".."),EQ=process.env.BEACON_HOME||$Q(c0(),".beacon"),TZ=$Q(EQ,"server.json"),s0=process.env.PORT||"4319";function t0(Q){try{return process.kill(Q,0),!0}catch{return!1}}function r0(Q){try{return JSON.parse(m0(Q,"utf8"))}catch{return null}}async function gZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function o0(Q,Z=60){for(let $=0;$<Z;$++){if(await gZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function i0(Q){S0(EQ,{recursive:!0});let Z=h0($Q(EQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=_0("bun",["run","dev"],{cwd:a0,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return p0(TZ,JSON.stringify(J)),J}async function e0(){let Q=r0(TZ);if(Q&&t0(Q.pid)&&await gZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await jZ(Number(s0))),{port:$}=i0(Z);return await o0(`http://localhost:${$}/api/workspace`),$}function Q1(Q){if(process.env.BEACON_NO_OPEN)return;let Z=CZ()==="darwin"?"open":CZ()==="win32"?"start":"xdg-open";try{MZ(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}function Z1(){try{return MZ("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function $1(Q){return n0("sha256").update(Q).digest("hex").slice(0,12)}async function Y1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function AQ(Q,Z){return KZ(Q,Z)}function ZQ(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function N(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await oQ();let Z=(await Y1())?.tool_input?.plan;if(!Z||!Z.trim())N(AQ());let Y=`http://localhost:${await e0()}`,J=Z1()||process.cwd(),V=$1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
254
- `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",X=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(X.status===422){let B=await X.json().catch(()=>({}));N(ZQ(B.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!X.ok)N(AQ());if(!await fetch(`${Y}/api/plan/presence`,{headers:{"x-beacon-workspace":V}}).then((B)=>B.json()).then((B)=>!!B?.live).catch(()=>!1)){let B=encodeURIComponent(`/plan?ws=${V}`);Q1(`${Y}/api/workspace/activate?id=${V}&redirect=${B}`)}let W=Date.now()+xZ,M=(B)=>new Promise((YQ)=>setTimeout(YQ,B));while(Date.now()<W){await M(GZ);let B=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((YQ)=>YQ.json()).catch(()=>null);if(!B)continue;if(B.kind==="approved")N(AQ(fQ().planApprovalMode,vZ(B.features)));if(B.kind==="discarded")N(ZQ("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(B.kind==="feedback")N(ZQ(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
253
+ `)+"\n\nWhen the work ships, register them in ONE call: `beacon_describe_feature` with a "+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as k0}from"child_process";import{platform as vZ}from"os";function _0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=vZ()==="darwin"?"open":vZ()==="win32"?"start":"xdg-open";try{k0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function CZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);_0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var t0=ZQ(n0(a0(import.meta.url)),".."),DQ=process.env.BEACON_HOME||ZQ(d0(),".beacon"),MZ=ZQ(DQ,"server.json"),r0=process.env.PORT||"4319";function o0(Q){try{return process.kill(Q,0),!0}catch{return!1}}function i0(Q){try{return JSON.parse(c0(Q,"utf8"))}catch{return null}}async function TZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function e0(Q,Z=60){for(let $=0;$<Z;$++){if(await TZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function Q1(Q){m0(DQ,{recursive:!0});let Z=p0(ZQ(DQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=h0("bun",["run","dev"],{cwd:t0,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return l0(MZ,JSON.stringify(J)),J}async function Z1(){let Q=i0(MZ);if(Q&&o0(Q.pid)&&await TZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await HZ(Number(r0))),{port:$}=Q1(Z);return await e0(`http://localhost:${$}/api/workspace`),$}function $1(){try{return S0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function Y1(Q){return s0("sha256").update(Q).digest("hex").slice(0,12)}async function J1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function fQ(Q,Z){return PZ(Q,Z)}function QQ(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function N(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await rQ();let Z=(await J1())?.tool_input?.plan;if(!Z||!Z.trim())N(fQ());let Y=`http://localhost:${await Z1()}`,J=$1()||process.cwd(),V=Y1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
254
+ `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",X=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(X.status===422){let B=await X.json().catch(()=>({}));N(QQ(B.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!X.ok)N(fQ());await CZ(Y,V);let z=Date.now()+GZ,W=(B)=>new Promise(($Q)=>setTimeout($Q,B));while(Date.now()<z){await W(jZ);let B=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then(($Q)=>$Q.json()).catch(()=>null);if(!B)continue;if(B.kind==="approved")N(fQ(EQ().planApprovalMode,NZ(B.features)));if(B.kind==="discarded")N(QQ("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(B.kind==="feedback")N(QQ(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
255
255
 
256
- `+B.feedback))}N(ZQ("Beacon plan review timed out without a verdict. Re-present the plan and ask the user to review it."))})();
256
+ `+B.feedback))}N(QQ("Beacon plan review timed out without a verdict. Re-present the plan and ask the user to review it."))})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trybeacon",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "The visual planning surface for the coding agent in your terminal.",
5
5
  "homepage": "https://trybeacon.sh",
6
6
  "bin": {