({
configuration,
text,
images,
newTab,
}: {
configuration: RooCodeSettings
text?: string
images?: string[]
newTab?: boolean
})
| 168 | } |
| 169 | |
| 170 | public async startNewTask({ |
| 171 | configuration, |
| 172 | text, |
| 173 | images, |
| 174 | newTab, |
| 175 | }: { |
| 176 | configuration: RooCodeSettings |
| 177 | text?: string |
| 178 | images?: string[] |
| 179 | newTab?: boolean |
| 180 | }) { |
| 181 | let provider: ClineProvider |
| 182 | |
| 183 | if (newTab) { |
| 184 | await vscode.commands.executeCommand("workbench.action.files.revert") |
| 185 | await vscode.commands.executeCommand("workbench.action.closeAllEditors") |
| 186 | |
| 187 | provider = await openClineInNewTab({ context: this.context, outputChannel: this.outputChannel }) |
| 188 | this.registerListeners(provider) |
| 189 | } else { |
| 190 | await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`) |
| 191 | |
| 192 | provider = this.sidebarProvider |
| 193 | } |
| 194 | |
| 195 | await provider.removeClineFromStack() |
| 196 | await provider.postStateToWebview() |
| 197 | await provider.postMessageToWebview({ type: "action", action: "chatButtonClicked" }) |
| 198 | await provider.postMessageToWebview({ type: "invoke", invoke: "newChat", text, images }) |
| 199 | |
| 200 | const options: CreateTaskOptions = { |
| 201 | consecutiveMistakeLimit: Number.MAX_SAFE_INTEGER, |
| 202 | } |
| 203 | |
| 204 | const task = await provider.createTask(text, images, undefined, options, configuration) |
| 205 | |
| 206 | if (!task) { |
| 207 | throw new Error("Failed to create task due to policy restrictions") |
| 208 | } |
| 209 | |
| 210 | return task.taskId |
| 211 | } |
| 212 | |
| 213 | public async resumeTask(taskId: string): Promise<void> { |
| 214 | await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`) |
no test coverage detected