* Loads configuration from saved URI in auth config
( uri: string, accessToken: string | null, organizationId: string | null, apiClient: DefaultApiInterface, injectBlocks: PackageIdentifier[], )
| 220 | * Loads configuration from saved URI in auth config |
| 221 | */ |
| 222 | async function loadFromSavedUri( |
| 223 | uri: string, |
| 224 | accessToken: string | null, |
| 225 | organizationId: string | null, |
| 226 | apiClient: DefaultApiInterface, |
| 227 | injectBlocks: PackageIdentifier[], |
| 228 | ): Promise<AssistantUnrolled> { |
| 229 | const filePath = uriToPath(uri); |
| 230 | if (filePath) { |
| 231 | return await loadConfigYaml( |
| 232 | filePath, |
| 233 | accessToken, |
| 234 | organizationId, |
| 235 | apiClient, |
| 236 | injectBlocks, |
| 237 | ); |
| 238 | } |
| 239 | |
| 240 | const slug = uriToSlug(uri); |
| 241 | if (slug) { |
| 242 | return await loadAssistantSlug( |
| 243 | slug, |
| 244 | accessToken, |
| 245 | organizationId, |
| 246 | apiClient, |
| 247 | injectBlocks, |
| 248 | ); |
| 249 | } |
| 250 | |
| 251 | throw new Error(`Invalid saved config URI: ${uri}`); |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Loads first available user assistant with fallback to default agent |
no test coverage detected