From 0e4be83c356382bc39594f2e48199be5ab2e54f4 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 7 Apr 2025 11:41:08 -0400 Subject: [PATCH] Fixes to resumeTask and isTaskInHistory (#2380) --- src/exports/api.ts | 8 ++++---- src/exports/interface.ts | 14 ++++++++++++++ src/exports/roo-code.d.ts | 2 -- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/exports/api.ts b/src/exports/api.ts index 19f1784676..42b4b1d4bf 100644 --- a/src/exports/api.ts +++ b/src/exports/api.ts @@ -133,14 +133,14 @@ export class API extends EventEmitter implements RooCodeAPI { } public async resumeTask(taskId: string): Promise { - 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 { try { - await this.provider.getTaskWithId(taskId) + await this.sidebarProvider.getTaskWithId(taskId) return true } catch { return false diff --git a/src/exports/interface.ts b/src/exports/interface.ts index f30cc3a09e..a0ef46a226 100644 --- a/src/exports/interface.ts +++ b/src/exports/interface.ts @@ -27,6 +27,20 @@ export interface RooCodeAPI extends EventEmitter { newTab?: boolean }): Promise + /** + * 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 + + /** + * 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 + /** * Returns the current task stack. * @returns An array of task IDs. diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 06304dbda4..087edc37c7 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -557,14 +557,12 @@ interface RooCodeAPI extends EventEmitter { * @throws Error if the task is not found in the task history. */ resumeTask(taskId: string): Promise - /** * 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 - /** * Returns the current task stack. * @returns An array of task IDs.