( targetPath: string, processedPaths: Set<string>, )
| 1202 | * @returns Array of MemoryFileInfo objects for matching conditional rules |
| 1203 | */ |
| 1204 | export async function getManagedAndUserConditionalRules( |
| 1205 | targetPath: string, |
| 1206 | processedPaths: Set<string>, |
| 1207 | ): Promise<MemoryFileInfo[]> { |
| 1208 | const result: MemoryFileInfo[] = [] |
| 1209 | |
| 1210 | // Process Managed conditional .claude/rules/*.md files |
| 1211 | const managedClaudeRulesDir = getManagedClaudeRulesDir() |
| 1212 | result.push( |
| 1213 | ...(await processConditionedMdRules( |
| 1214 | targetPath, |
| 1215 | managedClaudeRulesDir, |
| 1216 | 'Managed', |
| 1217 | processedPaths, |
| 1218 | false, |
| 1219 | )), |
| 1220 | ) |
| 1221 | |
| 1222 | if (isSettingSourceEnabled('userSettings')) { |
| 1223 | // Process User conditional .claude/rules/*.md files |
| 1224 | const userClaudeRulesDir = getUserClaudeRulesDir() |
| 1225 | result.push( |
| 1226 | ...(await processConditionedMdRules( |
| 1227 | targetPath, |
| 1228 | userClaudeRulesDir, |
| 1229 | 'User', |
| 1230 | processedPaths, |
| 1231 | true, |
| 1232 | )), |
| 1233 | ) |
| 1234 | } |
| 1235 | |
| 1236 | return result |
| 1237 | } |
| 1238 | |
| 1239 | /** |
| 1240 | * Gets memory files for a single nested directory (between CWD and target). |
no test coverage detected