33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- // version: 2
6+ // version: 3
77
88declare module 'vscode' {
99 /**
@@ -35,6 +35,14 @@ declare module 'vscode' {
3535 */
3636 readonly onDidChangeChatSessionItems : Event < void > ;
3737
38+ /**
39+ * Provides a list of chat sessions.
40+ */
41+ // TODO: Do we need a flag to try auth if needed?
42+ provideChatSessionItems ( token : CancellationToken ) : ProviderResult < ChatSessionItem [ ] > ;
43+
44+ // #region Unstable parts of API
45+
3846 /**
3947 * Event that the provider can fire to signal that the current (original) chat session should be replaced with a new (modified) chat session.
4048 * The UI can use this information to gracefully migrate the user to the new session.
@@ -61,27 +69,16 @@ declare module 'vscode' {
6169 metadata ?: any ;
6270 } , token : CancellationToken ) : ProviderResult < ChatSessionItem > ;
6371
64- /**
65- * Provides a list of chat sessions.
66- */
67- // TODO: Do we need a flag to try auth if needed?
68- provideChatSessionItems ( token : CancellationToken ) : ProviderResult < ChatSessionItem [ ] > ;
72+ // #endregion
6973 }
7074
7175 export interface ChatSessionItem {
72- /**
73- * Unique identifier for the chat session.
74- *
75- * @deprecated Will be replaced by `resource`
76- */
77- id : string ;
78-
7976 /**
8077 * The resource associated with the chat session.
8178 *
8279 * This is uniquely identifies the chat session and is used to open the chat session.
8380 */
84- resource : Uri | undefined ;
81+ resource : Uri ;
8582
8683 /**
8784 * Human readable name of the session shown in the UI
@@ -149,9 +146,12 @@ declare module 'vscode' {
149146 readonly history : ReadonlyArray < ChatRequestTurn | ChatResponseTurn2 > ;
150147
151148 /**
152- * Options configured for this session.
149+ * Options configured for this session as key-value pairs.
150+ * Keys correspond to option group IDs (e.g., 'models', 'subagents')
151+ * and values are the selected option item IDs.
152+ * TODO: Strongly type the keys
153153 */
154- readonly options ?: { model ?: LanguageModelChatInformation } ;
154+ readonly options ?: Record < string , string > ;
155155
156156 /**
157157 * Callback invoked by the editor for a currently running response. This allows the session to push items for the
@@ -172,22 +172,28 @@ declare module 'vscode' {
172172 readonly requestHandler : ChatRequestHandler | undefined ;
173173 }
174174
175+ /**
176+ * Provides the content for a chat session rendered using the native chat UI.
177+ */
175178 export interface ChatSessionContentProvider {
176179 /**
177- * Resolves a chat session into a full `ChatSession` object .
180+ * Provides the chat session content for a given uri .
178181 *
179- * @param sessionId The id of the chat session to open.
182+ * The returned {@linkcode ChatSession} is used to populate the history of the chat UI.
183+ *
184+ * @param resource The URI of the chat session to resolve.
180185 * @param token A cancellation token that can be used to cancel the operation.
186+ *
187+ * @return The {@link ChatSession chat session} associated with the given URI.
181188 */
182- provideChatSessionContent ( sessionId : string , token : CancellationToken ) : Thenable < ChatSession > | ChatSession ;
189+ provideChatSessionContent ( resource : Uri , token : CancellationToken ) : Thenable < ChatSession > | ChatSession ;
183190
184191 /**
185- *
186- * @param sessionId Identifier of the chat session being updated.
192+ * @param resource Identifier of the chat session being updated.
187193 * @param updates Collection of option identifiers and their new values. Only the options that changed are included.
188194 * @param token A cancellation token that can be used to cancel the notification if the session is disposed.
189195 */
190- provideHandleOptionsChange ?( sessionId : string , updates : ReadonlyArray < ChatSessionOptionUpdate > , token : CancellationToken ) : void ;
196+ provideHandleOptionsChange ?( resource : Uri , updates : ReadonlyArray < ChatSessionOptionUpdate > , token : CancellationToken ) : void ;
191197
192198 /**
193199 * Called as soon as you register (call me once)
@@ -224,12 +230,12 @@ declare module 'vscode' {
224230 /**
225231 * Registers a new {@link ChatSessionContentProvider chat session content provider}.
226232 *
227- * @param chatSessionType A unique identifier for the chat session type . This is used to differentiate between different chat session providers .
233+ * @param scheme The uri-scheme to register for . This must be unique .
228234 * @param provider The provider to register.
229235 *
230236 * @returns A disposable that unregisters the provider when disposed.
231237 */
232- export function registerChatSessionContentProvider ( chatSessionType : string , provider : ChatSessionContentProvider , chatParticipant : ChatParticipant , capabilities ?: ChatSessionCapabilities ) : Disposable ;
238+ export function registerChatSessionContentProvider ( scheme : string , provider : ChatSessionContentProvider , chatParticipant : ChatParticipant , capabilities ?: ChatSessionCapabilities ) : Disposable ;
233239 }
234240
235241 export interface ChatContext {
@@ -252,31 +258,51 @@ declare module 'vscode' {
252258 supportsInterruptions ?: boolean ;
253259 }
254260
255- export interface ChatSessionProviderOptions {
261+ /**
262+ * Represents a single selectable item within a provider option group.
263+ */
264+ export interface ChatSessionProviderOptionItem {
265+ /**
266+ * Unique identifier for the option item.
267+ */
268+ readonly id : string ;
269+
256270 /**
257- * Set of available models .
271+ * Human-readable name displayed in the UI .
258272 */
259- models ?: LanguageModelChatInformation [ ] ;
273+ readonly name : string ;
260274 }
261275
262276 /**
263- * @deprecated
277+ * Represents a group of related provider options (e.g., models, sub-agents).
264278 */
265- export interface ChatSessionShowOptions {
279+ export interface ChatSessionProviderOptionGroup {
266280 /**
267- * The editor view column to show the chat session in.
268- *
269- * If not provided, the chat session will be shown in the chat panel instead.
281+ * Unique identifier for the option group (e.g., "models", "subagents").
270282 */
271- readonly viewColumn ?: ViewColumn ;
283+ readonly id : string ;
284+
285+ /**
286+ * Human-readable name for the option group.
287+ */
288+ readonly name : string ;
289+
290+ /**
291+ * Optional description providing context about this option group.
292+ */
293+ readonly description ?: string ;
294+
295+ /**
296+ * The selectable items within this option group.
297+ */
298+ readonly items : ChatSessionProviderOptionItem [ ] ;
272299 }
273300
274- export namespace window {
301+ export interface ChatSessionProviderOptions {
275302 /**
276- * Shows a chat session in the panel or editor.
277- *
278- * @deprecated
303+ * Provider-defined option groups (0-2 groups supported).
304+ * Examples: models picker, sub-agents picker, etc.
279305 */
280- export function showChatSession ( chatSessionType : string , sessionId : string , options : ChatSessionShowOptions ) : Thenable < void > ;
306+ optionGroups ?: ChatSessionProviderOptionGroup [ ] ;
281307 }
282308}
0 commit comments