@@ -31,9 +31,8 @@ declare module 'vscode' {
31
31
32
32
/**
33
33
* Provides a list of chat sessions.
34
- *
35
- * TODO: Do we need a flag to try auth if needed?
36
34
*/
35
+ // TODO: Do we need a flag to try auth if needed?
37
36
provideChatSessionItems ( token : CancellationToken ) : ProviderResult < ChatSessionItem [ ] > ;
38
37
}
39
38
@@ -60,10 +59,9 @@ declare module 'vscode' {
60
59
* The full history of the session
61
60
*
62
61
* 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?
66
62
*/
63
+ // TODO: Are these the right types to use?
64
+ // TODO: link request + response to encourage correct usage?
67
65
readonly history : ReadonlyArray < ChatRequestTurn | ChatResponseTurn2 > ;
68
66
69
67
/**
@@ -79,27 +77,41 @@ declare module 'vscode' {
79
77
* Handles new request for the session.
80
78
*
81
79
* 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?
84
80
*/
81
+ // TODO: Should we introduce our own type for `ChatRequestHandler` since not all field apply to chat sessions?
85
82
readonly requestHandler : ChatRequestHandler | undefined ;
86
83
}
87
84
88
85
export interface ChatSessionContentProvider {
89
86
/**
90
87
* Resolves a chat session into a full `ChatSession` object.
91
88
*
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.
93
90
* @param token A cancellation token that can be used to cancel the operation.
94
91
*/
95
- provideChatSessionContent ( id : string , token : CancellationToken ) : Thenable < ChatSession > ;
92
+ provideChatSessionContent ( sessionId : string , token : CancellationToken ) : Thenable < ChatSession > | ChatSession ;
96
93
}
97
94
98
95
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
+ */
99
106
export function registerChatSessionItemProvider ( chatSessionType : string , provider : ChatSessionItemProvider ) : Disposable ;
100
107
101
108
/**
109
+ * Registers a new {@link ChatSessionContentProvider chat session content provider}.
110
+ *
102
111
* @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.
103
115
*/
104
116
export function registerChatSessionContentProvider ( chatSessionType : string , provider : ChatSessionContentProvider ) : Disposable ;
105
117
}
@@ -114,7 +126,9 @@ declare module 'vscode' {
114
126
}
115
127
116
128
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 > ;
119
133
}
120
134
}
0 commit comments