(mode: RuleMode, agent: string)
| 51 | } |
| 52 | |
| 53 | export async function getRuleContent(mode: RuleMode, agent: string): Promise<string> { |
| 54 | const [filename, fallback] = |
| 55 | mode === "mcp" ? ["context7-mcp.md", FALLBACK_MCP] : ["context7-cli.md", FALLBACK_CLI]; |
| 56 | let body = await fetchRule(filename, fallback); |
| 57 | |
| 58 | if (mode === "cli" && agent === "codex" && !body.includes(CODEX_CLI_SANDBOX_GUIDANCE)) { |
| 59 | body = `${body.trimEnd()}\n${CODEX_CLI_SANDBOX_GUIDANCE}\n`; |
| 60 | } |
| 61 | |
| 62 | return agent === "cursor" ? `${CURSOR_FRONTMATTER}${body}` : body; |
| 63 | } |
| 64 | |
| 65 | export function customizeSkillFilesForAgent( |
| 66 | agent: string, |
no test coverage detected