@codingame/monaco-vscode-rollup-vsix-plugin 5.3.0 → 6.0.1

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.
@@ -1,291 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
-
6
- declare module 'vscode' {
7
-
8
- /**
9
- * Represents a language model response.
10
- *
11
- * @see {@link LanguageModelAccess.chatRequest}
12
- */
13
- export interface LanguageModelChatResponse {
14
-
15
- /**
16
- * An async iterable that is a stream of text chunks forming the overall response.
17
- *
18
- * *Note* that this stream will error when during data receiving an error occurrs.
19
- */
20
- stream: AsyncIterable<string>;
21
- }
22
-
23
- /**
24
- * A language model message that represents a system message.
25
- *
26
- * System messages provide instructions to the language model that define the context in
27
- * which user messages are interpreted.
28
- *
29
- * *Note* that a language model may choose to add additional system messages to the ones
30
- * provided by extensions.
31
- */
32
- export class LanguageModelChatSystemMessage {
33
-
34
- /**
35
- * The content of this message.
36
- */
37
- content: string;
38
-
39
- /**
40
- * Create a new system message.
41
- *
42
- * @param content The content of the message.
43
- */
44
- constructor(content: string);
45
- }
46
-
47
- /**
48
- * A language model message that represents a user message.
49
- */
50
- export class LanguageModelChatUserMessage {
51
-
52
- /**
53
- * The content of this message.
54
- */
55
- content: string;
56
-
57
- /**
58
- * The optional name of a user for this message.
59
- */
60
- name: string | undefined;
61
-
62
- /**
63
- * Create a new user message.
64
- *
65
- * @param content The content of the message.
66
- * @param name The optional name of a user for the message.
67
- */
68
- constructor(content: string, name?: string);
69
- }
70
-
71
- /**
72
- * A language model message that represents an assistant message, usually in response to a user message
73
- * or as a sample response/reply-pair.
74
- */
75
- export class LanguageModelChatAssistantMessage {
76
-
77
- /**
78
- * The content of this message.
79
- */
80
- content: string;
81
-
82
- /**
83
- * The optional name of a user for this message.
84
- */
85
- name: string | undefined;
86
-
87
- /**
88
- * Create a new assistant message.
89
- *
90
- * @param content The content of the message.
91
- * @param name The optional name of a user for the message.
92
- */
93
- constructor(content: string, name?: string);
94
- }
95
-
96
- /**
97
- * Different types of language model messages.
98
- */
99
- export type LanguageModelChatMessage = LanguageModelChatSystemMessage | LanguageModelChatUserMessage | LanguageModelChatAssistantMessage;
100
-
101
- /**
102
- * Represents information about a registered language model.
103
- */
104
- export interface LanguageModelInformation {
105
- /**
106
- * The identifier of the language model.
107
- */
108
- readonly id: string;
109
-
110
- /**
111
- * The human-readable name of the language model.
112
- */
113
- readonly name: string;
114
-
115
- /**
116
- * The version of the language model.
117
- */
118
- readonly version: string;
119
-
120
- /**
121
- * The number of available tokens that can be used when sending requests
122
- * to the language model.
123
- *
124
- * @see {@link lm.sendChatRequest}
125
- */
126
- readonly tokens: number;
127
- }
128
-
129
- /**
130
- * An event describing the change in the set of available language models.
131
- */
132
- // TODO@API use LanguageModelInformation instead of string?
133
- export interface LanguageModelChangeEvent {
134
- /**
135
- * Added language models.
136
- */
137
- readonly added: readonly string[];
138
- /**
139
- * Removed language models.
140
- */
141
- readonly removed: readonly string[];
142
- }
143
-
144
- /**
145
- * An error type for language model specific errors.
146
- *
147
- * Consumers of language models should check the code property to determine specific
148
- * failure causes, like `if(someError.code === vscode.LanguageModelError.NotFound.name) {...}`
149
- * for the case of referring to an unknown language model. For unspecified errors the `cause`-property
150
- * will contain the actual error.
151
- */
152
- export class LanguageModelError extends Error {
153
-
154
- /**
155
- * The language model does not exist.
156
- */
157
- static NotFound(message?: string): LanguageModelError;
158
-
159
- /**
160
- * The requestor does not have permissions to use this
161
- * language model
162
- */
163
- static NoPermissions(message?: string): LanguageModelError;
164
-
165
- /**
166
- * A code that identifies this error.
167
- *
168
- * Possible values are names of errors, like {@linkcode LanguageModelError.NotFound NotFound},
169
- * or `Unknown` for unspecified errors from the language model itself. In the latter case the
170
- * `cause`-property will contain the actual error.
171
- */
172
- readonly code: string;
173
- }
174
-
175
- /**
176
- * Options for making a chat request using a language model.
177
- *
178
- * @see {@link lm.chatRequest}
179
- */
180
- export interface LanguageModelChatRequestOptions {
181
-
182
- /**
183
- * A human-readable message that explains why access to a language model is needed and what feature is enabled by it.
184
- */
185
- justification?: string;
186
-
187
- /**
188
- * Do not show the consent UI if the user has not yet granted access to the language model but fail the request instead.
189
- */
190
- // TODO@API Revisit this, how do you do the first request?
191
- silent?: boolean;
192
-
193
- /**
194
- * A set of options that control the behavior of the language model. These options are specific to the language model
195
- * and need to be lookup in the respective documentation.
196
- */
197
- modelOptions?: { [name: string]: any };
198
- }
199
-
200
- /**
201
- * Namespace for language model related functionality.
202
- */
203
- export namespace lm {
204
-
205
- /**
206
- * The identifiers of all language models that are currently available.
207
- */
208
- export const languageModels: readonly string[];
209
-
210
- /**
211
- * An event that is fired when the set of available language models changes.
212
- */
213
- export const onDidChangeLanguageModels: Event<LanguageModelChangeEvent>;
214
-
215
- /**
216
- * Retrieve information about a language model.
217
- *
218
- * @param languageModel A language model identifier.
219
- * @returns A {@link LanguageModelInformation} instance or `undefined` if the language model does not exist.
220
- */
221
- export function getLanguageModelInformation(languageModel: string): LanguageModelInformation | undefined;
222
-
223
- /**
224
- * Make a chat request using a language model.
225
- *
226
- * - *Note 1:* language model use may be subject to access restrictions and user consent.
227
- *
228
- * - *Note 2:* language models are contributed by other extensions and as they evolve and change,
229
- * the set of available language models may change over time. Therefore it is strongly recommend to check
230
- * {@link languageModels} for aviailable values and handle missing language models gracefully.
231
- *
232
- * This function will return a rejected promise if making a request to the language model is not
233
- * possible. Reasons for this can be:
234
- *
235
- * - user consent not given, see {@link LanguageModelError.NoPermissions `NoPermissions`}
236
- * - model does not exist, see {@link LanguageModelError.NotFound `NotFound`}
237
- * - quota limits exceeded, see {@link LanguageModelError.cause `LanguageModelError.cause`}
238
- *
239
- * @param languageModel A language model identifier.
240
- * @param messages An array of message instances.
241
- * @param options Options that control the request.
242
- * @param token A cancellation token which controls the request. See {@link CancellationTokenSource} for how to create one.
243
- * @returns A thenable that resolves to a {@link LanguageModelChatResponse}. The promise will reject when the request couldn't be made.
244
- */
245
- export function sendChatRequest(languageModel: string, messages: LanguageModelChatMessage[], options: LanguageModelChatRequestOptions, token: CancellationToken): Thenable<LanguageModelChatResponse>;
246
-
247
- /**
248
- * Uses the language model specific tokenzier and computes the length in token of a given message.
249
- *
250
- * *Note* that this function will throw when the language model does not exist.
251
- *
252
- * @param languageModel A language model identifier.
253
- * @param text A string or a message instance.
254
- * @param token Optional cancellation token.
255
- * @returns A thenable that resolves to the length of the message in tokens.
256
- */
257
- export function computeTokenLength(languageModel: string, text: string | LanguageModelChatMessage, token?: CancellationToken): Thenable<number>;
258
- }
259
-
260
- /**
261
- * Represents extension specific information about the access to language models.
262
- */
263
- export interface LanguageModelAccessInformation {
264
-
265
- /**
266
- * An event that fires when access information changes.
267
- */
268
- onDidChange: Event<void>;
269
-
270
- /**
271
- * Checks if a request can be made to a language model.
272
- *
273
- * *Note* that calling this function will not trigger a consent UI but just checks.
274
- *
275
- * @param languageModelId A language model identifier.
276
- * @return `true` if a request can be made, `false` if not, `undefined` if the language
277
- * model does not exist or consent hasn't been asked for.
278
- */
279
- canSendRequest(languageModelId: string): boolean | undefined;
280
- }
281
-
282
- export interface ExtensionContext {
283
-
284
- /**
285
- * An object that keeps information about how this extension can use language models.
286
- *
287
- * @see {@link lm.sendChatRequest}
288
- */
289
- readonly languageModelAccessInformation: LanguageModelAccessInformation;
290
- }
291
- }
@@ -1,28 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
-
6
- declare module 'vscode' {
7
-
8
- // See https://github.com/microsoft/vscode/issues/209491
9
-
10
- export class TestRunRequest2 extends TestRunRequest {
11
- /**
12
- * Controls how test Test Results view is focused. If true, the editor
13
- * will keep the maintain the user's focus. If false, the editor will
14
- * prefer to move focus into the Test Results view, although
15
- * this may be configured by users.
16
- */
17
- readonly preserveFocus: boolean;
18
-
19
- /**
20
- * @param include Array of specific tests to run, or undefined to run all tests
21
- * @param exclude An array of tests to exclude from the run.
22
- * @param profile The run profile used for this request.
23
- * @param continuous Whether to run tests continuously as source changes.
24
- * @param preserveFocus Whether to preserve the user's focus when the run is started
25
- */
26
- constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean);
27
- }
28
- }