1
+ import { ConfigJson } from "@continuedev/config-types" ;
1
2
import {
2
3
ContinueConfig ,
3
4
IDE ,
4
5
IdeSettings ,
5
6
SerializedContinueConfig ,
6
7
} from "../.." ;
7
8
import { ControlPlaneClient } from "../../control-plane/client" ;
8
- import { ControlPlaneSettings } from "../../control-plane/schema" ;
9
9
import { TeamAnalytics } from "../../control-plane/TeamAnalytics" ;
10
+ import ContinueProxy from "../../llm/llms/stubs/ContinueProxy" ;
10
11
import { Telemetry } from "../../util/posthog" ;
11
12
import {
12
13
defaultContextProvidersJetBrains ,
@@ -26,7 +27,7 @@ export default class ControlPlaneProfileLoader implements IProfileLoader {
26
27
readonly profileId : string ;
27
28
profileTitle : string ;
28
29
29
- workspaceSettings : ControlPlaneSettings | undefined ;
30
+ workspaceSettings : ConfigJson | undefined ;
30
31
31
32
constructor (
32
33
private readonly workspaceId : string ,
@@ -55,13 +56,8 @@ export default class ControlPlaneProfileLoader implements IProfileLoader {
55
56
this . profileId ,
56
57
) ) as any ) ;
57
58
58
- // First construct a SerializedContinueConfig from the ControlPlaneSettings
59
- const serializedConfig : SerializedContinueConfig = {
60
- models : settings . models ,
61
- tabAutocompleteModel : settings . tabAutocompleteModel ,
62
- embeddingsProvider : settings . embeddingsModel ,
63
- reranker : settings . reranker ,
64
- } ;
59
+ // First construct a SerializedContinueConfig from the ControlPlaneSettings (TODO)
60
+ const serializedConfig : SerializedContinueConfig = settings ;
65
61
66
62
serializedConfig . contextProviders ??=
67
63
ideInfo . ideType === "vscode"
@@ -94,6 +90,16 @@ export default class ControlPlaneProfileLoader implements IProfileLoader {
94
90
ideInfo . extensionVersion ,
95
91
) ;
96
92
93
+ [
94
+ ...finalConfig . models ,
95
+ ...( finalConfig . tabAutocompleteModels ?? [ ] ) ,
96
+ ] . forEach ( async ( model ) => {
97
+ if ( model . providerName === "continue-proxy" ) {
98
+ const accessToken = await this . controlPlaneClient . getAccessToken ( ) ;
99
+ ( model as ContinueProxy ) . workOsAccessToken = accessToken ;
100
+ }
101
+ } ) ;
102
+
97
103
return finalConfig ;
98
104
}
99
105
0 commit comments