The earlier doc-backed fix left one leak: handleGetDesignMd/handleSetDesignMd still called setDesignMdForPrompt(spec), which wrote into a process-level module variable `_designMdContent` that get_design_prompt's "style" + "design-md" sections read. Switching between documents kept the prior file's policy; get_design_prompt itself had no filePath parameter so it couldn't even identify the current document. Fix: - Delete `_designMdContent` / setDesignMdForPrompt / getDesignMdForPrompt. - `buildDesignPrompt(section, designMdPolicy?)` takes policy as an explicit stateless argument. - Export `designMdSpecToPromptPolicy(spec)` — pure converter. - Add `filePath` to get_design_prompt's schema. The route handler opens the addressed document, derives the policy from `doc.designMd`, and threads it into buildDesignPrompt. Add `design-md` to the section enum (previously only returned via the "style" override). - design-md.ts handlers no longer touch the old setter. Verified by a two-file live smoke: set design.md on A → get_design_prompt on B returns "No design.md loaded" with no A-specific tokens. |
||
|---|---|---|
| .. | ||
| agent-native@e1f90cab96 | ||
| pen-acp | ||
| pen-ai-skills | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||