@theia/ai-copilot 1.76.0-next.4 → 1.76.0-next.42
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 +87 -14
- package/lib/browser/copilot-auth-dialog.d.ts.map +1 -1
- package/lib/browser/copilot-auth-dialog.js +19 -11
- package/lib/browser/copilot-auth-dialog.js.map +1 -1
- package/lib/browser/copilot-frontend-application-contribution.d.ts +21 -1
- package/lib/browser/copilot-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/copilot-frontend-application-contribution.js +129 -26
- 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 +6 -22
- 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 +44 -20
- package/lib/node/copilot-language-models-manager-impl.d.ts.map +1 -1
- package/lib/node/copilot-language-models-manager-impl.js +112 -65
- 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 +162 -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 +315 -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 +54 -0
- package/lib/node/copilot-sdk-mappers.d.ts.map +1 -0
- package/lib/node/copilot-sdk-mappers.js +158 -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 +168 -0
- package/lib/node/copilot-sdk-mappers.spec.js.map +1 -0
- package/lib/node/copilot-sdk-types.d.ts +208 -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 +20 -16
- package/src/browser/copilot-frontend-application-contribution.ts +144 -31
- package/src/common/copilot-auth-service.ts +28 -24
- package/src/common/copilot-language-models-manager.ts +6 -29
- 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 +188 -0
- package/src/node/copilot-language-models-manager-impl.ts +131 -84
- 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 +377 -0
- package/src/node/copilot-sdk-language-model.ts +330 -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 +190 -0
- package/src/node/copilot-sdk-mappers.ts +172 -0
- package/src/node/copilot-sdk-types.ts +290 -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
package/README.md
CHANGED
|
@@ -13,37 +13,96 @@
|
|
|
13
13
|
## Description
|
|
14
14
|
|
|
15
15
|
The `@theia/ai-copilot` extension integrates GitHub Copilot language models with Theia AI.
|
|
16
|
-
This allows users to authenticate with their GitHub Copilot subscription and use Copilot models (e.g., GPT-
|
|
16
|
+
This allows users to authenticate with their GitHub Copilot subscription and use Copilot models (e.g., GPT-5, Claude Sonnet) through Theia's AI features.
|
|
17
|
+
|
|
18
|
+
> **Experimental:** This integration is under development and may be unstable. Its preferences are marked as experimental
|
|
19
|
+
> and are subject to change or removal.
|
|
20
|
+
|
|
21
|
+
Requests are served by the official GitHub Copilot CLI via [`@github/copilot-sdk`](https://www.npmjs.com/package/@github/copilot-sdk).
|
|
22
|
+
The CLI is launched as a background process on the machine hosting the Theia backend and is spoken to over JSON-RPC.
|
|
23
|
+
|
|
24
|
+
> **Note:** This extension requires an active GitHub Copilot subscription and the GitHub Copilot CLI.
|
|
25
|
+
|
|
26
|
+
### Installing the Copilot CLI
|
|
27
|
+
|
|
28
|
+
The CLI is not shipped with the application and has to be available on the machine hosting the backend:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install -g @github/copilot
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
It is looked up in the installation of the application, on the `PATH` of the backend process and in the global `npm` directory.
|
|
35
|
+
When it is installed somewhere else, point at its executable with the `ai-features.copilot.executablePath` preference:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"ai-features.copilot.executablePath": "/opt/copilot/copilot"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The `COPILOT_CLI_PATH` environment variable of the backend process does the same, for a deployment that configures this
|
|
44
|
+
centrally rather than per user.
|
|
45
|
+
|
|
46
|
+
The CLI is not bundled because it is a large platform-specific binary under a proprietary license, and because a packaged
|
|
47
|
+
application cannot execute a binary from inside its own archive. An application that wants to ship it has to install it
|
|
48
|
+
next to itself and make sure it stays extracted.
|
|
49
|
+
|
|
50
|
+
Only the CLI has to be installed. It ships the Copilot SDK next to its executable, and that is the copy this integration
|
|
51
|
+
loads, so `@github/copilot-sdk` does not have to be installed separately. Should a CLI distribution ever ship without that
|
|
52
|
+
copy, an installed `@github/copilot-sdk` is used as a fallback:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm install -g @github/copilot-sdk
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Why the Copilot CLI
|
|
59
|
+
|
|
60
|
+
Access to the Copilot models is granted per OAuth application, not per user or per subscription.
|
|
61
|
+
An application that GitHub has not entitled only sees a small legacy subset of the models, regardless of the subscription or of the request headers it sends.
|
|
62
|
+
The Copilot CLI is an entitled first-party application, so routing through it makes the current model lineup available without Theia having to obtain an entitlement of its own.
|
|
17
63
|
|
|
18
64
|
### Authentication
|
|
19
65
|
|
|
20
|
-
The
|
|
66
|
+
The sign-in is a device code flow performed by the Copilot CLI, driven from within the application:
|
|
21
67
|
|
|
22
68
|
1. Click the "Copilot" status bar item or run the **Copilot: Sign In** command
|
|
23
|
-
2. A dialog appears with a device code
|
|
24
|
-
3. Enter the code and authorize
|
|
25
|
-
4. The dialog
|
|
69
|
+
2. A dialog appears with a device code, click the link to open GitHub's device authorization page
|
|
70
|
+
3. Enter the code and authorize
|
|
71
|
+
4. The dialog reports success and the status bar reflects the signed-in state
|
|
26
72
|
|
|
27
73
|
Once authenticated, Copilot models become available in the AI Configuration for use with any Theia AI agent.
|
|
28
74
|
|
|
29
|
-
|
|
75
|
+
The credentials are owned by the application, not by the CLI: the sign-in runs against a private, temporary Copilot home so that
|
|
76
|
+
the token is not written into the credential store of the machine, and it is then kept in the credential store of Theia.
|
|
77
|
+
The CLI is given that token for its requests and nothing else, so a token in the environment or an existing sign-in of the
|
|
78
|
+
GitHub CLI is never used, and **Copilot: Sign Out** removes the credentials of this application without touching either.
|
|
30
79
|
|
|
31
80
|
### Configuration
|
|
32
81
|
|
|
33
|
-
Available models can be configured via the `ai-features.copilot.
|
|
82
|
+
Available models can be configured via the `ai-features.copilot.modelOverrides` preference.
|
|
83
|
+
When it is empty, the models are discovered from your Copilot subscription:
|
|
34
84
|
|
|
35
85
|
```json
|
|
36
86
|
{
|
|
37
|
-
"ai-features.copilot.
|
|
38
|
-
"gpt-
|
|
39
|
-
"claude-sonnet-
|
|
87
|
+
"ai-features.copilot.modelOverrides": [
|
|
88
|
+
"gpt-5.5",
|
|
89
|
+
"claude-sonnet-5"
|
|
40
90
|
]
|
|
41
91
|
}
|
|
42
92
|
```
|
|
43
93
|
|
|
44
|
-
###
|
|
94
|
+
### Copilot Business and Enterprise
|
|
95
|
+
|
|
96
|
+
Copilot Business and Enterprise seats are served by their own API host, but nothing has to be configured for them:
|
|
97
|
+
the endpoint belonging to the subscription is resolved from the credentials of the sign-in.
|
|
98
|
+
|
|
99
|
+
Should that resolution ever fail for a deployment, the host can be forced with the `COPILOT_API_URL` environment variable
|
|
100
|
+
of the process running the backend, for example `https://api.business.githubcopilot.com`. This is a last resort rather than
|
|
101
|
+
part of the normal setup: a value that does not match the subscription makes every request fail, and GitHub reports that
|
|
102
|
+
the same way as a missing entitlement, which is hard to tell apart.
|
|
45
103
|
|
|
46
|
-
For GitHub Enterprise
|
|
104
|
+
For GitHub Enterprise deployments, configure the domain via the `ai-features.copilot.enterpriseUrl` preference.
|
|
105
|
+
It is used for the sign-in, and remembered with the credentials so that requests go to the same deployment:
|
|
47
106
|
|
|
48
107
|
```json
|
|
49
108
|
{
|
|
@@ -53,8 +112,22 @@ For GitHub Enterprise users, configure the enterprise URL via the `ai-features.c
|
|
|
53
112
|
|
|
54
113
|
### Commands
|
|
55
114
|
|
|
56
|
-
- **Copilot: Sign In** -
|
|
57
|
-
- **Copilot: Sign Out** -
|
|
115
|
+
- **Copilot: Sign In** - Signs in via the device code flow
|
|
116
|
+
- **Copilot: Sign Out** - Removes the stored credentials
|
|
117
|
+
|
|
118
|
+
### Known limitations
|
|
119
|
+
|
|
120
|
+
- The Copilot CLI has to be installed on the machine hosting the backend, see above.
|
|
121
|
+
- The Copilot CLI runs as a process on the machine hosting the backend, one per frontend connection.
|
|
122
|
+
This is not suitable for multi-user backend deployments, where every connected frontend would share a single identity.
|
|
123
|
+
- Structured output is not available on this path.
|
|
124
|
+
- The request mapping is lossy, because the CLI is an agent that takes a single prompt per turn rather than a message history:
|
|
125
|
+
- The conversation is flattened into one prompt. A single user turn is forwarded as it is, a longer history is rendered as a
|
|
126
|
+
role-labelled transcript. The system prompt of the Theia agent is not part of that, it becomes the system message of the
|
|
127
|
+
session and takes the place of the agent instructions the CLI would use.
|
|
128
|
+
- Images in a request are sent as inline attachments when they are base64-encoded; images given as a URL are dropped
|
|
129
|
+
and only noted as omitted, because the SDK's attachments carry inline data rather than a remote reference.
|
|
130
|
+
- Tool calls and tool results of the history are rendered as text rather than as the structured entries they were.
|
|
58
131
|
|
|
59
132
|
## Additional Information
|
|
60
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-auth-dialog.d.ts","sourceRoot":"","sources":["../../src/browser/copilot-auth-dialog.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"copilot-auth-dialog.d.ts","sourceRoot":"","sources":["../../src/browser/copilot-auth-dialog.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,MAAM,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MtB,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAarB,IAAI,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAU1C,MAAM,IAAI,IAAI;cAKP,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAkBpB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BhD,IAAI,KAAK,IAAI,OAAO,CAEnB;cAEkB,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,GAAG,WAAW;IAU5E,SAAS,CAAC,cAAc,QAAa,OAAO,CAAC,IAAI,CAAC,CAUhD;IAEF,SAAS,CAAC,aAAa,QAAO,IAAI,CAIhC;IAEF,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAQnC,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IAiB1C,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IAW1C,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IA6D1C,SAAS,CAAC,aAAa,GAAI,GAAG,KAAK,CAAC,UAAU,KAAG,IAAI,CAGnD;IAEF,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IAW1C,SAAS,CAAC,aAAa,IAAI,KAAK,CAAC,SAAS;IAgB1C,SAAS,CAAC,kBAAkB,GAAI,GAAG,KAAK,CAAC,UAAU,KAAG,IAAI,CAGxD;IAEF,SAAS,CAAC,WAAW,QAAO,IAAI,CAE9B;IAEF,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS;CAc3C"}
|
|
@@ -56,26 +56,28 @@ let CopilotAuthDialog = class CopilotAuthDialog extends react_dialog_1.ReactDial
|
|
|
56
56
|
init() {
|
|
57
57
|
this.titleNode.textContent = this.props.title;
|
|
58
58
|
this.appendAcceptButton(core_1.nls.localize('theia/ai/copilot/auth/authorize', 'I have authorized'));
|
|
59
|
-
this.appendCloseButton(
|
|
59
|
+
this.appendCloseButton(dialogs_1.Dialog.CANCEL);
|
|
60
60
|
}
|
|
61
61
|
updateButtonStates() {
|
|
62
62
|
const isPolling = this.state === 'polling';
|
|
63
63
|
const isSuccess = this.state === 'success';
|
|
64
|
+
// Singleton dialog: button state survives close, so reset it on every render.
|
|
64
65
|
if (this.acceptButton) {
|
|
65
66
|
this.acceptButton.disabled = isPolling || isSuccess;
|
|
66
|
-
|
|
67
|
-
this.acceptButton.style.display = 'none';
|
|
68
|
-
}
|
|
67
|
+
this.acceptButton.style.display = isSuccess ? 'none' : '';
|
|
69
68
|
}
|
|
70
69
|
if (this.closeButton) {
|
|
71
|
-
|
|
72
|
-
this.closeButton.textContent = core_1.nls.localizeByDefault('Close');
|
|
73
|
-
}
|
|
70
|
+
this.closeButton.textContent = isSuccess ? core_1.nls.localizeByDefault('Close') : dialogs_1.Dialog.CANCEL;
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
async open() {
|
|
77
74
|
this.initiateFlow();
|
|
78
|
-
|
|
75
|
+
const result = await super.open();
|
|
76
|
+
if (this.state !== 'success') {
|
|
77
|
+
// Leave no Copilot CLI process behind when the dialog is dismissed or retried.
|
|
78
|
+
await this.authService.cancelSignIn();
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
79
81
|
}
|
|
80
82
|
update() {
|
|
81
83
|
super.update();
|
|
@@ -84,8 +86,11 @@ let CopilotAuthDialog = class CopilotAuthDialog extends react_dialog_1.ReactDial
|
|
|
84
86
|
async initiateFlow() {
|
|
85
87
|
try {
|
|
86
88
|
this.state = 'loading';
|
|
89
|
+
this.deviceCodeResponse = undefined;
|
|
90
|
+
this.errorMessage = undefined;
|
|
91
|
+
this.copied = false;
|
|
87
92
|
this.update();
|
|
88
|
-
this.deviceCodeResponse = await this.authService.
|
|
93
|
+
this.deviceCodeResponse = await this.authService.startSignIn(this.props.enterpriseUrl);
|
|
89
94
|
this.state = 'waiting';
|
|
90
95
|
this.update();
|
|
91
96
|
}
|
|
@@ -102,7 +107,7 @@ let CopilotAuthDialog = class CopilotAuthDialog extends react_dialog_1.ReactDial
|
|
|
102
107
|
this.state = 'polling';
|
|
103
108
|
this.update();
|
|
104
109
|
try {
|
|
105
|
-
const success = await this.authService.
|
|
110
|
+
const success = await this.authService.waitForSignIn();
|
|
106
111
|
if (success) {
|
|
107
112
|
this.state = 'success';
|
|
108
113
|
this.update();
|
|
@@ -124,7 +129,10 @@ let CopilotAuthDialog = class CopilotAuthDialog extends react_dialog_1.ReactDial
|
|
|
124
129
|
}
|
|
125
130
|
isValid(_value, _mode) {
|
|
126
131
|
if (this.state === 'error') {
|
|
127
|
-
|
|
132
|
+
// The error is shown in the dialog body by renderError, where it can wrap. Returning only a
|
|
133
|
+
// failed result keeps the accept button disabled without repeating the (often long) message
|
|
134
|
+
// next to it, where it does not fit.
|
|
135
|
+
return { result: false, message: '' };
|
|
128
136
|
}
|
|
129
137
|
return '';
|
|
130
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-auth-dialog.js","sourceRoot":"","sources":["../../src/browser/copilot-auth-dialog.tsx"],"names":[],"mappings":";;;;;AAiBA,4DAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"copilot-auth-dialog.js","sourceRoot":"","sources":["../../src/browser/copilot-auth-dialog.tsx"],"names":[],"mappings":";;;;;AAiBA,4DAAiF;AACjF,6DAAmF;AACnF,+EAA2E;AAC3E,iFAA6E;AAC7E,kFAA8E;AAC9E,sCAAkD;AAClD,yEAAwF;AACxF,iFAA2E;AAE3E,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AAKpD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,qBAAW;CAEtD,CAAA;AAFY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAElC;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,0BAAoB;aAsBvC,OAAE,GAAG,qBAAqB,AAAxB,CAAyB;IAE3C,YACoC,KAAyD;Q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AC,QAAQ,CAAC,uCAAuC,EAAE,kBAAkB,CAAC,GAC1E,SACJ,IACF,CACT,CAAC;IACN,CAAC;IAWS,WAAW;QACjB,OAAO,CACH,iCAAK,SAAS,EAAC,mDAAmD,aAC9D,iCAAM,SAAS,EAAC,uBAAuB,GAAQ,EAC/C,wCAAI,IAAI,CAAC,YAAY,GAAK,EAC1B,mCACI,SAAS,EAAC,cAAc,EACxB,OAAO,EAAE,IAAI,CAAC,WAAW,YAExB,UAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAC9B,IACP,CACT,CAAC;IACN,CAAC;;AArSQ,8CAAiB;AAGP;IADlB,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;sDACwB;AAGhC;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;2DAC6B;AAGnC;IADlB,IAAA,kBAAM,EAAC,8BAAa,CAAC;;wDAC0B;AAG7B;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;;yDAC2B;AAG/B;IADlB,IAAA,kBAAM,EAAC,wDAAyB,CAAC;;mDACqB;AAgB7C;IADT,IAAA,yBAAa,GAAE;;;;6CAKf;4BAnCQ,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;IA0BJ,mBAAA,IAAA,kBAAM,EAAC,sBAAsB,CAAC,CAAA;6CAAoC,sBAAsB;GAzBpF,iBAAiB,CAsS7B"}
|
|
@@ -3,6 +3,7 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
|
3
3
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
4
4
|
import { CopilotAuthService, CopilotLanguageModelsManager, CopilotModelDescription } from '../common';
|
|
5
5
|
import { AICorePreferences } from '@theia/ai-core/lib/common/ai-core-preferences';
|
|
6
|
+
import { ModelDiscoveryStatusService } from '@theia/ai-core/lib/browser';
|
|
6
7
|
export declare class CopilotFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
7
8
|
protected readonly preferenceService: PreferenceService;
|
|
8
9
|
protected readonly manager: CopilotLanguageModelsManager;
|
|
@@ -10,16 +11,35 @@ export declare class CopilotFrontendApplicationContribution implements FrontendA
|
|
|
10
11
|
protected readonly authService: CopilotAuthService;
|
|
11
12
|
protected readonly messageService: MessageService;
|
|
12
13
|
protected readonly commandService: CommandService;
|
|
14
|
+
protected readonly discoveryStatus: ModelDiscoveryStatusService;
|
|
13
15
|
protected prevModels: string[];
|
|
14
16
|
protected useAutoDiscovery: boolean;
|
|
15
17
|
onStart(): void;
|
|
16
18
|
protected isCopilotEnabled(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Hands the configured location of the Copilot CLI to the backend, which searches for it when
|
|
21
|
+
* none is configured.
|
|
22
|
+
*/
|
|
23
|
+
protected updateExecutablePath(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Tells the user why they are signed out after an update, since the sign-in of the previous
|
|
26
|
+
* version cannot be carried over: it belonged to an OAuth application that is no longer used.
|
|
27
|
+
*/
|
|
28
|
+
protected notifySignInRequired(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Tells the user that a changed GitHub Copilot domain only takes effect on the next sign-in, since
|
|
31
|
+
* the domain is read when signing in and not while a session is already established.
|
|
32
|
+
*/
|
|
33
|
+
protected notifyEnterpriseUrlChanged(): Promise<void>;
|
|
34
|
+
/** The state of a provider whose credential is a sign-in that has not happened, with the way to fix it. */
|
|
35
|
+
protected setSignInRequiredStatus(): void;
|
|
17
36
|
protected initializeModels(): Promise<void>;
|
|
18
37
|
protected discoverAndRegisterModels(): Promise<void>;
|
|
38
|
+
protected discovering: Promise<void>;
|
|
39
|
+
protected runDiscovery(): Promise<void>;
|
|
19
40
|
protected removeAllCopilotModels(): void;
|
|
20
41
|
protected handleModelChanges(newModels: string[]): void;
|
|
21
42
|
protected updateAllModels(): void;
|
|
22
|
-
protected notifyTokenMigration(): Promise<void>;
|
|
23
43
|
protected createCopilotModelDescription(modelId: string): CopilotModelDescription;
|
|
24
44
|
}
|
|
25
45
|
//# sourceMappingURL=copilot-frontend-application-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/copilot-frontend-application-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAO,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,uBAAuB,EAAuB,MAAM,WAAW,CAAC;AAE3H,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"copilot-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/copilot-frontend-application-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAO,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,uBAAuB,EAAuB,MAAM,WAAW,CAAC;AAE3H,OAAO,EAAE,iBAAiB,EAA+B,MAAM,+CAA+C,CAAC;AAE/G,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAIzE,qBACa,sCAAuC,YAAW,+BAA+B;IAG1F,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;IAGzD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IAGnD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;IAEhE,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAM;IACpC,SAAS,CAAC,gBAAgB,UAAS;IAEnC,OAAO,IAAI,IAAI;IAqEf,SAAS,CAAC,gBAAgB,IAAI,OAAO;IAIrC;;;OAGG;cACa,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKrD;;;OAGG;cACa,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAarD;;;OAGG;cACa,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB3D,2GAA2G;IAC3G,SAAS,CAAC,uBAAuB,IAAI,IAAI;cAYzB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;cAiCjC,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1D,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,CAAqB;cAEzC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC7C,SAAS,CAAC,sBAAsB,IAAI,IAAI;IASxC,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAYvD,SAAS,CAAC,eAAe,IAAI,IAAI;IASjC,SAAS,CAAC,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB;CAUpF"}
|
|
@@ -24,31 +24,54 @@ const common_1 = require("../common");
|
|
|
24
24
|
const copilot_preferences_1 = require("../common/copilot-preferences");
|
|
25
25
|
const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
|
|
26
26
|
const copilot_command_contribution_1 = require("./copilot-command-contribution");
|
|
27
|
+
const browser_1 = require("@theia/ai-core/lib/browser");
|
|
28
|
+
const COPILOT_PROVIDER_LABEL = 'GitHub Copilot';
|
|
27
29
|
let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationContribution {
|
|
28
30
|
constructor() {
|
|
29
31
|
this.prevModels = [];
|
|
30
32
|
this.useAutoDiscovery = false;
|
|
33
|
+
this.discovering = Promise.resolve();
|
|
31
34
|
}
|
|
32
35
|
onStart() {
|
|
33
36
|
this.preferenceService.ready.then(async () => {
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
this.discoveryStatus.registerProvider({
|
|
38
|
+
providerId: common_1.COPILOT_PROVIDER_ID,
|
|
39
|
+
label: COPILOT_PROVIDER_LABEL,
|
|
40
|
+
refresh: () => this.initializeModels()
|
|
41
|
+
});
|
|
42
|
+
// Before anything reaches for the CLI: the backend cannot read the preferences itself.
|
|
43
|
+
await this.updateExecutablePath();
|
|
36
44
|
if (this.isCopilotEnabled()) {
|
|
37
45
|
const authState = await this.authService.getAuthState();
|
|
38
46
|
if (authState.migrationRequired) {
|
|
39
|
-
this.
|
|
47
|
+
this.notifySignInRequired();
|
|
40
48
|
}
|
|
41
|
-
await this.initializeModels();
|
|
42
49
|
}
|
|
50
|
+
// Also when disabled: that is a state of its own on the provider's page, not the absence of one.
|
|
51
|
+
await this.initializeModels();
|
|
43
52
|
this.preferenceService.onPreferenceChanged(event => {
|
|
44
|
-
if (event.preferenceName === copilot_preferences_1.
|
|
53
|
+
if (event.preferenceName === copilot_preferences_1.COPILOT_EXECUTABLE_PATH_PREF) {
|
|
54
|
+
this.updateExecutablePath().then(() => {
|
|
55
|
+
if (this.isCopilotEnabled() && this.useAutoDiscovery) {
|
|
56
|
+
// A CLI that could not be found before may be reachable now.
|
|
57
|
+
this.discoverAndRegisterModels();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else if (event.preferenceName === copilot_preferences_1.COPILOT_ENABLED_PREF) {
|
|
45
62
|
if (this.isCopilotEnabled()) {
|
|
46
63
|
this.initializeModels();
|
|
47
64
|
}
|
|
48
65
|
else {
|
|
49
66
|
this.removeAllCopilotModels();
|
|
67
|
+
this.initializeModels();
|
|
50
68
|
}
|
|
51
69
|
}
|
|
70
|
+
else if (event.preferenceName === copilot_preferences_1.COPILOT_ENTERPRISE_URL_PREF) {
|
|
71
|
+
// The domain is only read at sign-in time, so a change while signed in has no effect
|
|
72
|
+
// until the next sign-in. Let the user know instead of silently ignoring it.
|
|
73
|
+
this.notifyEnterpriseUrlChanged();
|
|
74
|
+
}
|
|
52
75
|
else if (event.preferenceName === copilot_preferences_1.COPILOT_MODEL_OVERRIDES_PREF && this.isCopilotEnabled()) {
|
|
53
76
|
const newModels = this.preferenceService.get(copilot_preferences_1.COPILOT_MODEL_OVERRIDES_PREF, []);
|
|
54
77
|
if (newModels.length > 0) {
|
|
@@ -61,17 +84,6 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
61
84
|
this.discoverAndRegisterModels();
|
|
62
85
|
}
|
|
63
86
|
}
|
|
64
|
-
else if (event.preferenceName === copilot_preferences_1.COPILOT_ENTERPRISE_URL_PREF && this.isCopilotEnabled()) {
|
|
65
|
-
const url = this.preferenceService.get(copilot_preferences_1.COPILOT_ENTERPRISE_URL_PREF);
|
|
66
|
-
this.manager.setEnterpriseUrl(url || undefined);
|
|
67
|
-
if (this.useAutoDiscovery) {
|
|
68
|
-
this.removeAllCopilotModels();
|
|
69
|
-
this.discoverAndRegisterModels();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.manager.refreshModelsStatus();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
87
|
});
|
|
76
88
|
this.authService.onAuthStateChanged(async (state) => {
|
|
77
89
|
if (this.isCopilotEnabled() && this.useAutoDiscovery) {
|
|
@@ -80,6 +92,7 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
80
92
|
}
|
|
81
93
|
else {
|
|
82
94
|
this.removeAllCopilotModels();
|
|
95
|
+
this.setSignInRequiredStatus();
|
|
83
96
|
}
|
|
84
97
|
}
|
|
85
98
|
});
|
|
@@ -93,9 +106,73 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
93
106
|
isCopilotEnabled() {
|
|
94
107
|
return this.preferenceService.get(copilot_preferences_1.COPILOT_ENABLED_PREF, true);
|
|
95
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Hands the configured location of the Copilot CLI to the backend, which searches for it when
|
|
111
|
+
* none is configured.
|
|
112
|
+
*/
|
|
113
|
+
async updateExecutablePath() {
|
|
114
|
+
const executablePath = this.preferenceService.get(copilot_preferences_1.COPILOT_EXECUTABLE_PATH_PREF, '').trim();
|
|
115
|
+
await this.authService.setExecutablePath(executablePath || undefined);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Tells the user why they are signed out after an update, since the sign-in of the previous
|
|
119
|
+
* version cannot be carried over: it belonged to an OAuth application that is no longer used.
|
|
120
|
+
*/
|
|
121
|
+
async notifySignInRequired() {
|
|
122
|
+
const signIn = core_1.nls.localize('theia/ai/copilot/commands/signIn', 'Sign in to GitHub Copilot');
|
|
123
|
+
const action = await this.messageService.info(core_1.nls.localize('theia/ai/copilot/signInAgain', 'GitHub Copilot now signs in through the GitHub Copilot CLI. Your previous sign-in could not be carried over and has been '
|
|
124
|
+
+ 'removed, please sign in again to use Copilot models.'), signIn);
|
|
125
|
+
if (action === signIn) {
|
|
126
|
+
this.commandService.executeCommand(copilot_command_contribution_1.CopilotCommands.SIGN_IN.id);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Tells the user that a changed GitHub Copilot domain only takes effect on the next sign-in, since
|
|
131
|
+
* the domain is read when signing in and not while a session is already established.
|
|
132
|
+
*/
|
|
133
|
+
async notifyEnterpriseUrlChanged() {
|
|
134
|
+
const authState = await this.authService.getAuthState();
|
|
135
|
+
if (!authState.isAuthenticated) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const signIn = core_1.nls.localize('theia/ai/copilot/commands/signIn', 'Sign in to GitHub Copilot');
|
|
139
|
+
const action = await this.messageService.info(core_1.nls.localize('theia/ai/copilot/enterpriseUrlChanged', 'The GitHub Copilot domain changed. Sign in again for it to take effect.'), signIn);
|
|
140
|
+
if (action === signIn) {
|
|
141
|
+
this.commandService.executeCommand(copilot_command_contribution_1.CopilotCommands.SIGN_IN.id);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** The state of a provider whose credential is a sign-in that has not happened, with the way to fix it. */
|
|
145
|
+
setSignInRequiredStatus() {
|
|
146
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, {
|
|
147
|
+
state: 'no-credentials',
|
|
148
|
+
// What Copilot lacks is a sign-in, not an API key, so it says so rather than letting the
|
|
149
|
+
// state speak for it.
|
|
150
|
+
stateLabel: core_1.nls.localizeByDefault('Not signed in'),
|
|
151
|
+
message: core_1.nls.localize('theia/ai/copilot/discovery/signedOut', 'Not signed in to GitHub Copilot. Sign in to discover the models it offers.'),
|
|
152
|
+
action: { label: copilot_command_contribution_1.CopilotCommands.SIGN_IN.label, commandId: copilot_command_contribution_1.CopilotCommands.SIGN_IN.id }
|
|
153
|
+
});
|
|
154
|
+
}
|
|
96
155
|
async initializeModels() {
|
|
156
|
+
if (!this.isCopilotEnabled()) {
|
|
157
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, {
|
|
158
|
+
state: 'no-credentials',
|
|
159
|
+
stateLabel: core_1.nls.localizeByDefault('Disabled'),
|
|
160
|
+
message: core_1.nls.localize('theia/ai/copilot/discovery/disabled', 'The GitHub Copilot provider is disabled. Enable it to discover models.'),
|
|
161
|
+
action: undefined
|
|
162
|
+
});
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
97
165
|
const configuredModels = this.preferenceService.get(copilot_preferences_1.COPILOT_MODEL_OVERRIDES_PREF, []);
|
|
98
166
|
if (configuredModels.length > 0) {
|
|
167
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, {
|
|
168
|
+
state: 'overridden',
|
|
169
|
+
stateLabel: undefined,
|
|
170
|
+
discovered: configuredModels.map(id => ({ id })),
|
|
171
|
+
message: core_1.nls.localize('theia/ai/copilot/discovery/overridden', 'The model list is configured manually. Clear the model overrides to discover the models from GitHub Copilot again.'),
|
|
172
|
+
lastFetch: undefined,
|
|
173
|
+
fromCache: false,
|
|
174
|
+
action: undefined
|
|
175
|
+
});
|
|
99
176
|
this.useAutoDiscovery = false;
|
|
100
177
|
this.manager.createOrUpdateLanguageModels(...configuredModels.map((modelId) => this.createCopilotModelDescription(modelId)));
|
|
101
178
|
this.prevModels = [...configuredModels];
|
|
@@ -106,7 +183,29 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
106
183
|
}
|
|
107
184
|
}
|
|
108
185
|
async discoverAndRegisterModels() {
|
|
109
|
-
|
|
186
|
+
// Runs are queued rather than overlapped: startup, a key change and a manual refresh can all
|
|
187
|
+
// ask within a moment of each other, and two runs in flight would compute what to unregister
|
|
188
|
+
// from the same stale list and leave the registry disagreeing with the provider.
|
|
189
|
+
this.discovering = this.discovering.then(() => this.runDiscovery().catch(error => this.discoveryStatus.reportError(common_1.COPILOT_PROVIDER_ID, error)));
|
|
190
|
+
return this.discovering;
|
|
191
|
+
}
|
|
192
|
+
async runDiscovery() {
|
|
193
|
+
// Signing in is Copilot's equivalent of setting an API key, so a missing sign-in reads like a
|
|
194
|
+
// missing credential rather than like a failure: the CLI would answer the list call with an
|
|
195
|
+
// authorization error, which says the same thing in a way nobody can act on.
|
|
196
|
+
if (!(await this.authService.getAuthState()).isAuthenticated) {
|
|
197
|
+
this.setSignInRequiredStatus();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, { state: 'fetching', stateLabel: undefined, message: undefined, action: undefined });
|
|
201
|
+
const { models, error } = await this.manager.fetchAvailableModels();
|
|
202
|
+
if (error) {
|
|
203
|
+
// The models of an earlier discovery stay registered; the manager already marks them
|
|
204
|
+
// unavailable, so they are visible as such rather than silently gone.
|
|
205
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, { state: 'error', stateLabel: undefined, message: error, action: undefined });
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const modelIds = models.map(model => model.id);
|
|
110
209
|
if (modelIds.length > 0) {
|
|
111
210
|
const modelsToRemove = this.prevModels.filter(m => !modelIds.includes(m));
|
|
112
211
|
if (modelsToRemove.length > 0) {
|
|
@@ -115,6 +214,15 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
115
214
|
this.manager.createOrUpdateLanguageModels(...modelIds.map((modelId) => this.createCopilotModelDescription(modelId)));
|
|
116
215
|
this.prevModels = [...modelIds];
|
|
117
216
|
}
|
|
217
|
+
this.discoveryStatus.updateStatus(common_1.COPILOT_PROVIDER_ID, {
|
|
218
|
+
state: 'ready',
|
|
219
|
+
stateLabel: undefined,
|
|
220
|
+
discovered: models,
|
|
221
|
+
message: undefined,
|
|
222
|
+
lastFetch: Date.now(),
|
|
223
|
+
fromCache: false,
|
|
224
|
+
action: undefined
|
|
225
|
+
});
|
|
118
226
|
}
|
|
119
227
|
removeAllCopilotModels() {
|
|
120
228
|
if (this.prevModels.length > 0) {
|
|
@@ -139,21 +247,12 @@ let CopilotFrontendApplicationContribution = class CopilotFrontendApplicationCon
|
|
|
139
247
|
const models = this.preferenceService.get(copilot_preferences_1.COPILOT_MODEL_OVERRIDES_PREF, []);
|
|
140
248
|
this.manager.createOrUpdateLanguageModels(...models.map((modelId) => this.createCopilotModelDescription(modelId)));
|
|
141
249
|
}
|
|
142
|
-
async notifyTokenMigration() {
|
|
143
|
-
const signIn = core_1.nls.localize('theia/ai/copilot/commands/signIn', 'Sign in to GitHub Copilot');
|
|
144
|
-
const action = await this.messageService.info(core_1.nls.localize('theia/ai/copilot/tokenMigration', 'Your GitHub Copilot session used an outdated authentication method and has been cleared. Please sign in again to access all available models.'), signIn);
|
|
145
|
-
if (action === signIn) {
|
|
146
|
-
this.commandService.executeCommand(copilot_command_contribution_1.CopilotCommands.SIGN_IN.id);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
250
|
createCopilotModelDescription(modelId) {
|
|
150
251
|
const id = `${common_1.COPILOT_PROVIDER_ID}/${modelId}`;
|
|
151
252
|
const maxRetries = this.aiCorePreferences.get(ai_core_preferences_1.PREFERENCE_NAME_MAX_RETRIES) ?? 3;
|
|
152
253
|
return {
|
|
153
254
|
id,
|
|
154
255
|
model: modelId,
|
|
155
|
-
enableStreaming: true,
|
|
156
|
-
supportsStructuredOutput: true,
|
|
157
256
|
maxRetries
|
|
158
257
|
};
|
|
159
258
|
}
|
|
@@ -183,6 +282,10 @@ tslib_1.__decorate([
|
|
|
183
282
|
(0, inversify_1.inject)(core_1.CommandService),
|
|
184
283
|
tslib_1.__metadata("design:type", Object)
|
|
185
284
|
], CopilotFrontendApplicationContribution.prototype, "commandService", void 0);
|
|
285
|
+
tslib_1.__decorate([
|
|
286
|
+
(0, inversify_1.inject)(browser_1.ModelDiscoveryStatusService),
|
|
287
|
+
tslib_1.__metadata("design:type", browser_1.ModelDiscoveryStatusService)
|
|
288
|
+
], CopilotFrontendApplicationContribution.prototype, "discoveryStatus", void 0);
|
|
186
289
|
exports.CopilotFrontendApplicationContribution = CopilotFrontendApplicationContribution = tslib_1.__decorate([
|
|
187
290
|
(0, inversify_1.injectable)()
|
|
188
291
|
], CopilotFrontendApplicationContribution);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/copilot-frontend-application-contribution.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,4DAAkE;AAClE,sCAAqE;AAErE,4EAAwE;AACxE,sCAA2H;AAC3H,
|
|
1
|
+
{"version":3,"file":"copilot-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/copilot-frontend-application-contribution.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,4DAAkE;AAClE,sCAAqE;AAErE,4EAAwE;AACxE,sCAA2H;AAC3H,uEAA8J;AAC9J,uFAA+G;AAC/G,iFAAiE;AACjE,wDAAyE;AAEzE,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAGzC,IAAM,sCAAsC,GAA5C,MAAM,sCAAsC;IAA5C;QAuBO,eAAU,GAAa,EAAE,CAAC;QAC1B,qBAAgB,GAAG,KAAK,CAAC;QA+KzB,gBAAW,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAkF7D,CAAC;IA/PG,OAAO;QACH,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YACzC,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC;gBAClC,UAAU,EAAE,4BAAmB;gBAC/B,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;aACzC,CAAC,CAAC;YACH,uFAAuF;YACvF,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAClC,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;gBAC1B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;gB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