* Strip a leading YAML frontmatter block (`---` ... `---`) so the rendered * README body doesn't show the metadata to the user. Conservative: only * strips when frontmatter is at column 0; anything else passes through.
(raw: string)
| 157 | * strips when frontmatter is at column 0; anything else passes through. |
| 158 | */ |
| 159 | function stripFrontmatter(raw: string): string { |
| 160 | const text = raw.replace(/^/, ''); |
| 161 | if (!text.startsWith('---')) return text; |
| 162 | const closeMatch = /^---\s*$/m.exec(text.slice(3)); |
| 163 | if (!closeMatch || closeMatch.index === undefined) return text; |
| 164 | // Skip past the closing fence and any trailing newline. |
| 165 | const tailStart = 3 + closeMatch.index + closeMatch[0].length; |
| 166 | return text.slice(tailStart).replace(/^\r?\n/, ''); |
| 167 | } |
| 168 | |
| 169 | export interface AgentCapabilities { |
| 170 | readonly parallelPerCwd: boolean; |
no outgoing calls
no test coverage detected