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