trybeacon 0.1.90 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +17 -17
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/@modal/(.)settings/page.js +1 -1
- package/.next/server/app/@modal/(.)settings/page.js.nft.json +1 -1
- package/.next/server/app/@modal/(.)settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/linear/route.js +1 -17
- package/.next/server/app/api/linear/route.js.nft.json +1 -1
- package/.next/server/app/api/linear/scopes/route.js +1 -17
- package/.next/server/app/api/linear/scopes/route.js.nft.json +1 -1
- package/.next/server/app/api/linear/sync/route.js +1 -17
- package/.next/server/app/api/linear/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/share/create/route.js +1 -1
- package/.next/server/app/docs/page.js +1 -1
- package/.next/server/app/docs/page.js.nft.json +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +4 -4
- package/.next/server/app/docs.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_full.segment.rsc +4 -4
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +3 -3
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page.js.nft.json +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +4 -4
- package/.next/server/app/help.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/help.segments/_full.segment.rsc +4 -4
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +3 -3
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/learn/page.js +3 -3
- package/.next/server/app/learn/page.js.nft.json +1 -1
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/parked/page.js +1 -1
- package/.next/server/app/parked/page.js.nft.json +1 -1
- package/.next/server/app/parked/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +3 -3
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +2 -2
- package/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +1 -1
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +17 -17
- package/.next/server/chunks/1495.js +18 -0
- package/.next/server/chunks/{7436.js → 1898.js} +3 -3
- package/.next/server/chunks/3825.js +1 -1
- package/.next/server/chunks/4378.js +1 -1
- package/.next/server/chunks/{5332.js → 473.js} +3 -3
- package/.next/server/chunks/5623.js +1 -1
- package/.next/server/chunks/799.js +1 -0
- package/.next/server/chunks/8709.js +8 -7
- package/.next/server/chunks/9683.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/2149-6eac4575d8a8281c.js +1 -0
- package/.next/static/chunks/{6283-20a6abe3453496ae.js → 3729-99f9edd66d1473ac.js} +3 -3
- package/.next/static/chunks/569-c70eb3d6c88282dc.js +1 -0
- package/.next/static/chunks/6818-051146427620d0f9.js +1 -0
- package/.next/static/chunks/8907-f1d97713a336fc2b.js +1 -0
- package/.next/static/chunks/app/@modal/(.)settings/page-77639f97e58859de.js +1 -0
- package/.next/static/chunks/app/docs/page-574e48b1b9519c80.js +1 -0
- package/.next/static/chunks/app/layout-6f04d1687adcd16e.js +1 -0
- package/.next/static/chunks/app/learn/page-ba0ec2cba32bd4e1.js +7 -0
- package/.next/static/chunks/app/map/page-a07e21cd94bae873.js +1 -0
- package/.next/static/chunks/app/plan/{page-b8b89d7171a582ce.js → page-8e2a2edfb8fe69c5.js} +2 -2
- package/.next/static/chunks/app/s/[token]/page-b4dc768d9d1c6e29.js +1 -0
- package/.next/static/chunks/app/settings/page-c15764e1c2f54c5a.js +1 -0
- package/.next/static/css/b6c71ada5fa39830.css +1 -0
- package/.next/trace +47 -47
- package/.next/trace-build +1 -1
- package/dist/bin/ask.js +2 -2
- package/dist/bin/doctor.js +32 -30
- package/dist/bin/hook.js +31 -29
- package/dist/bin/mcp.js +41 -39
- package/dist/bin/plan.js +32 -30
- package/dist/bin/prompt.js +2 -2
- package/dist/bin/remove.js +3 -3
- package/dist/bin/stop-hook.js +4 -4
- package/dist/bin/uninstall.js +31 -29
- package/dist/lib/assets.js +20 -20
- package/dist/lib/codex-install.js +30 -28
- package/dist/lib/daemon-boot.js +11 -11
- package/dist/lib/global-install.js +31 -29
- package/drizzle/0013_quick_brother_voodoo.sql +1 -0
- package/drizzle/meta/0013_snapshot.json +1953 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/.next/server/chunks/2806.js +0 -1
- package/.next/static/chunks/2114-74736df56930b46c.js +0 -1
- package/.next/static/chunks/569-bfdcec83011428d3.js +0 -1
- package/.next/static/chunks/6818-85b9a09bb74062ef.js +0 -1
- package/.next/static/chunks/6930-1231a4681af2ad3f.js +0 -1
- package/.next/static/chunks/app/@modal/(.)settings/page-58f068e66bf2fdf6.js +0 -1
- package/.next/static/chunks/app/docs/page-126c0e42c71731b2.js +0 -1
- package/.next/static/chunks/app/layout-a8bb07fb86893add.js +0 -1
- package/.next/static/chunks/app/learn/page-49bdcae5bf2a7a49.js +0 -7
- package/.next/static/chunks/app/map/page-6e32f55c7b69bfa0.js +0 -1
- package/.next/static/chunks/app/s/[token]/page-7ebe66049fae02ce.js +0 -1
- package/.next/static/chunks/app/settings/page-435bfb2ac6f01744.js +0 -1
- package/.next/static/css/56890131dbc6daff.css +0 -1
- /package/.next/static/{l2BAGl1tReuc34hH3NvPZ → 5WK9Cj2xVeIioVVqODVpo}/_buildManifest.js +0 -0
- /package/.next/static/{l2BAGl1tReuc34hH3NvPZ → 5WK9Cj2xVeIioVVqODVpo}/_ssgManifest.js +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}function
|
|
2
|
+
var xq=Object.defineProperty;var Dq=(q)=>q;function Tq(q,J){this[q]=Dq.bind(null,J)}var qq=(q,J)=>{for(var Q in J)xq(q,Q,{get:J[Q],enumerable:!0,configurable:!0,set:Tq.bind(J,Q)})};var R=(q,J)=>()=>(q&&(J=q(q=0)),J);import{existsSync as M,mkdirSync as p,readdirSync as fq,readFileSync as K,rmSync as kq,writeFileSync as D}from"fs";import{basename as Lq,dirname as Qq,join as w}from"path";function XJ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function Oq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let J=w(q,".claude","plugins");if(!M(J))return null;let Q=[J];for(let Y=0;Y<3&&Q.length;Y++){let Z=[];for(let $ of Q){let z=w($,".claude-plugin","plugin.json");try{if(M(z)&&JSON.parse(K(z,"utf8")).name==="beacon")return $}catch{}try{for(let U of fq($,{withFileTypes:!0}))if(U.isDirectory())Z.push(w($,U.name))}catch{}}Q=Z}return null}function wJ(q){return Oq(q)!==null}function jJ(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function u(){let q=process.env.BEACON_CLI_PATH;if(q)return q;if(M(Jq))return Jq;return"beacon"}function Eq(q){let J=q.indexOf(" ");return J===-1?q:q.slice(0,J)}function m(q){let J=u();if(J==="beacon")return q;return q.replace(/^beacon(\s|$)/,`${J}$1`)}function G(q){let J=Eq(q);return Lq(J)+q.slice(J.length)}function uJ(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let J=JSON.parse(K(w(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let Q of Object.keys(J.plugins??{}))if(/^beacon@/.test(Q))return{key:Q,marketplace:Q.split("@")[1]??""}}catch{}return null}function b(q){try{return JSON.parse(K(q,"utf8"))}catch{return{}}}function l(q,J){p(Qq(q),{recursive:!0}),D(q,JSON.stringify(J,null,2)+`
|
|
3
|
+
`)}function Zq(q,J,Q={}){let Y=b(q);Y.hooks=Y.hooks??{},Y.hooks[J.event]=Y.hooks[J.event]??[];let Z=Y.hooks[J.event];if(Z.some((z)=>z.hooks?.some((U)=>G(U.command)===G(J.command)&&(Q.matchAnyMatcher||z.matcher===J.matcher))))return!1;return Z.push({matcher:J.matcher,hooks:[{type:"command",command:J.command}]}),l(q,Y),!0}function $q(q,J){let Q=b(q),Y=Q.hooks?.[J.event];if(!Y)return!1;let Z=Y.flatMap((U,V)=>(U.hooks??[]).flatMap((W,v)=>G(W.command)===G(J.command)?[{matcherIndex:V,hookIndex:v,preferred:U.matcher===J.matcher}]:[]));if(Z.length<2)return!1;let $=Z.find((U)=>U.preferred)??Z[0],z=new Set(Z.filter((U)=>U!==$).map((U)=>`${U.matcherIndex}:${U.hookIndex}`));return Q.hooks[J.event]=Y.map((U,V)=>({...U,hooks:(U.hooks??[]).filter((W,v)=>!z.has(`${V}:${v}`))})).filter((U)=>(U.hooks??[]).length>0),l(q,Q),!0}function Vq(q,J){return(b(q).hooks?.[J.event]??[]).some((Z)=>Z.hooks?.some(($)=>G($.command)===G(J.command)))}function KJ(q,J){let Y=b(q).hooks?.[J.event]??[];for(let Z of Y)for(let $ of Z.hooks??[])if(G($.command)===G(J.command))return $.command;return null}function zq(q,J){let Q=b(q),Y=Q.hooks?.[J.event];if(!Y)return!1;let Z=!1,$=Y.map((z)=>{let U=z.hooks?.length??0,V=(z.hooks??[]).filter((W)=>G(W.command)!==G(J.command));if(V.length!==U)Z=!0;return{...z,hooks:V}}).filter((z)=>(z.hooks??[]).length>0);if(!Z)return!1;if($.length)Q.hooks[J.event]=$;else delete Q.hooks[J.event];if(Q.hooks&&Object.keys(Q.hooks).length===0)delete Q.hooks;return l(q,Q),!0}function Uq(q,J,Q,Y){let Z=`${J}
|
|
4
4
|
${Y.trim()}
|
|
5
|
-
${Q}`,$="";try{$=
|
|
5
|
+
${Q}`,$="";try{$=K(q,"utf8")}catch{}let z=new RegExp(`${J}[\\s\\S]*?${Q}`);$=z.test($)?$.replace(z,Z):$.trim()?`${$.trim()}
|
|
6
6
|
|
|
7
7
|
${Z}
|
|
8
8
|
`:`${Z}
|
|
9
|
-
`,
|
|
9
|
+
`,p(Qq(q),{recursive:!0}),D(q,$.endsWith(`
|
|
10
10
|
`)?$:`${$}
|
|
11
|
-
`)}function
|
|
11
|
+
`)}function s(q,J){try{return K(q,"utf8").includes(J)}catch{return!1}}function Wq(q,J,Q){let Y="";try{Y=K(q,"utf8")}catch{return!1}let Z=new RegExp(`${J}[\\s\\S]*?${Q}\\n?`);if(!Z.test(Y))return!1;let $=Y.replace(Z,"").replace(/\n{3,}/g,`
|
|
12
12
|
|
|
13
|
-
`).trimStart();return
|
|
13
|
+
`).trimStart();return D(q,$),!0}function Pq(q,J,Q){let Y=w(q,J);p(Y,{recursive:!0});let Z=w(Y,"SKILL.md");return D(Z,Q),Z}function t(q,J){return M(w(q,J,"SKILL.md"))}function Hq(q,J){let Q=w(q,J);if(!M(Q))return!1;return kq(Q,{recursive:!0,force:!0}),!0}var T,Jq="/Applications/Beacon.app/Contents/Resources/bin/beacon",Yq=`## Beacon (visual planning panel)
|
|
14
14
|
|
|
15
15
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
16
16
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -34,23 +34,23 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
34
34
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
35
35
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
36
36
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
37
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
37
|
+
verbatim. Do NOT implement until the tool returns approval.`;var d=R(()=>{T=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});var gJ=1500,RJ=480000,MJ=1800000,f=3600000,bJ=3000;var vq=()=>{};var jq={};qq(jq,{stripAgentsPointer:()=>wq,repoMcpCliTarget:()=>sq,removeRepoAssets:()=>dq,installRefreshSkill:()=>yq,installPlanSkill:()=>_q,installInitSkill:()=>Iq,installExplainSkill:()=>Sq,installCodexRepoSkills:()=>pq,ensureWorkflowDoc:()=>mq,ensureMcp:()=>lq,contextDocTargets:()=>i,auditRepo:()=>tq,REFRESH_SKILL:()=>c,PLAN_SKILL:()=>Bq,INIT_SKILL:()=>r,EXPLAIN_SKILL:()=>Xq});import{existsSync as B,mkdirSync as A,readFileSync as X,rmSync as k,writeFileSync as H}from"fs";import{join as P}from"path";function Iq(q){let J=P(q,".claude","skills","beacon-init");A(J,{recursive:!0});let Q=P(J,"SKILL.md");return H(Q,r),Q}function yq(q){let J=P(q,".claude","skills","beacon-refresh");A(J,{recursive:!0});let Q=P(J,"SKILL.md");return H(Q,c),Q}function _q(q){let J=P(q,".claude","skills","beacon-plan");A(J,{recursive:!0});let Q=P(J,"SKILL.md");return H(Q,Bq),Q}function Sq(q){let J=P(q,".claude","skills","beacon-explain");A(J,{recursive:!0});let Q=P(J,"SKILL.md");return H(Q,Xq),Q}function pq(q){let J=[];for(let Q of hq){let Y=P(q,".agents","skills",Q.name);A(Y,{recursive:!0});let Z=P(Y,"SKILL.md");H(Z,Q.body()),J.push(Z)}return J}function i(q){let J=P(q,"AGENTS.md"),Q=P(q,"CLAUDE.md"),Y=B(J),Z=B(Q);if(!Y&&!Z)return[J,Q];let $=[];if(Y)$.push(J);if(Z)$.push(Q);return $}function wq(q){let J=P(q,"CLAUDE.md");if(!B(J))return;let Q=X(J,"utf8"),Y=Q.split(`
|
|
38
38
|
`).filter((Z)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Z)).join(`
|
|
39
39
|
`).trim();if(Y&&Y!==Q.trim())H(J,`${Y}
|
|
40
|
-
`)}function
|
|
40
|
+
`)}function mq(q){let J=new RegExp(`${L}[\\s\\S]*?${a}`);for(let Q of i(q)){let Y="";try{Y=X(Q,"utf8")}catch{}Y=J.test(Y)?Y.replace(J,Gq):`${Y.trim()}
|
|
41
41
|
|
|
42
|
-
${
|
|
42
|
+
${Gq}
|
|
43
43
|
`.trimStart(),H(Q,Y.endsWith(`
|
|
44
44
|
`)?Y:`${Y}
|
|
45
|
-
`)}
|
|
46
|
-
`),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return Q.mcpServers.beacon={command:
|
|
47
|
-
`),{path:J,added:!0,updated:!1}}function
|
|
48
|
-
`)}}catch{}let Z=!1,$=new RegExp(`\\n?${
|
|
45
|
+
`)}wq(q)}function lq(q){let J=P(q,".mcp.json"),Q={};try{Q=JSON.parse(X(J,"utf8"))}catch{}Q.mcpServers=Q.mcpServers??{};let Y=Q.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<f)return Y.timeout=f,H(J,JSON.stringify(Q,null,2)+`
|
|
46
|
+
`),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return Q.mcpServers.beacon={command:u(),args:["mcp"],timeout:f},H(J,JSON.stringify(Q,null,2)+`
|
|
47
|
+
`),{path:J,added:!0,updated:!1}}function sq(q){try{return JSON.parse(X(P(q,".mcp.json"),"utf8")).mcpServers?.beacon?.command??null}catch{return null}}function tq(q){let J=P(q,".mcp.json"),Q=!1;try{Q=!!JSON.parse(X(J,"utf8")).mcpServers?.beacon}catch{}let Y=i(q).some((Z)=>{try{return X(Z,"utf8").includes(L)}catch{return!1}});return{repo:q,mcpRegistered:Q,workflowBlock:Y,skills:{"beacon-init":B(P(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":B(P(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":B(P(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":B(P(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function dq(q){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let W=P(q,".claude","skills",V);if(B(W))k(W,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let W=P(q,".agents","skills",V);if(B(W))k(W,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let Q=!1,Y=P(q,".mcp.json");try{let V=JSON.parse(X(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,Q=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)k(Y,{force:!0});else H(Y,JSON.stringify(V,null,2)+`
|
|
48
|
+
`)}}catch{}let Z=!1,$=new RegExp(`\\n?${L}[\\s\\S]*?${a}\\n?`);for(let V of[P(q,"AGENTS.md"),P(q,"CLAUDE.md")])try{let W=X(V,"utf8");if($.test(W)){let v=W.replace($,`
|
|
49
49
|
`).replace(/\n{3,}/g,`
|
|
50
50
|
|
|
51
|
-
`).trimStart();H(
|
|
52
|
-
`)?
|
|
53
|
-
`),Z=!0}}catch{}let
|
|
51
|
+
`).trimStart();H(V,v.endsWith(`
|
|
52
|
+
`)?v:`${v}
|
|
53
|
+
`),Z=!0}}catch{}let z=!1,U=P(q,"CLAUDE.md");try{let V=X(U,"utf8"),W=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==V){if(!W.trim())k(U,{force:!0});else H(U,W);z=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:Q,agentsBlockRemoved:Z,claudeImportRemoved:z}}var r=`---
|
|
54
54
|
name: beacon-init
|
|
55
55
|
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.
|
|
56
56
|
---
|
|
@@ -97,7 +97,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
|
|
|
97
97
|
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.
|
|
98
98
|
|
|
99
99
|
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.
|
|
100
|
-
`,
|
|
100
|
+
`,c=`---
|
|
101
101
|
name: beacon-refresh
|
|
102
102
|
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.
|
|
103
103
|
---
|
|
@@ -144,7 +144,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
144
144
|
If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
|
|
145
145
|
|
|
146
146
|
After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
|
|
147
|
-
`,
|
|
147
|
+
`,Bq=`---
|
|
148
148
|
name: beacon-plan
|
|
149
149
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
150
150
|
---
|
|
@@ -193,7 +193,7 @@ If it returns feedback, revise and call it again.
|
|
|
193
193
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
194
194
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
195
195
|
run \`beacon\` in this repo once.
|
|
196
|
-
`,
|
|
196
|
+
`,Xq=`---
|
|
197
197
|
name: beacon-explain
|
|
198
198
|
description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
|
|
199
199
|
---
|
|
@@ -263,7 +263,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
|
|
|
263
263
|
Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
|
|
264
264
|
the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
|
|
265
265
|
the lesson.
|
|
266
|
-
`,hq,
|
|
266
|
+
`,hq,L="<!-- beacon:workflow:start -->",a="<!-- beacon:workflow:end -->",Gq;var uq=R(()=>{d();vq();hq=[{name:"beacon-init",body:()=>r},{name:"beacon-refresh",body:()=>c}];Gq=`${L}
|
|
267
267
|
## Beacon \u2014 feature workflow
|
|
268
268
|
|
|
269
269
|
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:
|
|
@@ -335,18 +335,20 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
335
335
|
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.
|
|
336
336
|
|
|
337
337
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
338
|
-
${
|
|
339
|
-
`)){let Z=Y.trim();if(!Z||Z.startsWith("#"))continue;let $=/^\[([^\]]+)\]/.exec(Z);if($){if(Q=$[1].trim()==="mcp_servers.beacon",Q)J.mcp_servers=J.mcp_servers??{},J.mcp_servers.beacon=J.mcp_servers.beacon??{};continue}if(Q){let
|
|
338
|
+
${a}`});import{mkdirSync as rq,renameSync as cq,rmSync as aq,writeFileSync as iq}from"fs";import{dirname as oq}from"path";function F(q,J){rq(oq(q),{recursive:!0});let Q=`${q}.tmp`;try{iq(Q,J),cq(Q,q)}catch(Y){throw aq(Q,{force:!0}),Y}}function kJ(q,J,Q=!1){F(q,JSON.stringify(J,null,Q?2:void 0))}var Kq=()=>{};var PJ={};qq(PJ,{setupCodexAssets:()=>zJ,removeCodexMcp:()=>Cq,removeCodexArtifacts:()=>WJ,parseTomlBeacon:()=>Aq,nodeWhich:()=>Rq,hasCodexMcp:()=>e,ensureCodexMcp:()=>Fq,commandExists:()=>Mq,codexMcpProblem:()=>ZJ,codexMcpCliTarget:()=>VJ,codexDetected:()=>bq,auditCodex:()=>UJ,CODEX_HOOKS:()=>h});import{accessSync as nq,constants as eq,readFileSync as x}from"fs";import{homedir as qJ}from"os";import{delimiter as JJ,join as g}from"path";function Nq(){return process.env.HOME||process.env.USERPROFILE||qJ()}function Rq(q,J=process.env.PATH||"",Q=QJ){if(!q)return null;for(let Y of J.split(JJ)){if(!Y)continue;let Z=g(Y,q);if(Q(Z))return Z}return null}function QJ(q){try{return nq(q,eq.X_OK),!0}catch{return!1}}function Mq(q){if(typeof Bun<"u"&&typeof Bun.which==="function")return Bun.which(q)!==null;return Rq(q)!==null}function bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(o===void 0)o=Mq("codex");return o}function Aq(q){let J={},Q=!1;for(let Y of q.split(`
|
|
339
|
+
`)){let Z=Y.trim();if(!Z||Z.startsWith("#"))continue;let $=/^\[([^\]]+)\]/.exec(Z);if($){if(Q=$[1].trim()==="mcp_servers.beacon",Q)J.mcp_servers=J.mcp_servers??{},J.mcp_servers.beacon=J.mcp_servers.beacon??{};continue}if(Q){let z=/^command\s*=\s*["']([^"']*)["']/.exec(Z);if(z)J.mcp_servers.beacon.command=z[1]}}return J}function N(q){try{if(typeof Bun<"u"&&Bun.TOML?.parse)return Bun.TOML.parse(q);return Aq(q)}catch{return null}}function e(){try{return Boolean(N(x(j(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function ZJ(){let q="";try{q=x(j(),"utf8")}catch{return null}let J=N(q);if(!J)return`~/.codex/config.toml does not parse \u2014 ${C}`;if(J.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${C}`;return null}function $J(q){let J=q.split(`
|
|
340
|
+
`),Q=J.indexOf(_),Y=J.indexOf(S,Q);if(Q===-1||Y===-1)return null;let Z=J.findIndex((U,V)=>V>Q&&V<Y&&U.trim()==="[mcp_servers.beacon]");if(Z===-1)return null;let $=Z+1;while($<Y&&!/^\s*\[/.test(J[$]))$++;let z=J.findIndex((U,V)=>V>Z&&V<$&&/^\s*command\s*=/.test(U));if(z===-1)return null;return J[z]=`command = ${JSON.stringify(u())}`,J.join(`
|
|
341
|
+
`)}function Fq(){let q="",J=!1;try{q=x(j(),"utf8"),J=!0}catch{}if(J){let $=N(q);if(!$)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${C}`};if($.mcp_servers?.beacon){let z=$J(q);if(z&&z!==q)F(j(),z);return{added:!1}}if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${C}`}}let Q=!q?"":q.endsWith(`
|
|
340
342
|
`)?`
|
|
341
343
|
`:`
|
|
342
344
|
|
|
343
|
-
`,Y=q+Q+
|
|
344
|
-
`),Q=J.indexOf(
|
|
345
|
+
`,Y=q+Q+YJ();if(N(Y)?.mcp_servers?.beacon?.command!==u())return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${C}`};return F(j(),Y),{added:!0}}function VJ(){try{return N(x(j(),"utf8"))?.mcp_servers?.beacon?.command??null}catch{return null}}function Cq(){let q="";try{q=x(j(),"utf8")}catch{return{removed:!1}}let J=q.split(`
|
|
346
|
+
`),Q=J.indexOf(_);if(Q===-1)return{removed:!1,skipped:e()};let Y=J.indexOf(S,Q);if(Y===-1)return{removed:!1,skipped:!0};let Z=J.findIndex((U,V)=>V>Q&&V<Y&&U.trim()==="[mcp_servers.beacon]");if(Z===-1)return{removed:!1,skipped:!0};let $=Z+1;while($<Y&&!/^\s*\[/.test(J[$]))$++;J.splice(Z,$-Z),J.splice(J.indexOf(S),1),J.splice(J.indexOf(_),1);let z=J.join(`
|
|
345
347
|
`).replace(/\n{3,}/g,`
|
|
346
348
|
|
|
347
|
-
`).replace(/^\n+/,"");if(
|
|
349
|
+
`).replace(/^\n+/,"");if(N(z)===null)return{removed:!1,skipped:!0};return F(j(),z),{removed:!0}}async function zJ(){let{INIT_SKILL:q,REFRESH_SKILL:J,PLAN_SKILL:Q,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (uq(),jq)),Z={"beacon-init":q,"beacon-refresh":J,"beacon-plan":Q,"beacon-explain":Y},$=[];for(let W of T){if(!t(I(),W))$.push(W);Pq(I(),W,Z[W])}let z=0;for(let W of h){let v=W.event==="UserPromptSubmit"||W.event==="Stop";if(v)$q(O(),{event:W.event,matcher:W.matcher,command:m(W.command)});if(Zq(O(),{event:W.event,matcher:W.matcher,command:m(W.command)},{matchAnyMatcher:v}))z++}let U=s(E(),y);Uq(E(),y,gq,Yq);let V=Fq();return{skillsAdded:$,hooksAdded:z,agentsMdBlockTouched:!U,mcp:V}}function UJ(){let q={};for(let Q of T)q[Q]=t(I(),Q);let J={};for(let Q of h)J[Q.event]=Vq(O(),{event:Q.event,command:Q.command});return{detected:bq(),skills:q,hooks:J,agentsMdBlock:s(E(),y),mcp:e()}}function WJ(){let q=[];for(let Z of T)if(Hq(I(),Z))q.push(Z);let J=0;for(let Z of h)if(zq(O(),{event:Z.event,command:Z.command}))J++;let Q=Wq(E(),y,gq),Y=Cq();return{skillsRemoved:q,hooksRemoved:J,agentsMdBlockRemoved:Q,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var n=()=>g(Nq(),".codex"),O=()=>g(n(),"hooks.json"),j=()=>g(n(),"config.toml"),E=()=>g(n(),"AGENTS.md"),I=()=>g(Nq(),".agents","skills"),y="<!-- beacon:global:start -->",gq="<!-- beacon:global:end -->",h,o,_="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",S="# beacon:end",YJ=()=>`${_}
|
|
348
350
|
[mcp_servers.beacon]
|
|
349
|
-
command = "${
|
|
351
|
+
command = "${u()}"
|
|
350
352
|
args = ["mcp"]
|
|
351
|
-
${
|
|
352
|
-
`,
|
|
353
|
+
${S}
|
|
354
|
+
`,C="add it manually: codex mcp add beacon -- beacon mcp";var HJ=R(()=>{d();Kq();h=[{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."}]});HJ();export{zJ as setupCodexAssets,Cq as removeCodexMcp,WJ as removeCodexArtifacts,Aq as parseTomlBeacon,Rq as nodeWhich,e as hasCodexMcp,Fq as ensureCodexMcp,Mq as commandExists,ZJ as codexMcpProblem,VJ as codexMcpCliTarget,bq as codexDetected,UJ as auditCodex,h as CODEX_HOOKS};
|
package/dist/lib/daemon-boot.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}function
|
|
4
|
-
${
|
|
5
|
-
${J}`,
|
|
2
|
+
var _=Object.defineProperty;var v=(q)=>q;function j(q,G){this[q]=v.bind(null,G)}var C=(q,G)=>{for(var J in G)_(q,J,{get:G[J],enumerable:!0,configurable:!0,set:j.bind(G,J)})};var w=(q,G)=>()=>(q&&(G=q(q=0)),G);import{existsSync as Y,mkdirSync as M,readdirSync as H,readFileSync as X,rmSync as E,writeFileSync as u}from"fs";import{basename as P,dirname as B,join as V}from"path";function y(){return!!process.env.CLAUDE_PLUGIN_ROOT}function z(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let G=V(q,".claude","plugins");if(!Y(G))return null;let J=[G];for(let N=0;N<3&&J.length;N++){let O=[];for(let Q of J){let T=V(Q,".claude-plugin","plugin.json");try{if(Y(T)&&JSON.parse(X(T,"utf8")).name==="beacon")return Q}catch{}try{for(let R of H(Q,{withFileTypes:!0}))if(R.isDirectory())O.push(V(Q,R.name))}catch{}}J=O}return null}function f(q){return z(q)!==null}function p(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function F(){let q=process.env.BEACON_CLI_PATH;if(q)return q;if(Y(K))return K;return"beacon"}function I(q){let G=q.indexOf(" ");return G===-1?q:q.slice(0,G)}function h(q){let G=F();if(G==="beacon")return q;return q.replace(/^beacon(\s|$)/,`${G}$1`)}function U(q){let G=I(q);return P(G)+q.slice(G.length)}function t(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let G=JSON.parse(X(V(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let J of Object.keys(G.plugins??{}))if(/^beacon@/.test(J))return{key:J,marketplace:J.split("@")[1]??""}}catch{}return null}function Z(q){try{return JSON.parse(X(q,"utf8"))}catch{return{}}}function g(q,G){M(B(q),{recursive:!0}),u(q,JSON.stringify(G,null,2)+`
|
|
3
|
+
`)}function s(q,G,J={}){let N=Z(q);N.hooks=N.hooks??{},N.hooks[G.event]=N.hooks[G.event]??[];let O=N.hooks[G.event];if(O.some((T)=>T.hooks?.some((R)=>U(R.command)===U(G.command)&&(J.matchAnyMatcher||T.matcher===G.matcher))))return!1;return O.push({matcher:G.matcher,hooks:[{type:"command",command:G.command}]}),g(q,N),!0}function r(q,G){let J=Z(q),N=J.hooks?.[G.event];if(!N)return!1;let O=N.flatMap((R,W)=>(R.hooks??[]).flatMap(($,A)=>U($.command)===U(G.command)?[{matcherIndex:W,hookIndex:A,preferred:R.matcher===G.matcher}]:[]));if(O.length<2)return!1;let Q=O.find((R)=>R.preferred)??O[0],T=new Set(O.filter((R)=>R!==Q).map((R)=>`${R.matcherIndex}:${R.hookIndex}`));return J.hooks[G.event]=N.map((R,W)=>({...R,hooks:(R.hooks??[]).filter(($,A)=>!T.has(`${W}:${A}`))})).filter((R)=>(R.hooks??[]).length>0),g(q,J),!0}function n(q,G){return(Z(q).hooks?.[G.event]??[]).some((O)=>O.hooks?.some((Q)=>U(Q.command)===U(G.command)))}function d(q,G){let N=Z(q).hooks?.[G.event]??[];for(let O of N)for(let Q of O.hooks??[])if(U(Q.command)===U(G.command))return Q.command;return null}function a(q,G){let J=Z(q),N=J.hooks?.[G.event];if(!N)return!1;let O=!1,Q=N.map((T)=>{let R=T.hooks?.length??0,W=(T.hooks??[]).filter(($)=>U($.command)!==U(G.command));if(W.length!==R)O=!0;return{...T,hooks:W}}).filter((T)=>(T.hooks??[]).length>0);if(!O)return!1;if(Q.length)J.hooks[G.event]=Q;else delete J.hooks[G.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return g(q,J),!0}function i(q,G,J,N){let O=`${G}
|
|
4
|
+
${N.trim()}
|
|
5
|
+
${J}`,Q="";try{Q=X(q,"utf8")}catch{}let T=new RegExp(`${G}[\\s\\S]*?${J}`);Q=T.test(Q)?Q.replace(T,O):Q.trim()?`${Q.trim()}
|
|
6
6
|
|
|
7
|
-
${
|
|
8
|
-
`:`${
|
|
9
|
-
`,
|
|
10
|
-
`)?
|
|
11
|
-
`)}function
|
|
7
|
+
${O}
|
|
8
|
+
`:`${O}
|
|
9
|
+
`,M(B(q),{recursive:!0}),u(q,Q.endsWith(`
|
|
10
|
+
`)?Q:`${Q}
|
|
11
|
+
`)}function o(q,G){try{return X(q,"utf8").includes(G)}catch{return!1}}function c(q,G,J){let N="";try{N=X(q,"utf8")}catch{return!1}let O=new RegExp(`${G}[\\s\\S]*?${J}\\n?`);if(!O.test(N))return!1;let Q=N.replace(O,"").replace(/\n{3,}/g,`
|
|
12
12
|
|
|
13
|
-
`).trimStart();return
|
|
13
|
+
`).trimStart();return u(q,Q),!0}function m(q,G,J){let N=V(q,G);M(N,{recursive:!0});let O=V(N,"SKILL.md");return u(O,J),O}function e(q,G){return Y(V(q,G,"SKILL.md"))}function qq(q,G){let J=V(q,G);if(!Y(J))return!1;return E(J,{recursive:!0,force:!0}),!0}var k,K="/Applications/Beacon.app/Contents/Resources/bin/beacon",l=`## Beacon (visual planning panel)
|
|
14
14
|
|
|
15
15
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
16
16
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -34,4 +34,4 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
34
34
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
35
35
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
36
36
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
37
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
37
|
+
verbatim. Do NOT implement until the tool returns approval.`;var L=w(()=>{k=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});L();import{existsSync as b}from"fs";function Oq(q=K){return b(q)}function Qq({healthy:q,appInstalled:G}){if(q)return"reuse";if(G)return"app";return"bun"}function Rq({present:q,alive:G,healthy:J}){return q&&G&&J?"reuse":"spawn"}export{Oq as desktopAppInstalled,Rq as decideDaemonRecheck,Qq as decideDaemonBoot};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}function
|
|
2
|
+
var rq=Object.defineProperty;var lq=(q)=>q;function cq(q,J){this[q]=lq.bind(null,J)}var Nq=(q,J)=>{for(var Q in J)rq(q,Q,{get:J[Q],enumerable:!0,configurable:!0,set:cq.bind(J,Q)})};var F=(q,J)=>()=>(q&&(J=q(q=0)),J);import{existsSync as x,mkdirSync as Qq,readdirSync as dq,readFileSync as g,rmSync as aq,writeFileSync as D}from"fs";import{basename as iq,dirname as gq,join as G}from"path";function uq(){return!!process.env.CLAUDE_PLUGIN_ROOT}function Rq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let J=G(q,".claude","plugins");if(!x(J))return null;let Q=[J];for(let Y=0;Y<3&&Q.length;Y++){let Z=[];for(let $ of Q){let z=G($,".claude-plugin","plugin.json");try{if(x(z)&&JSON.parse(g(z,"utf8")).name==="beacon")return $}catch{}try{for(let W of dq($,{withFileTypes:!0}))if(W.isDirectory())Z.push(G($,W.name))}catch{}}Q=Z}return null}function Fq(q){return Rq(q)!==null}function nq(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function N(){let q=process.env.BEACON_CLI_PATH;if(q)return q;if(x(Kq))return Kq;return"beacon"}function Yq(q){let J=q.indexOf(" ");return J===-1?q:q.slice(0,J)}function M(q){let J=N();if(J==="beacon")return q;return q.replace(/^beacon(\s|$)/,`${J}$1`)}function w(q){let J=Yq(q);return iq(J)+q.slice(J.length)}function oq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let J=JSON.parse(g(G(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let Q of Object.keys(J.plugins??{}))if(/^beacon@/.test(Q))return{key:Q,marketplace:Q.split("@")[1]??""}}catch{}return null}function f(q){try{return JSON.parse(g(q,"utf8"))}catch{return{}}}function Zq(q,J){Qq(gq(q),{recursive:!0}),D(q,JSON.stringify(J,null,2)+`
|
|
3
|
+
`)}function E(q,J,Q={}){let Y=f(q);Y.hooks=Y.hooks??{},Y.hooks[J.event]=Y.hooks[J.event]??[];let Z=Y.hooks[J.event];if(Z.some((z)=>z.hooks?.some((W)=>w(W.command)===w(J.command)&&(Q.matchAnyMatcher||z.matcher===J.matcher))))return!1;return Z.push({matcher:J.matcher,hooks:[{type:"command",command:J.command}]}),Zq(q,Y),!0}function xq(q,J){let Q=f(q),Y=Q.hooks?.[J.event];if(!Y)return!1;let Z=Y.flatMap((W,V)=>(W.hooks??[]).flatMap((U,H)=>w(U.command)===w(J.command)?[{matcherIndex:V,hookIndex:H,preferred:W.matcher===J.matcher}]:[]));if(Z.length<2)return!1;let $=Z.find((W)=>W.preferred)??Z[0],z=new Set(Z.filter((W)=>W!==$).map((W)=>`${W.matcherIndex}:${W.hookIndex}`));return Q.hooks[J.event]=Y.map((W,V)=>({...W,hooks:(W.hooks??[]).filter((U,H)=>!z.has(`${V}:${H}`))})).filter((W)=>(W.hooks??[]).length>0),Zq(q,Q),!0}function I(q,J){return(f(q).hooks?.[J.event]??[]).some((Z)=>Z.hooks?.some(($)=>w($.command)===w(J.command)))}function Mq(q,J){let Y=f(q).hooks?.[J.event]??[];for(let Z of Y)for(let $ of Z.hooks??[])if(w($.command)===w(J.command))return $.command;return null}function L(q,J){let Q=f(q),Y=Q.hooks?.[J.event];if(!Y)return!1;let Z=!1,$=Y.map((z)=>{let W=z.hooks?.length??0,V=(z.hooks??[]).filter((U)=>w(U.command)!==w(J.command));if(V.length!==W)Z=!0;return{...z,hooks:V}}).filter((z)=>(z.hooks??[]).length>0);if(!Z)return!1;if($.length)Q.hooks[J.event]=$;else delete Q.hooks[J.event];if(Q.hooks&&Object.keys(Q.hooks).length===0)delete Q.hooks;return Zq(q,Q),!0}function _(q,J,Q,Y){let Z=`${J}
|
|
4
4
|
${Y.trim()}
|
|
5
|
-
${Q}`,$="";try{$=
|
|
5
|
+
${Q}`,$="";try{$=g(q,"utf8")}catch{}let z=new RegExp(`${J}[\\s\\S]*?${Q}`);$=z.test($)?$.replace(z,Z):$.trim()?`${$.trim()}
|
|
6
6
|
|
|
7
7
|
${Z}
|
|
8
8
|
`:`${Z}
|
|
9
|
-
`,
|
|
9
|
+
`,Qq(gq(q),{recursive:!0}),D(q,$.endsWith(`
|
|
10
10
|
`)?$:`${$}
|
|
11
|
-
`)}function b(q,J){try{return
|
|
11
|
+
`)}function b(q,J){try{return g(q,"utf8").includes(J)}catch{return!1}}function h(q,J,Q){let Y="";try{Y=g(q,"utf8")}catch{return!1}let Z=new RegExp(`${J}[\\s\\S]*?${Q}\\n?`);if(!Z.test(Y))return!1;let $=Y.replace(Z,"").replace(/\n{3,}/g,`
|
|
12
12
|
|
|
13
|
-
`).trimStart();return
|
|
13
|
+
`).trimStart();return D(q,$),!0}function S(q,J,Q){let Y=G(q,J);Qq(Y,{recursive:!0});let Z=G(Y,"SKILL.md");return D(Z,Q),Z}function T(q,J){return x(G(q,J,"SKILL.md"))}function p(q,J){let Q=G(q,J);if(!x(Q))return!1;return aq(Q,{recursive:!0,force:!0}),!0}var B,Kq="/Applications/Beacon.app/Contents/Resources/bin/beacon",k=`## Beacon (visual planning panel)
|
|
14
14
|
|
|
15
15
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
16
16
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -34,23 +34,23 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
34
34
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
35
35
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
36
36
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
37
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
37
|
+
verbatim. Do NOT implement until the tool returns approval.`;var m=F(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});var sJ=1500,rJ=480000,lJ=1800000,t=3600000,cJ=3000;var fq=()=>{};var Uq={};Nq(Uq,{stripAgentsPointer:()=>Aq,repoMcpCliTarget:()=>zJ,removeRepoAssets:()=>UJ,installRefreshSkill:()=>qJ,installPlanSkill:()=>JJ,installInitSkill:()=>eq,installExplainSkill:()=>QJ,installCodexRepoSkills:()=>ZJ,ensureWorkflowDoc:()=>$J,ensureMcp:()=>VJ,contextDocTargets:()=>Wq,auditRepo:()=>WJ,REFRESH_SKILL:()=>Vq,PLAN_SKILL:()=>Tq,INIT_SKILL:()=>$q,EXPLAIN_SKILL:()=>Cq});import{existsSync as v,mkdirSync as C,readFileSync as j,rmSync as s,writeFileSync as P}from"fs";import{join as X}from"path";function eq(q){let J=X(q,".claude","skills","beacon-init");C(J,{recursive:!0});let Q=X(J,"SKILL.md");return P(Q,$q),Q}function qJ(q){let J=X(q,".claude","skills","beacon-refresh");C(J,{recursive:!0});let Q=X(J,"SKILL.md");return P(Q,Vq),Q}function JJ(q){let J=X(q,".claude","skills","beacon-plan");C(J,{recursive:!0});let Q=X(J,"SKILL.md");return P(Q,Tq),Q}function QJ(q){let J=X(q,".claude","skills","beacon-explain");C(J,{recursive:!0});let Q=X(J,"SKILL.md");return P(Q,Cq),Q}function ZJ(q){let J=[];for(let Q of YJ){let Y=X(q,".agents","skills",Q.name);C(Y,{recursive:!0});let Z=X(Y,"SKILL.md");P(Z,Q.body()),J.push(Z)}return J}function Wq(q){let J=X(q,"AGENTS.md"),Q=X(q,"CLAUDE.md"),Y=v(J),Z=v(Q);if(!Y&&!Z)return[J,Q];let $=[];if(Y)$.push(J);if(Z)$.push(Q);return $}function Aq(q){let J=X(q,"CLAUDE.md");if(!v(J))return;let Q=j(J,"utf8"),Y=Q.split(`
|
|
38
38
|
`).filter((Z)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Z)).join(`
|
|
39
|
-
`).trim();if(Y&&Y!==Q.trim())
|
|
40
|
-
`)}function
|
|
39
|
+
`).trim();if(Y&&Y!==Q.trim())P(J,`${Y}
|
|
40
|
+
`)}function $J(q){let J=new RegExp(`${r}[\\s\\S]*?${zq}`);for(let Q of Wq(q)){let Y="";try{Y=j(Q,"utf8")}catch{}Y=J.test(Y)?Y.replace(J,bq):`${Y.trim()}
|
|
41
41
|
|
|
42
42
|
${bq}
|
|
43
|
-
`.trimStart(),
|
|
43
|
+
`.trimStart(),P(Q,Y.endsWith(`
|
|
44
44
|
`)?Y:`${Y}
|
|
45
|
-
`)}
|
|
46
|
-
`),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return Q.mcpServers.beacon={command:
|
|
47
|
-
`),{path:J,added:!0,updated:!1}}function
|
|
48
|
-
`)}}catch{}let Z=!1,$=new RegExp(`\\n?${
|
|
45
|
+
`)}Aq(q)}function VJ(q){let J=X(q,".mcp.json"),Q={};try{Q=JSON.parse(j(J,"utf8"))}catch{}Q.mcpServers=Q.mcpServers??{};let Y=Q.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<t)return Y.timeout=t,P(J,JSON.stringify(Q,null,2)+`
|
|
46
|
+
`),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return Q.mcpServers.beacon={command:N(),args:["mcp"],timeout:t},P(J,JSON.stringify(Q,null,2)+`
|
|
47
|
+
`),{path:J,added:!0,updated:!1}}function zJ(q){try{return JSON.parse(j(X(q,".mcp.json"),"utf8")).mcpServers?.beacon?.command??null}catch{return null}}function WJ(q){let J=X(q,".mcp.json"),Q=!1;try{Q=!!JSON.parse(j(J,"utf8")).mcpServers?.beacon}catch{}let Y=Wq(q).some((Z)=>{try{return j(Z,"utf8").includes(r)}catch{return!1}});return{repo:q,mcpRegistered:Q,workflowBlock:Y,skills:{"beacon-init":v(X(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v(X(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v(X(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v(X(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function UJ(q){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(q,".claude","skills",V);if(v(U))s(U,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let U=X(q,".agents","skills",V);if(v(U))s(U,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let Q=!1,Y=X(q,".mcp.json");try{let V=JSON.parse(j(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,Q=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)s(Y,{force:!0});else P(Y,JSON.stringify(V,null,2)+`
|
|
48
|
+
`)}}catch{}let Z=!1,$=new RegExp(`\\n?${r}[\\s\\S]*?${zq}\\n?`);for(let V of[X(q,"AGENTS.md"),X(q,"CLAUDE.md")])try{let U=j(V,"utf8");if($.test(U)){let H=U.replace($,`
|
|
49
49
|
`).replace(/\n{3,}/g,`
|
|
50
50
|
|
|
51
|
-
`).trimStart();
|
|
52
|
-
`)?
|
|
53
|
-
`),Z=!0}}catch{}let
|
|
51
|
+
`).trimStart();P(V,H.endsWith(`
|
|
52
|
+
`)?H:`${H}
|
|
53
|
+
`),Z=!0}}catch{}let z=!1,W=X(q,"CLAUDE.md");try{let V=j(W,"utf8"),U=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==V){if(!U.trim())s(W,{force:!0});else P(W,U);z=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:Q,agentsBlockRemoved:Z,claudeImportRemoved:z}}var $q=`---
|
|
54
54
|
name: beacon-init
|
|
55
55
|
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.
|
|
56
56
|
---
|
|
@@ -97,7 +97,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
|
|
|
97
97
|
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.
|
|
98
98
|
|
|
99
99
|
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.
|
|
100
|
-
`,
|
|
100
|
+
`,Vq=`---
|
|
101
101
|
name: beacon-refresh
|
|
102
102
|
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.
|
|
103
103
|
---
|
|
@@ -144,7 +144,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
144
144
|
If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
|
|
145
145
|
|
|
146
146
|
After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
|
|
147
|
-
`,
|
|
147
|
+
`,Tq=`---
|
|
148
148
|
name: beacon-plan
|
|
149
149
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
150
150
|
---
|
|
@@ -193,7 +193,7 @@ If it returns feedback, revise and call it again.
|
|
|
193
193
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
194
194
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
195
195
|
run \`beacon\` in this repo once.
|
|
196
|
-
`,
|
|
196
|
+
`,Cq=`---
|
|
197
197
|
name: beacon-explain
|
|
198
198
|
description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
|
|
199
199
|
---
|
|
@@ -263,7 +263,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
|
|
|
263
263
|
Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
|
|
264
264
|
the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
|
|
265
265
|
the lesson.
|
|
266
|
-
`,
|
|
266
|
+
`,YJ,r="<!-- beacon:workflow:start -->",zq="<!-- beacon:workflow:end -->",bq;var Xq=F(()=>{m();fq();YJ=[{name:"beacon-init",body:()=>$q},{name:"beacon-refresh",body:()=>Vq}];bq=`${r}
|
|
267
267
|
## Beacon \u2014 feature workflow
|
|
268
268
|
|
|
269
269
|
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:
|
|
@@ -335,18 +335,20 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
335
335
|
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.
|
|
336
336
|
|
|
337
337
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
338
|
-
${
|
|
339
|
-
`)){let Z=Y.trim();if(!Z||Z.startsWith("#"))continue;let $=/^\[([^\]]+)\]/.exec(Z);if($){if(Q=$[1].trim()==="mcp_servers.beacon",Q)J.mcp_servers=J.mcp_servers??{},J.mcp_servers.beacon=J.mcp_servers.beacon??{};continue}if(Q){let
|
|
338
|
+
${zq}`});import{mkdirSync as XJ,renameSync as PJ,rmSync as HJ,writeFileSync as wJ}from"fs";import{dirname as vJ}from"path";function A(q,J){XJ(vJ(q),{recursive:!0});let Q=`${q}.tmp`;try{wJ(Q,J),PJ(Q,q)}catch(Y){throw HJ(Q,{force:!0}),Y}}function JQ(q,J,Q=!1){A(q,JSON.stringify(J,null,Q?2:void 0))}var Oq=()=>{};var Sq={};Nq(Sq,{setupCodexAssets:()=>xJ,removeCodexMcp:()=>hq,removeCodexArtifacts:()=>fJ,parseTomlBeacon:()=>Lq,nodeWhich:()=>kq,hasCodexMcp:()=>wq,ensureCodexMcp:()=>_q,commandExists:()=>Eq,codexMcpProblem:()=>uJ,codexMcpCliTarget:()=>FJ,codexDetected:()=>Iq,auditCodex:()=>MJ,CODEX_HOOKS:()=>o});import{accessSync as jJ,constants as GJ,readFileSync as y}from"fs";import{homedir as BJ}from"os";import{delimiter as NJ,join as R}from"path";function yq(){return process.env.HOME||process.env.USERPROFILE||BJ()}function kq(q,J=process.env.PATH||"",Q=KJ){if(!q)return null;for(let Y of J.split(NJ)){if(!Y)continue;let Z=R(Y,q);if(Q(Z))return Z}return null}function KJ(q){try{return jJ(q,GJ.X_OK),!0}catch{return!1}}function Eq(q){if(typeof Bun<"u"&&typeof Bun.which==="function")return Bun.which(q)!==null;return kq(q)!==null}function Iq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(Pq===void 0)Pq=Eq("codex");return Pq}function Lq(q){let J={},Q=!1;for(let Y of q.split(`
|
|
339
|
+
`)){let Z=Y.trim();if(!Z||Z.startsWith("#"))continue;let $=/^\[([^\]]+)\]/.exec(Z);if($){if(Q=$[1].trim()==="mcp_servers.beacon",Q)J.mcp_servers=J.mcp_servers??{},J.mcp_servers.beacon=J.mcp_servers.beacon??{};continue}if(Q){let z=/^command\s*=\s*["']([^"']*)["']/.exec(Z);if(z)J.mcp_servers.beacon.command=z[1]}}return J}function u(q){try{if(typeof Bun<"u"&&Bun.TOML?.parse)return Bun.TOML.parse(q);return Lq(q)}catch{return null}}function wq(){try{return Boolean(u(y(K(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function uJ(){let q="";try{q=y(K(),"utf8")}catch{return null}let J=u(q);if(!J)return`~/.codex/config.toml does not parse \u2014 ${O}`;if(J.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${O}`;return null}function RJ(q){let J=q.split(`
|
|
340
|
+
`),Q=J.indexOf(i),Y=J.indexOf(n,Q);if(Q===-1||Y===-1)return null;let Z=J.findIndex((W,V)=>V>Q&&V<Y&&W.trim()==="[mcp_servers.beacon]");if(Z===-1)return null;let $=Z+1;while($<Y&&!/^\s*\[/.test(J[$]))$++;let z=J.findIndex((W,V)=>V>Z&&V<$&&/^\s*command\s*=/.test(W));if(z===-1)return null;return J[z]=`command = ${JSON.stringify(N())}`,J.join(`
|
|
341
|
+
`)}function _q(){let q="",J=!1;try{q=y(K(),"utf8"),J=!0}catch{}if(J){let $=u(q);if(!$)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${O}`};if($.mcp_servers?.beacon){let z=RJ(q);if(z&&z!==q)A(K(),z);return{added:!1}}if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${O}`}}let Q=!q?"":q.endsWith(`
|
|
340
342
|
`)?`
|
|
341
343
|
`:`
|
|
342
344
|
|
|
343
|
-
`,Y=q+Q+
|
|
344
|
-
`),Q=J.indexOf(
|
|
345
|
+
`,Y=q+Q+gJ();if(u(Y)?.mcp_servers?.beacon?.command!==N())return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${O}`};return A(K(),Y),{added:!0}}function FJ(){try{return u(y(K(),"utf8"))?.mcp_servers?.beacon?.command??null}catch{return null}}function hq(){let q="";try{q=y(K(),"utf8")}catch{return{removed:!1}}let J=q.split(`
|
|
346
|
+
`),Q=J.indexOf(i);if(Q===-1)return{removed:!1,skipped:wq()};let Y=J.indexOf(n,Q);if(Y===-1)return{removed:!1,skipped:!0};let Z=J.findIndex((W,V)=>V>Q&&V<Y&&W.trim()==="[mcp_servers.beacon]");if(Z===-1)return{removed:!1,skipped:!0};let $=Z+1;while($<Y&&!/^\s*\[/.test(J[$]))$++;J.splice(Z,$-Z),J.splice(J.indexOf(n),1),J.splice(J.indexOf(i),1);let z=J.join(`
|
|
345
347
|
`).replace(/\n{3,}/g,`
|
|
346
348
|
|
|
347
|
-
`).replace(/^\n+/,"");if(
|
|
349
|
+
`).replace(/^\n+/,"");if(u(z)===null)return{removed:!1,skipped:!0};return A(K(),z),{removed:!0}}async function xJ(){let{INIT_SKILL:q,REFRESH_SKILL:J,PLAN_SKILL:Q,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (Xq(),Uq)),Z={"beacon-init":q,"beacon-refresh":J,"beacon-plan":Q,"beacon-explain":Y},$=[];for(let U of B){if(!T(d(),U))$.push(U);S(d(),U,Z[U])}let z=0;for(let U of o){let H=U.event==="UserPromptSubmit"||U.event==="Stop";if(H)xq(l(),{event:U.event,matcher:U.matcher,command:M(U.command)});if(E(l(),{event:U.event,matcher:U.matcher,command:M(U.command)},{matchAnyMatcher:H}))z++}let W=b(c(),a);_(c(),a,Dq,k);let V=_q();return{skillsAdded:$,hooksAdded:z,agentsMdBlockTouched:!W,mcp:V}}function MJ(){let q={};for(let Q of B)q[Q]=T(d(),Q);let J={};for(let Q of o)J[Q.event]=I(l(),{event:Q.event,command:Q.command});return{detected:Iq(),skills:q,hooks:J,agentsMdBlock:b(c(),a),mcp:wq()}}function fJ(){let q=[];for(let Z of B)if(p(d(),Z))q.push(Z);let J=0;for(let Z of o)if(L(l(),{event:Z.event,command:Z.command}))J++;let Q=h(c(),a,Dq),Y=hq();return{skillsRemoved:q,hooksRemoved:J,agentsMdBlockRemoved:Q,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var Hq=()=>R(yq(),".codex"),l=()=>R(Hq(),"hooks.json"),K=()=>R(Hq(),"config.toml"),c=()=>R(Hq(),"AGENTS.md"),d=()=>R(yq(),".agents","skills"),a="<!-- beacon:global:start -->",Dq="<!-- beacon:global:end -->",o,Pq,i="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",n="# beacon:end",gJ=()=>`${i}
|
|
348
350
|
[mcp_servers.beacon]
|
|
349
|
-
command = "${
|
|
351
|
+
command = "${N()}"
|
|
350
352
|
args = ["mcp"]
|
|
351
|
-
${
|
|
352
|
-
`,
|
|
353
|
+
${n}
|
|
354
|
+
`,O="add it manually: codex mcp add beacon -- beacon mcp";var pq=F(()=>{m();Oq();o=[{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."}]});m();import{existsSync as bJ}from"fs";import{homedir as TJ}from"os";import{join as e}from"path";function CJ(){return process.env.HOME||process.env.USERPROFILE||TJ()}var qq=()=>e(CJ(),".claude"),vq=()=>e(qq(),"skills"),Jq=()=>e(qq(),"settings.json"),jq=()=>e(qq(),"CLAUDE.md"),Gq="<!-- beacon:global:start -->",mq="<!-- beacon:global:end -->";var AJ=k,Bq=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract: in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. Fail-open when there's no active contract."},{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:"PreToolUse",matcher:"AskUserQuestion",command:"beacon ask",description:"Surface the agent's AskUserQuestion in Beacon's modal; your pick flows back as the answer (falls through to the terminal if Beacon isn't open)."},{event:"PermissionRequest",matcher:"Edit|Write|MultiEdit|Bash|NotebookEdit",command:"beacon ask",description:"Surface edit/create/run approvals in Beacon's modal; your allow/deny flows back (falls through to the terminal prompt if Beacon isn't open)."},{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 OJ(q,J){return S(vq(),q,J)}function tq(q){return T(vq(),q)}function yJ(q){return p(vq(),q)}function DJ(q){return E(Jq(),q)}function kJ(q){return I(Jq(),q)}function EJ(q){return L(Jq(),q)}function IJ(q){_(jq(),Gq,mq,q)}function sq(){return b(jq(),Gq)}function LJ(){return h(jq(),Gq,mq)}function HQ(){let q={};for(let Q of B)q[Q]=tq(Q);let J={};for(let Q of Bq)J[Q.event]=kJ({event:Q.event,command:Q.command});return{homeExists:bJ(qq()),skills:q,hooks:J,claudeMdBlock:sq()}}function wQ(){let q=Mq(Jq(),{event:"PostToolUse",command:"beacon hook"});return q?Yq(q):null}async function _J(){let{INIT_SKILL:q,REFRESH_SKILL:J,PLAN_SKILL:Q,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (Xq(),Uq)),Z={"beacon-init":q,"beacon-refresh":J,"beacon-plan":Q,"beacon-explain":Y},$=[];for(let V of B){if(!tq(V))$.push(V);OJ(V,Z[V])}let z=0;for(let V of Bq)if(DJ({event:V.event,matcher:V.matcher,command:M(V.command)}))z++;let W=sq();return IJ(AJ),{skillsAdded:$,hooksAdded:z,claudeMdBlockTouched:!W}}async function vQ(){if(uq())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let q;if(Fq()){try{hJ()}catch{}q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{q={ok:!0,...await _J()}}catch(J){q={ok:!1,error:J instanceof Error?J.message:String(J),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let J=await Promise.resolve().then(() => (pq(),Sq));if(J.codexDetected())q.codex={ok:!0,...await J.setupCodexAssets()}}catch(J){q.codex={ok:!1,error:J instanceof Error?J.message:String(J),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return q}function hJ(){let q=[];for(let Y of B)if(yJ(Y))q.push(Y);let J=0;for(let Y of Bq)if(EJ(Y))J++;let Q=LJ();return{skillsRemoved:q,hooksRemoved:J,claudeMdBlockRemoved:Q}}export{_J as setupGlobalAssets,vQ as selfHealGlobal,yJ as removeGlobalSkill,EJ as removeGlobalHook,LJ as removeGlobalClaudeMdBlock,hJ as removeBeaconArtifacts,uq as isPluginManaged,nq as isInstalledPluginPath,tq as isGlobalSkillInstalled,oq as installedBeaconPlugin,OJ as installGlobalSkill,kJ as hasGlobalHook,sq as hasGlobalClaudeMdBlock,wQ as globalHookCliTarget,Rq as findBeaconPluginDir,DJ as ensureGlobalHook,IJ as ensureGlobalClaudeMdBlock,Fq as beaconPluginInstalled,N as beaconCliCommand,HQ as auditGlobal,B as GLOBAL_SKILLS,Bq as GLOBAL_HOOKS,AJ as GLOBAL_CLAUDE_MD_BLOCK};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `Node` ADD `externalMeta` text;
|