( toolsValue: unknown, )
| 111 | * Empty field = [] (no tools) |
| 112 | */ |
| 113 | export function parseAgentToolsFromFrontmatter( |
| 114 | toolsValue: unknown, |
| 115 | ): string[] | undefined { |
| 116 | const parsed = parseToolListString(toolsValue) |
| 117 | if (parsed === null) { |
| 118 | // For agents: undefined = all tools (undefined), null = no tools ([]) |
| 119 | return toolsValue === undefined ? undefined : [] |
| 120 | } |
| 121 | // If parsed contains '*', return undefined (all tools) |
| 122 | if (parsed.includes('*')) { |
| 123 | return undefined |
| 124 | } |
| 125 | return parsed |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Parse allowed-tools from slash command frontmatter |
no test coverage detected