trybeacon 0.1.61 → 0.1.63

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 (147) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +22 -22
  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/board-layout/route.js +1 -1
  24. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  25. package/.next/server/app/api/db/backfill-access/route.js.nft.json +1 -1
  26. package/.next/server/app/api/draft/approve/route.js +1 -1
  27. package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
  28. package/.next/server/app/api/draft/route.js +1 -1
  29. package/.next/server/app/api/draft/route.js.nft.json +1 -1
  30. package/.next/server/app/api/draft/status/route.js +1 -1
  31. package/.next/server/app/api/draft/status/route.js.nft.json +1 -1
  32. package/.next/server/app/api/init/route.js +1 -1
  33. package/.next/server/app/api/plan/annotations/route.js +1 -1
  34. package/.next/server/app/api/plan/annotations/route.js.nft.json +1 -1
  35. package/.next/server/app/api/plan/approve/route.js +1 -1
  36. package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
  37. package/.next/server/app/api/plan/markdown/route.js +1 -1
  38. package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
  39. package/.next/server/app/api/plan/route.js +1 -1
  40. package/.next/server/app/api/plan/route.js.nft.json +1 -1
  41. package/.next/server/app/api/plan/verdict/route.js +1 -1
  42. package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
  43. package/.next/server/app/api/reset/route.js +1 -1
  44. package/.next/server/app/api/reset/route.js.nft.json +1 -1
  45. package/.next/server/app/api/share/create/route.js +1 -1
  46. package/.next/server/app/api/share/create/route.js.nft.json +1 -1
  47. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/docs.html +1 -1
  49. package/.next/server/app/docs.rsc +2 -2
  50. package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  51. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  52. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  53. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  55. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  56. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/feedback.html +1 -1
  58. package/.next/server/app/feedback.rsc +2 -2
  59. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  60. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  61. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  62. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  63. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  64. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  65. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/help.html +1 -1
  67. package/.next/server/app/help.rsc +2 -2
  68. package/.next/server/app/help.segments/_full.segment.rsc +2 -2
  69. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  70. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  71. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  72. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  73. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  74. package/.next/server/app/index.html +1 -1
  75. package/.next/server/app/index.rsc +3 -3
  76. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  77. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  78. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  79. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  80. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  81. package/.next/server/app/map/page.js +1 -1
  82. package/.next/server/app/map/page.js.nft.json +1 -1
  83. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/page.js +2 -2
  85. package/.next/server/app/page.js.nft.json +1 -1
  86. package/.next/server/app/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/plan/page.js +2 -2
  88. package/.next/server/app/plan/page.js.nft.json +1 -1
  89. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/s/[token]/page.js +1 -1
  91. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  92. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/settings/page.js +1 -1
  94. package/.next/server/app/settings/page.js.nft.json +1 -1
  95. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  96. package/.next/server/app-paths-manifest.json +22 -22
  97. package/.next/server/chunks/1130.js +1 -1
  98. package/.next/server/chunks/2179.js +1 -0
  99. package/.next/server/chunks/2343.js +1 -0
  100. package/.next/server/chunks/2994.js +2 -0
  101. package/.next/server/chunks/3098.js +1 -1
  102. package/.next/server/chunks/3221.js +5 -0
  103. package/.next/server/chunks/3284.js +154 -0
  104. package/.next/server/chunks/3622.js +1 -1
  105. package/.next/server/chunks/5719.js +1 -0
  106. package/.next/server/chunks/9734.js +1 -1
  107. package/.next/server/middleware-build-manifest.js +1 -1
  108. package/.next/server/pages/404.html +1 -1
  109. package/.next/server/pages/500.html +1 -1
  110. package/.next/server/server-reference-manifest.js +1 -1
  111. package/.next/server/server-reference-manifest.json +1 -1
  112. package/.next/static/chunks/5780-fd253c7329871c77.js +1 -0
  113. package/.next/static/chunks/{3021-ed52ee7b3f02e2cd.js → 5957-83f611fcd5a08b45.js} +1 -1
  114. package/.next/static/chunks/766-242213d211df0afd.js +1 -0
  115. package/.next/static/chunks/{5847-5ddb55da26c93a1e.js → 8915-fa61a860c63a7c85.js} +3 -3
  116. package/.next/static/chunks/app/map/{page-e6a0e8c5a0ce482d.js → page-af4a5a1f12413f4d.js} +1 -1
  117. package/.next/static/chunks/app/page-6f46e6682942af3a.js +1 -0
  118. package/.next/static/chunks/app/plan/page-6213cdfdbee97ad6.js +1 -0
  119. package/.next/static/chunks/app/s/[token]/{page-ee635988a6aff3fb.js → page-5c21314106b5ae91.js} +1 -1
  120. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
  121. package/.next/static/css/f86b3e50f4e93bc8.css +1 -0
  122. package/.next/trace +42 -42
  123. package/.next/trace-build +1 -1
  124. package/dist/bin/beacon.js +14 -13
  125. package/dist/bin/doctor.js +12 -4
  126. package/dist/bin/hook.js +12 -4
  127. package/dist/bin/mcp.js +26 -18
  128. package/dist/bin/plan.js +12 -4
  129. package/dist/bin/uninstall.js +12 -4
  130. package/dist/lib/assets.js +12 -4
  131. package/dist/lib/codex-install.js +12 -4
  132. package/dist/lib/global-install.js +12 -4
  133. package/package.json +1 -1
  134. package/.next/server/chunks/1988.js +0 -154
  135. package/.next/server/chunks/249.js +0 -1
  136. package/.next/server/chunks/2693.js +0 -5
  137. package/.next/server/chunks/519.js +0 -1
  138. package/.next/server/chunks/8035.js +0 -1
  139. package/.next/server/chunks/8846.js +0 -2
  140. package/.next/static/chunks/6638-4e53879181b1df75.js +0 -1
  141. package/.next/static/chunks/6961-d1f5351e5ff6c376.js +0 -1
  142. package/.next/static/chunks/app/page-a229992616b3a3de.js +0 -1
  143. package/.next/static/chunks/app/plan/page-51392fb2730c3058.js +0 -1
  144. package/.next/static/chunks/app/settings/page-323bfcf32d1e7fc8.js +0 -1
  145. package/.next/static/css/e9ed4ff9a583fd9c.css +0 -1
  146. /package/.next/static/{j_yDuyPEP2TT78o8NwY-x → kt65bLHd8wfwQxMb3ivew}/_buildManifest.js +0 -0
  147. /package/.next/static/{j_yDuyPEP2TT78o8NwY-x → kt65bLHd8wfwQxMb3ivew}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":30227287,"timestamp":52465051,"id":14,"parentId":1,"tags":{},"startTime":1781718319866,"traceId":"e6940f38a738a0f6"},{"name":"run-typescript","duration":12702964,"timestamp":82695228,"id":4492,"parentId":1,"tags":{},"startTime":1781718350096,"traceId":"e6940f38a738a0f6"},{"name":"static-check","duration":697134,"timestamp":95446082,"id":4495,"parentId":1,"tags":{},"startTime":1781718362847,"traceId":"e6940f38a738a0f6"},{"name":"static-generation","duration":4337249,"timestamp":96688075,"id":4657,"parentId":1,"tags":{},"startTime":1781718364089,"traceId":"e6940f38a738a0f6"},{"name":"collect-build-traces","duration":11922440,"timestamp":96145824,"id":4654,"parentId":1,"tags":{},"startTime":1781718363547,"traceId":"e6940f38a738a0f6"},{"name":"telemetry-flush","duration":54,"timestamp":108071845,"id":4666,"parentId":1,"tags":{},"startTime":1781718375473,"traceId":"e6940f38a738a0f6"},{"name":"next-build","duration":55723661,"timestamp":52348249,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781718319749,"traceId":"e6940f38a738a0f6"}]
1
+ [{"name":"run-webpack","duration":29846558,"timestamp":48508277,"id":14,"parentId":1,"tags":{},"startTime":1781795653315,"traceId":"f07316b58a4dfbe0"},{"name":"run-typescript","duration":13339604,"timestamp":78357552,"id":4492,"parentId":1,"tags":{},"startTime":1781795683165,"traceId":"f07316b58a4dfbe0"},{"name":"static-check","duration":766007,"timestamp":91710638,"id":4495,"parentId":1,"tags":{},"startTime":1781795696518,"traceId":"f07316b58a4dfbe0"},{"name":"static-generation","duration":4550703,"timestamp":93045349,"id":4657,"parentId":1,"tags":{},"startTime":1781795697852,"traceId":"f07316b58a4dfbe0"},{"name":"collect-build-traces","duration":12238223,"timestamp":92479402,"id":4654,"parentId":1,"tags":{},"startTime":1781795697286,"traceId":"f07316b58a4dfbe0"},{"name":"telemetry-flush","duration":54,"timestamp":104721434,"id":4666,"parentId":1,"tags":{},"startTime":1781795709528,"traceId":"f07316b58a4dfbe0"},{"name":"next-build","duration":56328923,"timestamp":48392576,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781795653200,"traceId":"f07316b58a4dfbe0"}]
@@ -1,19 +1,20 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{execSync as _,spawn as m}from"child_process";import{existsSync as u,mkdirSync as g,openSync as c,readFileSync as d,writeFileSync as p}from"fs";import{homedir as t,platform as L}from"os";import{basename as l,dirname as j,join as U}from"path";import{fileURLToPath as a}from"url";var T=j(a(import.meta.url)),O=l(j(T))==="dist",V=O?j(j(T)):j(T),P=process.cwd(),v=process.env.BEACON_HOME||U(t(),".beacon"),A=U(v,"server.json"),w=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=U(V,"drizzle");function Q(z){if(!O)return U(V,z);return U(V,"dist",z.replace(/\.ts$/,".js"))}var Y=process.argv[2];if(Y==="mcp")await import(Q("bin/mcp.ts"));else if(Y==="hook")await import(Q("bin/hook.ts"));else if(Y==="guard")await import(Q("bin/guard.ts"));else if(Y==="plan")await import(Q("bin/plan.ts"));else if(Y==="prompt")await import(Q("bin/prompt.ts"));else if(Y==="stop-hook")await import(Q("bin/stop-hook.ts"));else if(Y==="stop")f();else if(Y==="remove")await import(Q("bin/remove.ts"));else if(Y==="setup")await E(D()||P);else if(Y==="doctor")await import(Q("bin/doctor.ts"));else if(Y==="uninstall")await import(Q("bin/uninstall.ts"));else if(Y==="update")await zz(process.argv.includes("--force")||process.argv.includes("-f"));else if(Y==="telemetry")await e(process.argv[3]);else if(Y==="version"||Y==="--version"||Y==="-v")console.log(x());else await r();async function E(z,Z=!1){let{installInitSkill:X,installRefreshSkill:J,installCodexRepoSkills:K,ensureMcp:G,ensureWorkflowDoc:W}=await import(Q("lib/assets.ts")),{selfHealGlobal:F}=await import(Q("lib/global-install.ts")),{codexDetected:M}=await import(Q("lib/codex-install.ts")),N=await F(),H=X(z),B=J(z);W(z);let $=G(z),y=M()?K(z):[];if(Z){if($.added||$.updated)console.log(`[beacon] ${$.added?"registered":"updated"} Beacon MCP in ${$.path} \u2014 restart your agent CLI`+($.updated?" to apply the longer plan-review timeout.":" to use @beacon mentions."))}else{console.log(`
4
- \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${H}`),console.log(` \u2713 skill: ${B}`);for(let I of y)console.log(` \u2713 skill: ${I}`);console.log(` ${$.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${$.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
- `)}return{initSkill:H,refreshSkill:B,mcp:$,codexSkills:y,heal:N}}function D(){try{return _("git rev-parse --show-toplevel",{cwd:P,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function k(z){try{return process.kill(z,0),!0}catch{return!1}}function R(z){try{return JSON.parse(d(z,"utf8"))}catch{return null}}async function S(z){try{return(await fetch(z)).ok}catch{return!1}}async function n(z,Z=60){for(let X=0;X<Z;X++){if(await S(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function i(z){g(v,{recursive:!0});let Z=c(U(v,"server.log"),"a"),X={...process.env,PORT:z,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:U(V,"drizzle")};delete X.BEACON_REPO,delete X.BEACON_DATA_DIR,delete X.DATABASE_URL;let K=m("bun",O?["run","start"]:["run","dev"],{cwd:V,env:X,detached:!0,stdio:["ignore",Z,Z]});K.unref();let G={pid:K.pid??0,port:z};return p(A,JSON.stringify(G)),G}async function s(){let z=R(A);if(z&&k(z.pid)&&await S(`http://localhost:${z.port}/api/workspace`))return z.port;let{findAvailablePort:Z}=await import(Q("lib/daemon-port.ts")),X=String(await Z(Number(w)));console.log(X===w?"[beacon] starting the Beacon server\u2026":`[beacon] port ${w} is busy \u2014 starting the Beacon server on port ${X}\u2026`);let{port:J}=i(X);if(!await n(`http://localhost:${J}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return J}function o(z){if(process.env.BEACON_NO_OPEN)return;let Z=L()==="darwin"?"open":L()==="win32"?"start":"xdg-open";try{_(`${Z} "${z}"`,{stdio:"ignore"})}catch{}}async function r(){let z=D()||P,{registerWorkspaceExplicit:Z,idForPath:X,dataDirFor:J,ensureWorkspaceDb:K,isRegistrableWorkspacePath:G}=await import(Q("lib/workspaces.ts"));if(!G(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
6
- `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let W=X(z),F=J(W),M=!u(U(F,"db.sqlite"));if(M)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await K(W);if(!N.ok)console.error(`[beacon] failed to provision database: ${N.error}`);if(M)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:H}=await E(z,!0),B=[];if(H.skillsAdded.length)B.push(`skills ${H.skillsAdded.join(", ")}`);if(H.hooksAdded)B.push(`${H.hooksAdded} Claude Code hook${H.hooksAdded===1?"":"s"}`);if(H.claudeMdBlockTouched)B.push("global CLAUDE.md block");if(B.length)console.log(`[beacon] wired into ~/.claude/: ${B.join(" + ")}.`);let $=H.codex;if($){let q=[];if($.skillsAdded.length)q.push(`skills ${$.skillsAdded.join(", ")}`);if($.hooksAdded)q.push(`${$.hooksAdded} Codex hook${$.hooksAdded===1?"":"s"}`);if($.agentsMdBlockTouched)q.push("global AGENTS.md block");if($.mcp.added)q.push("MCP entry in config.toml");if(q.length)console.log(`[beacon] wired into ~/.codex/: ${q.join(" + ")}.`);if($.mcp.error)console.log(`[beacon] codex MCP not wired: ${$.mcp.error}`)}try{let q=await import(Q("lib/telemetry.ts"));if(!q.telemetryStatus().machineId){let b=q.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
3
+ import{execSync as _,spawn as g}from"child_process";import{existsSync as c,mkdirSync as d,openSync as p,readFileSync as k,writeFileSync as l}from"fs";import{homedir as t,platform as T}from"os";import{basename as n,dirname as N,join as B}from"path";import{fileURLToPath as a}from"url";var O=N(a(import.meta.url)),P=n(N(O))==="dist",F=P?N(N(O)):N(O),y=process.cwd(),w=process.env.BEACON_HOME||B(t(),".beacon"),A=B(w,"server.json"),v=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=B(F,"drizzle");function Q(z){if(!P)return B(F,z);return B(F,"dist",z.replace(/\.ts$/,".js"))}var q=process.argv[2];if(q==="mcp")await import(Q("bin/mcp.ts"));else if(q==="hook")await import(Q("bin/hook.ts"));else if(q==="guard")await import(Q("bin/guard.ts"));else if(q==="plan")await import(Q("bin/plan.ts"));else if(q==="prompt")await import(Q("bin/prompt.ts"));else if(q==="stop-hook")await import(Q("bin/stop-hook.ts"));else if(q==="stop")f();else if(q==="remove")await import(Q("bin/remove.ts"));else if(q==="setup")await x(R()||y);else if(q==="init-persist")await s(process.argv[3]);else if(q==="doctor")await import(Q("bin/doctor.ts"));else if(q==="uninstall")await import(Q("bin/uninstall.ts"));else if(q==="update")await Xz(process.argv.includes("--force")||process.argv.includes("-f"));else if(q==="telemetry")await zz(process.argv[3]);else if(q==="version"||q==="--version"||q==="-v")console.log(D());else await e();async function x(z,X=!1){let{installInitSkill:Z,installRefreshSkill:J,installCodexRepoSkills:K,ensureMcp:G,ensureWorkflowDoc:H}=await import(Q("lib/assets.ts")),{selfHealGlobal:V}=await import(Q("lib/global-install.ts")),{codexDetected:W}=await import(Q("lib/codex-install.ts")),j=await V(),Y=Z(z),I=J(z);H(z);let $=G(z),L=W()?K(z):[];if(X){if($.added||$.updated)console.log(`[beacon] ${$.added?"registered":"updated"} Beacon MCP in ${$.path} \u2014 restart your agent CLI`+($.updated?" to apply the longer plan-review timeout.":" to use @beacon mentions."))}else{console.log(`
4
+ \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${Y}`),console.log(` \u2713 skill: ${I}`);for(let M of L)console.log(` \u2713 skill: ${M}`);console.log(` ${$.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${$.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
+ `)}return{initSkill:Y,refreshSkill:I,mcp:$,codexSkills:L,heal:j}}async function s(z){let X=R()||y,{idForPath:Z,isRegistrableWorkspacePath:J,BEACON_WS_PATH_HEADER:K}=await import(Q("lib/workspaces.ts"));if(!J(X))console.error(`[beacon] refusing to init ${X} \u2014 that's your home directory, not a project.
6
+ `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let G="";try{G=k(z??0,"utf8").trim()}catch(Y){console.error(`[beacon] could not read the init analysis ${z?`from ${z}`:"from stdin"}: ${Y instanceof Error?Y.message:Y}`),process.exit(1)}if(!G)console.error("[beacon] empty init analysis \u2014 pass the JSON as a file argument (`beacon init-persist analysis.json`) or on stdin."),process.exit(1);await x(X,!0);let H=await b(),V=Z(X),W;try{W=await fetch(`http://localhost:${H}/api/init`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V,[K]:X},body:G})}catch(Y){console.error(`[beacon] could not reach the Beacon daemon on port ${H}: ${Y instanceof Error?Y.message:Y}`),process.exit(1)}let j=await W.text();if(!W.ok)console.error(`[beacon] init failed (HTTP ${W.status}): ${j}`),process.exit(1);console.log(`[beacon] mapped ${X} into Beacon: ${j}`),console.log(`[beacon] open the panel \u2192 http://localhost:${H}/map`)}function R(){try{return _("git rev-parse --show-toplevel",{cwd:y,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function S(z){try{return process.kill(z,0),!0}catch{return!1}}function C(z){try{return JSON.parse(k(z,"utf8"))}catch{return null}}async function h(z){try{return(await fetch(z)).ok}catch{return!1}}async function i(z,X=60){for(let Z=0;Z<X;Z++){if(await h(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function o(z){d(w,{recursive:!0});let X=p(B(w,"server.log"),"a"),Z={...process.env,PORT:z,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:B(F,"drizzle")};delete Z.BEACON_REPO,delete Z.BEACON_DATA_DIR,delete Z.DATABASE_URL;let K=g("bun",P?["run","start"]:["run","dev"],{cwd:F,env:Z,detached:!0,stdio:["ignore",X,X]});K.unref();let G={pid:K.pid??0,port:z};return l(A,JSON.stringify(G)),G}async function b(){let z=C(A);if(z&&S(z.pid)&&await h(`http://localhost:${z.port}/api/workspace`))return z.port;let{findAvailablePort:X}=await import(Q("lib/daemon-port.ts")),Z=String(await X(Number(v)));console.log(Z===v?"[beacon] starting the Beacon server\u2026":`[beacon] port ${v} is busy \u2014 starting the Beacon server on port ${Z}\u2026`);let{port:J}=o(Z);if(!await i(`http://localhost:${J}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return J}function r(z){if(process.env.BEACON_NO_OPEN)return;let X=T()==="darwin"?"open":T()==="win32"?"start":"xdg-open";try{_(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function e(){let z=R()||y,{registerWorkspaceExplicit:X,idForPath:Z,dataDirFor:J,ensureWorkspaceDb:K,isRegistrableWorkspacePath:G}=await import(Q("lib/workspaces.ts"));if(!G(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
7
+ `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let H=Z(z),V=J(H),W=!c(B(V,"db.sqlite"));if(W)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let j=await K(H);if(!j.ok)console.error(`[beacon] failed to provision database: ${j.error}`);if(W)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:Y}=await x(z,!0),I=[];if(Y.skillsAdded.length)I.push(`skills ${Y.skillsAdded.join(", ")}`);if(Y.hooksAdded)I.push(`${Y.hooksAdded} Claude Code hook${Y.hooksAdded===1?"":"s"}`);if(Y.claudeMdBlockTouched)I.push("global CLAUDE.md block");if(I.length)console.log(`[beacon] wired into ~/.claude/: ${I.join(" + ")}.`);let $=Y.codex;if($){let U=[];if($.skillsAdded.length)U.push(`skills ${$.skillsAdded.join(", ")}`);if($.hooksAdded)U.push(`${$.hooksAdded} Codex hook${$.hooksAdded===1?"":"s"}`);if($.agentsMdBlockTouched)U.push("global AGENTS.md block");if($.mcp.added)U.push("MCP entry in config.toml");if(U.length)console.log(`[beacon] wired into ~/.codex/: ${U.join(" + ")}.`);if($.mcp.error)console.log(`[beacon] codex MCP not wired: ${$.mcp.error}`)}try{let U=await import(Q("lib/telemetry.ts"));if(!U.telemetryStatus().machineId){let u=U.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
7
8
  `+` architecture \u2014 never repo names, paths, or code) at most every 12h to count
8
9
  `+` active installs. Opt out: \`beacon telemetry off\`, BEACON_TELEMETRY_DISABLED=1,
9
- or DO_NOT_TRACK=1. Details: beacon telemetry status.${b?"":" (currently disabled by your env)"}`),q.ensureTelemetryId()}}catch{}Z(z);let I=`http://localhost:${await s()}`,C=`/map?ws=${W}`,h=`${I}/api/workspace/activate?id=${W}&redirect=${encodeURIComponent(C)}`;if(console.log(`
10
+ or DO_NOT_TRACK=1. Details: beacon telemetry status.${u?"":" (currently disabled by your env)"}`),U.ensureTelemetryId()}}catch{}X(z);let M=`http://localhost:${await b()}`,E=`/map?ws=${H}`,m=`${M}/api/workspace/activate?id=${H}&redirect=${encodeURIComponent(E)}`;if(console.log(`
10
11
  \u25C9 Beacon
11
12
  repo: ${z}
12
- data: ${F}
13
- url: ${I}
14
- `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),await fetch(`${I}/api/tab/presence`,{headers:{"x-beacon-workspace":W}}).then((q)=>q.json()).then((q)=>!!q?.live).catch(()=>!1))await fetch(`${I}/api/tab/nav`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":W},body:JSON.stringify({path:C})}).catch(()=>{}),console.log(` \u21BB reusing your open Beacon tab \u2014 switch to your browser.
15
- `);else o(h)}function x(){return R(U(V,"package.json"))?.version??"0.0.0"}async function e(z){let Z=await import(Q("lib/telemetry.ts"));if(z==="on"||z==="off"){Z.setTelemetryEnabled(z==="on"),console.log(`[beacon] telemetry ${z==="on"?"enabled":"disabled"}.`);return}if(z&&z!=="status")console.error("usage: beacon telemetry [on|off|status]"),process.exit(1);let X=Z.telemetryStatus(),J=X.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":X.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":X.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
16
- \u25C9 Beacon telemetry: ${X.enabled?"enabled":"disabled"}${J}`),console.log(` machine id: ${X.machineId??"(not generated yet \u2014 created on first `beacon` run)"}`),X.machineId)console.log(` payload: ${JSON.stringify(Z.heartbeatPayload(x()))}`);console.log(` sent at most every 12h while the daemon runs \u2014 never repo names, paths, or code.
17
- `+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function zz(z){let Z=x(),{INSTALL_COMMAND:X,NPM_LATEST_URL:J}=await import(Q("lib/release.ts"));if(L()==="win32"){console.log(`[beacon] current version v${Z}.`),console.log(`[beacon] on Windows, update with your package manager:
18
- npm i -g trybeacon@latest`);return}let K=null;try{let G=await fetch(J);if(G.ok)K=(await G.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:G}=await import(Q("lib/semver.ts"));if(!G(K,Z)){console.log(`[beacon] already on the latest version (v${Z}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(K?`[beacon] updating Beacon v${Z} \u2192 v${K}\u2026`:`[beacon] reinstalling Beacon (current v${Z})\u2026`);try{_(X,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
19
- ${X}`),process.exitCode=1;return}f(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function f(){let z=R(A);if(z&&k(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
13
+ data: ${V}
14
+ url: ${M}
15
+ `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),await fetch(`${M}/api/tab/presence`,{headers:{"x-beacon-workspace":H}}).then((U)=>U.json()).then((U)=>!!U?.live).catch(()=>!1))await fetch(`${M}/api/tab/nav`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":H},body:JSON.stringify({path:E})}).catch(()=>{}),console.log(` \u21BB reusing your open Beacon tab \u2014 switch to your browser.
16
+ `);else r(m)}function D(){return C(B(F,"package.json"))?.version??"0.0.0"}async function zz(z){let X=await import(Q("lib/telemetry.ts"));if(z==="on"||z==="off"){X.setTelemetryEnabled(z==="on"),console.log(`[beacon] telemetry ${z==="on"?"enabled":"disabled"}.`);return}if(z&&z!=="status")console.error("usage: beacon telemetry [on|off|status]"),process.exit(1);let Z=X.telemetryStatus(),J=Z.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":Z.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":Z.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
17
+ \u25C9 Beacon telemetry: ${Z.enabled?"enabled":"disabled"}${J}`),console.log(` machine id: ${Z.machineId??"(not generated yet \u2014 created on first `beacon` run)"}`),Z.machineId)console.log(` payload: ${JSON.stringify(X.heartbeatPayload(D()))}`);console.log(` sent at most every 12h while the daemon runs \u2014 never repo names, paths, or code.
18
+ `+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function Xz(z){let X=D(),{INSTALL_COMMAND:Z,NPM_LATEST_URL:J}=await import(Q("lib/release.ts"));if(T()==="win32"){console.log(`[beacon] current version v${X}.`),console.log(`[beacon] on Windows, update with your package manager:
19
+ npm i -g trybeacon@latest`);return}let K=null;try{let G=await fetch(J);if(G.ok)K=(await G.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:G}=await import(Q("lib/semver.ts"));if(!G(K,X)){console.log(`[beacon] already on the latest version (v${X}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(K?`[beacon] updating Beacon v${X} \u2192 v${K}\u2026`:`[beacon] reinstalling Beacon (current v${X})\u2026`);try{_(Z,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
20
+ ${Z}`),process.exitCode=1;return}f(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function f(){let z=C(A);if(z&&S(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
@@ -52,9 +52,17 @@ A single \`beacon_init_persist\` MCP tool call with:
52
52
  - Don't fabricate tables/endpoints. If you can't find the schema source, omit \`snapshot\`.
53
53
  - Don't ask the user to confirm before persisting. The user invoked /beacon-init \u2014 that's the confirmation.
54
54
 
55
- 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
+ ## If \`beacon_init_persist\` is NOT in your tools (or the call can't reach the daemon)
56
56
 
57
- After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
57
+ That happens when this repo was never opened with \`beacon\`: there's no \`.mcp.json\`, so the Beacon MCP server isn't in this session \u2014 and MCP tools can't be added mid-session. (It also covers a wired repo whose daemon is down, so the tool call errors.) **Do NOT stop and tell the user to run \`beacon\` first.** /beacon-init bootstraps itself: write the EXACT analysis object you'd have passed to \`beacon_init_persist\` to a temp JSON file, then persist it through the CLI:
58
+
59
+ \`\`\`bash
60
+ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/beacon-init.json
61
+ \`\`\`
62
+
63
+ That one command wires the repo (writes \`.mcp.json\` + skills so your NEXT session gets the \`beacon_*\` tools natively, heals the global install), starts the Beacon daemon if it isn't running, registers + provisions this workspace, and POSTs your analysis to the same \`/api/init\` endpoint the MCP tool uses \u2014 so init completes in THIS session. Read the counts it prints and report them.
64
+
65
+ After the tool (or \`beacon init-persist\`) returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
58
66
  `,vQ=`---
59
67
  name: beacon-refresh
60
68
  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.
@@ -180,14 +188,14 @@ When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFronte
180
188
  ### Adding a card directly \u2014 \`beacon_feature\` (no review gate)
181
189
 
182
190
  To put a card on the board WITHOUT the plan-review flow, call \`beacon_feature\` \u2014 ONE tool for a feature's whole lifecycle:
183
- - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card returns \`exists\` (reuse it) \u2014 \`add\` never activates or demotes a card already on the board.
191
+ - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card in the SAME category + layer returns \`exists\` (reuse it) \u2014 the same title in a DIFFERENT category or layer (FE/BE/FS) creates a distinct card; \`add\` never activates or demotes a card already on the board.
184
192
  - \`{ action: "start" }\` marks an existing card IN_PROGRESS (create-or-flag).
185
193
  - \`{ action: "subtasks" }\` adds child tasks under a card.
186
194
  - \`{ action: "done" }\` completes feature(s) and registers the files/architecture touched.
187
195
 
188
196
  A NEW card REQUIRES \`category\` + \`priority\` (and \`layer\` where the workspace has a frontend). Use \`beacon_propose_plan\` / \`beacon_present_plan\` only when you want the user to REVIEW before the card lands.
189
197
 
190
- REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
198
+ REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon blocks only an EXACT duplicate \u2014 same title AND category AND layer \u2014 plus a card created without a category; a same-named card in a DIFFERENT category, or on a different layer (frontend/backend/fullstack), is allowed as its own card. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
191
199
 
192
200
  When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
193
201
 
package/dist/bin/hook.js CHANGED
@@ -52,9 +52,17 @@ A single \`beacon_init_persist\` MCP tool call with:
52
52
  - Don't fabricate tables/endpoints. If you can't find the schema source, omit \`snapshot\`.
53
53
  - Don't ask the user to confirm before persisting. The user invoked /beacon-init \u2014 that's the confirmation.
54
54
 
55
- 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
+ ## If \`beacon_init_persist\` is NOT in your tools (or the call can't reach the daemon)
56
56
 
57
- After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
57
+ That happens when this repo was never opened with \`beacon\`: there's no \`.mcp.json\`, so the Beacon MCP server isn't in this session \u2014 and MCP tools can't be added mid-session. (It also covers a wired repo whose daemon is down, so the tool call errors.) **Do NOT stop and tell the user to run \`beacon\` first.** /beacon-init bootstraps itself: write the EXACT analysis object you'd have passed to \`beacon_init_persist\` to a temp JSON file, then persist it through the CLI:
58
+
59
+ \`\`\`bash
60
+ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/beacon-init.json
61
+ \`\`\`
62
+
63
+ That one command wires the repo (writes \`.mcp.json\` + skills so your NEXT session gets the \`beacon_*\` tools natively, heals the global install), starts the Beacon daemon if it isn't running, registers + provisions this workspace, and POSTs your analysis to the same \`/api/init\` endpoint the MCP tool uses \u2014 so init completes in THIS session. Read the counts it prints and report them.
64
+
65
+ After the tool (or \`beacon init-persist\`) returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
58
66
  `,$Q=`---
59
67
  name: beacon-refresh
60
68
  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.
@@ -180,14 +188,14 @@ When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFronte
180
188
  ### Adding a card directly \u2014 \`beacon_feature\` (no review gate)
181
189
 
182
190
  To put a card on the board WITHOUT the plan-review flow, call \`beacon_feature\` \u2014 ONE tool for a feature's whole lifecycle:
183
- - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card returns \`exists\` (reuse it) \u2014 \`add\` never activates or demotes a card already on the board.
191
+ - \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card in the SAME category + layer returns \`exists\` (reuse it) \u2014 the same title in a DIFFERENT category or layer (FE/BE/FS) creates a distinct card; \`add\` never activates or demotes a card already on the board.
184
192
  - \`{ action: "start" }\` marks an existing card IN_PROGRESS (create-or-flag).
185
193
  - \`{ action: "subtasks" }\` adds child tasks under a card.
186
194
  - \`{ action: "done" }\` completes feature(s) and registers the files/architecture touched.
187
195
 
188
196
  A NEW card REQUIRES \`category\` + \`priority\` (and \`layer\` where the workspace has a frontend). Use \`beacon_propose_plan\` / \`beacon_present_plan\` only when you want the user to REVIEW before the card lands.
189
197
 
190
- REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
198
+ REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon blocks only an EXACT duplicate \u2014 same title AND category AND layer \u2014 plus a card created without a category; a same-named card in a DIFFERENT category, or on a different layer (frontend/backend/fullstack), is allowed as its own card. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
191
199
 
192
200
  When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
193
201