mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Fixes to resumeTask and isTaskInHistory (#2380)
This commit is contained in:
parent
cf74568f66
commit
0e4be83c35
3 changed files with 18 additions and 6 deletions
|
|
@ -133,14 +133,14 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
|
|||
}
|
||||
|
||||
public async resumeTask(taskId: string): Promise<void> {
|
||||
const { historyItem } = await this.provider.getTaskWithId(taskId)
|
||||
await this.provider.initClineWithHistoryItem(historyItem)
|
||||
await this.provider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
|
||||
const { historyItem } = await this.sidebarProvider.getTaskWithId(taskId)
|
||||
await this.sidebarProvider.initClineWithHistoryItem(historyItem)
|
||||
await this.sidebarProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
|
||||
}
|
||||
|
||||
public async isTaskInHistory(taskId: string): Promise<boolean> {
|
||||
try {
|
||||
await this.provider.getTaskWithId(taskId)
|
||||
await this.sidebarProvider.getTaskWithId(taskId)
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -27,6 +27,20 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
|
|||
newTab?: boolean
|
||||
}): Promise<string>
|
||||
|
||||
/**
|
||||
* Resumes a task with the given ID.
|
||||
* @param taskId The ID of the task to resume.
|
||||
* @throws Error if the task is not found in the task history.
|
||||
*/
|
||||
resumeTask(taskId: string): Promise<void>
|
||||
|
||||
/**
|
||||
* Checks if a task with the given ID is in the task history.
|
||||
* @param taskId The ID of the task to check.
|
||||
* @returns True if the task is in the task history, false otherwise.
|
||||
*/
|
||||
isTaskInHistory(taskId: string): Promise<boolean>
|
||||
|
||||
/**
|
||||
* Returns the current task stack.
|
||||
* @returns An array of task IDs.
|
||||
|
|
|
|||
2
src/exports/roo-code.d.ts
vendored
2
src/exports/roo-code.d.ts
vendored
|
|
@ -557,14 +557,12 @@ interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
|
|||
* @throws Error if the task is not found in the task history.
|
||||
*/
|
||||
resumeTask(taskId: string): Promise<void>
|
||||
|
||||
/**
|
||||
* Checks if a task with the given ID is in the task history.
|
||||
* @param taskId The ID of the task to check.
|
||||
* @returns True if the task is in the task history, false otherwise.
|
||||
*/
|
||||
isTaskInHistory(taskId: string): Promise<boolean>
|
||||
|
||||
/**
|
||||
* Returns the current task stack.
|
||||
* @returns An array of task IDs.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue