Skip to content

Commit 5cd084d

Browse files
authored
Merge pull request #1669 from franekp/public-api-current-task-ids
feat(RooCodeAPI): add getCurrentTaskStack() returning stack of task IDs
2 parents 19dbf3e + c4559b7 commit 5cd084d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
169169
return this.clineStack.length
170170
}
171171

172+
public getCurrentTaskStack(): string[] {
173+
return this.clineStack.map((cline) => cline.taskId)
174+
}
175+
172176
// remove the current task/cline instance (at the top of the stack), ao this task is finished
173177
// and resume the previous task/cline instance (if it exists)
174178
// this is used when a sub task is finished and the parent task needs to be resumed

src/exports/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,8 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
8080
public getMessages(taskId: string) {
8181
return this.history.getMessages(taskId)
8282
}
83+
84+
public getCurrentTaskStack(): string[] {
85+
return this.provider.getCurrentTaskStack()
86+
}
8387
}

src/exports/roo-code.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
6262
* @returns An array of ClineMessage objects.
6363
*/
6464
getMessages(taskId: string): ClineMessage[]
65+
66+
/**
67+
* Returns the current task stack.
68+
* @returns An array of task IDs.
69+
*/
70+
getCurrentTaskStack(): string[]
6571
}
6672

6773
export type ClineAsk =

0 commit comments

Comments
 (0)