@@ -35,8 +35,6 @@ declare module 'vscode' {
3535 /**
3636 * Registers a new {@link ChatSessionItemProvider chat session item provider}.
3737 *
38- * @deprecated Use {@linkcode createChatSessionItemController} instead.
39- *
4038 * To use this, also make sure to also add `chatSessions` contribution in the `package.json`.
4139 *
4240 * @param chatSessionType The type of chat session the provider is for.
@@ -48,21 +46,12 @@ declare module 'vscode' {
4846
4947 /**
5048 * Creates a new {@link ChatSessionItemController chat session item controller} with the given unique identifier.
51- *
52- * To use this, also make sure to also add `chatSessions` contribution in the `package.json`.
53- *
54- * @param chatSessionType The type of chat session the provider is for.
55- * @param refreshHandler The controller's {@link ChatSessionItemController.refreshHandler refresh handler}.
56- *
57- * @returns A new controller instance that can be used to manage chat session items for the given chat session type.
5849 */
59- export function createChatSessionItemController ( chatSessionType : string , refreshHandler : ChatSessionItemControllerRefreshHandler ) : ChatSessionItemController ;
50+ export function createChatSessionItemController ( id : string , refreshHandler : ( token : CancellationToken ) => Thenable < void > ) : ChatSessionItemController ;
6051 }
6152
6253 /**
6354 * Provides a list of information about chat sessions.
64- *
65- * @deprecated Use {@linkcode ChatSessionItemController} instead.
6655 */
6756 export interface ChatSessionItemProvider {
6857 /**
@@ -88,21 +77,7 @@ declare module 'vscode' {
8877 }
8978
9079 /**
91- * Extension callback invoked to refresh the collection of chat session items for a {@linkcode ChatSessionItemController}.
92- */
93- export type ChatSessionItemControllerRefreshHandler = ( token : CancellationToken ) => Thenable < void > ;
94-
95- export interface ChatSessionItemControllerNewItemHandlerContext {
96- readonly request : ChatRequest ;
97- }
98-
99- /**
100- * Extension callback invoked when a new chat session is started.
101- */
102- export type ChatSessionItemControllerNewItemHandler = ( context : ChatSessionItemControllerNewItemHandlerContext , token : CancellationToken ) => Thenable < ChatSessionItem > ;
103-
104- /**
105- * Manages chat sessions for a specific chat session type
80+ * Provides a list of information about chat sessions.
10681 */
10782 export interface ChatSessionItemController {
10883 readonly id : string ;
@@ -118,7 +93,7 @@ declare module 'vscode' {
11893 readonly items : ChatSessionItemCollection ;
11994
12095 /**
121- * Creates a new managed chat session item that can be added to the collection.
96+ * Creates a new managed chat session item that be added to the collection.
12297 */
12398 createChatSessionItem ( resource : Uri , label : string ) : ChatSessionItem ;
12499
@@ -127,16 +102,7 @@ declare module 'vscode' {
127102 *
128103 * This is also called on first load to get the initial set of items.
129104 */
130- readonly refreshHandler : ChatSessionItemControllerRefreshHandler ;
131-
132- /**
133- * Invoked when a new chat session is started.
134- *
135- * This allows the controller to initialize the chat session item with information from the initial request.
136- *
137- * The returned chat session is added to the collection and shown in the UI.
138- */
139- newChatSessionItemHandler ?: ChatSessionItemControllerNewItemHandler ;
105+ readonly refreshHandler : ( token : CancellationToken ) => Thenable < void > ;
140106
141107 /**
142108 * Fired when an item's archived state changes.
@@ -155,8 +121,7 @@ declare module 'vscode' {
155121
156122 /**
157123 * Replaces the items stored by the collection.
158- *
159- * @param items Items to store. If two items have the same resource URI, the last one will be used.
124+ * @param items Items to store.
160125 */
161126 replace ( items : readonly ChatSessionItem [ ] ) : void ;
162127
@@ -171,42 +136,31 @@ declare module 'vscode' {
171136 /**
172137 * Adds the chat session item to the collection. If an item with the same resource URI already
173138 * exists, it'll be replaced.
174- *
175139 * @param item Item to add.
176140 */
177141 add ( item : ChatSessionItem ) : void ;
178142
179143 /**
180144 * Removes a single chat session item from the collection.
181- *
182145 * @param resource Item resource to delete.
183146 */
184147 delete ( resource : Uri ) : void ;
185148
186149 /**
187150 * Efficiently gets a chat session item by resource, if it exists, in the collection.
188- *
189151 * @param resource Item resource to get.
190- *
191152 * @returns The found item or undefined if it does not exist.
192153 */
193154 get ( resource : Uri ) : ChatSessionItem | undefined ;
194155 }
195156
196- /**
197- * A chat session show in the UI.
198- *
199- * This should be created by calling a {@link ChatSessionItemController.createChatSessionItem createChatSessionItem}
200- * method on the controller. The item can then be added to the controller's {@link ChatSessionItemController.items items collection}
201- * to show it in the UI.
202- */
203157 export interface ChatSessionItem {
204158 /**
205159 * The resource associated with the chat session.
206160 *
207161 * This is uniquely identifies the chat session and is used to open the chat session.
208162 */
209- readonly resource : Uri ;
163+ resource : Uri ;
210164
211165 /**
212166 * Human readable name of the session shown in the UI
@@ -346,15 +300,6 @@ declare module 'vscode' {
346300 }
347301
348302 export interface ChatSession {
349- /**
350- * An optional title for the chat session.
351- *
352- * When provided, this title is used as the display name for the session
353- * (e.g. in the editor tab). When not provided, the title defaults to
354- * the first user message in the session history.
355- */
356- readonly title ?: string ;
357-
358303 /**
359304 * The full history of the session
360305 *
@@ -390,7 +335,6 @@ declare module 'vscode' {
390335 */
391336 // TODO: Should we introduce our own type for `ChatRequestHandler` since not all field apply to chat sessions?
392337 // TODO: Revisit this to align with code.
393- // TODO: pass in options?
394338 readonly requestHandler : ChatRequestHandler | undefined ;
395339 }
396340
@@ -456,8 +400,9 @@ declare module 'vscode' {
456400
457401 /**
458402 * Called as soon as you register (call me once)
403+ * @param token
459404 */
460- provideChatSessionProviderOptions ?( token : CancellationToken ) : Thenable < ChatSessionProviderOptions > ;
405+ provideChatSessionProviderOptions ?( token : CancellationToken ) : Thenable < ChatSessionProviderOptions | ChatSessionProviderOptions > ;
461406 }
462407
463408 export interface ChatSessionOptionUpdate {
@@ -490,15 +435,7 @@ declare module 'vscode' {
490435
491436 export interface ChatSessionContext {
492437 readonly chatSessionItem : ChatSessionItem ; // Maps to URI of chat session editor (could be 'untitled-1', etc..)
493-
494- /** @deprecated This will be removed along with the concept of `untitled-` sessions. */
495438 readonly isUntitled : boolean ;
496-
497- /**
498- * The initial option selections for the session, provided with the first request.
499- * Contains the options the user selected (or defaults) before the session was created.
500- */
501- readonly initialSessionOptions ?: ReadonlyArray < { optionId : string ; value : string | ChatSessionProviderOptionItem } > ;
502439 }
503440
504441 export interface ChatSessionCapabilities {
@@ -614,13 +551,6 @@ declare module 'vscode' {
614551 * Provider-defined option groups (0-2 groups supported).
615552 * Examples: models picker, sub-agents picker, etc.
616553 */
617- readonly optionGroups ?: readonly ChatSessionProviderOptionGroup [ ] ;
618-
619- /**
620- * The set of default options used for new chat sessions, provided as key-value pairs.
621- *
622- * Keys correspond to option group IDs (e.g., 'models', 'subagents').
623- */
624- readonly newSessionOptions ?: Record < string , string | ChatSessionProviderOptionItem > ;
554+ optionGroups ?: ChatSessionProviderOptionGroup [ ] ;
625555 }
626556}
0 commit comments