@codingame/monaco-vscode-chat-service-override 28.1.1 → 28.2.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.
package/index.d.ts CHANGED
@@ -1,15 +1,7 @@
1
1
  import { type IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
2
- import { ChatEntitlement, type IChatSentiment, type IQuotas } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService";
3
- export interface CustomEntitlement {
4
- entitlement: ChatEntitlement;
5
- sentiment: IChatSentiment;
6
- anonymous: boolean;
7
- quotas: IQuotas;
8
- previewFeaturesDisabled: boolean;
9
- }
2
+ import type { IDefaultAccount } from "@codingame/monaco-vscode-api/vscode/vs/base/common/defaultAccount";
10
3
  export interface ChatServiceOverrideOptions {
11
- customEntitlement?: CustomEntitlement;
4
+ defaultAccount?: IDefaultAccount;
12
5
  }
13
- export default function getServiceOverride({ customEntitlement }?: ChatServiceOverrideOptions): IEditorOverrideServices;
14
- export { ChatEntitlement };
15
- export type { IChatSentiment, IQuotas };
6
+ export default function getServiceOverride({ defaultAccount }?: ChatServiceOverrideOptions): IEditorOverrideServices;
7
+ export type { IDefaultAccount };
package/index.js CHANGED
@@ -32,7 +32,6 @@ import { IChatMarkdownAnchorService } from '@codingame/monaco-vscode-api/vscode/
32
32
  import { ChatMarkdownAnchorService } from './vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.js';
33
33
  import { ChatEditingService } from './vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js';
34
34
  import { ChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService';
35
- export { ChatEntitlement } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService';
36
35
  import { PromptsService } from './vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js';
37
36
  import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
38
37
  import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
@@ -106,39 +105,30 @@ import { ChatDebugServiceImpl } from './vscode/src/vs/workbench/contrib/chat/com
106
105
  import { IChatResponseResourceFileSystemProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service';
107
106
  import { ChatResponseResourceFileSystemProvider } from './vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js';
108
107
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
109
-
108
+ import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
110
109
  import './vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js';
111
110
  import './vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js';
112
111
  import './vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js';
113
112
  import './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js';
114
113
  import './vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js';
115
- import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
116
114
 
117
- class CustomEntitlementService {
118
- constructor(customEntitlement) {
119
- this.customEntitlement = customEntitlement;
120
- this.onDidChangeEntitlement = Event.None;
121
- this.entitlement = this.customEntitlement.entitlement;
122
- this.entitlementObs = constObservable(this.entitlement);
123
- this.previewFeaturesDisabled = this.customEntitlement.previewFeaturesDisabled;
124
- this.organisations = undefined;
125
- this.isInternal = true;
126
- this.sku = undefined;
127
- this.copilotTrackingId = undefined;
128
- this.onDidChangeQuotaExceeded = Event.None;
129
- this.onDidChangeQuotaRemaining = Event.None;
130
- this.quotas = this.customEntitlement.quotas;
131
- this.onDidChangeSentiment = Event.None;
132
- this.sentiment = this.customEntitlement.sentiment;
133
- this.sentimentObs = constObservable(this.sentiment);
134
- this.onDidChangeAnonymous = Event.None;
135
- this.anonymous = this.customEntitlement.anonymous;
136
- this.anonymousObs = constObservable(this.anonymous);
115
+ class DefaultAccountService {
116
+ constructor(defaultAccount) {
117
+ this.defaultAccount = defaultAccount;
118
+ this.onDidChangePolicyData = Event.None;
119
+ this.policyData = null;
120
+ this.getDefaultAccountAuthenticationProvider = () => ({ id: 'default', name: 'Default', enterprise: false });
121
+ this.setDefaultAccountProvider = () => { };
122
+ this.refresh = async () => null;
123
+ this.signIn = async () => null;
124
+ this.onDidChangeDefaultAccount = Event.None;
125
+ this.getDefaultAccount = async () => this.defaultAccount;
126
+ this.copilotTokenInfo = null;
127
+ this.onDidChangeCopilotTokenInfo = Event.None;
128
+ this.signOut = async () => { };
137
129
  }
138
- markAnonymousRateLimited() { }
139
- async update() { }
140
130
  }
141
- function getServiceOverride({ customEntitlement } = {}) {
131
+ function getServiceOverride({ defaultAccount } = {}) {
142
132
  return {
143
133
  [IChatService.toString()]: new SyncDescriptor(ChatService, [], true),
144
134
  [IChatWidgetService.toString()]: new SyncDescriptor(ChatWidgetService, [], true),
@@ -159,9 +149,7 @@ function getServiceOverride({ customEntitlement } = {}) {
159
149
  [IChatEditingService.toString()]: new SyncDescriptor(ChatEditingService, [], true),
160
150
  [IChatTransferService.toString()]: new SyncDescriptor(ChatTransferService, [], true),
161
151
  [IChatMarkdownAnchorService.toString()]: new SyncDescriptor(ChatMarkdownAnchorService, [], true),
162
- [IChatEntitlementService.toString()]: customEntitlement != null
163
- ? new SyncDescriptor(CustomEntitlementService, [customEntitlement], true)
164
- : new SyncDescriptor(ChatEntitlementService, [], true),
152
+ [IChatEntitlementService.toString()]: new SyncDescriptor(ChatEntitlementService, [], true),
165
153
  [IPromptsService.toString()]: new SyncDescriptor(PromptsService, [], true),
166
154
  [IChatStatusItemService.toString()]: new SyncDescriptor(ChatStatusItemService, [], true),
167
155
  [IChatContextPickService.toString()]: new SyncDescriptor(ChatContextPickService, [], true),
@@ -195,7 +183,8 @@ function getServiceOverride({ customEntitlement } = {}) {
195
183
  [IPluginInstallService.toString()]: new SyncDescriptor(PluginInstallService, [], true),
196
184
  [IChatAttachmentWidgetRegistry.toString()]: new SyncDescriptor(ChatAttachmentWidgetRegistry, [], true),
197
185
  [IChatDebugService.toString()]: new SyncDescriptor(ChatDebugServiceImpl, [], true),
198
- [IChatResponseResourceFileSystemProvider.toString()]: new SyncDescriptor(ChatResponseResourceFileSystemProvider, [], true)
186
+ [IChatResponseResourceFileSystemProvider.toString()]: new SyncDescriptor(ChatResponseResourceFileSystemProvider, [], true),
187
+ [IDefaultAccountService.toString()]: new SyncDescriptor(DefaultAccountService, [defaultAccount], true)
199
188
  };
200
189
  }
201
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-chat-service-override",
3
- "version": "28.1.1",
3
+ "version": "28.2.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - chat service-override",
6
6
  "keywords": [],
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "28.1.1",
19
- "@codingame/monaco-vscode-katex-common": "28.1.1",
20
- "@codingame/monaco-vscode-xterm-addons-common": "28.1.1",
21
- "@codingame/monaco-vscode-xterm-common": "28.1.1"
18
+ "@codingame/monaco-vscode-api": "28.2.0",
19
+ "@codingame/monaco-vscode-katex-common": "28.2.0",
20
+ "@codingame/monaco-vscode-xterm-addons-common": "28.2.0",
21
+ "@codingame/monaco-vscode-xterm-common": "28.2.0"
22
22
  },
23
23
  "main": "index.js",
24
24
  "module": "index.js",
@@ -126,7 +126,7 @@ function waitForCommandRegistration(commandId) {
126
126
  return Promise.resolve();
127
127
  }
128
128
  return ( new Promise(resolve => {
129
- const timer = ( new TimeoutTimer());
129
+ const timer = new TimeoutTimer();
130
130
  const listener = CommandsRegistry.onDidRegisterCommand(id => {
131
131
  if (id === commandId) {
132
132
  listener.dispose();
@@ -384,7 +384,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
384
384
  };
385
385
  }
386
386
  getTextEdits(codeBlock, chatSessionResource, token) {
387
- return ( new AsyncIterableProducer(async executor => {
387
+ return new AsyncIterableProducer(async executor => {
388
388
  const request = {
389
389
  codeBlocks: [codeBlock],
390
390
  chatSessionResource
@@ -399,10 +399,10 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
399
399
  if (result?.errorMessage) {
400
400
  executor.reject(( new Error(result.errorMessage)));
401
401
  }
402
- }));
402
+ });
403
403
  }
404
404
  getNotebookEdits(codeBlock, chatSessionResource, token) {
405
- return ( new AsyncIterableProducer(async executor => {
405
+ return new AsyncIterableProducer(async executor => {
406
406
  const request = {
407
407
  codeBlocks: [codeBlock],
408
408
  chatSessionResource,
@@ -420,7 +420,7 @@ let ApplyCodeBlockOperation = class ApplyCodeBlockOperation {
420
420
  if (result?.errorMessage) {
421
421
  executor.reject(( new Error(result.errorMessage)));
422
422
  }
423
- }));
423
+ });
424
424
  }
425
425
  async waitForFirstElement(iterable) {
426
426
  const iterator = iterable[Symbol.asyncIterator]();