@theia/ai-copilot 1.75.0 → 1.76.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -14
- package/lib/browser/copilot-auth-dialog.d.ts.map +1 -1
- package/lib/browser/copilot-auth-dialog.js +12 -4
- package/lib/browser/copilot-auth-dialog.js.map +1 -1
- package/lib/browser/copilot-frontend-application-contribution.d.ts +15 -1
- package/lib/browser/copilot-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/copilot-frontend-application-contribution.js +52 -24
- package/lib/browser/copilot-frontend-application-contribution.js.map +1 -1
- package/lib/common/copilot-auth-service.d.ts +27 -24
- package/lib/common/copilot-auth-service.d.ts.map +1 -1
- package/lib/common/copilot-language-models-manager.d.ts +3 -21
- package/lib/common/copilot-language-models-manager.d.ts.map +1 -1
- package/lib/common/copilot-language-models-manager.js +1 -13
- package/lib/common/copilot-language-models-manager.js.map +1 -1
- package/lib/common/copilot-preferences.d.ts +1 -0
- package/lib/common/copilot-preferences.d.ts.map +1 -1
- package/lib/common/copilot-preferences.js +24 -6
- package/lib/common/copilot-preferences.js.map +1 -1
- package/lib/common/index.d.ts +0 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +0 -1
- package/lib/common/index.js.map +1 -1
- package/lib/node/copilot-auth-service-impl.d.ts +25 -16
- package/lib/node/copilot-auth-service-impl.d.ts.map +1 -1
- package/lib/node/copilot-auth-service-impl.js +67 -183
- package/lib/node/copilot-auth-service-impl.js.map +1 -1
- package/lib/node/copilot-auth-service-impl.spec.js +104 -168
- package/lib/node/copilot-auth-service-impl.spec.js.map +1 -1
- package/lib/node/copilot-backend-module.d.ts.map +1 -1
- package/lib/node/copilot-backend-module.js +10 -2
- package/lib/node/copilot-backend-module.js.map +1 -1
- package/lib/node/copilot-cli-auth-provider.d.ts +146 -0
- package/lib/node/copilot-cli-auth-provider.d.ts.map +1 -0
- package/lib/node/copilot-cli-auth-provider.js +430 -0
- package/lib/node/copilot-cli-auth-provider.js.map +1 -0
- package/lib/node/copilot-cli-auth-provider.spec.d.ts +2 -0
- package/lib/node/copilot-cli-auth-provider.spec.d.ts.map +1 -0
- package/lib/node/copilot-cli-auth-provider.spec.js +249 -0
- package/lib/node/copilot-cli-auth-provider.spec.js.map +1 -0
- package/lib/node/copilot-cli-locator.d.ts +120 -0
- package/lib/node/copilot-cli-locator.d.ts.map +1 -0
- package/lib/node/copilot-cli-locator.js +348 -0
- package/lib/node/copilot-cli-locator.js.map +1 -0
- package/lib/node/copilot-cli-locator.spec.d.ts +2 -0
- package/lib/node/copilot-cli-locator.spec.d.ts.map +1 -0
- package/lib/node/copilot-cli-locator.spec.js +327 -0
- package/lib/node/copilot-cli-locator.spec.js.map +1 -0
- package/lib/node/copilot-credential-store.d.ts +45 -0
- package/lib/node/copilot-credential-store.d.ts.map +1 -0
- package/lib/node/copilot-credential-store.js +96 -0
- package/lib/node/copilot-credential-store.js.map +1 -0
- package/lib/node/copilot-credential-store.spec.d.ts +2 -0
- package/lib/node/copilot-credential-store.spec.d.ts.map +1 -0
- package/lib/node/copilot-credential-store.spec.js +93 -0
- package/lib/node/copilot-credential-store.spec.js.map +1 -0
- package/lib/node/copilot-language-models-manager-impl.d.ts +20 -18
- package/lib/node/copilot-language-models-manager-impl.d.ts.map +1 -1
- package/lib/node/copilot-language-models-manager-impl.js +39 -67
- package/lib/node/copilot-language-models-manager-impl.js.map +1 -1
- package/lib/node/copilot-language-models-manager-impl.spec.d.ts +2 -0
- package/lib/node/copilot-language-models-manager-impl.spec.d.ts.map +1 -0
- package/lib/node/copilot-language-models-manager-impl.spec.js +119 -0
- package/lib/node/copilot-language-models-manager-impl.spec.js.map +1 -0
- package/lib/node/copilot-runtime-env.d.ts +20 -0
- package/lib/node/copilot-runtime-env.d.ts.map +1 -0
- package/lib/node/copilot-runtime-env.js +49 -0
- package/lib/node/copilot-runtime-env.js.map +1 -0
- package/lib/node/copilot-sdk-client-provider.d.ts +103 -0
- package/lib/node/copilot-sdk-client-provider.d.ts.map +1 -0
- package/lib/node/copilot-sdk-client-provider.js +247 -0
- package/lib/node/copilot-sdk-client-provider.js.map +1 -0
- package/lib/node/copilot-sdk-client-provider.spec.d.ts +2 -0
- package/lib/node/copilot-sdk-client-provider.spec.d.ts.map +1 -0
- package/lib/node/copilot-sdk-client-provider.spec.js +215 -0
- package/lib/node/copilot-sdk-client-provider.spec.js.map +1 -0
- package/lib/node/copilot-sdk-language-model.d.ts +85 -0
- package/lib/node/copilot-sdk-language-model.d.ts.map +1 -0
- package/lib/node/copilot-sdk-language-model.js +301 -0
- package/lib/node/copilot-sdk-language-model.js.map +1 -0
- package/lib/node/copilot-sdk-language-model.spec.d.ts +2 -0
- package/lib/node/copilot-sdk-language-model.spec.d.ts.map +1 -0
- package/lib/node/copilot-sdk-language-model.spec.js +302 -0
- package/lib/node/copilot-sdk-language-model.spec.js.map +1 -0
- package/lib/node/copilot-sdk-loader.d.ts +57 -0
- package/lib/node/copilot-sdk-loader.d.ts.map +1 -0
- package/lib/node/copilot-sdk-loader.js +133 -0
- package/lib/node/copilot-sdk-loader.js.map +1 -0
- package/lib/node/copilot-sdk-loader.spec.d.ts +2 -0
- package/lib/node/copilot-sdk-loader.spec.d.ts.map +1 -0
- package/lib/node/copilot-sdk-loader.spec.js +113 -0
- package/lib/node/copilot-sdk-loader.spec.js.map +1 -0
- package/lib/node/copilot-sdk-mappers.d.ts +49 -0
- package/lib/node/copilot-sdk-mappers.d.ts.map +1 -0
- package/lib/node/copilot-sdk-mappers.js +147 -0
- package/lib/node/copilot-sdk-mappers.js.map +1 -0
- package/lib/node/copilot-sdk-mappers.spec.d.ts +2 -0
- package/lib/node/copilot-sdk-mappers.spec.d.ts.map +1 -0
- package/lib/node/copilot-sdk-mappers.spec.js +133 -0
- package/lib/node/copilot-sdk-mappers.spec.js.map +1 -0
- package/lib/node/copilot-sdk-types.d.ts +198 -0
- package/lib/node/copilot-sdk-types.d.ts.map +1 -0
- package/lib/{common/copilot-oauth-config.js → node/copilot-sdk-types.js} +2 -13
- package/lib/node/copilot-sdk-types.js.map +1 -0
- package/lib/node/index.d.ts +9 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +9 -1
- package/lib/node/index.js.map +1 -1
- package/package.json +4 -6
- package/src/browser/copilot-auth-dialog.tsx +12 -8
- package/src/browser/copilot-frontend-application-contribution.ts +62 -29
- package/src/common/copilot-auth-service.ts +28 -24
- package/src/common/copilot-language-models-manager.ts +3 -28
- package/src/common/copilot-preferences.ts +24 -5
- package/src/common/index.ts +0 -1
- package/src/node/copilot-auth-service-impl.spec.ts +122 -207
- package/src/node/copilot-auth-service-impl.ts +63 -218
- package/src/node/copilot-backend-module.ts +11 -2
- package/src/node/copilot-cli-auth-provider.spec.ts +315 -0
- package/src/node/copilot-cli-auth-provider.ts +444 -0
- package/src/node/copilot-cli-locator.spec.ts +386 -0
- package/src/node/copilot-cli-locator.ts +363 -0
- package/src/node/copilot-credential-store.spec.ts +106 -0
- package/src/node/copilot-credential-store.ts +99 -0
- package/src/node/copilot-language-models-manager-impl.spec.ts +137 -0
- package/src/node/copilot-language-models-manager-impl.ts +51 -85
- package/src/node/copilot-runtime-env.ts +46 -0
- package/src/node/copilot-sdk-client-provider.spec.ts +253 -0
- package/src/node/copilot-sdk-client-provider.ts +241 -0
- package/src/node/copilot-sdk-language-model.spec.ts +363 -0
- package/src/node/copilot-sdk-language-model.ts +329 -0
- package/src/node/copilot-sdk-loader.spec.ts +126 -0
- package/src/node/copilot-sdk-loader.ts +142 -0
- package/src/node/copilot-sdk-mappers.spec.ts +151 -0
- package/src/node/copilot-sdk-mappers.ts +161 -0
- package/src/node/copilot-sdk-types.ts +276 -0
- package/src/node/index.ts +9 -1
- package/lib/common/copilot-oauth-config.d.ts +0 -33
- package/lib/common/copilot-oauth-config.d.ts.map +0 -1
- package/lib/common/copilot-oauth-config.js.map +0 -1
- package/lib/node/copilot-language-model.d.ts +0 -34
- package/lib/node/copilot-language-model.d.ts.map +0 -1
- package/lib/node/copilot-language-model.js +0 -236
- package/lib/node/copilot-language-model.js.map +0 -1
- package/lib/node/copilot-language-model.spec.d.ts +0 -2
- package/lib/node/copilot-language-model.spec.d.ts.map +0 -1
- package/lib/node/copilot-language-model.spec.js +0 -89
- package/lib/node/copilot-language-model.spec.js.map +0 -1
- package/src/common/copilot-oauth-config.ts +0 -55
- package/src/node/copilot-language-model.spec.ts +0 -106
- package/src/node/copilot-language-model.ts +0 -273
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import { LanguageModelRegistry, LanguageModelStatus } from '@theia/ai-core';
|
|
2
|
-
import {
|
|
2
|
+
import { DisposableCollection, ILogger } from '@theia/core';
|
|
3
3
|
import { CopilotLanguageModelsManager, CopilotModelDescription } from '../common';
|
|
4
|
-
import {
|
|
4
|
+
import { CopilotSdkClientProvider } from './copilot-sdk-client-provider';
|
|
5
5
|
import { CopilotAuthServiceImpl } from './copilot-auth-service-impl';
|
|
6
6
|
/**
|
|
7
7
|
* Backend implementation of the Copilot language models manager.
|
|
8
8
|
* Manages registration and lifecycle of Copilot language models in the AI language model registry.
|
|
9
9
|
*/
|
|
10
|
-
export declare class CopilotLanguageModelsManagerImpl implements CopilotLanguageModelsManager
|
|
10
|
+
export declare class CopilotLanguageModelsManagerImpl implements CopilotLanguageModelsManager {
|
|
11
11
|
protected readonly languageModelRegistry: LanguageModelRegistry;
|
|
12
12
|
protected readonly authService: CopilotAuthServiceImpl;
|
|
13
|
-
protected readonly
|
|
13
|
+
protected readonly sdkClientProvider: CopilotSdkClientProvider;
|
|
14
14
|
protected readonly logger: ILogger;
|
|
15
|
-
protected enterpriseUrl: string | undefined;
|
|
16
15
|
protected readonly toDispose: DisposableCollection;
|
|
16
|
+
/**
|
|
17
|
+
* Why the last model discovery failed, if it did.
|
|
18
|
+
*
|
|
19
|
+
* Being signed in does not imply that requests are accepted: the credentials can lack the Copilot
|
|
20
|
+
* entitlement, be revoked, or belong to a subscription served by a different API host. Reporting
|
|
21
|
+
* the models as ready in those cases claims a working setup that is not there, so the failure is
|
|
22
|
+
* remembered and reflected in the status of the models.
|
|
23
|
+
*/
|
|
24
|
+
protected discoveryFailure: string | undefined;
|
|
17
25
|
protected init(): void;
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Detaches from the auth service when the container this manager lives in goes away.
|
|
28
|
+
* Unbinding a container runs `@preDestroy` rather than `dispose`, see the client provider.
|
|
29
|
+
*/
|
|
30
|
+
protected stop(): void;
|
|
20
31
|
protected calculateStatus(): Promise<LanguageModelStatus>;
|
|
21
32
|
createOrUpdateLanguageModels(...modelDescriptions: CopilotModelDescription[]): Promise<void>;
|
|
22
33
|
removeLanguageModels(...modelIds: string[]): void;
|
|
23
34
|
refreshModelsStatus(): Promise<void>;
|
|
24
35
|
fetchAvailableModelIds(): Promise<string[]>;
|
|
25
36
|
/**
|
|
26
|
-
*
|
|
27
|
-
* The API returns both alias IDs (e.g., `gpt-4o`) and versioned IDs
|
|
28
|
-
* (e.g., `gpt-4o-2024-11-20`) for the same model family.
|
|
29
|
-
* We keep only the family alias when it exists, falling back to
|
|
30
|
-
* the versioned ID otherwise.
|
|
37
|
+
* Records the outcome of the last model discovery and reflects it in the status of the models.
|
|
31
38
|
*/
|
|
32
|
-
protected
|
|
33
|
-
id: string;
|
|
34
|
-
capabilities?: {
|
|
35
|
-
family?: string;
|
|
36
|
-
};
|
|
37
|
-
}>): string[];
|
|
39
|
+
protected setDiscoveryFailure(failure: string | undefined): Promise<void>;
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=copilot-language-models-manager-impl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-language-models-manager-impl.d.ts","sourceRoot":"","sources":["../../src/node/copilot-language-models-manager-impl.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,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AmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAOlF"}
|
|
@@ -21,8 +21,8 @@ const ai_core_1 = require("@theia/ai-core");
|
|
|
21
21
|
const core_1 = require("@theia/core");
|
|
22
22
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
23
|
const common_1 = require("../common");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const copilot_sdk_language_model_1 = require("./copilot-sdk-language-model");
|
|
25
|
+
const copilot_sdk_client_provider_1 = require("./copilot-sdk-client-provider");
|
|
26
26
|
const copilot_auth_service_impl_1 = require("./copilot-auth-service-impl");
|
|
27
27
|
/**
|
|
28
28
|
* Backend implementation of the Copilot language models manager.
|
|
@@ -34,42 +34,46 @@ let CopilotLanguageModelsManagerImpl = class CopilotLanguageModelsManagerImpl {
|
|
|
34
34
|
}
|
|
35
35
|
init() {
|
|
36
36
|
this.toDispose.push(this.authService.onAuthStateChanged(() => {
|
|
37
|
-
|
|
37
|
+
// The listener cannot be awaited, so the failure is reported here rather than escaping as
|
|
38
|
+
// an unhandled rejection.
|
|
39
|
+
this.refreshModelsStatus().catch(error => this.logger.warn('Copilot: failed to update the status of the models:', error));
|
|
38
40
|
}));
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Detaches from the auth service when the container this manager lives in goes away.
|
|
44
|
+
* Unbinding a container runs `@preDestroy` rather than `dispose`, see the client provider.
|
|
45
|
+
*/
|
|
46
|
+
stop() {
|
|
41
47
|
this.toDispose.dispose();
|
|
42
48
|
}
|
|
43
|
-
setEnterpriseUrl(url) {
|
|
44
|
-
this.enterpriseUrl = url;
|
|
45
|
-
}
|
|
46
49
|
async calculateStatus() {
|
|
47
50
|
const authState = await this.authService.getAuthState();
|
|
48
|
-
if (authState.isAuthenticated) {
|
|
49
|
-
return { status: '
|
|
51
|
+
if (!authState.isAuthenticated) {
|
|
52
|
+
return { status: 'unavailable', message: core_1.nls.localize('theia/ai/copilot/notSignedIn', 'Not signed in to GitHub Copilot') };
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
if (this.discoveryFailure) {
|
|
55
|
+
return { status: 'unavailable', message: this.discoveryFailure };
|
|
56
|
+
}
|
|
57
|
+
return { status: 'ready' };
|
|
52
58
|
}
|
|
53
59
|
async createOrUpdateLanguageModels(...modelDescriptions) {
|
|
54
60
|
const status = await this.calculateStatus();
|
|
55
61
|
for (const modelDescription of modelDescriptions) {
|
|
56
62
|
const model = await this.languageModelRegistry.getLanguageModel(modelDescription.id);
|
|
57
63
|
if (model) {
|
|
58
|
-
if (!(model instanceof
|
|
64
|
+
if (!(model instanceof copilot_sdk_language_model_1.CopilotSdkLanguageModel)) {
|
|
59
65
|
this.logger.warn(`Copilot: model ${modelDescription.id} is not a Copilot model`);
|
|
60
66
|
continue;
|
|
61
67
|
}
|
|
62
68
|
await this.languageModelRegistry.patchLanguageModel(modelDescription.id, {
|
|
63
69
|
model: modelDescription.model,
|
|
64
|
-
enableStreaming: modelDescription.enableStreaming,
|
|
65
|
-
supportsStructuredOutput: modelDescription.supportsStructuredOutput,
|
|
66
70
|
status,
|
|
67
71
|
maxRetries: modelDescription.maxRetries
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
else {
|
|
71
75
|
this.languageModelRegistry.addLanguageModels([
|
|
72
|
-
new
|
|
76
|
+
new copilot_sdk_language_model_1.CopilotSdkLanguageModel(modelDescription.id, modelDescription.model, status, modelDescription.maxRetries, () => this.sdkClientProvider.getClient(), this.logger)
|
|
73
77
|
]);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
@@ -81,7 +85,7 @@ let CopilotLanguageModelsManagerImpl = class CopilotLanguageModelsManagerImpl {
|
|
|
81
85
|
const status = await this.calculateStatus();
|
|
82
86
|
const allModels = await this.languageModelRegistry.getLanguageModels();
|
|
83
87
|
for (const model of allModels) {
|
|
84
|
-
if (model instanceof
|
|
88
|
+
if (model instanceof copilot_sdk_language_model_1.CopilotSdkLanguageModel && model.id.startsWith(`${common_1.COPILOT_PROVIDER_ID}/`)) {
|
|
85
89
|
await this.languageModelRegistry.patchLanguageModel(model.id, {
|
|
86
90
|
status
|
|
87
91
|
});
|
|
@@ -89,65 +93,27 @@ let CopilotLanguageModelsManagerImpl = class CopilotLanguageModelsManagerImpl {
|
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
async fetchAvailableModelIds() {
|
|
92
|
-
const accessToken = await this.authService.getAccessToken();
|
|
93
|
-
if (!accessToken) {
|
|
94
|
-
return [];
|
|
95
|
-
}
|
|
96
|
-
const baseURL = (0, common_1.getCopilotApiBaseUrl)(this.enterpriseUrl);
|
|
97
96
|
try {
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
'User-Agent': this.oauthConfig.userAgent,
|
|
102
|
-
'Accept': 'application/json'
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
if (!response.ok) {
|
|
106
|
-
this.logger.warn(`Copilot: failed to fetch available models: ${response.status} ${response.statusText}`);
|
|
107
|
-
return [];
|
|
108
|
-
}
|
|
109
|
-
const data = await response.json();
|
|
110
|
-
const models = data.data ?? [];
|
|
111
|
-
const modelIds = this.deduplicateModels(models);
|
|
112
|
-
this.logger.info(`Copilot: discovered ${modelIds.length} available models: ${modelIds.join(', ')}`);
|
|
97
|
+
const modelIds = await this.sdkClientProvider.listModelIds();
|
|
98
|
+
this.logger.info(`Copilot: discovered ${modelIds.length} models [${modelIds.join(', ')}]`);
|
|
99
|
+
await this.setDiscoveryFailure(undefined);
|
|
113
100
|
return modelIds;
|
|
114
101
|
}
|
|
115
102
|
catch (error) {
|
|
116
|
-
this.logger.warn('Copilot: failed to fetch available models:', error);
|
|
103
|
+
this.logger.warn('Copilot: failed to fetch available models via the Copilot CLI:', error);
|
|
104
|
+
await this.setDiscoveryFailure(error instanceof Error ? error.message : String(error));
|
|
117
105
|
return [];
|
|
118
106
|
}
|
|
119
107
|
}
|
|
120
108
|
/**
|
|
121
|
-
*
|
|
122
|
-
* The API returns both alias IDs (e.g., `gpt-4o`) and versioned IDs
|
|
123
|
-
* (e.g., `gpt-4o-2024-11-20`) for the same model family.
|
|
124
|
-
* We keep only the family alias when it exists, falling back to
|
|
125
|
-
* the versioned ID otherwise.
|
|
109
|
+
* Records the outcome of the last model discovery and reflects it in the status of the models.
|
|
126
110
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const seenFamilies = new Set();
|
|
131
|
-
for (const model of models) {
|
|
132
|
-
const family = model.capabilities?.family;
|
|
133
|
-
if (family && seenFamilies.has(family)) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
if (family) {
|
|
137
|
-
seenFamilies.add(family);
|
|
138
|
-
// Prefer the family alias if it exists as a model ID
|
|
139
|
-
if (allIds.has(family)) {
|
|
140
|
-
result.push(family);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
result.push(model.id);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
result.push(model.id);
|
|
148
|
-
}
|
|
111
|
+
async setDiscoveryFailure(failure) {
|
|
112
|
+
if (this.discoveryFailure === failure) {
|
|
113
|
+
return;
|
|
149
114
|
}
|
|
150
|
-
|
|
115
|
+
this.discoveryFailure = failure;
|
|
116
|
+
await this.refreshModelsStatus();
|
|
151
117
|
}
|
|
152
118
|
};
|
|
153
119
|
exports.CopilotLanguageModelsManagerImpl = CopilotLanguageModelsManagerImpl;
|
|
@@ -160,9 +126,9 @@ tslib_1.__decorate([
|
|
|
160
126
|
tslib_1.__metadata("design:type", copilot_auth_service_impl_1.CopilotAuthServiceImpl)
|
|
161
127
|
], CopilotLanguageModelsManagerImpl.prototype, "authService", void 0);
|
|
162
128
|
tslib_1.__decorate([
|
|
163
|
-
(0, inversify_1.inject)(
|
|
164
|
-
tslib_1.__metadata("design:type",
|
|
165
|
-
], CopilotLanguageModelsManagerImpl.prototype, "
|
|
129
|
+
(0, inversify_1.inject)(copilot_sdk_client_provider_1.CopilotSdkClientProvider),
|
|
130
|
+
tslib_1.__metadata("design:type", copilot_sdk_client_provider_1.CopilotSdkClientProvider)
|
|
131
|
+
], CopilotLanguageModelsManagerImpl.prototype, "sdkClientProvider", void 0);
|
|
166
132
|
tslib_1.__decorate([
|
|
167
133
|
(0, inversify_1.inject)(core_1.ILogger),
|
|
168
134
|
(0, inversify_1.named)('ai-copilot:CopilotLanguageModelsManagerImpl'),
|
|
@@ -174,6 +140,12 @@ tslib_1.__decorate([
|
|
|
174
140
|
tslib_1.__metadata("design:paramtypes", []),
|
|
175
141
|
tslib_1.__metadata("design:returntype", void 0)
|
|
176
142
|
], CopilotLanguageModelsManagerImpl.prototype, "init", null);
|
|
143
|
+
tslib_1.__decorate([
|
|
144
|
+
(0, inversify_1.preDestroy)(),
|
|
145
|
+
tslib_1.__metadata("design:type", Function),
|
|
146
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
147
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
148
|
+
], CopilotLanguageModelsManagerImpl.prototype, "stop", null);
|
|
177
149
|
exports.CopilotLanguageModelsManagerImpl = CopilotLanguageModelsManagerImpl = tslib_1.__decorate([
|
|
178
150
|
(0, inversify_1.injectable)()
|
|
179
151
|
], CopilotLanguageModelsManagerImpl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-language-models-manager-impl.js","sourceRoot":"","sources":["../../src/node/copilot-language-models-manager-impl.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4CAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"copilot-language-models-manager-impl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AAC,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACpC,OAAO;QACX,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAChC,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACrC,CAAC;CACJ,CAAA;AA9HY,4EAAgC;AAGtB;IADlB,IAAA,kBAAM,EAAC,+BAAqB,CAAC;;+EACkC;AAG7C;IADlB,IAAA,kBAAM,EAAC,kDAAsB,CAAC;sCACC,kDAAsB;qEAAC;AAGpC;IADlB,IAAA,kBAAM,EAAC,sDAAwB,CAAC;sCACK,sDAAwB;2EAAC;AAG5C;IADlB,IAAA,kBAAM,EAAC,cAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,6CAA6C,CAAC;;gEACnC;AAezB;IADT,IAAA,yBAAa,GAAE;;;;4DAOf;AAOS;IADT,IAAA,sBAAU,GAAE;;;;4DAGZ;2CA1CQ,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;GACA,gCAAgC,CA8H5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-language-models-manager-impl.spec.d.ts","sourceRoot":"","sources":["../../src/node/copilot-language-models-manager-impl.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const mock_logger_1 = require("@theia/core/lib/common/test/mock-logger");
|
|
20
|
+
const copilot_language_models_manager_impl_1 = require("./copilot-language-models-manager-impl");
|
|
21
|
+
/** A registry that records the models and the patches it received. */
|
|
22
|
+
class FakeRegistry {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.models = [];
|
|
25
|
+
this.patches = [];
|
|
26
|
+
}
|
|
27
|
+
async getLanguageModel(id) {
|
|
28
|
+
return this.models.find(model => model.id === id);
|
|
29
|
+
}
|
|
30
|
+
async getLanguageModels() {
|
|
31
|
+
return this.models;
|
|
32
|
+
}
|
|
33
|
+
addLanguageModels(models) {
|
|
34
|
+
this.models.push(...models);
|
|
35
|
+
}
|
|
36
|
+
removeLanguageModels(ids) {
|
|
37
|
+
for (const id of ids) {
|
|
38
|
+
const index = this.models.findIndex(model => model.id === id);
|
|
39
|
+
if (index >= 0) {
|
|
40
|
+
this.models.splice(index, 1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async patchLanguageModel(id, patch) {
|
|
45
|
+
this.patches.push({ id, patch });
|
|
46
|
+
Object.assign(this.models.find(model => model.id === id) ?? {}, patch);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class TestableCopilotLanguageModelsManagerImpl extends copilot_language_models_manager_impl_1.CopilotLanguageModelsManagerImpl {
|
|
50
|
+
constructor(registry) {
|
|
51
|
+
super();
|
|
52
|
+
this.registry = registry;
|
|
53
|
+
this.authState = { isAuthenticated: true };
|
|
54
|
+
this.modelIds = ['gpt-5'];
|
|
55
|
+
Object.assign(this, {
|
|
56
|
+
logger: new mock_logger_1.MockLogger(),
|
|
57
|
+
languageModelRegistry: registry,
|
|
58
|
+
authService: {
|
|
59
|
+
getAuthState: async () => this.authState,
|
|
60
|
+
onAuthStateChanged: () => ({ dispose: () => { } })
|
|
61
|
+
},
|
|
62
|
+
sdkClientProvider: {
|
|
63
|
+
listModelIds: async () => {
|
|
64
|
+
if (this.listFailure) {
|
|
65
|
+
throw this.listFailure;
|
|
66
|
+
}
|
|
67
|
+
return this.modelIds;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
callCalculateStatus() {
|
|
73
|
+
return this.calculateStatus();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
describe('CopilotLanguageModelsManagerImpl - status', () => {
|
|
77
|
+
let manager;
|
|
78
|
+
beforeEach(() => {
|
|
79
|
+
manager = new TestableCopilotLanguageModelsManagerImpl(new FakeRegistry());
|
|
80
|
+
});
|
|
81
|
+
it('should report a model as ready for a user who is signed in', async () => {
|
|
82
|
+
await manager.createOrUpdateLanguageModels({ id: 'copilot/gpt-5', model: 'gpt-5', maxRetries: 3 });
|
|
83
|
+
(0, chai_1.expect)(manager.registry.models[0].status).to.deep.equal({ status: 'ready' });
|
|
84
|
+
});
|
|
85
|
+
it('should report a model as unavailable while nobody is signed in', async () => {
|
|
86
|
+
manager.authState = { isAuthenticated: false };
|
|
87
|
+
(0, chai_1.expect)(await manager.callCalculateStatus()).to.deep.include({ status: 'unavailable' });
|
|
88
|
+
});
|
|
89
|
+
it('should report models as unavailable when they cannot be listed, rather than as ready', async () => {
|
|
90
|
+
manager.listFailure = new Error('not authorized to use this Copilot feature');
|
|
91
|
+
(0, chai_1.expect)(await manager.fetchAvailableModelIds()).to.be.empty;
|
|
92
|
+
const status = await manager.callCalculateStatus();
|
|
93
|
+
(0, chai_1.expect)(status.status).to.equal('unavailable');
|
|
94
|
+
(0, chai_1.expect)(status.message).to.contain('not authorized');
|
|
95
|
+
});
|
|
96
|
+
it('should reflect a failed listing in the models that are already registered', async () => {
|
|
97
|
+
await manager.createOrUpdateLanguageModels({ id: 'copilot/gpt-5', model: 'gpt-5', maxRetries: 3 });
|
|
98
|
+
manager.listFailure = new Error('socket hang up');
|
|
99
|
+
await manager.fetchAvailableModelIds();
|
|
100
|
+
(0, chai_1.expect)(manager.registry.patches.map(patch => patch.id)).to.deep.equal(['copilot/gpt-5']);
|
|
101
|
+
(0, chai_1.expect)(manager.registry.models[0].status).to.deep.include({ status: 'unavailable' });
|
|
102
|
+
});
|
|
103
|
+
it('should report ready again once the models can be listed', async () => {
|
|
104
|
+
await manager.createOrUpdateLanguageModels({ id: 'copilot/gpt-5', model: 'gpt-5', maxRetries: 3 });
|
|
105
|
+
manager.listFailure = new Error('socket hang up');
|
|
106
|
+
await manager.fetchAvailableModelIds();
|
|
107
|
+
manager.listFailure = undefined;
|
|
108
|
+
(0, chai_1.expect)(await manager.fetchAvailableModelIds()).to.deep.equal(['gpt-5']);
|
|
109
|
+
(0, chai_1.expect)(manager.registry.models[0].status).to.deep.equal({ status: 'ready' });
|
|
110
|
+
});
|
|
111
|
+
it('should update an existing model instead of registering it twice', async () => {
|
|
112
|
+
await manager.createOrUpdateLanguageModels({ id: 'copilot/gpt-5', model: 'gpt-5', maxRetries: 3 });
|
|
113
|
+
await manager.createOrUpdateLanguageModels({ id: 'copilot/gpt-5', model: 'gpt-5', maxRetries: 5 });
|
|
114
|
+
(0, chai_1.expect)(manager.registry.models).to.have.lengthOf(1);
|
|
115
|
+
(0, chai_1.expect)(manager.registry.patches).to.have.lengthOf(1);
|
|
116
|
+
(0, chai_1.expect)(manager.registry.patches[0].patch).to.deep.include({ maxRetries: 5 });
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=copilot-language-models-manager-impl.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-language-models-manager-impl.spec.js","sourceRoot":"","sources":["../../src/node/copilot-language-models-manager-impl.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;A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E,KAAK,IAAI,EAAE;QAC7E,MAAM,OAAO,CAAC,4BAA4B,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnG,MAAM,OAAO,CAAC,4BAA4B,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QACnG,IAAA,aAAM,EAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACrD,IAAA,aAAM,EAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environment of the processes this integration starts, which are the Copilot CLI of a sign-in
|
|
3
|
+
* and the one that serves the requests.
|
|
4
|
+
*/
|
|
5
|
+
export declare namespace CopilotRuntimeEnv {
|
|
6
|
+
/**
|
|
7
|
+
* The variables the Copilot CLI accepts a token from. None of them is a sign-in of this
|
|
8
|
+
* application, so a token this application does not own must not reach the CLI through them.
|
|
9
|
+
*/
|
|
10
|
+
const TOKEN_VARIABLES: string[];
|
|
11
|
+
/**
|
|
12
|
+
* The given environment without the variables that carry a token.
|
|
13
|
+
*
|
|
14
|
+
* They are dropped by name and regardless of their case, rather than masked with `undefined`.
|
|
15
|
+
* Environment variables are case-insensitive on Windows, so a `Github_Token` of the backend would
|
|
16
|
+
* survive a `GITHUB_TOKEN: undefined` next to it and would still be read by the CLI.
|
|
17
|
+
*/
|
|
18
|
+
function withoutTokens(env: NodeJS.ProcessEnv): Record<string, string | undefined>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=copilot-runtime-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-runtime-env.d.ts","sourceRoot":"","sources":["../../src/node/copilot-runtime-env.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,yBAAiB,iBAAiB,CAAC;IAE/B;;;OAGG;IACI,MAAM,eAAe,UAAuD,CAAC;IAEpF;;;;;;OAMG;IACH,SAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CASxF;CACJ"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CopilotRuntimeEnv = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* The environment of the processes this integration starts, which are the Copilot CLI of a sign-in
|
|
21
|
+
* and the one that serves the requests.
|
|
22
|
+
*/
|
|
23
|
+
var CopilotRuntimeEnv;
|
|
24
|
+
(function (CopilotRuntimeEnv) {
|
|
25
|
+
/**
|
|
26
|
+
* The variables the Copilot CLI accepts a token from. None of them is a sign-in of this
|
|
27
|
+
* application, so a token this application does not own must not reach the CLI through them.
|
|
28
|
+
*/
|
|
29
|
+
CopilotRuntimeEnv.TOKEN_VARIABLES = ['COPILOT_GITHUB_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN'];
|
|
30
|
+
/**
|
|
31
|
+
* The given environment without the variables that carry a token.
|
|
32
|
+
*
|
|
33
|
+
* They are dropped by name and regardless of their case, rather than masked with `undefined`.
|
|
34
|
+
* Environment variables are case-insensitive on Windows, so a `Github_Token` of the backend would
|
|
35
|
+
* survive a `GITHUB_TOKEN: undefined` next to it and would still be read by the CLI.
|
|
36
|
+
*/
|
|
37
|
+
function withoutTokens(env) {
|
|
38
|
+
const dropped = new Set(CopilotRuntimeEnv.TOKEN_VARIABLES.map(name => name.toLowerCase()));
|
|
39
|
+
const result = {};
|
|
40
|
+
for (const [name, value] of Object.entries(env)) {
|
|
41
|
+
if (!dropped.has(name.toLowerCase())) {
|
|
42
|
+
result[name] = value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
CopilotRuntimeEnv.withoutTokens = withoutTokens;
|
|
48
|
+
})(CopilotRuntimeEnv || (exports.CopilotRuntimeEnv = CopilotRuntimeEnv = {}));
|
|
49
|
+
//# sourceMappingURL=copilot-runtime-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-runtime-env.js","sourceRoot":"","sources":["../../src/node/copilot-runtime-env.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF;;;GAGG;AACH,IAAiB,iBAAiB,CAyBjC;AAzBD,WAAiB,iBAAiB;IAE9B;;;OAGG;IACU,iCAAe,GAAG,CAAC,sBAAsB,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAEpF;;;;;;OAMG;IACH,SAAgB,aAAa,CAAC,GAAsB;QAChD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,kBAAA,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACzE,MAAM,MAAM,GAAuC,EAAE,CAAC;QACtD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;gBACnC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACzB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IATe,+BAAa,gBAS5B,CAAA;AACL,CAAC,EAzBgB,iBAAiB,iCAAjB,iBAAiB,QAyBjC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ILogger } from '@theia/core';
|
|
2
|
+
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
3
|
+
import type { CopilotClient, CopilotClientOptions } from './copilot-sdk-types';
|
|
4
|
+
import { CopilotCredentials, CopilotCredentialStore } from './copilot-credential-store';
|
|
5
|
+
import { CopilotCliLocator } from './copilot-cli-locator';
|
|
6
|
+
import { CopilotSdkApi, CopilotSdkLoader } from './copilot-sdk-loader';
|
|
7
|
+
/**
|
|
8
|
+
* Manages the lifecycle of a {@link CopilotClient}, which spawns and talks to the
|
|
9
|
+
* official Copilot CLI over JSON-RPC.
|
|
10
|
+
*
|
|
11
|
+
* The runtime is given the token this application holds, and nothing else: credentials the CLI could
|
|
12
|
+
* otherwise pick up on its own, from the environment or from the sign-in of the GitHub CLI, are not a
|
|
13
|
+
* sign-in of this application and are deliberately kept out of reach. The token is established by
|
|
14
|
+
* {@link CopilotCliAuthProvider} and kept in {@link CopilotCredentialStore}.
|
|
15
|
+
*
|
|
16
|
+
* A single client is started lazily and shared for the lifetime of the (connection-scoped) backend
|
|
17
|
+
* container. It is recreated when the host configuration changes.
|
|
18
|
+
*
|
|
19
|
+
* Note: this provider is bound in the per-connection container, so each frontend connection runs
|
|
20
|
+
* its own CLI process, authenticated with the credentials of the backend host. This is not suitable
|
|
21
|
+
* for multi-user backend deployments, where every connected frontend would share a single identity.
|
|
22
|
+
*/
|
|
23
|
+
export declare class CopilotSdkClientProvider {
|
|
24
|
+
protected readonly credentialStore: CopilotCredentialStore;
|
|
25
|
+
protected readonly cliLocator: CopilotCliLocator;
|
|
26
|
+
protected readonly sdkLoader: CopilotSdkLoader;
|
|
27
|
+
protected readonly envVariablesServer: EnvVariablesServer;
|
|
28
|
+
protected readonly logger: ILogger;
|
|
29
|
+
protected clientPromise: Promise<CopilotClient> | undefined;
|
|
30
|
+
protected clientConfigKey: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a started {@link CopilotClient}, creating (or recreating, if the
|
|
33
|
+
* configuration changed) one on demand.
|
|
34
|
+
*/
|
|
35
|
+
getClient(): Promise<CopilotClient>;
|
|
36
|
+
/**
|
|
37
|
+
* Lists the model IDs available to the authenticated user via the Copilot CLI.
|
|
38
|
+
* Because the CLI runs under an entitled identity, this returns the full current model lineup
|
|
39
|
+
* rather than the baseline set that the direct REST API exposes to an unentitled OAuth app.
|
|
40
|
+
*/
|
|
41
|
+
listModelIds(): Promise<string[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Replaces the bare authorization failure of the Copilot runtime with an explanation of the
|
|
44
|
+
* possible causes, because the runtime only reports that the feature is not authorized.
|
|
45
|
+
*/
|
|
46
|
+
protected enrichEntitlementError(error: unknown): unknown;
|
|
47
|
+
protected getConfigKey(credentials: CopilotCredentials): string;
|
|
48
|
+
protected recreate(configKey: string, credentials: CopilotCredentials, previous: Promise<CopilotClient> | undefined): Promise<CopilotClient>;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the options of the {@link CopilotClient}.
|
|
51
|
+
*
|
|
52
|
+
* The token of this application is passed explicitly and the resolution of a logged-in user is
|
|
53
|
+
* switched off, so that the runtime cannot fall back to credentials this application does not own.
|
|
54
|
+
*
|
|
55
|
+
* The CLI is passed explicitly as well, see {@link CopilotCliLocator}: the SDK would otherwise look
|
|
56
|
+
* for the JavaScript entry point of a platform package installed next to itself and spawn it with
|
|
57
|
+
* `process.execPath`, which is the Electron binary rather than Node.js in an Electron application.
|
|
58
|
+
*
|
|
59
|
+
* The runtime is configured in `empty` mode rather than in the `copilot-cli` mode the SDK defaults
|
|
60
|
+
* to. That mode brings the ambient behaviour of the CLI along, which the SDK documents as unsuitable
|
|
61
|
+
* for an application serving requests on a backend: instructions and skills found on the host,
|
|
62
|
+
* session and memory stores, host git operations and plugins. Theia drives the conversation itself
|
|
63
|
+
* and declares the tools of each request, so none of that applies, and `empty` mode additionally
|
|
64
|
+
* keeps the runtime away from the system keychain. Its two requirements are met here, a persistence
|
|
65
|
+
* location ({@link getCopilotHome}) and an explicit tool list per session.
|
|
66
|
+
*/
|
|
67
|
+
protected createClientOptions(sdk: CopilotSdkApi, credentials: CopilotCredentials, cliPath: string, baseDirectory: string): CopilotClientOptions;
|
|
68
|
+
/**
|
|
69
|
+
* The Copilot home the runtime is pointed at, below the configuration directory of Theia.
|
|
70
|
+
*
|
|
71
|
+
* Requests are served in sessions that the runtime persists in its home, and the default home is
|
|
72
|
+
* the one the user's own Copilot CLI uses. Prompts sent from Theia would end up listed among the
|
|
73
|
+
* conversations the user started themselves, so this application keeps its own.
|
|
74
|
+
*/
|
|
75
|
+
protected getCopilotHome(): Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the environment for the runtime process.
|
|
78
|
+
*
|
|
79
|
+
* Tokens from the environment are removed: the runtime accepts them even when a token is passed
|
|
80
|
+
* explicitly, and they are not a sign-in of this application. The GitHub host is taken from the
|
|
81
|
+
* credentials, so that the runtime always talks to the deployment that was signed in to.
|
|
82
|
+
*
|
|
83
|
+
* The Copilot API endpoint is deliberately not set: the runtime resolves the one belonging to the
|
|
84
|
+
* subscription from the token, including for Business and Enterprise seats. The environment of the
|
|
85
|
+
* backend is inherited as-is, so an operator can still override it with `COPILOT_API_URL` should
|
|
86
|
+
* that resolution ever fail for a deployment.
|
|
87
|
+
*/
|
|
88
|
+
protected createRuntimeEnv(credentials: CopilotCredentials): Record<string, string | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Stops and clears the current client. Safe to call when no client exists.
|
|
91
|
+
*/
|
|
92
|
+
reset(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Stops the CLI when the container this provider lives in goes away, which happens when the
|
|
95
|
+
* frontend connection it belongs to is closed.
|
|
96
|
+
*
|
|
97
|
+
* A closing connection unbinds its container, and unbinding runs `@preDestroy` rather than
|
|
98
|
+
* `dispose`. Without this hook the CLI of every closed connection would keep running for the rest
|
|
99
|
+
* of the lifetime of the backend.
|
|
100
|
+
*/
|
|
101
|
+
protected stop(): Promise<void>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=copilot-sdk-client-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-sdk-client-provider.d.ts","sourceRoot":"","sources":["../../src/node/copilot-sdk-client-provider.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,OAAO,EAAY,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qB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