( toolsValue: unknown, )
| 154 | * Empty field = [] (no tools) |
| 155 | */ |
| 156 | export function parseAgentToolsFromFrontmatter( |
| 157 | toolsValue: unknown, |
| 158 | ): string[] | undefined { |
| 159 | const parsed = parseToolListString(toolsValue) |
| 160 | if (parsed === null) { |
| 161 | // For agents: undefined = all tools (undefined), null = no tools ([]) |
| 162 | return toolsValue === undefined ? undefined : [] |
| 163 | } |
| 164 | // If parsed contains '*', return undefined (all tools) |
| 165 | if (parsed.includes('*')) { |
| 166 | return undefined |
| 167 | } |
| 168 | return parsed |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Parse allowed-tools from slash command frontmatter |
no test coverage detected