(options: {
ide: IDE;
llmLogger: ILLMLogger;
overrideConfigJson?: SerializedContinueConfig;
overrideConfigYaml?: AssistantUnrolled;
profileId: string;
overrideConfigYamlByPath?: string;
packageIdentifier: PackageIdentifier;
})
| 62 | } |
| 63 | |
| 64 | export default async function doLoadConfig(options: { |
| 65 | ide: IDE; |
| 66 | llmLogger: ILLMLogger; |
| 67 | overrideConfigJson?: SerializedContinueConfig; |
| 68 | overrideConfigYaml?: AssistantUnrolled; |
| 69 | profileId: string; |
| 70 | overrideConfigYamlByPath?: string; |
| 71 | packageIdentifier: PackageIdentifier; |
| 72 | }): Promise<ConfigResult<ContinueConfig>> { |
| 73 | const { |
| 74 | ide, |
| 75 | llmLogger, |
| 76 | overrideConfigJson, |
| 77 | overrideConfigYaml, |
| 78 | profileId, |
| 79 | overrideConfigYamlByPath, |
| 80 | packageIdentifier, |
| 81 | } = options; |
| 82 | |
| 83 | const ideInfo = await ide.getIdeInfo(); |
| 84 | const uniqueId = await ide.getUniqueId(); |
| 85 | const ideSettings = await ide.getIdeSettings(); |
| 86 | |
| 87 | // Migrations for old config files |
| 88 | // Removes |
| 89 | const configJsonPath = getConfigJsonPath(); |
| 90 | if (fs.existsSync(configJsonPath)) { |
| 91 | migrateJsonSharedConfig(configJsonPath, ide); |
| 92 | } |
| 93 | |
| 94 | const configYamlPath = localPathOrUriToPath( |
| 95 | overrideConfigYamlByPath || getConfigYamlPath(ideInfo.ideType), |
| 96 | ); |
| 97 | |
| 98 | let newConfig: ContinueConfig | undefined; |
| 99 | let errors: ConfigValidationError[] | undefined; |
| 100 | let configLoadInterrupted = false; |
| 101 | let configName: string | undefined; |
| 102 | |
| 103 | const hasPreReadContent = |
| 104 | packageIdentifier.uriType === "file" && |
| 105 | packageIdentifier.content !== undefined; |
| 106 | |
| 107 | if ( |
| 108 | overrideConfigYaml || |
| 109 | hasPreReadContent || |
| 110 | fs.existsSync(configYamlPath) |
| 111 | ) { |
| 112 | const result = await loadContinueConfigFromYaml({ |
| 113 | ide, |
| 114 | ideSettings, |
| 115 | ideInfo, |
| 116 | uniqueId, |
| 117 | llmLogger, |
| 118 | overrideConfigYaml, |
| 119 | packageIdentifier, |
| 120 | }); |
| 121 | newConfig = result.config; |
no test coverage detected