mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 05:11:06 -05:00
Implement bidirectional extension webview messaging system; extension holds claude messages state to keep webview stateless
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
interface ClaudeRequestResult {
|
||||
export interface ClaudeRequestResult {
|
||||
didCompleteTask: boolean
|
||||
inputTokens: number
|
||||
outputTokens: number
|
||||
|
||||
@@ -2,8 +2,18 @@
|
||||
|
||||
// webview will hold state
|
||||
export interface ExtensionMessage {
|
||||
type: "text" | "action" | "state"
|
||||
type: "action" | "state"
|
||||
text?: string
|
||||
action?: "plusButtonTapped" | "settingsButtonTapped"
|
||||
state?: { didOpenOnce: boolean, apiKey?: string, maxRequestsPerTask?: number }
|
||||
}
|
||||
state?: { didOpenOnce: boolean, apiKey?: string, maxRequestsPerTask?: number, claudeMessages: ClaudeMessage[] }
|
||||
}
|
||||
|
||||
export interface ClaudeMessage {
|
||||
type: "ask" | "say"
|
||||
ask?: ClaudeAsk
|
||||
say?: ClaudeSay
|
||||
text?: string
|
||||
}
|
||||
|
||||
export type ClaudeAsk = "request_limit_reached" | "followup" | "command" | "completion_result"
|
||||
export type ClaudeSay = "error" | "api_cost" | "text" | "tool" | "command_output" | "task_completed"
|
||||
@@ -1,5 +1,7 @@
|
||||
export interface WebviewMessage {
|
||||
type: "text" | "action" | "apiKey" | "maxRequestsPerTask" | "webviewDidLaunch"
|
||||
type: "apiKey" | "maxRequestsPerTask" | "webviewDidLaunch" | "newTask" | "askResponse"
|
||||
text?: string
|
||||
action?: "newTaskButtonTapped" | "yesButtonTapped" | "noButtonTapped" | "executeButtonTapped"
|
||||
}
|
||||
askResponse?: ClaudeAskResponse
|
||||
}
|
||||
|
||||
export type ClaudeAskResponse = "newTaskButtonTapped" | "yesButtonTapped" | "noButtonTapped" | "textResponse"
|
||||
Reference in New Issue
Block a user