From 3b5b34012f02de2e1fbfe78b9159dfc524a1ee25 Mon Sep 17 00:00:00 2001 From: Wojciech Kordalski Date: Sat, 15 Mar 2025 12:05:55 +0100 Subject: [PATCH 1/2] Expose task IDs on the Cline stack --- src/core/webview/ClineProvider.ts | 4 ++++ src/exports/api.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 87f33dc418..67bb03d585 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -169,6 +169,10 @@ export class ClineProvider implements vscode.WebviewViewProvider { return this.clineStack.length } + public getCurrentTaskStack(): string[] { + return this.clineStack.map((cline) => cline.taskId) + } + // remove the current task/cline instance (at the top of the stack), ao this task is finished // and resume the previous task/cline instance (if it exists) // this is used when a sub task is finished and the parent task needs to be resumed diff --git a/src/exports/api.ts b/src/exports/api.ts index 91817fcc58..9590f9cbf8 100644 --- a/src/exports/api.ts +++ b/src/exports/api.ts @@ -79,4 +79,8 @@ export class API extends EventEmitter implements RooCodeAPI { public getMessages(taskId: string) { return this.history.getMessages(taskId) } + + public getCurrentTaskStack(): string[] { + return this.provider.getCurrentTaskStack() + } } From c4559b7d0f1c8020cad7f0ae6416e16a2f98b40a Mon Sep 17 00:00:00 2001 From: Wojciech Kordalski Date: Sat, 15 Mar 2025 13:17:50 +0100 Subject: [PATCH 2/2] Add the `getCurrentTaskStack` method to public API interface --- src/exports/roo-code.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 1c45dec84b..6128e4a7c4 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -62,6 +62,12 @@ export interface RooCodeAPI extends EventEmitter { * @returns An array of ClineMessage objects. */ getMessages(taskId: string): ClineMessage[] + + /** + * Returns the current task stack. + * @returns An array of task IDs. + */ + getCurrentTaskStack(): string[] } export type ClineAsk =