(location: SettingSource)
| 89 | } |
| 90 | |
| 91 | function getLegacyAgentDirectoryPath(location: SettingSource): string { |
| 92 | switch (location) { |
| 93 | case 'flagSettings': |
| 94 | throw new Error(`Cannot get directory path for ${location} agents`) |
| 95 | case 'userSettings': |
| 96 | return join(getLegacyClaudeConfigHomeDir(), AGENT_PATHS.AGENTS_DIR) |
| 97 | case 'projectSettings': |
| 98 | return join( |
| 99 | getCwd(), |
| 100 | AGENT_PATHS.LEGACY_FOLDER_NAME, |
| 101 | AGENT_PATHS.AGENTS_DIR, |
| 102 | ) |
| 103 | case 'policySettings': |
| 104 | return join( |
| 105 | getManagedFilePath(), |
| 106 | AGENT_PATHS.LEGACY_FOLDER_NAME, |
| 107 | AGENT_PATHS.AGENTS_DIR, |
| 108 | ) |
| 109 | case 'localSettings': |
| 110 | return join( |
| 111 | getCwd(), |
| 112 | AGENT_PATHS.LEGACY_FOLDER_NAME, |
| 113 | AGENT_PATHS.AGENTS_DIR, |
| 114 | ) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | function getAgentDirectoryPath(location: SettingSource): string { |
| 119 | const canonicalDir = getCanonicalAgentDirectoryPath(location) |
no test coverage detected