Download src/parsers/codex.ts from hongcoding/agentlens: direct link, hf CLI and curl.
- Browser
- Download file 688 Bytes
-
https://huggingface.co/datasets/hongcoding/agentlens/resolve/main/src/parsers/codex.ts
- Command line
-
hf download hf://datasets/hongcoding/agentlens/src/parsers/codex.ts
-
curl -L -o codex.ts https://huggingface.co/datasets/hongcoding/agentlens/resolve/main/src/parsers/codex.ts
688 Bytes
| import type { Rule } from "../core/types.js"; | |
| import type { ConfigParser } from "./base.js"; | |
| import { nextRuleId, classifyRule, extractRuleBlocks } from "./base.js"; | |
| /** | |
| * Codex config parser. | |
| * Reads: AGENTS.md (project root) | |
| */ | |
| export const codexParser: ConfigParser = { | |
| agent: "codex", | |
| filePatterns: ["AGENTS.md"], | |
| parse(content: string, filePath: string): Rule[] { | |
| const blocks = extractRuleBlocks(content); | |
| return blocks.map((block) => ({ | |
| id: nextRuleId(), | |
| category: classifyRule(block), | |
| content: block, | |
| scope: "project" as const, | |
| source: { agent: "codex" as const, file: filePath }, | |
| status: "active" as const, | |
| })); | |
| }, | |
| }; | |