@theia/ai-copilot 1.77.0-next.99 → 1.77.0

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.
Files changed (124) hide show
  1. package/lib/browser/copilot-auth-dialog-messages.js +7 -10
  2. package/lib/browser/copilot-auth-dialog-messages.js.map +1 -1
  3. package/lib/browser/copilot-auth-dialog.d.ts +2 -2
  4. package/lib/browser/copilot-auth-dialog.d.ts.map +1 -1
  5. package/lib/browser/copilot-auth-dialog.js +43 -55
  6. package/lib/browser/copilot-auth-dialog.js.map +1 -1
  7. package/lib/browser/copilot-command-contribution.d.ts +2 -2
  8. package/lib/browser/copilot-command-contribution.d.ts.map +1 -1
  9. package/lib/browser/copilot-command-contribution.js +35 -46
  10. package/lib/browser/copilot-command-contribution.js.map +1 -1
  11. package/lib/browser/copilot-frontend-application-contribution.d.ts +1 -1
  12. package/lib/browser/copilot-frontend-application-contribution.d.ts.map +1 -1
  13. package/lib/browser/copilot-frontend-application-contribution.js +61 -71
  14. package/lib/browser/copilot-frontend-application-contribution.js.map +1 -1
  15. package/lib/browser/copilot-frontend-module.js +31 -33
  16. package/lib/browser/copilot-frontend-module.js.map +1 -1
  17. package/lib/browser/copilot-status-bar-contribution.d.ts +1 -1
  18. package/lib/browser/copilot-status-bar-contribution.d.ts.map +1 -1
  19. package/lib/browser/copilot-status-bar-contribution.js +30 -40
  20. package/lib/browser/copilot-status-bar-contribution.js.map +1 -1
  21. package/lib/browser/index.d.ts +5 -5
  22. package/lib/browser/index.d.ts.map +1 -1
  23. package/lib/browser/index.js +5 -8
  24. package/lib/browser/index.js.map +1 -1
  25. package/lib/common/copilot-auth-service.js +3 -6
  26. package/lib/common/copilot-auth-service.js.map +1 -1
  27. package/lib/common/copilot-language-models-manager.js +3 -6
  28. package/lib/common/copilot-language-models-manager.js.map +1 -1
  29. package/lib/common/copilot-preferences.js +20 -23
  30. package/lib/common/copilot-preferences.js.map +1 -1
  31. package/lib/common/index.d.ts +3 -3
  32. package/lib/common/index.d.ts.map +1 -1
  33. package/lib/common/index.js +3 -6
  34. package/lib/common/index.js.map +1 -1
  35. package/lib/node/copilot-auth-service-impl.d.ts +4 -4
  36. package/lib/node/copilot-auth-service-impl.d.ts.map +1 -1
  37. package/lib/node/copilot-auth-service-impl.js +21 -31
  38. package/lib/node/copilot-auth-service-impl.js.map +1 -1
  39. package/lib/node/copilot-auth-service-impl.spec.js +17 -19
  40. package/lib/node/copilot-auth-service-impl.spec.js.map +1 -1
  41. package/lib/node/copilot-backend-module.js +26 -28
  42. package/lib/node/copilot-backend-module.js.map +1 -1
  43. package/lib/node/copilot-cli-auth-provider.d.ts +4 -4
  44. package/lib/node/copilot-cli-auth-provider.d.ts.map +1 -1
  45. package/lib/node/copilot-cli-auth-provider.js +43 -53
  46. package/lib/node/copilot-cli-auth-provider.js.map +1 -1
  47. package/lib/node/copilot-cli-auth-provider.spec.js +60 -63
  48. package/lib/node/copilot-cli-auth-provider.spec.js.map +1 -1
  49. package/lib/node/copilot-cli-locator.js +34 -38
  50. package/lib/node/copilot-cli-locator.js.map +1 -1
  51. package/lib/node/copilot-cli-locator.spec.js +90 -93
  52. package/lib/node/copilot-cli-locator.spec.js.map +1 -1
  53. package/lib/node/copilot-credential-store.js +12 -17
  54. package/lib/node/copilot-credential-store.js.map +1 -1
  55. package/lib/node/copilot-credential-store.spec.js +16 -18
  56. package/lib/node/copilot-credential-store.spec.js.map +1 -1
  57. package/lib/node/copilot-language-models-manager-impl.d.ts +3 -3
  58. package/lib/node/copilot-language-models-manager-impl.d.ts.map +1 -1
  59. package/lib/node/copilot-language-models-manager-impl.js +31 -44
  60. package/lib/node/copilot-language-models-manager-impl.js.map +1 -1
  61. package/lib/node/copilot-language-models-manager-impl.spec.js +29 -31
  62. package/lib/node/copilot-language-models-manager-impl.spec.js.map +1 -1
  63. package/lib/node/copilot-runtime-env.js +2 -5
  64. package/lib/node/copilot-runtime-env.js.map +1 -1
  65. package/lib/node/copilot-sdk-client-provider.d.ts +4 -4
  66. package/lib/node/copilot-sdk-client-provider.d.ts.map +1 -1
  67. package/lib/node/copilot-sdk-client-provider.js +35 -46
  68. package/lib/node/copilot-sdk-client-provider.js.map +1 -1
  69. package/lib/node/copilot-sdk-client-provider.spec.js +43 -46
  70. package/lib/node/copilot-sdk-client-provider.spec.js.map +1 -1
  71. package/lib/node/copilot-sdk-language-model.d.ts +1 -1
  72. package/lib/node/copilot-sdk-language-model.d.ts.map +1 -1
  73. package/lib/node/copilot-sdk-language-model.js +9 -15
  74. package/lib/node/copilot-sdk-language-model.js.map +1 -1
  75. package/lib/node/copilot-sdk-language-model.spec.js +54 -56
  76. package/lib/node/copilot-sdk-language-model.spec.js.map +1 -1
  77. package/lib/node/copilot-sdk-loader.d.ts +2 -2
  78. package/lib/node/copilot-sdk-loader.d.ts.map +1 -1
  79. package/lib/node/copilot-sdk-loader.js +19 -24
  80. package/lib/node/copilot-sdk-loader.js.map +1 -1
  81. package/lib/node/copilot-sdk-loader.spec.js +22 -24
  82. package/lib/node/copilot-sdk-loader.spec.js.map +1 -1
  83. package/lib/node/copilot-sdk-mappers.d.ts +1 -1
  84. package/lib/node/copilot-sdk-mappers.d.ts.map +1 -1
  85. package/lib/node/copilot-sdk-mappers.js +11 -16
  86. package/lib/node/copilot-sdk-mappers.js.map +1 -1
  87. package/lib/node/copilot-sdk-mappers.spec.js +45 -47
  88. package/lib/node/copilot-sdk-mappers.spec.js.map +1 -1
  89. package/lib/node/copilot-sdk-types.js +1 -2
  90. package/lib/node/copilot-sdk-types.js.map +1 -1
  91. package/lib/node/index.d.ts +11 -11
  92. package/lib/node/index.d.ts.map +1 -1
  93. package/lib/node/index.js +11 -14
  94. package/lib/node/index.js.map +1 -1
  95. package/lib/package.spec.d.ts +1 -0
  96. package/lib/package.spec.js +1 -1
  97. package/lib/package.spec.js.map +1 -1
  98. package/package.json +16 -5
  99. package/src/browser/copilot-auth-dialog.tsx +2 -2
  100. package/src/browser/copilot-command-contribution.ts +3 -3
  101. package/src/browser/copilot-frontend-application-contribution.ts +3 -3
  102. package/src/browser/copilot-frontend-module.ts +7 -7
  103. package/src/browser/copilot-status-bar-contribution.ts +3 -3
  104. package/src/browser/index.ts +5 -5
  105. package/src/common/index.ts +3 -3
  106. package/src/node/copilot-auth-service-impl.spec.ts +2 -2
  107. package/src/node/copilot-auth-service-impl.ts +4 -4
  108. package/src/node/copilot-backend-module.ts +8 -8
  109. package/src/node/copilot-cli-auth-provider.spec.ts +2 -2
  110. package/src/node/copilot-cli-auth-provider.ts +5 -5
  111. package/src/node/copilot-cli-locator.spec.ts +1 -1
  112. package/src/node/copilot-cli-locator.ts +2 -2
  113. package/src/node/copilot-credential-store.spec.ts +1 -1
  114. package/src/node/copilot-language-models-manager-impl.spec.ts +2 -2
  115. package/src/node/copilot-language-models-manager-impl.ts +4 -4
  116. package/src/node/copilot-sdk-client-provider.spec.ts +3 -3
  117. package/src/node/copilot-sdk-client-provider.ts +6 -6
  118. package/src/node/copilot-sdk-language-model.spec.ts +2 -2
  119. package/src/node/copilot-sdk-language-model.ts +2 -2
  120. package/src/node/copilot-sdk-loader.spec.ts +1 -1
  121. package/src/node/copilot-sdk-loader.ts +3 -3
  122. package/src/node/copilot-sdk-mappers.spec.ts +2 -2
  123. package/src/node/copilot-sdk-mappers.ts +1 -1
  124. package/src/node/index.ts +11 -11
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // *****************************************************************************
3
2
  // Copyright (C) 2026 EclipseSource GmbH and others.
4
3
  //
@@ -24,4 +23,5 @@
24
23
  describe('ai-copilot package', () => {
25
24
  it('support code coverage statistics', () => true);
26
25
  });
26
+ export {};
27
27
  //# sourceMappingURL=package.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.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;;;;;;qBAMqB;AAErB,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.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;;;;;;qBAMqB;AAErB,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@theia/ai-copilot",
3
- "version": "1.77.0-next.99+2a7305415",
3
+ "version": "1.77.0",
4
4
  "description": "Theia - GitHub Copilot Integration",
5
+ "type": "module",
5
6
  "dependencies": {
6
- "@theia/ai-core": "1.77.0-next.99+2a7305415",
7
- "@theia/core": "1.77.0-next.99+2a7305415",
7
+ "@theia/ai-core": "1.77.0",
8
+ "@theia/core": "1.77.0",
8
9
  "tslib": "^2.8.1"
9
10
  },
10
11
  "publishConfig": {
@@ -41,10 +42,20 @@
41
42
  "watch": "theiaext watch"
42
43
  },
43
44
  "devDependencies": {
44
- "@theia/ext-scripts": "1.76.0"
45
+ "@theia/ext-scripts": "1.77.0"
45
46
  },
46
47
  "nyc": {
47
48
  "extends": "../../configs/nyc.json"
48
49
  },
49
- "gitHead": "2a73054157f8bf0d3969a98d6292f15f6c45404a"
50
+ "exports": {
51
+ "./package.json": "./package.json",
52
+ "./lib/browser": "./lib/browser/index.js",
53
+ "./lib/common": "./lib/common/index.js",
54
+ "./lib/node": "./lib/node/index.js",
55
+ "./lib/*.json": "./lib/*.json",
56
+ "./lib/*.js": "./lib/*.js",
57
+ "./lib/*": "./lib/*.js",
58
+ "./*": "./*"
59
+ },
60
+ "gitHead": "9c6d81590b559ee8a78a7808203674f3127411f1"
50
61
  }
@@ -21,8 +21,8 @@ import { ReactDialog } from '@theia/core/lib/browser/dialogs/react-dialog';
21
21
  import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
22
22
  import { WindowService } from '@theia/core/lib/browser/window/window-service';
23
23
  import { CommandService, nls } from '@theia/core';
24
- import { CopilotAuthService, DeviceCodeResponse } from '../common/copilot-auth-service';
25
- import { CopilotAuthDialogMessages } from './copilot-auth-dialog-messages';
24
+ import { CopilotAuthService, DeviceCodeResponse } from '../common/copilot-auth-service.js';
25
+ import { CopilotAuthDialogMessages } from './copilot-auth-dialog-messages.js';
26
26
 
27
27
  const OPEN_AI_CONFIG_VIEW_COMMAND = 'aiConfiguration:open';
28
28
 
@@ -18,9 +18,9 @@ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'
18
18
  import { Command, CommandContribution, CommandRegistry, Disposable, DisposableCollection, nls, PreferenceService } from '@theia/core';
19
19
  import { ConfirmDialog, Dialog } from '@theia/core/lib/browser';
20
20
  import { AIActivationService } from '@theia/ai-core/lib/browser';
21
- import { CopilotAuthService, CopilotAuthState } from '../common/copilot-auth-service';
22
- import { CopilotAuthDialog, CopilotAuthDialogProps } from './copilot-auth-dialog';
23
- import { COPILOT_ENABLED_PREF, COPILOT_ENTERPRISE_URL_PREF } from '../common/copilot-preferences';
21
+ import { CopilotAuthService, CopilotAuthState } from '../common/copilot-auth-service.js';
22
+ import { CopilotAuthDialog, CopilotAuthDialogProps } from './copilot-auth-dialog.js';
23
+ import { COPILOT_ENABLED_PREF, COPILOT_ENTERPRISE_URL_PREF } from '../common/copilot-preferences.js';
24
24
 
25
25
  export namespace CopilotCommands {
26
26
  export const SIGN_IN: Command = Command.toLocalizedCommand(
@@ -18,10 +18,10 @@ import { inject, injectable } from '@theia/core/shared/inversify';
18
18
  import { CommandService, nls, PreferenceService } from '@theia/core';
19
19
  import { FrontendApplicationContribution } from '@theia/core/lib/browser';
20
20
  import { MessageService } from '@theia/core/lib/common/message-service';
21
- import { CopilotAuthService, CopilotLanguageModelsManager, CopilotModelDescription, COPILOT_PROVIDER_ID } from '../common';
22
- import { COPILOT_ENABLED_PREF, COPILOT_ENTERPRISE_URL_PREF, COPILOT_EXECUTABLE_PATH_PREF, COPILOT_MODEL_OVERRIDES_PREF } from '../common/copilot-preferences';
21
+ import { CopilotAuthService, CopilotLanguageModelsManager, CopilotModelDescription, COPILOT_PROVIDER_ID } from '../common/index.js';
22
+ import { COPILOT_ENABLED_PREF, COPILOT_ENTERPRISE_URL_PREF, COPILOT_EXECUTABLE_PATH_PREF, COPILOT_MODEL_OVERRIDES_PREF } from '../common/copilot-preferences.js';
23
23
  import { AICorePreferences, PREFERENCE_NAME_MAX_RETRIES } from '@theia/ai-core/lib/common/ai-core-preferences';
24
- import { CopilotCommands } from './copilot-command-contribution';
24
+ import { CopilotCommands } from './copilot-command-contribution.js';
25
25
  import { ModelDiscoveryStatusService } from '@theia/ai-core/lib/browser';
26
26
 
27
27
  const COPILOT_PROVIDER_LABEL = 'GitHub Copilot';
@@ -30,13 +30,13 @@ import {
30
30
  COPILOT_AUTH_SERVICE_PATH,
31
31
  CopilotAuthServiceClient,
32
32
  CopilotAuthState
33
- } from '../common';
34
- import { CopilotPreferencesSchema } from '../common/copilot-preferences';
35
- import { CopilotFrontendApplicationContribution } from './copilot-frontend-application-contribution';
36
- import { CopilotCommandContribution } from './copilot-command-contribution';
37
- import { CopilotStatusBarContribution } from './copilot-status-bar-contribution';
38
- import { CopilotAuthDialog, CopilotAuthDialogProps } from './copilot-auth-dialog';
39
- import { CopilotAuthDialogMessages, DEFAULT_COPILOT_AUTH_DIALOG_MESSAGES } from './copilot-auth-dialog-messages';
33
+ } from '../common/index.js';
34
+ import { CopilotPreferencesSchema } from '../common/copilot-preferences.js';
35
+ import { CopilotFrontendApplicationContribution } from './copilot-frontend-application-contribution.js';
36
+ import { CopilotCommandContribution } from './copilot-command-contribution.js';
37
+ import { CopilotStatusBarContribution } from './copilot-status-bar-contribution.js';
38
+ import { CopilotAuthDialog, CopilotAuthDialogProps } from './copilot-auth-dialog.js';
39
+ import { CopilotAuthDialogMessages, DEFAULT_COPILOT_AUTH_DIALOG_MESSAGES } from './copilot-auth-dialog-messages.js';
40
40
 
41
41
  class CopilotAuthServiceClientImpl implements CopilotAuthServiceClient {
42
42
  protected readonly onAuthStateChangedEmitter = new Emitter<CopilotAuthState>();
@@ -19,9 +19,9 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
19
19
  import { StatusBar, StatusBarAlignment } from '@theia/core/lib/browser/status-bar/status-bar-types';
20
20
  import { Disposable, DisposableCollection, nls, PreferenceService } from '@theia/core';
21
21
  import { AIActivationService } from '@theia/ai-core/lib/browser';
22
- import { CopilotAuthService, CopilotAuthState } from '../common/copilot-auth-service';
23
- import { CopilotCommands } from './copilot-command-contribution';
24
- import { COPILOT_ENABLED_PREF } from '../common/copilot-preferences';
22
+ import { CopilotAuthService, CopilotAuthState } from '../common/copilot-auth-service.js';
23
+ import { CopilotCommands } from './copilot-command-contribution.js';
24
+ import { COPILOT_ENABLED_PREF } from '../common/copilot-preferences.js';
25
25
 
26
26
  const COPILOT_STATUS_BAR_ID = 'copilot-auth-status';
27
27
 
@@ -14,8 +14,8 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- export * from './copilot-auth-dialog';
18
- export * from './copilot-auth-dialog-messages';
19
- export * from './copilot-command-contribution';
20
- export * from './copilot-status-bar-contribution';
21
- export * from './copilot-frontend-application-contribution';
17
+ export * from './copilot-auth-dialog.js';
18
+ export * from './copilot-auth-dialog-messages.js';
19
+ export * from './copilot-command-contribution.js';
20
+ export * from './copilot-status-bar-contribution.js';
21
+ export * from './copilot-frontend-application-contribution.js';
@@ -14,6 +14,6 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- export * from './copilot-language-models-manager';
18
- export * from './copilot-auth-service';
19
- export * from './copilot-preferences';
17
+ export * from './copilot-language-models-manager.js';
18
+ export * from './copilot-auth-service.js';
19
+ export * from './copilot-preferences.js';
@@ -16,8 +16,8 @@
16
16
 
17
17
  import { expect } from 'chai';
18
18
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
19
- import { CopilotAuthState } from '../common/copilot-auth-service';
20
- import { CopilotAuthServiceImpl } from './copilot-auth-service-impl';
19
+ import { CopilotAuthState } from '../common/copilot-auth-service.js';
20
+ import { CopilotAuthServiceImpl } from './copilot-auth-service-impl.js';
21
21
 
22
22
  interface Stubs {
23
23
  /** Whether the sign-in of the previous integration had to be discarded. */
@@ -21,10 +21,10 @@ import {
21
21
  CopilotAuthServiceClient,
22
22
  CopilotAuthState,
23
23
  DeviceCodeResponse
24
- } from '../common/copilot-auth-service';
25
- import { CopilotCliAuthProvider } from './copilot-cli-auth-provider';
26
- import { CopilotCliLocator } from './copilot-cli-locator';
27
- import { CopilotCredentialStore } from './copilot-credential-store';
24
+ } from '../common/copilot-auth-service.js';
25
+ import { CopilotCliAuthProvider } from './copilot-cli-auth-provider.js';
26
+ import { CopilotCliLocator } from './copilot-cli-locator.js';
27
+ import { CopilotCredentialStore } from './copilot-credential-store.js';
28
28
 
29
29
  /**
30
30
  * Backend implementation of the GitHub Copilot authentication service.
@@ -23,14 +23,14 @@ import {
23
23
  CopilotAuthService,
24
24
  COPILOT_AUTH_SERVICE_PATH,
25
25
  CopilotAuthServiceClient
26
- } from '../common';
27
- import { CopilotLanguageModelsManagerImpl } from './copilot-language-models-manager-impl';
28
- import { CopilotSdkClientProvider } from './copilot-sdk-client-provider';
29
- import { CopilotSdkLoader } from './copilot-sdk-loader';
30
- import { CopilotCliAuthProvider } from './copilot-cli-auth-provider';
31
- import { CopilotCliLocator } from './copilot-cli-locator';
32
- import { CopilotCredentialStore } from './copilot-credential-store';
33
- import { CopilotAuthServiceImpl } from './copilot-auth-service-impl';
26
+ } from '../common/index.js';
27
+ import { CopilotLanguageModelsManagerImpl } from './copilot-language-models-manager-impl.js';
28
+ import { CopilotSdkClientProvider } from './copilot-sdk-client-provider.js';
29
+ import { CopilotSdkLoader } from './copilot-sdk-loader.js';
30
+ import { CopilotCliAuthProvider } from './copilot-cli-auth-provider.js';
31
+ import { CopilotCliLocator } from './copilot-cli-locator.js';
32
+ import { CopilotCredentialStore } from './copilot-credential-store.js';
33
+ import { CopilotAuthServiceImpl } from './copilot-auth-service-impl.js';
34
34
 
35
35
  const copilotConnectionModule = ConnectionContainerModule.create(({ bind }) => {
36
36
  bind(CopilotCliLocator).toSelf().inSingletonScope();
@@ -20,8 +20,8 @@ import * as os from 'os';
20
20
  import { join } from 'path';
21
21
  import { Deferred } from '@theia/core/lib/common/promise-util';
22
22
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
23
- import { DeviceCodeResponse } from '../common/copilot-auth-service';
24
- import { CopilotCliAuthProvider } from './copilot-cli-auth-provider';
23
+ import { DeviceCodeResponse } from '../common/copilot-auth-service.js';
24
+ import { CopilotCliAuthProvider } from './copilot-cli-auth-provider.js';
25
25
 
26
26
  class TestableCopilotCliAuthProvider extends CopilotCliAuthProvider {
27
27
  constructor() {
@@ -21,11 +21,11 @@ import { join } from 'path';
21
21
  import { inject, injectable, named, preDestroy } from '@theia/core/shared/inversify';
22
22
  import { Deferred } from '@theia/core/lib/common/promise-util';
23
23
  import { ILogger, nls } from '@theia/core';
24
- import { CopilotAuthState, DeviceCodeResponse } from '../common/copilot-auth-service';
25
- import { CopilotCliLocator } from './copilot-cli-locator';
26
- import { CopilotCredentialStore } from './copilot-credential-store';
27
- import { CopilotRuntimeEnv } from './copilot-runtime-env';
28
- import { CopilotSdkClientProvider } from './copilot-sdk-client-provider';
24
+ import { CopilotAuthState, DeviceCodeResponse } from '../common/copilot-auth-service.js';
25
+ import { CopilotCliLocator } from './copilot-cli-locator.js';
26
+ import { CopilotCredentialStore } from './copilot-credential-store.js';
27
+ import { CopilotRuntimeEnv } from './copilot-runtime-env.js';
28
+ import { CopilotSdkClientProvider } from './copilot-sdk-client-provider.js';
29
29
 
30
30
  /**
31
31
  * Time after which a login that never reports a code is given up on.
@@ -19,7 +19,7 @@ import { promises as fs } from 'fs';
19
19
  import * as os from 'os';
20
20
  import { join } from 'path';
21
21
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
22
- import { CopilotCliLocator, COPILOT_CLI_PATH_ENV } from './copilot-cli-locator';
22
+ import { CopilotCliLocator, COPILOT_CLI_PATH_ENV } from './copilot-cli-locator.js';
23
23
 
24
24
  class TestableCopilotCliLocator extends CopilotCliLocator {
25
25
  constructor() {
@@ -186,9 +186,9 @@ export class CopilotCliLocator {
186
186
  * package is found whether the installation hoisted it or nested it below the SDK.
187
187
  */
188
188
  protected async bundledCandidates(): Promise<string[]> {
189
- const candidates = [...this.resolvedCandidates(__filename)];
189
+ const candidates = [...this.resolvedCandidates(import.meta.filename)];
190
190
  try {
191
- const resolver = createRequire(__filename);
191
+ const resolver = createRequire(import.meta.filename);
192
192
  candidates.push(...this.resolvedCandidates(resolver.resolve('@github/copilot-sdk')));
193
193
  for (const base of resolver.resolve.paths('@github/copilot') ?? []) {
194
194
  candidates.push(...this.toPlatformPackageCandidates(base));
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { expect } from 'chai';
18
18
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
19
- import { CopilotCredentialStore } from './copilot-credential-store';
19
+ import { CopilotCredentialStore } from './copilot-credential-store.js';
20
20
 
21
21
  /** A keystore that records what was asked of it, keyed the way the real one is. */
22
22
  class FakeKeyStore {
@@ -17,8 +17,8 @@
17
17
  import { expect } from 'chai';
18
18
  import { LanguageModel, LanguageModelStatus } from '@theia/ai-core';
19
19
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
20
- import { CopilotAuthState } from '../common/copilot-auth-service';
21
- import { CopilotLanguageModelsManagerImpl } from './copilot-language-models-manager-impl';
20
+ import { CopilotAuthState } from '../common/copilot-auth-service.js';
21
+ import { CopilotLanguageModelsManagerImpl } from './copilot-language-models-manager-impl.js';
22
22
 
23
23
  /** A registry that records the models and the patches it received. */
24
24
  class FakeRegistry {
@@ -17,7 +17,7 @@
17
17
  import { DiscoveredModels, LanguageModelRegistry, LanguageModelStatus, ModelDiscoveryResult } from '@theia/ai-core';
18
18
  import { DisposableCollection, ILogger, nls } from '@theia/core';
19
19
  import { inject, injectable, named, postConstruct, preDestroy } from '@theia/core/shared/inversify';
20
- import { CopilotLanguageModelsManager, CopilotModelDescription, COPILOT_PROVIDER_ID } from '../common';
20
+ import { CopilotLanguageModelsManager, CopilotModelDescription, COPILOT_PROVIDER_ID } from '../common/index.js';
21
21
 
22
22
  /** The id under which Copilot offers its own model selection; always worth showing. */
23
23
  const COPILOT_AUTO_MODEL_ID = 'auto';
@@ -36,9 +36,9 @@ const NOMINATED_VENDORS: ReadonlyArray<{ vendor: string; matches: RegExp }> = [
36
36
  { vendor: 'openai', matches: /^(gpt|chatgpt|o\d)/i },
37
37
  { vendor: 'google', matches: /^gemini/i }
38
38
  ];
39
- import { CopilotSdkLanguageModel } from './copilot-sdk-language-model';
40
- import { CopilotSdkClientProvider } from './copilot-sdk-client-provider';
41
- import { CopilotAuthServiceImpl } from './copilot-auth-service-impl';
39
+ import { CopilotSdkLanguageModel } from './copilot-sdk-language-model.js';
40
+ import { CopilotSdkClientProvider } from './copilot-sdk-client-provider.js';
41
+ import { CopilotAuthServiceImpl } from './copilot-auth-service-impl.js';
42
42
 
43
43
  /**
44
44
  * Backend implementation of the Copilot language models manager.
@@ -20,9 +20,9 @@ import * as os from 'os';
20
20
  import { join } from 'path';
21
21
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
22
22
  import { FileUri } from '@theia/core/lib/common/file-uri';
23
- import { CopilotCredentials } from './copilot-credential-store';
24
- import { CopilotSdkClientProvider } from './copilot-sdk-client-provider';
25
- import type { CopilotClient, CopilotClientOptions } from './copilot-sdk-types';
23
+ import { CopilotCredentials } from './copilot-credential-store.js';
24
+ import { CopilotSdkClientProvider } from './copilot-sdk-client-provider.js';
25
+ import type { CopilotClient, CopilotClientOptions } from './copilot-sdk-types.js';
26
26
 
27
27
  interface SdkStub {
28
28
  api: {
@@ -20,12 +20,12 @@ import { inject, injectable, named, preDestroy } from '@theia/core/shared/invers
20
20
  import { ILogger, nls, URI } from '@theia/core';
21
21
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
22
22
  import { FileUri } from '@theia/core/lib/common/file-uri';
23
- import type { CopilotClient, CopilotClientOptions } from './copilot-sdk-types';
24
- import { CopilotCredentials, CopilotCredentialStore } from './copilot-credential-store';
25
- import { CopilotCliLocator } from './copilot-cli-locator';
26
- import { CopilotRuntimeEnv } from './copilot-runtime-env';
27
- import { CopilotSdkApi, CopilotSdkLoader } from './copilot-sdk-loader';
28
- import { selectSdkModelIds } from './copilot-sdk-mappers';
23
+ import type { CopilotClient, CopilotClientOptions } from './copilot-sdk-types.js';
24
+ import { CopilotCredentials, CopilotCredentialStore } from './copilot-credential-store.js';
25
+ import { CopilotCliLocator } from './copilot-cli-locator.js';
26
+ import { CopilotRuntimeEnv } from './copilot-runtime-env.js';
27
+ import { CopilotSdkApi, CopilotSdkLoader } from './copilot-sdk-loader.js';
28
+ import { selectSdkModelIds } from './copilot-sdk-mappers.js';
29
29
 
30
30
  /**
31
31
  * Manages the lifecycle of a {@link CopilotClient}, which spawns and talks to the
@@ -16,9 +16,9 @@
16
16
 
17
17
  import { expect } from 'chai';
18
18
  import { LanguageModelStreamResponsePart, ToolCallResponsePart, ToolRequest, UserRequest } from '@theia/ai-core';
19
- import type { CopilotClient, PermissionRequest, Tool } from './copilot-sdk-types';
19
+ import type { CopilotClient, PermissionRequest, Tool } from './copilot-sdk-types.js';
20
20
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
21
- import { approveTheiaTools, CopilotSdkLanguageModel, CopilotStreamSink } from './copilot-sdk-language-model';
21
+ import { approveTheiaTools, CopilotSdkLanguageModel, CopilotStreamSink } from './copilot-sdk-language-model.js';
22
22
 
23
23
  class TestableCopilotSdkLanguageModel extends CopilotSdkLanguageModel {
24
24
  constructor() {
@@ -24,8 +24,8 @@ import {
24
24
  UserRequest
25
25
  } from '@theia/ai-core';
26
26
  import { CancellationToken, ILogger } from '@theia/core';
27
- import type { BlobMessageAttachment, CopilotClient, CopilotSession, PermissionHandler, Tool } from './copilot-sdk-types';
28
- import { buildSdkPrompt, buildSdkSystemMessage } from './copilot-sdk-mappers';
27
+ import type { BlobMessageAttachment, CopilotClient, CopilotSession, PermissionHandler, Tool } from './copilot-sdk-types.js';
28
+ import { buildSdkPrompt, buildSdkSystemMessage } from './copilot-sdk-mappers.js';
29
29
 
30
30
  /**
31
31
  * Answers the permission requests of the CLI for the tools of a request.
@@ -17,7 +17,7 @@
17
17
  import { expect } from 'chai';
18
18
  import { join } from 'path';
19
19
  import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
20
- import { CopilotSdkLoader } from './copilot-sdk-loader';
20
+ import { CopilotSdkLoader } from './copilot-sdk-loader.js';
21
21
 
22
22
  /** What the loader checks for before accepting a module as the SDK. */
23
23
  const usableSdk = {
@@ -19,8 +19,8 @@ import { dirname, join } from 'path';
19
19
  import { pathToFileURL } from 'url';
20
20
  import { inject, injectable, named } from '@theia/core/shared/inversify';
21
21
  import { ILogger, nls } from '@theia/core';
22
- import { CopilotCliLocator } from './copilot-cli-locator';
23
- import type { CopilotClientConstructor, RuntimeConnectionFactory } from './copilot-sdk-types';
22
+ import { CopilotCliLocator } from './copilot-cli-locator.js';
23
+ import type { CopilotClientConstructor, RuntimeConnectionFactory } from './copilot-sdk-types.js';
24
24
 
25
25
  /**
26
26
  * The part of the Copilot SDK this integration uses at runtime.
@@ -117,7 +117,7 @@ export class CopilotSdkLoader {
117
117
  */
118
118
  protected importInstalled(): unknown {
119
119
  // A real require is needed here: the ambient one is rewritten when the backend is bundled.
120
- return createRequire(__filename)('@github/copilot-sdk');
120
+ return createRequire(import.meta.filename)('@github/copilot-sdk');
121
121
  }
122
122
 
123
123
  /**
@@ -16,8 +16,8 @@
16
16
 
17
17
  import { expect } from 'chai';
18
18
  import { LanguageModelMessage } from '@theia/ai-core';
19
- import type { ModelInfo } from './copilot-sdk-types';
20
- import { selectSdkModelIds, buildSdkPrompt, buildSdkSystemMessage } from './copilot-sdk-mappers';
19
+ import type { ModelInfo } from './copilot-sdk-types.js';
20
+ import { selectSdkModelIds, buildSdkPrompt, buildSdkSystemMessage } from './copilot-sdk-mappers.js';
21
21
 
22
22
  // Minimal ModelInfo factory: selectSdkModelIds only reads `id` and `policy.state`.
23
23
  function model(id: string, state?: 'enabled' | 'disabled' | 'unconfigured'): ModelInfo {
@@ -15,7 +15,7 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { Base64ImageContent, ImageContent, ImageMessage, LanguageModelMessage } from '@theia/ai-core';
18
- import type { BlobMessageAttachment, ModelInfo, SystemMessageConfig } from './copilot-sdk-types';
18
+ import type { BlobMessageAttachment, ModelInfo, SystemMessageConfig } from './copilot-sdk-types.js';
19
19
 
20
20
  /**
21
21
  * Selects the model IDs that should be surfaced to Theia from the list returned
package/src/node/index.ts CHANGED
@@ -14,14 +14,14 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- export * from './copilot-auth-service-impl';
18
- export * from './copilot-language-models-manager-impl';
19
- export * from './copilot-cli-auth-provider';
20
- export * from './copilot-cli-locator';
21
- export * from './copilot-credential-store';
22
- export * from './copilot-runtime-env';
23
- export * from './copilot-sdk-client-provider';
24
- export * from './copilot-sdk-loader';
25
- export * from './copilot-sdk-mappers';
26
- export * from './copilot-sdk-language-model';
27
- export * from './copilot-sdk-types';
17
+ export * from './copilot-auth-service-impl.js';
18
+ export * from './copilot-language-models-manager-impl.js';
19
+ export * from './copilot-cli-auth-provider.js';
20
+ export * from './copilot-cli-locator.js';
21
+ export * from './copilot-credential-store.js';
22
+ export * from './copilot-runtime-env.js';
23
+ export * from './copilot-sdk-client-provider.js';
24
+ export * from './copilot-sdk-loader.js';
25
+ export * from './copilot-sdk-mappers.js';
26
+ export * from './copilot-sdk-language-model.js';
27
+ export * from './copilot-sdk-types.js';