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