File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ export const taskPropertiesSchema = z.object({
8989 modelId : z . string ( ) . optional ( ) ,
9090 diffStrategy : z . string ( ) . optional ( ) ,
9191 isSubtask : z . boolean ( ) . optional ( ) ,
92+ todos : z
93+ . object ( {
94+ total : z . number ( ) ,
95+ completed : z . number ( ) ,
96+ inProgress : z . number ( ) ,
97+ pending : z . number ( ) ,
98+ } )
99+ . optional ( ) ,
92100} )
93101
94102export const gitPropertiesSchema = z . object ( {
Original file line number Diff line number Diff line change @@ -1853,6 +1853,19 @@ export class ClineProvider
18531853 // Get git repository information
18541854 const gitInfo = await getWorkspaceGitInfo ( )
18551855
1856+ // Calculate todo list statistics
1857+ const todoList = task ?. todoList
1858+ let todos : { total : number ; completed : number ; inProgress : number ; pending : number } | undefined
1859+
1860+ if ( todoList && todoList . length > 0 ) {
1861+ todos = {
1862+ total : todoList . length ,
1863+ completed : todoList . filter ( ( todo ) => todo . status === "completed" ) . length ,
1864+ inProgress : todoList . filter ( ( todo ) => todo . status === "in_progress" ) . length ,
1865+ pending : todoList . filter ( ( todo ) => todo . status === "pending" ) . length ,
1866+ }
1867+ }
1868+
18561869 // Return all properties including git info - clients will filter as needed
18571870 return {
18581871 appName : packageJSON ?. name ?? Package . name ,
@@ -1867,6 +1880,7 @@ export class ClineProvider
18671880 diffStrategy : task ?. diffStrategy ?. getName ( ) ,
18681881 isSubtask : task ? ! ! task . parentTask : undefined ,
18691882 cloudIsAuthenticated,
1883+ ...( todos && { todos } ) ,
18701884 ...gitInfo ,
18711885 }
18721886 }
You can’t perform that action at this time.
0 commit comments