@@ -5,7 +5,7 @@ import { ApiHandler, SingleCompletionHandler } from "../index"
55import { ApiStream } from "../transform/stream"
66import * as vscode from "vscode"
77import { ExtensionMessage } from "../../shared/ExtensionMessage"
8- import { getPanel } from "../../activate/registerCommands" // 导入 getPanel 函数
8+ import { getPanel } from "../../activate/registerCommands" // Import the getPanel function
99
1010/**
1111 * Human Relay API processor
@@ -115,10 +115,10 @@ function getMessageContent(message: Anthropic.Messages.MessageParam): string {
115115 */
116116async function showHumanRelayDialog ( promptText : string ) : Promise < string | undefined > {
117117 return new Promise < string | undefined > ( ( resolve ) => {
118- // 创建一个唯一的请求 ID
118+ // Create a unique request ID
119119 const requestId = Date . now ( ) . toString ( )
120120
121- // 注册全局回调函数
121+ // Register a global callback function
122122 vscode . commands . executeCommand (
123123 "roo-code.registerHumanRelayCallback" ,
124124 requestId ,
@@ -127,27 +127,27 @@ async function showHumanRelayDialog(promptText: string): Promise<string | undefi
127127 } ,
128128 )
129129
130- // 检查 panel 是否已经初始化
130+ // Check if the panel has been initialized
131131 if ( ! getPanel ( ) ) {
132- // 如果 panel 不存在,首先打开一个新面板
132+ // If the panel does not exist, first open a new panel
133133 vscode . commands . executeCommand ( "roo-cline.openInNewTab" ) . then ( ( ) => {
134- // 等待面板创建完成后再显示人工中继对话框
134+ // Wait for the panel to be created before showing the human relay dialog
135135 setTimeout ( ( ) => {
136136 vscode . commands . executeCommand ( "roo-code.showHumanRelayDialog" , {
137137 requestId,
138138 promptText,
139139 } )
140- } , 500 ) // 给面板创建留出一点时间
140+ } , 500 ) // Allow some time for the panel to be created
141141 } )
142142 } else {
143- // 如果 panel 已存在,直接显示对话框
143+ // If the panel already exists, directly show the dialog
144144 vscode . commands . executeCommand ( "roo-code.showHumanRelayDialog" , {
145145 requestId,
146146 promptText,
147147 } )
148148 }
149149
150- // 提供临时 UI,以防 WebView 加载失败
150+ // Provide a temporary UI in case the WebView fails to load
151151 vscode . window
152152 . showInformationMessage (
153153 "Please paste the copied message to the AI, then copy the response back into the dialog" ,
@@ -159,7 +159,7 @@ async function showHumanRelayDialog(promptText: string): Promise<string | undefi
159159 )
160160 . then ( ( selection ) => {
161161 if ( selection === "Use Input Box" ) {
162- // 注销回调
162+ // Unregister the callback
163163 vscode . commands . executeCommand ( "roo-code.unregisterHumanRelayCallback" , requestId )
164164
165165 vscode . window
0 commit comments