@@ -31,9 +31,8 @@ declare module 'vscode' {
3131
3232 /**
3333 * Provides a list of chat sessions.
34- *
35- * TODO: Do we need a flag to try auth if needed?
3634 */
35+ // TODO: Do we need a flag to try auth if needed?
3736 provideChatSessionItems ( token : CancellationToken ) : ProviderResult < ChatSessionItem [ ] > ;
3837 }
3938
@@ -60,10 +59,9 @@ declare module 'vscode' {
6059 * The full history of the session
6160 *
6261 * This should not include any currently active responses
63- *
64- * TODO: Are these the right types to use?
65- * TODO: link request + response to encourage correct usage?
6662 */
63+ // TODO: Are these the right types to use?
64+ // TODO: link request + response to encourage correct usage?
6765 readonly history : ReadonlyArray < ChatRequestTurn | ChatResponseTurn2 > ;
6866
6967 /**
@@ -79,27 +77,41 @@ declare module 'vscode' {
7977 * Handles new request for the session.
8078 *
8179 * If not set, then the session will be considered read-only and no requests can be made.
82- *
83- * TODO: Should we introduce our own type for `ChatRequestHandler` since not all field apply to chat sessions?
8480 */
81+ // TODO: Should we introduce our own type for `ChatRequestHandler` since not all field apply to chat sessions?
8582 readonly requestHandler : ChatRequestHandler | undefined ;
8683 }
8784
8885 export interface ChatSessionContentProvider {
8986 /**
9087 * Resolves a chat session into a full `ChatSession` object.
9188 *
92- * @param uri The URI of the chat session to open. Uris as structured as `vscode-chat-session:<chatSessionType>/id`
89+ * @param sessionId The id of the chat session to open.
9390 * @param token A cancellation token that can be used to cancel the operation.
9491 */
95- provideChatSessionContent ( id : string , token : CancellationToken ) : Thenable < ChatSession > ;
92+ provideChatSessionContent ( sessionId : string , token : CancellationToken ) : Thenable < ChatSession > | ChatSession ;
9693 }
9794
9895 export namespace chat {
96+ /**
97+ * Registers a new {@link ChatSessionItemProvider chat session item provider}.
98+ *
99+ * To use this, also make sure to also add `chatSessions` contribution in the `package.json`.
100+ *
101+ * @param chatSessionType The type of chat session the provider is for.
102+ * @param provider The provider to register.
103+ *
104+ * @returns A disposable that unregisters the provider when disposed.
105+ */
99106 export function registerChatSessionItemProvider ( chatSessionType : string , provider : ChatSessionItemProvider ) : Disposable ;
100107
101108 /**
109+ * Registers a new {@link ChatSessionContentProvider chat session content provider}.
110+ *
102111 * @param chatSessionType A unique identifier for the chat session type. This is used to differentiate between different chat session providers.
112+ * @param provider The provider to register.
113+ *
114+ * @returns A disposable that unregisters the provider when disposed.
103115 */
104116 export function registerChatSessionContentProvider ( chatSessionType : string , provider : ChatSessionContentProvider ) : Disposable ;
105117 }
@@ -114,7 +126,9 @@ declare module 'vscode' {
114126 }
115127
116128 export namespace window {
117-
118- export function showChatSession ( chatSessionType : string , id : string , options : ChatSessionShowOptions ) : Thenable < void > ;
129+ /**
130+ * Shows a chat session in the panel or editor.
131+ */
132+ export function showChatSession ( chatSessionType : string , sessionId : string , options : ChatSessionShowOptions ) : Thenable < void > ;
119133 }
120134}
0 commit comments