You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/core/Cline.ts
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,12 @@ export class Cline {
92
92
privateisSubTask: boolean=false
93
93
// a flag that indicated if this Cline instance is paused (waiting for provider to resume it after subtask completion)
94
94
privateisPaused: boolean=false
95
+
// this is the parent task work mode when it launched the subtask to be used when it is restored (so the last used mode by parent task will also be restored)
95
96
privatepausedModeSlug: string=defaultModeSlug
97
+
// if this is a subtask then this member holds a pointer to the parent task that launched it
98
+
privateparentTask: Cline|undefined=undefined
99
+
// if this is a subtask then this member holds a pointer to the top parent task that launched it
100
+
privaterootTask: Cline|undefined=undefined
96
101
readonlyapiConfiguration: ApiConfiguration
97
102
api: ApiHandler
98
103
privateterminalManager: TerminalManager
@@ -218,6 +223,30 @@ export class Cline {
218
223
returnthis.taskNumber
219
224
}
220
225
226
+
// this method returns the cline instance that is the parent task that launched this subtask (assuming this cline is a subtask)
227
+
// if undefined is returned, then there is no parent task and this is not a subtask or connection has been severed
228
+
getParentTask(): Cline|undefined{
229
+
returnthis.parentTask
230
+
}
231
+
232
+
// this method sets a cline instance that is the parent task that called this task (assuming this cline is a subtask)
233
+
// if undefined is set, then the connection is broken and the parent is no longer saved in the subtask member
234
+
setParentTask(parentToSet: Cline|undefined){
235
+
this.parentTask=parentToSet
236
+
}
237
+
238
+
// this method returns the cline instance that is the root task (top most parent) that eventually launched this subtask (assuming this cline is a subtask)
239
+
// if undefined is returned, then there is no root task and this is not a subtask or connection has been severed
240
+
getRootTask(): Cline|undefined{
241
+
returnthis.rootTask
242
+
}
243
+
244
+
// this method sets a cline instance that is the root task (top most patrnt) that called this task (assuming this cline is a subtask)
245
+
// if undefined is set, then the connection is broken and the root is no longer saved in the subtask member
0 commit comments