This repository was archived by the owner on May 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathWebviewMessage.ts
More file actions
313 lines (295 loc) · 8.17 KB
/
Copy pathWebviewMessage.ts
File metadata and controls
313 lines (295 loc) · 8.17 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
import { z } from "zod"
import {
type RooCodeSettings,
type ProviderSettings,
type PromptComponent,
type ModeConfig,
type InstallMarketplaceItemOptions,
type MarketplaceItem,
type ShareVisibility,
type QueuedMessage,
marketplaceItemSchema,
} from "@roo-code/types"
import { Mode } from "./modes"
export type ClineAskResponse = "yesButtonClicked" | "noButtonClicked" | "messageResponse" | "objectResponse"
export type PromptMode = Mode | "enhance"
export type AudioType = "notification" | "celebration" | "progress_loop"
export interface UpdateTodoListPayload {
todos: any[]
}
export type EditQueuedMessagePayload = Pick<QueuedMessage, "id" | "text" | "images">
export interface WebviewMessage {
type:
| "updateTodoList"
| "deleteMultipleTasksWithIds"
| "currentApiConfigName"
| "saveApiConfiguration"
| "upsertApiConfiguration"
| "deleteApiConfiguration"
| "loadApiConfiguration"
| "loadApiConfigurationById"
| "renameApiConfiguration"
| "getListApiConfiguration"
| "customInstructions"
| "webviewDidLaunch"
| "newTask"
| "askResponse"
| "terminalOperation"
| "clearTask"
| "didShowAnnouncement"
| "selectImages"
| "exportCurrentTask"
| "shareCurrentTask"
| "showTaskWithId"
| "deleteTaskWithId"
| "exportTaskWithId"
| "importSettings"
| "exportSettings"
| "resetState"
| "flushRouterModels"
| "requestRouterModels"
| "requestOpenAiModels"
| "requestOllamaModels"
| "requestLmStudioModels"
| "requestRooModels"
| "requestRooCreditBalance"
| "requestVsCodeLmModels"
| "requestHuggingFaceModels"
| "openImage"
| "saveImage"
| "openFile"
| "openMention"
| "cancelTask"
| "cancelAutoApproval"
| "updateVSCodeSetting"
| "getVSCodeSetting"
| "vsCodeSetting"
| "updateCondensingPrompt"
| "playSound"
| "playTts"
| "stopTts"
| "ttsEnabled"
| "ttsSpeed"
| "openKeyboardShortcuts"
| "openMcpSettings"
| "openProjectMcpSettings"
| "restartMcpServer"
| "refreshAllMcpServers"
| "toggleToolAlwaysAllow"
| "toggleToolEnabledForPrompt"
| "toggleMcpServer"
| "updateMcpTimeout"
| "enhancePrompt"
| "enhancedPrompt"
| "draggedImages"
| "deleteMessage"
| "deleteMessageConfirm"
| "submitEditedMessage"
| "editMessageConfirm"
| "enableMcpServerCreation"
| "remoteControlEnabled"
| "taskSyncEnabled"
| "searchCommits"
| "setApiConfigPassword"
| "mode"
| "updatePrompt"
| "getSystemPrompt"
| "copySystemPrompt"
| "systemPrompt"
| "enhancementApiConfigId"
| "autoApprovalEnabled"
| "updateCustomMode"
| "deleteCustomMode"
| "setopenAiCustomModelInfo"
| "openCustomModesSettings"
| "checkpointDiff"
| "checkpointRestore"
| "deleteMcpServer"
| "humanRelayResponse"
| "humanRelayCancel"
| "codebaseIndexEnabled"
| "telemetrySetting"
| "testBrowserConnection"
| "browserConnectionResult"
| "searchFiles"
| "toggleApiConfigPin"
| "hasOpenedModeSelector"
| "cloudButtonClicked"
| "rooCloudSignIn"
| "cloudLandingPageSignIn"
| "rooCloudSignOut"
| "rooCloudManualUrl"
| "claudeCodeSignIn"
| "claudeCodeSignOut"
| "switchOrganization"
| "condenseTaskContextRequest"
| "requestIndexingStatus"
| "startIndexing"
| "clearIndexData"
| "indexingStatusUpdate"
| "indexCleared"
| "focusPanelRequest"
| "openExternal"
| "filterMarketplaceItems"
| "marketplaceButtonClicked"
| "installMarketplaceItem"
| "installMarketplaceItemWithParameters"
| "cancelMarketplaceInstall"
| "removeInstalledMarketplaceItem"
| "marketplaceInstallResult"
| "fetchMarketplaceData"
| "switchTab"
| "shareTaskSuccess"
| "exportMode"
| "exportModeResult"
| "importMode"
| "importModeResult"
| "checkRulesDirectory"
| "checkRulesDirectoryResult"
| "saveCodeIndexSettingsAtomic"
| "requestCodeIndexSecretStatus"
| "requestCommands"
| "openCommandFile"
| "deleteCommand"
| "createCommand"
| "insertTextIntoTextarea"
| "showMdmAuthRequiredNotification"
| "imageGenerationSettings"
| "queueMessage"
| "removeQueuedMessage"
| "editQueuedMessage"
| "dismissUpsell"
| "getDismissedUpsells"
| "updateSettings"
| "allowedCommands"
| "deniedCommands"
| "killBrowserSession"
| "openBrowserSessionPanel"
| "showBrowserSessionPanelAtStep"
| "refreshBrowserSessionPanel"
| "browserPanelDidLaunch"
| "openDebugApiHistory"
| "openDebugUiHistory"
| "downloadErrorDiagnostics"
| "requestClaudeCodeRateLimits"
text?: string
editedMessageContent?: string
tab?: "settings" | "history" | "mcp" | "modes" | "chat" | "marketplace" | "cloud"
disabled?: boolean
context?: string
dataUri?: string
askResponse?: ClineAskResponse
apiConfiguration?: ProviderSettings
images?: string[]
bool?: boolean
value?: number
stepIndex?: number
isLaunchAction?: boolean
forceShow?: boolean
commands?: string[]
audioType?: AudioType
serverName?: string
toolName?: string
alwaysAllow?: boolean
isEnabled?: boolean
mode?: Mode
promptMode?: PromptMode
customPrompt?: PromptComponent
dataUrls?: string[]
values?: Record<string, any>
query?: string
setting?: string
slug?: string
modeConfig?: ModeConfig
timeout?: number
payload?: WebViewMessagePayload
source?: "global" | "project"
requestId?: string
ids?: string[]
hasSystemPromptOverride?: boolean
terminalOperation?: "continue" | "abort"
messageTs?: number
restoreCheckpoint?: boolean
historyPreviewCollapsed?: boolean
filters?: { type?: string; search?: string; tags?: string[] }
settings?: any
url?: string // For openExternal
mpItem?: MarketplaceItem
mpInstallOptions?: InstallMarketplaceItemOptions
config?: Record<string, any> // Add config to the payload
visibility?: ShareVisibility // For share visibility
hasContent?: boolean // For checkRulesDirectoryResult
checkOnly?: boolean // For deleteCustomMode check
upsellId?: string // For dismissUpsell
list?: string[] // For dismissedUpsells response
organizationId?: string | null // For organization switching
useProviderSignup?: boolean // For rooCloudSignIn to use provider signup flow
codeIndexSettings?: {
// Global state settings
codebaseIndexEnabled: boolean
codebaseIndexQdrantUrl: string
codebaseIndexEmbedderProvider:
| "openai"
| "ollama"
| "openai-compatible"
| "gemini"
| "mistral"
| "vercel-ai-gateway"
| "bedrock"
| "openrouter"
codebaseIndexEmbedderBaseUrl?: string
codebaseIndexEmbedderModelId: string
codebaseIndexEmbedderModelDimension?: number // Generic dimension for all providers
codebaseIndexOpenAiCompatibleBaseUrl?: string
codebaseIndexBedrockRegion?: string
codebaseIndexBedrockProfile?: string
codebaseIndexSearchMaxResults?: number
codebaseIndexSearchMinScore?: number
codebaseIndexOpenRouterSpecificProvider?: string // OpenRouter provider routing
// Secret settings
codeIndexOpenAiKey?: string
codeIndexQdrantApiKey?: string
codebaseIndexOpenAiCompatibleApiKey?: string
codebaseIndexGeminiApiKey?: string
codebaseIndexMistralApiKey?: string
codebaseIndexVercelAiGatewayApiKey?: string
codebaseIndexOpenRouterApiKey?: string
}
updatedSettings?: RooCodeSettings
}
export const checkoutDiffPayloadSchema = z.object({
ts: z.number().optional(),
previousCommitHash: z.string().optional(),
commitHash: z.string(),
mode: z.enum(["full", "checkpoint", "from-init", "to-current"]),
})
export type CheckpointDiffPayload = z.infer<typeof checkoutDiffPayloadSchema>
export const checkoutRestorePayloadSchema = z.object({
ts: z.number(),
commitHash: z.string(),
mode: z.enum(["preview", "restore"]),
})
export type CheckpointRestorePayload = z.infer<typeof checkoutRestorePayloadSchema>
export interface IndexingStatusPayload {
state: "Standby" | "Indexing" | "Indexed" | "Error"
message: string
}
export interface IndexClearedPayload {
success: boolean
error?: string
}
export const installMarketplaceItemWithParametersPayloadSchema = z.object({
item: marketplaceItemSchema,
parameters: z.record(z.string(), z.any()),
})
export type InstallMarketplaceItemWithParametersPayload = z.infer<
typeof installMarketplaceItemWithParametersPayloadSchema
>
export type WebViewMessagePayload =
| CheckpointDiffPayload
| CheckpointRestorePayload
| IndexingStatusPayload
| IndexClearedPayload
| InstallMarketplaceItemWithParametersPayload
| UpdateTodoListPayload
| EditQueuedMessagePayload