File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,21 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
132132 return taskId
133133 }
134134
135+ public async resumeTask ( taskId : string ) : Promise < void > {
136+ const { historyItem } = await this . provider . getTaskWithId ( taskId )
137+ await this . provider . initClineWithHistoryItem ( historyItem )
138+ await this . provider . postMessageToWebview ( { type : "action" , action : "chatButtonClicked" } )
139+ }
140+
141+ public async isTaskInHistory ( taskId : string ) : Promise < boolean > {
142+ try {
143+ await this . provider . getTaskWithId ( taskId )
144+ return true
145+ } catch {
146+ return false
147+ }
148+ }
149+
135150 public getCurrentTaskStack ( ) {
136151 return this . sidebarProvider . getCurrentTaskStack ( )
137152 }
Original file line number Diff line number Diff line change @@ -551,6 +551,20 @@ interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
551551 images ?: string [ ]
552552 newTab ?: boolean
553553 } ) : Promise < string >
554+ /**
555+ * Resumes a task with the given ID.
556+ * @param taskId The ID of the task to resume.
557+ * @throws Error if the task is not found in the task history.
558+ */
559+ resumeTask ( taskId : string ) : Promise < void >
560+
561+ /**
562+ * Checks if a task with the given ID is in the task history.
563+ * @param taskId The ID of the task to check.
564+ * @returns True if the task is in the task history, false otherwise.
565+ */
566+ isTaskInHistory ( taskId : string ) : Promise < boolean >
567+
554568 /**
555569 * Returns the current task stack.
556570 * @returns An array of task IDs.
You can’t perform that action at this time.
0 commit comments