Skip to content

Commit bca3db9

Browse files
committed
feat: protocol changes for openTab and renamings
1 parent 42d6c05 commit bca3db9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

runtimes/protocol/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const endChatRequestType = new ProtocolRequestType<EndChatParams, EndChat
5353
)
5454
export const quickActionRequestType = new AutoParameterStructuresProtocolRequestType<
5555
QuickActionParams | EncryptedQuickActionParams,
56-
QuickActionResult | string,
56+
QuickActionResult | string | null,
5757
QuickActionResult | string,
5858
void,
5959
void

types/chat.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface FileList {
8282
deletedFiles?: string[]
8383
}
8484

85-
export interface ChatResult {
85+
export interface ChatMessage {
8686
body?: string
8787
messageId?: string
8888
canBeVoted?: boolean // requires messageId to be filled to show vote thumbs
@@ -97,6 +97,7 @@ export interface ChatResult {
9797
codeReference?: ReferenceTrackerInformation[]
9898
fileList?: FileList
9999
}
100+
export interface ChatResult extends ChatMessage {}
100101

101102
export type EndChatParams = { tabId: string }
102103
export type EndChatResult = boolean
@@ -131,7 +132,7 @@ export interface QuickActions {
131132

132133
export interface TabData {
133134
placeholderText?: string
134-
messages: ChatResult[]
135+
messages: ChatMessage[]
135136
}
136137

137138
/**
@@ -156,8 +157,10 @@ export interface EncryptedQuickActionParams extends PartialResultParams {
156157
message: string
157158
}
158159

159-
// Currently the QuickAction result and ChatResult share the same shape
160-
export interface QuickActionResult extends ChatResult {}
160+
// Currently the QuickActionResult and ChatResult share the same shape,
161+
// however response for quick actions request is optional,
162+
// if server chooses to handle the request asynchronously
163+
export interface QuickActionResult extends ChatMessage {}
161164

162165
export interface FeedbackParams {
163166
tabId: string
@@ -213,9 +216,10 @@ export interface FollowUpClickParams {
213216
with options provided in `options` parameter and opens it.
214217
*/
215218
export interface OpenTabParams extends Partial<TabEventParams> {
216-
options?: {
219+
newTabOptions?: {
217220
useDefaultTabData?: boolean
218-
tabData?: TabData
221+
state?: TabState
222+
data?: TabData
219223
}
220224
}
221225
export interface OpenTabResult extends TabEventParams {}
@@ -228,8 +232,7 @@ export interface TabState {
228232
export interface ChatUpdateParams {
229233
tabId: string
230234
state?: TabState
231-
placeholderText?: string
232-
messages: ChatResult[]
235+
data?: TabData
233236
}
234237

235238
export type FileAction = 'accept-change' | 'reject-change' | string

0 commit comments

Comments
 (0)