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
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var bq=Object.defineProperty;var uq=(q)=>q;function wq(q,z){this[q]=uq.bind(null,z)}var d=(q,z)=>{for(var J in z)bq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:wq.bind(z,J)})};var X=(q,z)=>()=>(q&&(z=q(q=0)),z);var lq=1500,dq=480000,sq=1800000,w=3600000,cq=3000;var s=()=>{};var n={};d(n,{removeRepoAssets:()=>Dq,installRefreshSkill:()=>gq,installPlanSkill:()=>Kq,installInitSkill:()=>jq,installCodexRepoSkills:()=>Nq,ensureWorkflowDoc:()=>Mq,ensureMcp:()=>fq,auditRepo:()=>Rq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>t,INIT_SKILL:()=>E});import{existsSync as v,mkdirSync as g,readFileSync as H,rmSync as j,writeFileSync as W}from"fs";import{join as $}from"path";function jq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,E),J}function gq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,L),J}function Kq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,t),J}function Nq(q){let z=[];for(let J of Cq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");W(V,J.body()),z.push(V)}return z}function Mq(q){let z=$(q,"AGENTS.md"),J="";try{J=H(z,"utf8")}catch{}let Q=new RegExp(`${K}[\\s\\S]*?${y}`);J=Q.test(J)?J.replace(Q,c):`${J.trim()}
|
|
3
3
|
|
|
4
|
-
${
|
|
5
|
-
`.trimStart(),
|
|
4
|
+
${c}
|
|
5
|
+
`.trimStart(),W(z,J.endsWith(`
|
|
6
6
|
`)?J:`${J}
|
|
7
|
-
`);let V=$(q,"CLAUDE.md"),Y="";try{Y=
|
|
7
|
+
`);let V=$(q,"CLAUDE.md"),Y="";try{Y=H(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))W(V,`${Y?`${Y.trim()}
|
|
8
8
|
|
|
9
9
|
`:""}@AGENTS.md
|
|
10
|
-
`)}function
|
|
11
|
-
`),{path:z,added:!0}
|
|
12
|
-
`)}}catch{}let
|
|
10
|
+
`)}function fq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(H(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<w)return Q.timeout=w,W(z,JSON.stringify(J,null,2)+`
|
|
11
|
+
`),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:w},W(z,JSON.stringify(J,null,2)+`
|
|
12
|
+
`),{path:z,added:!0,updated:!1}}function Rq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(H(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=H($(q,"AGENTS.md"),"utf8").includes(K)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(H($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function Dq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(H(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)j(Q,{force:!0});else W(Q,JSON.stringify(Z,null,2)+`
|
|
13
|
+
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=H(Y,"utf8"),P=new RegExp(`\\n?${K}[\\s\\S]*?${y}\\n?`);if(P.test(Z)){let k=Z.replace(P,`
|
|
13
14
|
`).replace(/\n{3,}/g,`
|
|
14
15
|
|
|
15
|
-
`).trimStart();
|
|
16
|
-
`)?
|
|
17
|
-
`),V=!0}}catch{}let U=!1,
|
|
16
|
+
`).trimStart();W(Y,k.endsWith(`
|
|
17
|
+
`)?k:`${k}
|
|
18
|
+
`),V=!0}}catch{}let U=!1,B=$(q,"CLAUDE.md");try{let Z=H(B,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())j(B,{force:!0});else W(B,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var E=`---
|
|
18
19
|
name: beacon-init
|
|
19
20
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
20
21
|
---
|
|
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
53
54
|
If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
|
|
54
55
|
|
|
55
56
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
56
|
-
`,
|
|
57
|
+
`,L=`---
|
|
57
58
|
name: beacon-refresh
|
|
58
59
|
description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
|
|
59
60
|
---
|
|
@@ -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
|
|
|
@@ -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
|
+
`,Cq,K="<!-- beacon:workflow:start -->",y="<!-- beacon:workflow:end -->",c;var r=X(()=>{s();Cq=[{name:"beacon-init",body:()=>E},{name:"beacon-refresh",body:()=>L}];c=`${K}
|
|
152
153
|
## Beacon \u2014 feature workflow
|
|
153
154
|
|
|
154
155
|
This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
|
|
@@ -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,27 +208,27 @@ 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
|
-
${
|
|
210
|
-
`)}function
|
|
220
|
+
${y}`});import{existsSync as i,mkdirSync as O,readFileSync as N,rmSync as Iq,writeFileSync as M}from"fs";import{dirname as o,join as C}from"path";function h(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function qq(q,z){O(o(q),{recursive:!0}),M(q,JSON.stringify(z,null,2)+`
|
|
221
|
+
`)}function zq(q,z){let J=h(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),qq(q,J),!0}function Jq(q,z){return(h(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function Qq(q,z){let J=h(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let B=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==B)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return qq(q,J),!0}function Vq(q,z,J,Q){let V=`${z}
|
|
211
222
|
${Q.trim()}
|
|
212
223
|
${J}`,Y="";try{Y=N(q,"utf8")}catch{}let U=new RegExp(`${z}[\\s\\S]*?${J}`);Y=U.test(Y)?Y.replace(U,V):Y.trim()?`${Y.trim()}
|
|
213
224
|
|
|
214
225
|
${V}
|
|
215
226
|
`:`${V}
|
|
216
|
-
`,
|
|
227
|
+
`,O(o(q),{recursive:!0}),M(q,Y.endsWith(`
|
|
217
228
|
`)?Y:`${Y}
|
|
218
|
-
`)}function
|
|
229
|
+
`)}function _(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Yq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
|
|
219
230
|
|
|
220
|
-
`).trimStart();return
|
|
231
|
+
`).trimStart();return M(q,Y),!0}function Zq(q,z,J){let Q=C(q,z);O(Q,{recursive:!0});let V=C(Q,"SKILL.md");return M(V,J),V}function m(q,z){return i(C(q,z,"SKILL.md"))}function $q(q,z){let J=C(q,z);if(!i(J))return!1;return Iq(J,{recursive:!0,force:!0}),!0}var f,e=`## Beacon (visual planning panel)
|
|
221
232
|
|
|
222
233
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
223
234
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -238,17 +249,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
238
249
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
239
250
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
240
251
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
241
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
252
|
+
verbatim. Do NOT implement until the tool returns approval.`;var Uq=X(()=>{f=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Aq,renameSync as Tq,rmSync as Fq,writeFileSync as kq}from"fs";import{dirname as Eq}from"path";function R(q,z){Aq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{kq(J,z),Tq(J,q)}catch(Q){throw Fq(J,{force:!0}),Q}}function Qz(q,z,J=!1){R(q,JSON.stringify(z,null,J?2:void 0))}var Pq=()=>{};var Sq={};d(Sq,{setupCodexAssets:()=>hq,removeCodexMcp:()=>Gq,removeCodexArtifacts:()=>mq,hasCodexMcp:()=>l,ensureCodexMcp:()=>Xq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>_q,CODEX_HOOKS:()=>F});import{readFileSync as T}from"fs";import{homedir as Lq}from"os";import{join as u}from"path";function Wq(){return process.env.HOME||process.env.USERPROFILE||Lq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(S===void 0)S=Bun.which("codex")!==null;return S}function b(q){try{return Bun.TOML.parse(q)}catch{return null}}function l(){try{return Boolean(b(T(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=T(x(),"utf8")}catch{return null}let z=b(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${G}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${G}`;return null}function Xq(){let q="",z=!1;try{q=T(x(),"utf8"),z=!0}catch{}if(z){let Y=b(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${G}`};if(Y.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${G}`}}let J=!q?"":q.endsWith(`
|
|
242
253
|
`)?`
|
|
243
254
|
`:`
|
|
244
255
|
|
|
245
|
-
`,Q=q+J+
|
|
246
|
-
`),J=z.indexOf(
|
|
256
|
+
`,Q=q+J+yq;if(b(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${G}`};return R(x(),Q),{added:!0}}function Gq(){let q="";try{q=T(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
|
|
257
|
+
`),J=z.indexOf(vq);if(J===-1)return{removed:!1,skipped:l()};let Q=z.indexOf(xq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
|
|
247
258
|
`).replace(/\n{3,}/g,`
|
|
248
259
|
|
|
249
|
-
`).replace(/^\n+/,"");if(
|
|
260
|
+
`).replace(/^\n+/,"");if(b(V)===null)return{removed:!1,skipped:!0};return R(x(),V),{removed:!0}}async function hq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (r(),n)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of f){if(!m(I(),Z))V.push(Z);Zq(I(),Z,Q[Z])}let Y=0;for(let Z of F)if(zq(a(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=_(D(),A);Vq(D(),A,Hq,e);let B=Xq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:B}}function _q(){let q={};for(let J of f)q[J]=m(I(),J);let z={};for(let J of F)z[J.event]=Jq(a(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:_(D(),A),mcp:l()}}function mq(){let q=[];for(let V of f)if($q(I(),V))q.push(V);let z=0;for(let V of F)if(Qq(a(),{event:V.event,command:V.command}))z++;let J=Yq(D(),A,Hq),Q=Gq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var p=()=>u(Wq(),".codex"),a=()=>u(p(),"hooks.json"),x=()=>u(p(),"config.toml"),D=()=>u(p(),"AGENTS.md"),I=()=>u(Wq(),".agents","skills"),A="<!-- beacon:global:start -->",Hq="<!-- beacon:global:end -->",F,S,vq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",xq="# beacon:end",yq,G="add it manually: codex mcp add beacon -- beacon mcp";var pq=X(()=>{Uq();Pq();F=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];yq=`${vq}
|
|
250
261
|
[mcp_servers.beacon]
|
|
251
262
|
command = "beacon"
|
|
252
263
|
args = ["mcp"]
|
|
253
|
-
${
|
|
254
|
-
`});
|
|
264
|
+
${xq}
|
|
265
|
+
`});pq();export{hq as setupCodexAssets,Gq as removeCodexMcp,mq as removeCodexArtifacts,l as hasCodexMcp,Xq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,_q as auditCodex,F as CODEX_HOOKS};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var Tq=Object.defineProperty;var Iq=(q)=>q;function yq(q,z){this[q]=Iq.bind(null,z)}var Wq=(q,z)=>{for(var J in z)Tq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:yq.bind(z,J)})};var j=(q,z)=>()=>(q&&(z=q(q=0)),z);var xz=1500,Hz=480000,wz=1800000,b=3600000,vz=3000;var Xq=()=>{};var s={};Wq(s,{removeRepoAssets:()=>mq,installRefreshSkill:()=>Aq,installPlanSkill:()=>Eq,installInitSkill:()=>Dq,installCodexRepoSkills:()=>kq,ensureWorkflowDoc:()=>hq,ensureMcp:()=>Lq,auditRepo:()=>_q,REFRESH_SKILL:()=>n,PLAN_SKILL:()=>xq,INIT_SKILL:()=>d});import{existsSync as w,mkdirSync as f,readFileSync as x,rmSync as K,writeFileSync as U}from"fs";import{join as $}from"path";function Dq(q){let z=$(q,".claude","skills","beacon-init");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,d),J}function Aq(q){let z=$(q,".claude","skills","beacon-refresh");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,n),J}function Eq(q){let z=$(q,".claude","skills","beacon-plan");f(z,{recursive:!0});let J=$(z,"SKILL.md");return U(J,xq),J}function kq(q){let z=[];for(let J of Oq){let Q=$(q,".agents","skills",J.name);f(Q,{recursive:!0});let V=$(Q,"SKILL.md");U(V,J.body()),z.push(V)}return z}function hq(q){let z=$(q,"AGENTS.md"),J="";try{J=x(z,"utf8")}catch{}let Q=new RegExp(`${C}[\\s\\S]*?${r}`);J=Q.test(J)?J.replace(Q,Uq):`${J.trim()}
|
|
3
3
|
|
|
4
|
-
${
|
|
5
|
-
`.trimStart(),
|
|
4
|
+
${Uq}
|
|
5
|
+
`.trimStart(),U(z,J.endsWith(`
|
|
6
6
|
`)?J:`${J}
|
|
7
|
-
`);let V=$(q,"CLAUDE.md"),Y="";try{Y=
|
|
7
|
+
`);let V=$(q,"CLAUDE.md"),Y="";try{Y=x(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))U(V,`${Y?`${Y.trim()}
|
|
8
8
|
|
|
9
9
|
`:""}@AGENTS.md
|
|
10
|
-
`)}function
|
|
11
|
-
`),{path:z,added:!0}
|
|
12
|
-
`)}}catch{}let
|
|
10
|
+
`)}function Lq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(x(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<b)return Q.timeout=b,U(z,JSON.stringify(J,null,2)+`
|
|
11
|
+
`),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:b},U(z,JSON.stringify(J,null,2)+`
|
|
12
|
+
`),{path:z,added:!0,updated:!1}}function _q(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(x(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=x($(q,"AGENTS.md"),"utf8").includes(C)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(x($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":w($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":w($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":w($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":w($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function mq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=$(q,".claude","skills",Z);if(w(X))K(X,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let X=$(q,".agents","skills",Z);if(w(X))K(X,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(x(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)K(Q,{force:!0});else U(Q,JSON.stringify(Z,null,2)+`
|
|
13
|
+
`)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=x(Y,"utf8"),X=new RegExp(`\\n?${C}[\\s\\S]*?${r}\\n?`);if(X.test(Z)){let t=Z.replace(X,`
|
|
13
14
|
`).replace(/\n{3,}/g,`
|
|
14
15
|
|
|
15
|
-
`).trimStart();
|
|
16
|
+
`).trimStart();U(Y,t.endsWith(`
|
|
16
17
|
`)?t:`${t}
|
|
17
|
-
`),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=
|
|
18
|
+
`),V=!0}}catch{}let P=!1,W=$(q,"CLAUDE.md");try{let Z=x(W,"utf8"),X=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==Z){if(!X.trim())K(W,{force:!0});else U(W,X);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var d=`---
|
|
18
19
|
name: beacon-init
|
|
19
20
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
20
21
|
---
|
|
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
53
54
|
If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
|
|
54
55
|
|
|
55
56
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
56
|
-
`,
|
|
57
|
+
`,n=`---
|
|
57
58
|
name: beacon-refresh
|
|
58
59
|
description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
|
|
59
60
|
---
|
|
@@ -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
|
+
`,xq=`---
|
|
104
105
|
name: beacon-plan
|
|
105
106
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
106
107
|
---
|
|
@@ -148,7 +149,7 @@ If it returns feedback, revise and call it again.
|
|
|
148
149
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
149
150
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
150
151
|
run \`beacon\` in this repo once.
|
|
151
|
-
`,
|
|
152
|
+
`,Oq,C="<!-- beacon:workflow:start -->",r="<!-- beacon:workflow:end -->",Uq;var l=j(()=>{Xq();Oq=[{name:"beacon-init",body:()=>d},{name:"beacon-refresh",body:()=>n}];Uq=`${C}
|
|
152
153
|
## Beacon \u2014 feature workflow
|
|
153
154
|
|
|
154
155
|
This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
|
|
@@ -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,27 +208,27 @@ 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
|
-
${
|
|
210
|
-
`)}function
|
|
220
|
+
${r}`});import{existsSync as Hq,mkdirSync as i,readFileSync as M,rmSync as pq,writeFileSync as R}from"fs";import{dirname as wq,join as F}from"path";function o(q){try{return JSON.parse(M(q,"utf8"))}catch{return{}}}function vq(q,z){i(wq(q),{recursive:!0}),R(q,JSON.stringify(z,null,2)+`
|
|
221
|
+
`)}function I(q,z){let J=o(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((P)=>P.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),vq(q,J),!0}function y(q,z){return(o(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function D(q,z){let J=o(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((P)=>{let W=P.hooks?.length??0,Z=(P.hooks??[]).filter((X)=>X.command!==z.command);if(Z.length!==W)V=!0;return{...P,hooks:Z}}).filter((P)=>(P.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return vq(q,J),!0}function A(q,z,J,Q){let V=`${z}
|
|
211
222
|
${Q.trim()}
|
|
212
223
|
${J}`,Y="";try{Y=M(q,"utf8")}catch{}let P=new RegExp(`${z}[\\s\\S]*?${J}`);Y=P.test(Y)?Y.replace(P,V):Y.trim()?`${Y.trim()}
|
|
213
224
|
|
|
214
225
|
${V}
|
|
215
226
|
`:`${V}
|
|
216
|
-
`,
|
|
227
|
+
`,i(wq(q),{recursive:!0}),R(q,Y.endsWith(`
|
|
217
228
|
`)?Y:`${Y}
|
|
218
|
-
`)}function
|
|
229
|
+
`)}function g(q,z){try{return M(q,"utf8").includes(z)}catch{return!1}}function E(q,z,J){let Q="";try{Q=M(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
|
|
219
230
|
|
|
220
|
-
`).trimStart();return
|
|
231
|
+
`).trimStart();return R(q,Y),!0}function O(q,z,J){let Q=F(q,z);i(Q,{recursive:!0});let V=F(Q,"SKILL.md");return R(V,J),V}function B(q,z){return Hq(F(q,z,"SKILL.md"))}function k(q,z){let J=F(q,z);if(!Hq(J))return!1;return pq(J,{recursive:!0,force:!0}),!0}var H,T=`## Beacon (visual planning panel)
|
|
221
232
|
|
|
222
233
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
223
234
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -238,17 +249,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
238
249
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
239
250
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
240
251
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
241
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
252
|
+
verbatim. Do NOT implement until the tool returns approval.`;var e=j(()=>{H=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Sq,renameSync as aq,rmSync as cq,writeFileSync as tq}from"fs";import{dirname as dq}from"path";function h(q,z){Sq(dq(q),{recursive:!0});let J=`${q}.tmp`;try{tq(J,z),aq(J,q)}catch(Q){throw cq(J,{force:!0}),Q}}function Cz(q,z,J=!1){h(q,JSON.stringify(z,null,J?2:void 0))}var jq=()=>{};var fq={};Wq(fq,{setupCodexAssets:()=>lq,removeCodexMcp:()=>Kq,removeCodexArtifacts:()=>oq,hasCodexMcp:()=>Qq,ensureCodexMcp:()=>bq,codexMcpProblem:()=>sq,codexDetected:()=>uq,auditCodex:()=>iq,CODEX_HOOKS:()=>S});import{readFileSync as p}from"fs";import{homedir as nq}from"os";import{join as G}from"path";function gq(){return process.env.HOME||process.env.USERPROFILE||nq()}function uq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(qq===void 0)qq=Bun.which("codex")!==null;return qq}function N(q){try{return Bun.TOML.parse(q)}catch{return null}}function Qq(){try{return Boolean(N(p(v(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function sq(){let q="";try{q=p(v(),"utf8")}catch{return null}let z=N(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function bq(){let q="",z=!1;try{q=p(v(),"utf8"),z=!0}catch{}if(z){let Y=N(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};if(Y.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${u}`}}let J=!q?"":q.endsWith(`
|
|
242
253
|
`)?`
|
|
243
254
|
`:`
|
|
244
255
|
|
|
245
|
-
`,Q=q+J+
|
|
246
|
-
`),J=z.indexOf(
|
|
256
|
+
`,Q=q+J+rq;if(N(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return h(v(),Q),{added:!0}}function Kq(){let q="";try{q=p(v(),"utf8")}catch{return{removed:!1}}let z=q.split(`
|
|
257
|
+
`),J=z.indexOf(Nq);if(J===-1)return{removed:!1,skipped:Qq()};let Q=z.indexOf(Gq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
|
|
247
258
|
`).replace(/\n{3,}/g,`
|
|
248
259
|
|
|
249
|
-
`).replace(/^\n+/,"");if(
|
|
260
|
+
`).replace(/^\n+/,"");if(N(V)===null)return{removed:!1,skipped:!0};return h(v(),V),{removed:!0}}async function lq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (l(),s)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of H){if(!B(_(),Z))V.push(Z);O(_(),Z,Q[Z])}let Y=0;for(let Z of S)if(I(Jq(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let P=g(L(),m);A(L(),m,Bq,T);let W=bq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!P,mcp:W}}function iq(){let q={};for(let J of H)q[J]=B(_(),J);let z={};for(let J of S)z[J.event]=y(Jq(),{event:J.event,command:J.command});return{detected:uq(),skills:q,hooks:z,agentsMdBlock:g(L(),m),mcp:Qq()}}function oq(){let q=[];for(let V of H)if(k(_(),V))q.push(V);let z=0;for(let V of S)if(D(Jq(),{event:V.event,command:V.command}))z++;let J=E(L(),m,Bq),Q=Kq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var zq=()=>G(gq(),".codex"),Jq=()=>G(zq(),"hooks.json"),v=()=>G(zq(),"config.toml"),L=()=>G(zq(),"AGENTS.md"),_=()=>G(gq(),".agents","skills"),m="<!-- beacon:global:start -->",Bq="<!-- beacon:global:end -->",S,qq,Nq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Gq="# beacon:end",rq,u="add it manually: codex mcp add beacon -- beacon mcp";var Cq=j(()=>{e();jq();S=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];rq=`${Nq}
|
|
250
261
|
[mcp_servers.beacon]
|
|
251
262
|
command = "beacon"
|
|
252
263
|
args = ["mcp"]
|
|
253
|
-
${
|
|
254
|
-
`});
|
|
264
|
+
${Gq}
|
|
265
|
+
`});e();import{existsSync as eq}from"fs";import{homedir as qz}from"os";import{join as a}from"path";function zz(){return process.env.HOME||process.env.USERPROFILE||qz()}var c=()=>a(zz(),".claude"),Vq=()=>a(c(),"skills"),Yq=()=>a(c(),"settings.json"),Zq=()=>a(c(),"CLAUDE.md"),$q="<!-- beacon:global:start -->",Fq="<!-- beacon:global:end -->";var Jz=T,Pq=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function Qz(q,z){return O(Vq(),q,z)}function Mq(q){return B(Vq(),q)}function Vz(q){return k(Vq(),q)}function Yz(q){return I(Yq(),q)}function Zz(q){return y(Yq(),q)}function $z(q){return D(Yq(),q)}function Pz(q){A(Zq(),$q,Fq,q)}function Rq(){return g(Zq(),$q)}function Wz(){return E(Zq(),$q,Fq)}function kz(){let q={};for(let J of H)q[J]=Mq(J);let z={};for(let J of Pq)z[J.event]=Zz({event:J.event,command:J.command});return{homeExists:eq(c()),skills:q,hooks:z,claudeMdBlock:Rq()}}async function Xz(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (l(),s)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let W of H){if(!Mq(W))V.push(W);Qz(W,Q[W])}let Y=0;for(let W of Pq)if(Yz({event:W.event,matcher:W.matcher,command:W.command}))Y++;let P=Rq();return Pz(Jz),{skillsAdded:V,hooksAdded:Y,claudeMdBlockTouched:!P}}async function hz(){let q;try{q={ok:!0,...await Xz()}}catch(z){q={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let z=await Promise.resolve().then(() => (Cq(),fq));if(z.codexDetected())q.codex={ok:!0,...await z.setupCodexAssets()}}catch(z){q.codex={ok:!1,error:z instanceof Error?z.message:String(z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return q}function Lz(){let q=[];for(let Q of H)if(Vz(Q))q.push(Q);let z=0;for(let Q of Pq)if($z(Q))z++;let J=Wz();return{skillsRemoved:q,hooksRemoved:z,claudeMdBlockRemoved:J}}export{Xz as setupGlobalAssets,hz as selfHealGlobal,Vz as removeGlobalSkill,$z as removeGlobalHook,Wz as removeGlobalClaudeMdBlock,Lz as removeBeaconArtifacts,Mq as isGlobalSkillInstalled,Qz as installGlobalSkill,Zz as hasGlobalHook,Rq as hasGlobalClaudeMdBlock,Yz as ensureGlobalHook,Pz as ensureGlobalClaudeMdBlock,kz as auditGlobal,H as GLOBAL_SKILLS,Pq as GLOBAL_HOOKS,Jz as GLOBAL_CLAUDE_MD_BLOCK};
|