-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathchat.ts
More file actions
112 lines (111 loc) · 5.05 KB
/
Copy pathchat.ts
File metadata and controls
112 lines (111 loc) · 5.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import {
NotificationHandler,
RequestHandler,
ChatParams,
ChatResult,
EndChatParams,
EndChatResult,
FeedbackParams,
FollowUpClickParams,
InfoLinkClickParams,
InsertToCursorPositionParams,
LinkClickParams,
QuickActionParams,
QuickActionResult,
SourceLinkClickParams,
TabChangeParams,
TabAddParams,
TabRemoveParams,
OpenTabParams,
OpenTabResult,
ChatUpdateParams,
FileClickParams,
InlineChatParams,
InlineChatResult,
ContextCommandParams,
FilterContextCommandsParams,
FilterContextCommandsResult,
CreatePromptParams,
InlineChatResultParams,
ListConversationsParams,
ListConversationsResult,
ConversationClickParams,
ConversationClickResult,
GetSerializedChatResult,
GetSerializedChatParams,
TabBarActionParams,
TabBarActionResult,
ChatOptionsUpdateParams,
PromptInputOptionChangeParams,
ButtonClickParams,
ButtonClickResult,
ListMcpServersParams,
ListMcpServersResult,
McpServerClickResult,
McpServerClickParams,
OpenFileDialogParams,
OpenFileDialogResult,
RuleClickParams,
ListRulesParams,
ListRulesResult,
RuleClickResult,
PinnedContextParams,
ActiveEditorChangedParams,
ListAvailableModelsParams,
ListAvailableModelsResult,
SubscriptionDetailsParams,
SubscriptionUpgradeParams,
} from '../protocol'
/**
* The Chat feature interface. Provides access to chat features
*/
export type Chat = {
// Requests
onChatPrompt: (handler: RequestHandler<ChatParams, ChatResult | undefined | null, ChatResult>) => void
onInlineChatPrompt: (
handler: RequestHandler<InlineChatParams, InlineChatResult | undefined | null, InlineChatResult>
) => void
onEndChat: (handler: RequestHandler<EndChatParams, EndChatResult, void>) => void
onQuickAction: (handler: RequestHandler<QuickActionParams, QuickActionResult, void>) => void
openTab: (params: OpenTabParams) => Promise<OpenTabResult>
onButtonClick: (handler: RequestHandler<ButtonClickParams, ButtonClickResult, ButtonClickResult>) => void
onListConversations: (handler: RequestHandler<ListConversationsParams, ListConversationsResult, void>) => void
onListMcpServers: (handler: RequestHandler<ListMcpServersParams, ListMcpServersResult, void>) => void
onMcpServerClick: (handler: RequestHandler<McpServerClickParams, McpServerClickResult, void>) => void
onConversationClick: (handler: RequestHandler<ConversationClickParams, ConversationClickResult, void>) => void
onTabBarAction: (handler: RequestHandler<TabBarActionParams, TabBarActionResult, void>) => void
getSerializedChat: (params: GetSerializedChatParams) => Promise<GetSerializedChatResult>
onListRules: (handler: RequestHandler<ListRulesParams, ListRulesResult, void>) => void
onRuleClick: (handler: RequestHandler<RuleClickParams, RuleClickResult, void>) => void
onOpenFileDialog: (
handler: RequestHandler<OpenFileDialogParams, OpenFileDialogResult, OpenFileDialogResult>
) => void
onListAvailableModels: (handler: RequestHandler<ListAvailableModelsParams, ListAvailableModelsResult, void>) => void
onFilterContextCommands: (
handler: RequestHandler<FilterContextCommandsParams, FilterContextCommandsResult, void>
) => void
// Notifications
onSendFeedback: (handler: NotificationHandler<FeedbackParams>) => void
onReady: (handler: NotificationHandler<void>) => void
onTabAdd: (handler: NotificationHandler<TabAddParams>) => void
onTabChange: (handler: NotificationHandler<TabChangeParams>) => void
onTabRemove: (handler: NotificationHandler<TabRemoveParams>) => void
onCodeInsertToCursorPosition: (handler: NotificationHandler<InsertToCursorPositionParams>) => void
onLinkClick: (handler: NotificationHandler<LinkClickParams>) => void
onInfoLinkClick: (handler: NotificationHandler<InfoLinkClickParams>) => void
onSourceLinkClick: (handler: NotificationHandler<SourceLinkClickParams>) => void
onFollowUpClicked: (handler: NotificationHandler<FollowUpClickParams>) => void
sendChatUpdate: (params: ChatUpdateParams) => void
onFileClicked: (handler: NotificationHandler<FileClickParams>) => void
chatOptionsUpdate: (params: ChatOptionsUpdateParams) => void
sendContextCommands: (params: ContextCommandParams) => void
sendPinnedContext: (params: PinnedContextParams) => void
onPinnedContextAdd: (handler: NotificationHandler<PinnedContextParams>) => void
onPinnedContextRemove: (handler: NotificationHandler<PinnedContextParams>) => void
onActiveEditorChanged: (handler: NotificationHandler<ActiveEditorChangedParams>) => void
onCreatePrompt: (handler: NotificationHandler<CreatePromptParams>) => void
onInlineChatResult: (handler: NotificationHandler<InlineChatResultParams>) => void
onPromptInputOptionChange: (handler: NotificationHandler<PromptInputOptionChangeParams>) => void
sendSubscriptionDetails: (params: SubscriptionDetailsParams) => void
onSubscriptionUpgrade: (handler: NotificationHandler<SubscriptionUpgradeParams>) => void
}