( targetPath: string, processedPaths: Set<string>, )
| 1367 | * @returns Array of MemoryFileInfo objects for matching conditional rules |
| 1368 | */ |
| 1369 | export async function getManagedAndUserConditionalRules( |
| 1370 | targetPath: string, |
| 1371 | processedPaths: Set<string>, |
| 1372 | ): Promise<MemoryFileInfo[]> { |
| 1373 | const result: MemoryFileInfo[] = [] |
| 1374 | |
| 1375 | // Process Managed conditional .ncode/rules/*.md files (legacy .claude/rules/*.md still supported) |
| 1376 | const managedClaudeRulesDir = getManagedClaudeRulesDir() |
| 1377 | result.push( |
| 1378 | ...(await processConditionedMdRules( |
| 1379 | targetPath, |
| 1380 | managedClaudeRulesDir, |
| 1381 | 'Managed', |
| 1382 | processedPaths, |
| 1383 | false, |
| 1384 | )), |
| 1385 | ) |
| 1386 | |
| 1387 | if (isSettingSourceEnabled('userSettings')) { |
| 1388 | // Process User conditional instruction rule files |
| 1389 | for (const userInstructionRulesDir of getUserInstructionRuleDirsLowToHigh()) { |
| 1390 | result.push( |
| 1391 | ...(await processConditionedMdRules( |
| 1392 | targetPath, |
| 1393 | userInstructionRulesDir, |
| 1394 | 'User', |
| 1395 | processedPaths, |
| 1396 | true, |
| 1397 | )), |
| 1398 | ) |
| 1399 | } |
| 1400 | } |
| 1401 | |
| 1402 | return result |
| 1403 | } |
| 1404 | |
| 1405 | /** |
| 1406 | * Gets memory files for a single nested directory (between CWD and target). |
no test coverage detected