@codingame/monaco-vscode-rollup-vsix-plugin 10.1.3 → 11.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "10.1.3",
3
+ "version": "11.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,9 +18,9 @@
18
18
  "module": "rollup-vsix-plugin.js",
19
19
  "types": "rollup-vsix-plugin.d.ts",
20
20
  "dependencies": {
21
- "@rollup/pluginutils": "^5.1.2",
21
+ "@rollup/pluginutils": "^5.1.3",
22
22
  "css-url-parser": "^1.1.4",
23
- "memfs": "^4.12.0",
23
+ "memfs": "^4.14.0",
24
24
  "mime-types": "^2.1.35",
25
25
  "yauzl": "^3.0.0"
26
26
  }
@@ -834,6 +834,8 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
834
834
  /*
835
835
  * This module exists so that the AMD build of the monaco editor can replace this with an async loader plugin.
836
836
  * If you add new functions to this module make sure that they are also provided in the AMD build of the monaco editor.
837
+ *
838
+ * TODO@esm remove me once we no longer ship an AMD build.
837
839
  */
838
840
  function getNLSMessages() {
839
841
  return globalThis._VSCODE_NLS_MESSAGES;
@@ -134,7 +134,6 @@ declare module 'vscode' {
134
134
  constructor(uri: Uri, range: Range);
135
135
  }
136
136
 
137
- // Extended to add `SymbolInformation`. Would also be added to `constructor`.
138
137
  export interface ChatResponseAnchorPart {
139
138
  /**
140
139
  * The target of this anchor.
@@ -142,8 +141,18 @@ declare module 'vscode' {
142
141
  * If this is a {@linkcode Uri} or {@linkcode Location}, this is rendered as a normal link.
143
142
  *
144
143
  * If this is a {@linkcode SymbolInformation}, this is rendered as a symbol link.
144
+ *
145
+ * TODO mjbvz: Should this be a full `SymbolInformation`? Or just the parts we need?
146
+ * TODO mjbvz: Should we allow a `SymbolInformation` without a location? For example, until `resolve` completes?
145
147
  */
146
148
  value2: Uri | Location | SymbolInformation;
149
+
150
+ /**
151
+ * Optional method which fills in the details of the anchor.
152
+ *
153
+ * THis is currently only implemented for symbol links.
154
+ */
155
+ resolve?(token: CancellationToken): Thenable<void>;
147
156
  }
148
157
 
149
158
  export interface ChatResponseStream {
@@ -214,8 +223,6 @@ declare module 'vscode' {
214
223
  * The `data` for any confirmations that were rejected
215
224
  */
216
225
  rejectedConfirmationData?: any[];
217
-
218
- userSelectedModel?: LanguageModelChat;
219
226
  }
220
227
 
221
228
  // TODO@API fit this into the stream
@@ -344,13 +351,27 @@ declare module 'vscode' {
344
351
  }
345
352
 
346
353
  export interface ChatEditorAction {
354
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
347
355
  kind: 'editor';
348
356
  accepted: boolean;
349
357
  }
350
358
 
359
+ export interface ChatEditingSessionAction {
360
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
361
+ kind: 'chatEditingSessionAction';
362
+ uri: Uri;
363
+ hasRemainingEdits: boolean;
364
+ outcome: ChatEditingSessionActionOutcome;
365
+ }
366
+
367
+ export enum ChatEditingSessionActionOutcome {
368
+ Accepted = 1,
369
+ Rejected = 2
370
+ }
371
+
351
372
  export interface ChatUserActionEvent {
352
373
  readonly result: ChatResult;
353
- readonly action: ChatCopyAction | ChatInsertAction | ChatApplyAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction;
374
+ readonly action: ChatCopyAction | ChatInsertAction | ChatApplyAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction | ChatEditingSessionAction;
354
375
  }
355
376
 
356
377
  export interface ChatPromptReference {
@@ -363,4 +384,8 @@ declare module 'vscode' {
363
384
  export interface ChatResultFeedback {
364
385
  readonly unhelpfulReason?: string;
365
386
  }
387
+
388
+ export namespace lm {
389
+ export function fileIsIgnored(uri: Uri, token: CancellationToken): Thenable<boolean>;
390
+ }
366
391
  }
@@ -26,7 +26,11 @@ declare module 'vscode' {
26
26
  /**
27
27
  * Code editor inline chat
28
28
  */
29
- Editor = 4
29
+ Editor = 4,
30
+ /**
31
+ * Chat is happening in an editing session
32
+ */
33
+ EditingSession = 5,
30
34
  }
31
35
 
32
36
  export class ChatRequestEditorData {
@@ -104,4 +108,12 @@ declare module 'vscode' {
104
108
  description?: string;
105
109
  fullName?: string;
106
110
  }
111
+
112
+ export namespace lm {
113
+ export function registerIgnoredFileProvider(provider: LanguageModelIgnoredFileProvider): Disposable;
114
+ }
115
+
116
+ export interface LanguageModelIgnoredFileProvider {
117
+ provideFileIgnored(uri: Uri, token: CancellationToken): ProviderResult<boolean>;
118
+ }
107
119
  }
@@ -12,7 +12,7 @@ declare module 'vscode' {
12
12
 
13
13
  export interface ChatResponseFragment2 {
14
14
  index: number;
15
- part: LanguageModelChatResponseTextPart | LanguageModelChatResponseToolCallPart;
15
+ part: LanguageModelTextPart | LanguageModelToolCallPart;
16
16
  }
17
17
 
18
18
  // @API extension ship a d.ts files for their options
@@ -0,0 +1,33 @@
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
+ export interface ChatPromptReference {
9
+ /**
10
+ * The value of this reference. The `string | Uri | Location` types are used today, but this could expand in the future.
11
+ */
12
+ readonly value: string | Uri | Location | ChatReferenceBinaryData | unknown;
13
+ }
14
+
15
+ export class ChatReferenceBinaryData {
16
+ /**
17
+ * The MIME type of the binary data.
18
+ */
19
+ readonly mimeType: string;
20
+
21
+ /**
22
+ * Retrieves the binary data of the reference.
23
+ * @returns A promise that resolves to the binary data as a Uint8Array.
24
+ */
25
+ data(): Thenable<Uint8Array>;
26
+
27
+ /**
28
+ * @param mimeType The MIME type of the binary data.
29
+ * @param data The binary data of the reference.
30
+ */
31
+ constructor(mimeType: string, data: () => Thenable<Uint8Array>);
32
+ }
33
+ }
@@ -28,6 +28,8 @@ declare module 'vscode' {
28
28
  */
29
29
  rejected?: Command;
30
30
 
31
+ commands?: Command[];
32
+
31
33
  /**
32
34
  * Creates a new inline edit.
33
35
  *
@@ -3,231 +3,7 @@
3
3
  * Licensed under the MIT License. See License.txt in the project root for license information.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
 
6
- // version: 7
7
- // https://github.com/microsoft/vscode/issues/213274
6
+ // version: 15
8
7
 
9
8
  declare module 'vscode' {
10
-
11
- // TODO@API capabilities
12
-
13
- // API -> LM: an tool/function that is available to the language model
14
- export interface LanguageModelChatTool {
15
- // TODO@API should use "id" here to match vscode tools, or keep name to match OpenAI?
16
- name: string;
17
- description: string;
18
- parametersSchema?: JSONSchema;
19
- }
20
-
21
- // API -> LM: add tools as request option
22
- export interface LanguageModelChatRequestOptions {
23
- // TODO@API this will be a heterogeneous array of different types of tools
24
- tools?: LanguageModelChatTool[];
25
-
26
- /**
27
- * Force a specific tool to be used.
28
- */
29
- toolChoice?: string;
30
- }
31
-
32
- // LM -> USER: function that should be used
33
- export class LanguageModelChatResponseToolCallPart {
34
- name: string;
35
- toolCallId: string;
36
- parameters: any;
37
-
38
- constructor(name: string, toolCallId: string, parameters: any);
39
- }
40
-
41
- // LM -> USER: text chunk
42
- export class LanguageModelChatResponseTextPart {
43
- value: string;
44
-
45
- constructor(value: string);
46
- }
47
-
48
- export interface LanguageModelChatResponse {
49
- stream: AsyncIterable<LanguageModelChatResponseTextPart | LanguageModelChatResponseToolCallPart>;
50
- }
51
-
52
-
53
- // USER -> LM: the result of a function call
54
- export class LanguageModelChatMessageToolResultPart {
55
- toolCallId: string;
56
- content: string;
57
- isError: boolean;
58
-
59
- constructor(toolCallId: string, content: string, isError?: boolean);
60
- }
61
-
62
- export interface LanguageModelChatMessage {
63
- /**
64
- * A heterogeneous array of other things that a message can contain as content.
65
- * Some parts would be message-type specific for some models and wouldn't go together,
66
- * but it's up to the chat provider to decide what to do about that.
67
- * Can drop parts that are not valid for the message type.
68
- * LanguageModelChatMessageToolResultPart: only on User messages
69
- * LanguageModelChatResponseToolCallPart: only on Assistant messages
70
- */
71
- content2: (string | LanguageModelChatMessageToolResultPart | LanguageModelChatResponseToolCallPart)[];
72
- }
73
-
74
- export interface LanguageModelToolResult {
75
- /**
76
- * The result can contain arbitrary representations of the content. Use {@link LanguageModelToolInvocationOptions.requested} to request particular types.
77
- * `text/plain` is required to be supported by all tools. Another example might be a `PromptElementJSON` from `@vscode/prompt-tsx`, using the `contentType` exported by that library.
78
- */
79
- [contentType: string]: any;
80
- }
81
-
82
- // Tool registration/invoking between extensions
83
-
84
- export namespace lm {
85
- /**
86
- * Register a LanguageModelTool. The tool must also be registered in the package.json `languageModelTools` contribution point.
87
- */
88
- export function registerTool(id: string, tool: LanguageModelTool): Disposable;
89
-
90
- /**
91
- * A list of all available tools.
92
- */
93
- export const tools: ReadonlyArray<LanguageModelToolDescription>;
94
-
95
- /**
96
- * Invoke a tool with the given parameters.
97
- */
98
- export function invokeTool(id: string, options: LanguageModelToolInvocationOptions, token: CancellationToken): Thenable<LanguageModelToolResult>;
99
- }
100
-
101
- export type ChatParticipantToolToken = unknown;
102
-
103
- export interface LanguageModelToolInvocationOptions {
104
- /**
105
- * When this tool is being invoked within the context of a chat request, this token should be passed from {@link ChatRequest.toolInvocationToken}.
106
- * In that case, a progress bar will be automatically shown for the tool invocation in the chat response view. If the tool is being invoked
107
- * outside of a chat request, `undefined` should be passed instead.
108
- */
109
- toolInvocationToken: ChatParticipantToolToken | undefined;
110
-
111
- /**
112
- * Parameters with which to invoke the tool.
113
- */
114
- parameters: Object;
115
-
116
- /**
117
- * A tool invoker can request that particular content types be returned from the tool. All tools are required to support `text/plain`.
118
- */
119
- requestedContentTypes: string[];
120
-
121
- /**
122
- * Options to hint at how many tokens the tool should return in its response.
123
- */
124
- tokenOptions?: {
125
- /**
126
- * If known, the maximum number of tokens the tool should emit in its result.
127
- */
128
- tokenBudget: number;
129
-
130
- /**
131
- * Count the number of tokens in a message using the model specific tokenizer-logic.
132
- * @param text A string.
133
- * @param token Optional cancellation token. See {@link CancellationTokenSource} for how to create one.
134
- * @returns A thenable that resolves to the number of tokens.
135
- */
136
- countTokens(text: string, token?: CancellationToken): Thenable<number>;
137
- };
138
- }
139
-
140
- export type JSONSchema = object;
141
-
142
- export interface LanguageModelToolDescription {
143
- /**
144
- * A unique identifier for the tool.
145
- */
146
- id: string;
147
-
148
- /**
149
- * A human-readable name for this tool that may be used to describe it in the UI.
150
- */
151
- displayName: string | undefined;
152
-
153
- /**
154
- * A description of this tool that may be passed to a language model.
155
- */
156
- modelDescription: string;
157
-
158
- /**
159
- * A JSON schema for the parameters this tool accepts.
160
- */
161
- parametersSchema?: JSONSchema;
162
-
163
- /**
164
- * The list of content types that the tool has declared support for.
165
- */
166
- supportedContentTypes: string[];
167
- }
168
-
169
- export interface LanguageModelToolProvideConfirmationMessageOptions {
170
- participantName: string;
171
- parameters: any;
172
- }
173
-
174
- export interface LanguageModelToolConfirmationMessages {
175
- title: string;
176
- message: string | MarkdownString;
177
- }
178
-
179
- export interface LanguageModelTool {
180
- invoke(options: LanguageModelToolInvocationOptions, token: CancellationToken): ProviderResult<LanguageModelToolResult>;
181
-
182
- /**
183
- * This can be implemented to customize the message shown to the user when a tool requires confirmation.
184
- */
185
- provideToolConfirmationMessages?(options: LanguageModelToolProvideConfirmationMessageOptions, token: CancellationToken): Thenable<LanguageModelToolConfirmationMessages>;
186
-
187
- /**
188
- * This message will be shown with the progress notification when the tool is invoked in a chat session.
189
- */
190
- provideToolInvocationMessage?(parameters: any, token: CancellationToken): Thenable<string>;
191
- }
192
-
193
- export interface ChatLanguageModelToolReference {
194
- /**
195
- * The tool's ID. Refers to a tool listed in {@link lm.tools}.
196
- */
197
- readonly id: string;
198
-
199
- /**
200
- * The start and end index of the reference in the {@link ChatRequest.prompt prompt}. When undefined, the reference was not part of the prompt text.
201
- *
202
- * *Note* that the indices take the leading `#`-character into account which means they can
203
- * used to modify the prompt as-is.
204
- */
205
- readonly range?: [start: number, end: number];
206
- }
207
-
208
- export interface ChatRequest {
209
- /**
210
- * The list of tools that the user attached to their request.
211
- *
212
- * *Note* that if tools are referenced in the text of the prompt, using `#`, the prompt contains
213
- * references as authored and that it is up to the participant
214
- * to further modify the prompt, for instance by inlining reference values or creating links to
215
- * headings which contain the resolved values. References are sorted in reverse by their range
216
- * in the prompt. That means the last reference in the prompt is the first in this list. This simplifies
217
- * string-manipulation of the prompt.
218
- */
219
- readonly toolReferences: readonly ChatLanguageModelToolReference[];
220
-
221
- /**
222
- * A token that can be passed to {@link lm.invokeTool} when invoking a tool inside the context of handling a chat request.
223
- */
224
- readonly toolInvocationToken: ChatParticipantToolToken;
225
- }
226
-
227
- export interface ChatRequestTurn {
228
- /**
229
- * The list of tools were attached to this request.
230
- */
231
- readonly toolReferences?: readonly ChatLanguageModelToolReference[];
232
- }
233
9
  }
@@ -12,13 +12,16 @@ declare module 'vscode' {
12
12
  }
13
13
 
14
14
  export interface ConversationRequest {
15
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
15
16
  readonly type: 'request';
16
17
  readonly message: string;
17
18
  }
18
19
 
19
20
  export interface ConversationResponse {
21
+ // eslint-disable-next-line local/vscode-dts-string-type-literals
20
22
  readonly type: 'response';
21
23
  readonly message: string;
24
+ readonly result?: ChatResult;
22
25
  readonly references?: DocumentContextItem[];
23
26
  }
24
27
 
@@ -53,7 +56,7 @@ declare module 'vscode' {
53
56
  }
54
57
 
55
58
  export interface MappedEditsRequest {
56
- readonly codeBlocks: { code: string; resource: Uri }[];
59
+ readonly codeBlocks: { code: string; resource: Uri; markdownBeforeBlock?: string }[];
57
60
  readonly conversation: (ConversationRequest | ConversationResponse)[]; // for every prior response that contains codeblocks, make sure we pass the code as well as the resources based on the reported codemapper URIs
58
61
  }
59
62
 
@@ -31,7 +31,7 @@ declare module 'vscode' {
31
31
  * a cell execution or another NotebookExecution is created while another is still active.
32
32
  *
33
33
  * This should be used to indicate the {@link NotebookController notebook controller} is busy even though user may not have executed any cell though the UI.
34
- * @param {NotebookDocument} notebook
34
+ * @param notebook
35
35
  * @returns A notebook execution.
36
36
  */
37
37
  createNotebookExecution(notebook: NotebookDocument): NotebookExecution;
@@ -7,9 +7,8 @@ declare module 'vscode' {
7
7
  // https://github.com/microsoft/vscode/issues/133935
8
8
 
9
9
  export interface SourceControlActionButton {
10
- command: Command;
10
+ command: Command & { shortTitle?: string };
11
11
  secondaryCommands?: Command[][];
12
- description?: string;
13
12
  enabled: boolean;
14
13
  }
15
14
 
@@ -1,7 +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
- // empty placeholder declaration for the `chatParticipantDetection`-contribution point
7
- // https://github.com/microsoft/vscode/issues/227699