import { ApiConfiguration } from "./api" import { AutoApprovalSettings } from "./AutoApprovalSettings" import { BrowserSettings } from "./BrowserSettings" import { ChatSettings } from "./ChatSettings" import { UserInfo } from "./UserInfo" import { ChatContent } from "./ChatContent" import { TelemetrySetting } from "./TelemetrySetting" import { McpViewTab } from "./mcp" export interface WebviewMessage { type: | "addRemoteServer" | "apiConfiguration" | "webviewDidLaunch" | "newTask" | "condense" | "askResponse" | "didShowAnnouncement" | "selectImages" | "exportCurrentTask" | "showTaskWithId" | "deleteTaskWithId" | "exportTaskWithId" | "resetState" | "requestOllamaModels" | "requestLmStudioModels" | "openInBrowser" | "createRuleFile" | "openMention" | "showChatView" | "refreshOpenRouterModels" | "refreshRequestyModels" | "refreshOpenAiModels" | "refreshClineRules" | "openMcpSettings" | "restartMcpServer" | "deleteMcpServer" | "autoApprovalSettings" | "browserRelaunchResult" | "togglePlanActMode" | "taskCompletionViewChanges" | "openExtensionSettings" | "requestVsCodeLmModels" | "toggleToolAutoApprove" | "getLatestState" | "accountLogoutClicked" | "showAccountViewClicked" | "authStateChanged" | "authCallback" | "fetchMcpMarketplace" | "downloadMcp" | "silentlyRefreshMcpMarketplace" | "searchCommits" | "showMcpView" | "fetchLatestMcpServersFromHub" | "telemetrySetting" | "openSettings" | "fetchOpenGraphData" | "checkIsImageUrl" | "invoke" | "updateSettings" | "clearAllTaskHistory" | "fetchUserCreditsData" | "optionsResponse" | "requestTotalTasksSize" | "relaunchChromeDebugMode" | "taskFeedback" | "scrollToSettings" | "getRelativePaths" // Handles single and multiple URI resolution | "searchFiles" | "toggleFavoriteModel" | "grpc_request" | "toggleClineRule" | "deleteClineRule" | "copyToClipboard" // | "relaunchChromeDebugMode" text?: string uris?: string[] // Used for getRelativePaths disabled?: boolean askResponse?: ClineAskResponse apiConfiguration?: ApiConfiguration images?: string[] bool?: boolean number?: number autoApprovalSettings?: AutoApprovalSettings browserSettings?: BrowserSettings chatSettings?: ChatSettings chatContent?: ChatContent mcpId?: string timeout?: number tab?: McpViewTab // For toggleToolAutoApprove serverName?: string serverUrl?: string toolNames?: string[] autoApprove?: boolean // For auth user?: UserInfo | null customToken?: string // For openInBrowser url?: string planActSeparateModelsSetting?: boolean telemetrySetting?: TelemetrySetting customInstructionsSetting?: string // For task feedback feedbackType?: TaskFeedbackType mentionsRequestId?: string query?: string // For toggleFavoriteModel modelId?: string grpc_request?: { service: string method: string message: any // JSON serialized protobuf message request_id: string // For correlating requests and responses } // For cline rules isGlobal?: boolean rulePath?: string enabled?: boolean filename?: string offset?: number } export type ClineAskResponse = "yesButtonClicked" | "noButtonClicked" | "messageResponse" export type ClineCheckpointRestore = "task" | "workspace" | "taskAndWorkspace" export type TaskFeedbackType = "thumbs_up" | "thumbs_down"