* Gets the directory path for an agent location
(location: SettingSource)
| 58 | * Gets the directory path for an agent location |
| 59 | */ |
| 60 | function getAgentDirectoryPath(location: SettingSource): string { |
| 61 | switch (location) { |
| 62 | case 'flagSettings': |
| 63 | throw new Error(`Cannot get directory path for ${location} agents`) |
| 64 | case 'userSettings': |
| 65 | return join(getClaudeConfigHomeDir(), AGENT_PATHS.AGENTS_DIR) |
| 66 | case 'projectSettings': |
| 67 | return join(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR) |
| 68 | case 'policySettings': |
| 69 | return join( |
| 70 | getManagedFilePath(), |
| 71 | AGENT_PATHS.FOLDER_NAME, |
| 72 | AGENT_PATHS.AGENTS_DIR, |
| 73 | ) |
| 74 | case 'localSettings': |
| 75 | return join(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | function getRelativeAgentDirectoryPath(location: SettingSource): string { |
| 80 | switch (location) { |
no test coverage detected