@codingame/monaco-vscode-rollup-vsix-plugin 5.3.0 → 6.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 +2 -2
- package/rollup-vsix-plugin.js +156 -156
- package/vscode-dts/vscode.proposed.attributableCoverage.d.ts +28 -0
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +90 -97
- package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +76 -0
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +24 -7
- package/vscode-dts/vscode.proposed.chatVariableResolver.d.ts +82 -2
- package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +0 -5
- package/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts +2 -2
- package/vscode-dts/vscode.proposed.embeddings.d.ts +33 -0
- package/vscode-dts/vscode.proposed.interactive.d.ts +2 -110
- package/vscode-dts/vscode.proposed.languageModelSystem.d.ts +17 -0
- package/vscode-dts/vscode.proposed.resolvers.d.ts +2 -1
- package/vscode-dts/vscode.proposed.speech.d.ts +26 -6
- package/vscode-dts/vscode.proposed.testObserver.d.ts +9 -0
- package/vscode-dts/vscode.proposed.chatParticipant.d.ts +0 -458
- package/vscode-dts/vscode.proposed.debugFocus.d.ts +0 -66
- package/vscode-dts/vscode.proposed.languageModels.d.ts +0 -291
- package/vscode-dts/vscode.proposed.testPreserveFocus.d.ts +0 -28
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
export class FileCoverage2 extends FileCoverage {
|
|
8
|
+
/**
|
|
9
|
+
* Test {@link TestItem} this file coverage is generated from. If undefined,
|
|
10
|
+
* the editor will assume the coverage is the overall summary coverage for
|
|
11
|
+
* the entire file.
|
|
12
|
+
*
|
|
13
|
+
* If per-test coverage is available, an extension should append multiple
|
|
14
|
+
* `FileCoverage` instances with this property set for each test item. It
|
|
15
|
+
* must also append a `FileCoverage` instance without this property set to
|
|
16
|
+
* represent the overall coverage of the file.
|
|
17
|
+
*/
|
|
18
|
+
testItem?: TestItem;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
uri: Uri,
|
|
22
|
+
statementCoverage: TestCoverageCount,
|
|
23
|
+
branchCoverage?: TestCoverageCount,
|
|
24
|
+
declarationCoverage?: TestCoverageCount,
|
|
25
|
+
testItem?: TestItem,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -5,55 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
declare module 'vscode' {
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* The location at which the chat is happening.
|
|
10
|
-
*/
|
|
11
|
-
export enum ChatLocation {
|
|
12
|
-
/**
|
|
13
|
-
* The chat panel
|
|
14
|
-
*/
|
|
15
|
-
Panel = 1,
|
|
16
|
-
/**
|
|
17
|
-
* Terminal inline chat
|
|
18
|
-
*/
|
|
19
|
-
Terminal = 2,
|
|
20
|
-
/**
|
|
21
|
-
* Notebook inline chat
|
|
22
|
-
*/
|
|
23
|
-
Notebook = 3,
|
|
24
|
-
/**
|
|
25
|
-
* Code editor inline chat
|
|
26
|
-
*/
|
|
27
|
-
Editor = 4
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface ChatRequest {
|
|
31
|
-
/**
|
|
32
|
-
* The attempt number of the request. The first request has attempt number 0.
|
|
33
|
-
*/
|
|
34
|
-
readonly attempt: number;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* If automatic command detection is enabled.
|
|
38
|
-
*/
|
|
39
|
-
readonly enableCommandDetection: boolean;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The location at which the chat is happening. This will always be one of the supported values
|
|
43
|
-
*/
|
|
44
|
-
readonly location: ChatLocation;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
8
|
export interface ChatParticipant {
|
|
48
9
|
onDidPerformAction: Event<ChatUserActionEvent>;
|
|
49
|
-
supportIssueReporting?: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ChatErrorDetails {
|
|
53
|
-
/**
|
|
54
|
-
* If set to true, the message content is completely hidden. Only ChatErrorDetails#message will be shown.
|
|
55
|
-
*/
|
|
56
|
-
responseIsRedacted?: boolean;
|
|
57
10
|
}
|
|
58
11
|
|
|
59
12
|
/**
|
|
@@ -102,11 +55,83 @@ declare module 'vscode' {
|
|
|
102
55
|
constructor(uri: Uri, edits: TextEdit | TextEdit[]);
|
|
103
56
|
}
|
|
104
57
|
|
|
58
|
+
export class ChatResponseConfirmationPart {
|
|
59
|
+
title: string;
|
|
60
|
+
message: string;
|
|
61
|
+
data: any;
|
|
62
|
+
constructor(title: string, message: string, data: any);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseDetectedParticipantPart | ChatResponseConfirmationPart;
|
|
66
|
+
|
|
67
|
+
export class ChatResponseWarningPart {
|
|
68
|
+
value: MarkdownString;
|
|
69
|
+
constructor(value: string | MarkdownString);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class ChatResponseProgressPart2 extends ChatResponseProgressPart {
|
|
73
|
+
value: string;
|
|
74
|
+
task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>;
|
|
75
|
+
constructor(value: string, task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>);
|
|
76
|
+
}
|
|
77
|
+
|
|
105
78
|
export interface ChatResponseStream {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Push a progress part to this stream. Short-hand for
|
|
82
|
+
* `push(new ChatResponseProgressPart(value))`.
|
|
83
|
+
*
|
|
84
|
+
* @param value A progress message
|
|
85
|
+
* @param task If provided, a task to run while the progress is displayed. When the Thenable resolves, the progress will be marked complete in the UI, and the progress message will be updated to the resolved string if one is specified.
|
|
86
|
+
* @returns This stream.
|
|
87
|
+
*/
|
|
88
|
+
progress(value: string, task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>): void;
|
|
89
|
+
|
|
90
|
+
textEdit(target: Uri, edits: TextEdit | TextEdit[]): void;
|
|
91
|
+
markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;
|
|
92
|
+
detectedParticipant(participant: string, command?: ChatCommand): void;
|
|
93
|
+
push(part: ChatResponsePart | ChatResponseTextEditPart | ChatResponseDetectedParticipantPart | ChatResponseWarningPart | ChatResponseProgressPart2): void;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Show an inline message in the chat view asking the user to confirm an action.
|
|
97
|
+
* Multiple confirmations may be shown per response. The UI might show "Accept All" / "Reject All" actions.
|
|
98
|
+
* @param title The title of the confirmation entry
|
|
99
|
+
* @param message An extra message to display to the user
|
|
100
|
+
* @param data An arbitrary JSON-stringifiable object that will be included in the ChatRequest when
|
|
101
|
+
* the confirmation is accepted or rejected
|
|
102
|
+
* TODO@API should this be MarkdownString?
|
|
103
|
+
* TODO@API should actually be a more generic function that takes an array of buttons
|
|
104
|
+
*/
|
|
105
|
+
confirmation(title: string, message: string, data: any): void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Push a warning to this stream. Short-hand for
|
|
109
|
+
* `push(new ChatResponseWarningPart(message))`.
|
|
110
|
+
*
|
|
111
|
+
* @param message A warning message
|
|
112
|
+
* @returns This stream.
|
|
113
|
+
*/
|
|
114
|
+
warning(message: string | MarkdownString): void;
|
|
115
|
+
|
|
116
|
+
reference(value: Uri | Location | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }): void;
|
|
117
|
+
|
|
118
|
+
push(part: ExtendedChatResponsePart): void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Does this piggy-back on the existing ChatRequest, or is it a different type of request entirely?
|
|
123
|
+
* Does it show up in history?
|
|
124
|
+
*/
|
|
125
|
+
export interface ChatRequest {
|
|
126
|
+
/**
|
|
127
|
+
* The `data` for any confirmations that were accepted
|
|
128
|
+
*/
|
|
129
|
+
acceptedConfirmationData?: any[];
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The `data` for any confirmations that were rejected
|
|
133
|
+
*/
|
|
134
|
+
rejectedConfirmationData?: any[];
|
|
110
135
|
}
|
|
111
136
|
|
|
112
137
|
// TODO@API fit this into the stream
|
|
@@ -126,14 +151,17 @@ declare module 'vscode' {
|
|
|
126
151
|
}
|
|
127
152
|
|
|
128
153
|
export class ChatCompletionItem {
|
|
154
|
+
id: string;
|
|
129
155
|
label: string | CompletionItemLabel;
|
|
130
156
|
values: ChatVariableValue[];
|
|
157
|
+
fullName?: string;
|
|
158
|
+
icon?: ThemeIcon;
|
|
131
159
|
insertText?: string;
|
|
132
160
|
detail?: string;
|
|
133
161
|
documentation?: string | MarkdownString;
|
|
134
162
|
command?: Command;
|
|
135
163
|
|
|
136
|
-
constructor(label: string | CompletionItemLabel, values: ChatVariableValue[]);
|
|
164
|
+
constructor(id: string, label: string | CompletionItemLabel, values: ChatVariableValue[]);
|
|
137
165
|
}
|
|
138
166
|
|
|
139
167
|
export type ChatExtendedRequestHandler = (request: ChatRequest, context: ChatContext, response: ChatResponseStream, token: CancellationToken) => ProviderResult<ChatResult | void>;
|
|
@@ -144,7 +172,13 @@ declare module 'vscode' {
|
|
|
144
172
|
*/
|
|
145
173
|
export function createChatParticipant(id: string, handler: ChatExtendedRequestHandler): ChatParticipant;
|
|
146
174
|
|
|
147
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Current version of the proposal. Changes whenever backwards-incompatible changes are made.
|
|
177
|
+
* If a new feature is added that doesn't break existing code, the version is not incremented. When the extension uses this new feature, it should set its engines.vscode version appropriately.
|
|
178
|
+
* But if a change is made to an existing feature that would break existing code, the version should be incremented.
|
|
179
|
+
* The chat extension should not activate if it doesn't support the current version.
|
|
180
|
+
*/
|
|
181
|
+
export const _version: 1 | number;
|
|
148
182
|
}
|
|
149
183
|
|
|
150
184
|
/*
|
|
@@ -209,51 +243,10 @@ declare module 'vscode' {
|
|
|
209
243
|
readonly action: ChatCopyAction | ChatInsertAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction;
|
|
210
244
|
}
|
|
211
245
|
|
|
212
|
-
export interface
|
|
246
|
+
export interface ChatPromptReference {
|
|
213
247
|
/**
|
|
214
|
-
*
|
|
248
|
+
* TODO Needed for now to drive the variableName-type reference, but probably both of these should go away in the future.
|
|
215
249
|
*/
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export interface ChatVariableResolverResponseStream {
|
|
220
|
-
/**
|
|
221
|
-
* Push a progress part to this stream. Short-hand for
|
|
222
|
-
* `push(new ChatResponseProgressPart(value))`.
|
|
223
|
-
*
|
|
224
|
-
* @param value
|
|
225
|
-
* @returns This stream.
|
|
226
|
-
*/
|
|
227
|
-
progress(value: string): ChatVariableResolverResponseStream;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Push a reference to this stream. Short-hand for
|
|
231
|
-
* `push(new ChatResponseReferencePart(value))`.
|
|
232
|
-
*
|
|
233
|
-
* *Note* that the reference is not rendered inline with the response.
|
|
234
|
-
*
|
|
235
|
-
* @param value A uri or location
|
|
236
|
-
* @returns This stream.
|
|
237
|
-
*/
|
|
238
|
-
reference(value: Uri | Location): ChatVariableResolverResponseStream;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Pushes a part to this stream.
|
|
242
|
-
*
|
|
243
|
-
* @param part A response part, rendered or metadata
|
|
244
|
-
*/
|
|
245
|
-
push(part: ChatVariableResolverResponsePart): ChatVariableResolverResponseStream;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export type ChatVariableResolverResponsePart = ChatResponseProgressPart | ChatResponseReferencePart;
|
|
249
|
-
|
|
250
|
-
export interface ChatVariableResolver {
|
|
251
|
-
/**
|
|
252
|
-
* A callback to resolve the value of a chat variable.
|
|
253
|
-
* @param name The name of the variable.
|
|
254
|
-
* @param context Contextual information about this chat request.
|
|
255
|
-
* @param token A cancellation token.
|
|
256
|
-
*/
|
|
257
|
-
resolve2?(name: string, context: ChatVariableContext, stream: ChatVariableResolverResponseStream, token: CancellationToken): ProviderResult<ChatVariableValue[]>;
|
|
250
|
+
readonly name: string;
|
|
258
251
|
}
|
|
259
252
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
* The location at which the chat is happening.
|
|
10
|
+
*/
|
|
11
|
+
export enum ChatLocation {
|
|
12
|
+
/**
|
|
13
|
+
* The chat panel
|
|
14
|
+
*/
|
|
15
|
+
Panel = 1,
|
|
16
|
+
/**
|
|
17
|
+
* Terminal inline chat
|
|
18
|
+
*/
|
|
19
|
+
Terminal = 2,
|
|
20
|
+
/**
|
|
21
|
+
* Notebook inline chat
|
|
22
|
+
*/
|
|
23
|
+
Notebook = 3,
|
|
24
|
+
/**
|
|
25
|
+
* Code editor inline chat
|
|
26
|
+
*/
|
|
27
|
+
Editor = 4
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ChatRequest {
|
|
31
|
+
/**
|
|
32
|
+
* The attempt number of the request. The first request has attempt number 0.
|
|
33
|
+
*/
|
|
34
|
+
readonly attempt: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* If automatic command detection is enabled.
|
|
38
|
+
*/
|
|
39
|
+
readonly enableCommandDetection: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The location at which the chat is happening. This will always be one of the supported values
|
|
43
|
+
*/
|
|
44
|
+
readonly location: ChatLocation;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ChatParticipant {
|
|
48
|
+
supportIssueReporting?: boolean;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Temp, support references that are slow to resolve and should be tools rather than references.
|
|
52
|
+
*/
|
|
53
|
+
supportsSlowReferences?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ChatErrorDetails {
|
|
57
|
+
/**
|
|
58
|
+
* If set to true, the message content is completely hidden. Only ChatErrorDetails#message will be shown.
|
|
59
|
+
*/
|
|
60
|
+
responseIsRedacted?: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export namespace chat {
|
|
64
|
+
export function createDynamicChatParticipant(id: string, dynamicProps: DynamicChatParticipantProps, handler: ChatExtendedRequestHandler): ChatParticipant;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* These don't get set on the ChatParticipant after creation, like other props, because they are typically defined in package.json and we want them at the time of creation.
|
|
69
|
+
*/
|
|
70
|
+
export interface DynamicChatParticipantProps {
|
|
71
|
+
name: string;
|
|
72
|
+
publisherName: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
fullName?: string;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -19,22 +19,34 @@ declare module 'vscode' {
|
|
|
19
19
|
|
|
20
20
|
onDidReceiveLanguageModelResponse2?: Event<{ readonly extensionId: string; readonly participant?: string; readonly tokenCount?: number }>;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
provideLanguageModelResponse(messages: LanguageModelChatMessage[], options: { [name: string]: any }, extensionId: string, progress: Progress<ChatResponseFragment>, token: CancellationToken): Thenable<any>;
|
|
23
23
|
|
|
24
24
|
provideTokenCount(text: string | LanguageModelChatMessage, token: CancellationToken): Thenable<number>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface ChatResponseProviderMetadata {
|
|
28
|
+
|
|
29
|
+
readonly vendor: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Human-readable name of the language model.
|
|
33
|
+
*/
|
|
34
|
+
readonly name: string;
|
|
35
|
+
/**
|
|
36
|
+
* Opaque family-name of the language model. Values might be `gpt-3.5-turbo`, `gpt4`, `phi2`, or `llama`
|
|
37
|
+
* but they are defined by extensions contributing languages and subject to change.
|
|
38
|
+
*/
|
|
39
|
+
readonly family: string;
|
|
40
|
+
|
|
28
41
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
42
|
+
* Opaque version string of the model. This is defined by the extension contributing the language model
|
|
43
|
+
* and subject to change while the identifier is stable.
|
|
31
44
|
*/
|
|
32
|
-
|
|
33
|
-
name: string;
|
|
45
|
+
readonly version: string;
|
|
34
46
|
|
|
35
|
-
|
|
47
|
+
readonly maxInputTokens: number;
|
|
36
48
|
|
|
37
|
-
|
|
49
|
+
readonly maxOutputTokens: number;
|
|
38
50
|
|
|
39
51
|
/**
|
|
40
52
|
* When present, this gates the use of `requestLanguageModelAccess` behind an authorization flow where
|
|
@@ -44,6 +56,11 @@ declare module 'vscode' {
|
|
|
44
56
|
auth?: true | { label: string };
|
|
45
57
|
}
|
|
46
58
|
|
|
59
|
+
export interface ChatResponseProviderMetadata {
|
|
60
|
+
// limit this provider to some extensions
|
|
61
|
+
extensions?: string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
47
64
|
export namespace chat {
|
|
48
65
|
|
|
49
66
|
/**
|
|
@@ -9,11 +9,25 @@ declare module 'vscode' {
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Register a variable which can be used in a chat request to any participant.
|
|
12
|
+
* @param id A unique ID for the variable.
|
|
12
13
|
* @param name The name of the variable, to be used in the chat input as `#name`.
|
|
13
|
-
* @param
|
|
14
|
+
* @param userDescription A description of the variable for the chat input suggest widget.
|
|
15
|
+
* @param modelDescription A description of the variable for the model.
|
|
16
|
+
* @param isSlow Temp, to limit access to '#codebase' which is not a 'reference' and will fit into a tools API later.
|
|
14
17
|
* @param resolver Will be called to provide the chat variable's value when it is used.
|
|
18
|
+
* @param fullName The full name of the variable when selecting context in the picker UI.
|
|
19
|
+
* @param icon An icon to display when selecting context in the picker UI.
|
|
15
20
|
*/
|
|
16
|
-
export function registerChatVariableResolver(name: string,
|
|
21
|
+
export function registerChatVariableResolver(id: string, name: string, userDescription: string, modelDescription: string | undefined, isSlow: boolean | undefined, resolver: ChatVariableResolver, fullName?: string, icon?: ThemeIcon): Disposable;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Attaches a chat context with the specified name, value, and location.
|
|
25
|
+
*
|
|
26
|
+
* @param name - The name of the chat context.
|
|
27
|
+
* @param value - The value of the chat context.
|
|
28
|
+
* @param location - The location of the chat context.
|
|
29
|
+
*/
|
|
30
|
+
export function attachContext(name: string, value: string | Uri | Location | unknown, location: ChatLocation.Panel): void;
|
|
17
31
|
}
|
|
18
32
|
|
|
19
33
|
export interface ChatVariableValue {
|
|
@@ -52,5 +66,71 @@ declare module 'vscode' {
|
|
|
52
66
|
* @param token A cancellation token.
|
|
53
67
|
*/
|
|
54
68
|
resolve(name: string, context: ChatVariableContext, token: CancellationToken): ProviderResult<ChatVariableValue[]>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A callback to resolve the value of a chat variable.
|
|
72
|
+
* @param name The name of the variable.
|
|
73
|
+
* @param context Contextual information about this chat request.
|
|
74
|
+
* @param token A cancellation token.
|
|
75
|
+
*/
|
|
76
|
+
resolve2?(name: string, context: ChatVariableContext, stream: ChatVariableResolverResponseStream, token: CancellationToken): ProviderResult<ChatVariableValue[]>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The detail level of this chat variable value.
|
|
82
|
+
*/
|
|
83
|
+
export enum ChatVariableLevel {
|
|
84
|
+
Short = 1,
|
|
85
|
+
Medium = 2,
|
|
86
|
+
Full = 3
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface ChatVariableValue {
|
|
90
|
+
/**
|
|
91
|
+
* The detail level of this chat variable value. If possible, variable resolvers should try to offer shorter values that will consume fewer tokens in an LLM prompt.
|
|
92
|
+
*/
|
|
93
|
+
level: ChatVariableLevel;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The variable's value, which can be included in an LLM prompt as-is, or the chat participant may decide to read the value and do something else with it.
|
|
97
|
+
*/
|
|
98
|
+
value: string | Uri;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* A description of this value, which could be provided to the LLM as a hint.
|
|
102
|
+
*/
|
|
103
|
+
description?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ChatVariableResolverResponseStream {
|
|
107
|
+
/**
|
|
108
|
+
* Push a progress part to this stream. Short-hand for
|
|
109
|
+
* `push(new ChatResponseProgressPart(value))`.
|
|
110
|
+
*
|
|
111
|
+
* @param value
|
|
112
|
+
* @returns This stream.
|
|
113
|
+
*/
|
|
114
|
+
progress(value: string): ChatVariableResolverResponseStream;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Push a reference to this stream. Short-hand for
|
|
118
|
+
* `push(new ChatResponseReferencePart(value))`.
|
|
119
|
+
*
|
|
120
|
+
* *Note* that the reference is not rendered inline with the response.
|
|
121
|
+
*
|
|
122
|
+
* @param value A uri or location
|
|
123
|
+
* @returns This stream.
|
|
124
|
+
*/
|
|
125
|
+
reference(value: Uri | Location): ChatVariableResolverResponseStream;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Pushes a part to this stream.
|
|
129
|
+
*
|
|
130
|
+
* @param part A response part, rendered or metadata
|
|
131
|
+
*/
|
|
132
|
+
push(part: ChatVariableResolverResponsePart): ChatVariableResolverResponseStream;
|
|
55
133
|
}
|
|
134
|
+
|
|
135
|
+
export type ChatVariableResolverResponsePart = ChatResponseProgressPart | ChatResponseReferencePart;
|
|
56
136
|
}
|
|
@@ -27,11 +27,6 @@ declare module 'vscode' {
|
|
|
27
27
|
*/
|
|
28
28
|
isDefault?: boolean;
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* The full name of this participant.
|
|
32
|
-
*/
|
|
33
|
-
fullName?: string;
|
|
34
|
-
|
|
35
30
|
/**
|
|
36
31
|
* When true, this participant is invoked when the user submits their query using ctrl/cmd+enter
|
|
37
32
|
* TODO@API name
|
|
@@ -33,9 +33,9 @@ declare module 'vscode' {
|
|
|
33
33
|
export interface HoverContext {
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* The delta by which to increase/decrease the hover verbosity level
|
|
37
37
|
*/
|
|
38
|
-
readonly
|
|
38
|
+
readonly verbosityDelta?: number;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* The previous hover sent for the same position
|
|
@@ -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
|
+
// https://github.com/microsoft/vscode/issues/212083
|
|
9
|
+
|
|
10
|
+
export interface Embedding {
|
|
11
|
+
readonly values: number[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// TODO@API strictly not the right namespace...
|
|
15
|
+
export namespace lm {
|
|
16
|
+
|
|
17
|
+
export const embeddingModels: string[];
|
|
18
|
+
|
|
19
|
+
export const onDidChangeEmbeddingModels: Event<void>;
|
|
20
|
+
|
|
21
|
+
export function computeEmbeddings(embeddingsModel: string, input: string, token?: CancellationToken): Thenable<Embedding>;
|
|
22
|
+
|
|
23
|
+
export function computeEmbeddings(embeddingsModel: string, input: string[], token?: CancellationToken): Thenable<Embedding[]>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface EmbeddingsProvider {
|
|
27
|
+
provideEmbeddings(input: string[], token: CancellationToken): ProviderResult<Embedding[]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export namespace lm {
|
|
31
|
+
export function registerEmbeddingsProvider(embeddingsModel: string, provider: EmbeddingsProvider): Disposable;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -5,117 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
declare module 'vscode' {
|
|
7
7
|
|
|
8
|
-
export interface InteractiveEditorSlashCommand {
|
|
9
|
-
command: string;
|
|
10
|
-
detail?: string;
|
|
11
|
-
refer?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the command should execute as soon
|
|
14
|
-
* as it is entered. Defaults to `false`.
|
|
15
|
-
*/
|
|
16
|
-
executeImmediately?: boolean;
|
|
17
|
-
// kind: CompletionItemKind;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// todo@API make classes
|
|
21
|
-
export interface InteractiveEditorSession {
|
|
22
|
-
placeholder?: string;
|
|
23
|
-
input?: string;
|
|
24
|
-
slashCommands?: InteractiveEditorSlashCommand[];
|
|
25
|
-
wholeRange?: Range;
|
|
26
|
-
message?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// todo@API make classes
|
|
30
|
-
export interface InteractiveEditorRequest {
|
|
31
|
-
prompt: string;
|
|
32
|
-
selection: Selection;
|
|
33
|
-
wholeRange: Range;
|
|
34
|
-
attempt: number;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated, use previewDocument
|
|
38
|
-
*/
|
|
39
|
-
live: boolean;
|
|
40
|
-
previewDocument: TextDocument;
|
|
41
|
-
withIntentDetection: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// todo@API make classes
|
|
45
|
-
export interface InteractiveEditorResponse {
|
|
46
|
-
edits: TextEdit[] | WorkspaceEdit;
|
|
47
|
-
contents?: MarkdownString;
|
|
48
|
-
placeholder?: string;
|
|
49
|
-
wholeRange?: Range;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// todo@API make classes
|
|
53
|
-
export interface InteractiveEditorMessageResponse {
|
|
54
|
-
contents: MarkdownString;
|
|
55
|
-
placeholder?: string;
|
|
56
|
-
wholeRange?: Range;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface InteractiveEditorProgressItem {
|
|
60
|
-
message?: string;
|
|
61
|
-
edits?: TextEdit[];
|
|
62
|
-
editsShouldBeInstant?: boolean;
|
|
63
|
-
slashCommand?: InteractiveEditorSlashCommand;
|
|
64
|
-
content?: string | MarkdownString;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export enum InteractiveEditorResponseFeedbackKind {
|
|
68
|
-
Unhelpful = 0,
|
|
69
|
-
Helpful = 1,
|
|
70
|
-
Undone = 2,
|
|
71
|
-
Accepted = 3,
|
|
72
|
-
Bug = 4
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface TextDocumentContext {
|
|
76
|
-
document: TextDocument;
|
|
77
|
-
selection: Selection;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface InteractiveEditorSessionProviderMetadata {
|
|
81
|
-
label?: string;
|
|
82
|
-
supportReportIssue?: boolean;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface InteractiveEditorReplyFollowup {
|
|
86
|
-
message: string;
|
|
87
|
-
tooltip?: string;
|
|
88
|
-
title?: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface InteractiveEditorCommandFollowup {
|
|
92
|
-
commandId: string;
|
|
93
|
-
args?: any[];
|
|
94
|
-
title: string;
|
|
95
|
-
when?: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export type InteractiveEditorFollowup = InteractiveEditorReplyFollowup | InteractiveEditorCommandFollowup;
|
|
99
|
-
|
|
100
|
-
export interface InteractiveEditorSessionProvider<S extends InteractiveEditorSession = InteractiveEditorSession, R extends InteractiveEditorResponse | InteractiveEditorMessageResponse = InteractiveEditorResponse | InteractiveEditorMessageResponse> {
|
|
101
|
-
|
|
102
|
-
// Create a session. The lifetime of this session is the duration of the editing session with the input mode widget.
|
|
103
|
-
prepareInteractiveEditorSession(context: TextDocumentContext, token: CancellationToken): ProviderResult<S>;
|
|
104
|
-
|
|
105
|
-
provideInteractiveEditorResponse(session: S, request: InteractiveEditorRequest, progress: Progress<InteractiveEditorProgressItem>, token: CancellationToken): ProviderResult<R>;
|
|
106
|
-
|
|
107
|
-
provideFollowups?(session: S, response: R, token: CancellationToken): ProviderResult<InteractiveEditorFollowup[]>;
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line local/vscode-dts-provider-naming
|
|
110
|
-
handleInteractiveEditorResponseFeedback?(session: S, response: R, kind: InteractiveEditorResponseFeedbackKind): void;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
8
|
export namespace interactive {
|
|
114
|
-
//
|
|
115
|
-
export const _version:
|
|
116
|
-
|
|
117
|
-
export function registerInteractiveEditorSessionProvider(provider: InteractiveEditorSessionProvider, metadata?: InteractiveEditorSessionProviderMetadata): Disposable;
|
|
118
|
-
|
|
9
|
+
// Can be deleted after another insiders
|
|
10
|
+
export const _version: number;
|
|
119
11
|
export function transferActiveChat(toWorkspace: Uri): void;
|
|
120
12
|
}
|
|
121
13
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
// https://github.com/microsoft/vscode/issues/206265
|
|
9
|
+
|
|
10
|
+
// TODO@API don't have this dedicated type but as property, e.g anthropic doesn't have a system-role, see
|
|
11
|
+
// https://github.com/anthropics/anthropic-sdk-typescript/blob/c2da9604646ff103fbdbca016a9a9d49b03b387b/src/resources/messages.ts#L384
|
|
12
|
+
// So, we could have `LanguageModelChatRequestOptions#system` which would be more limiting but also more natural?
|
|
13
|
+
|
|
14
|
+
export enum LanguageModelChatMessageRole {
|
|
15
|
+
System = 3
|
|
16
|
+
}
|
|
17
|
+
}
|