@@ -4,10 +4,9 @@ import { formatResponse } from "../prompts/responses"
44
55import cloneDeep from "clone-deep"
66import crypto from "crypto"
7- import { TodoItem , TodoStatus } from "@roo-code/types"
7+ import { TodoItem , TodoStatus , todoStatusSchema } from "@roo-code/types"
88import { getLatestTodo } from "../../shared/todo"
99
10- const VALID_STATUS : string [ ] = [ "pending" , "in_progress" , "completed" , "todo" , "doing" , "done" ]
1110let approvedTodoList : TodoItem [ ] | undefined = undefined
1211
1312/**
@@ -96,8 +95,8 @@ function todoListToMarkdown(todos: TodoItem[]): string {
9695}
9796
9897function normalizeStatus ( status : string | undefined ) : TodoStatus {
99- if ( status === "completed" || status === "done" ) return "completed"
100- if ( status === "in_progress" || status === "doing" || status === "working" ) return "in_progress"
98+ if ( status === "completed" ) return "completed"
99+ if ( status === "in_progress" ) return "in_progress"
101100 return "pending"
102101}
103102
@@ -138,7 +137,7 @@ function validateTodos(todos: any[]): { valid: boolean; error?: string } {
138137 if ( ! t . id || typeof t . id !== "string" ) return { valid : false , error : `Item ${ i + 1 } is missing id` }
139138 if ( ! t . content || typeof t . content !== "string" )
140139 return { valid : false , error : `Item ${ i + 1 } is missing content` }
141- if ( t . status && ! VALID_STATUS . includes ( t . status ) )
140+ if ( t . status && ! todoStatusSchema . options . includes ( t . status as TodoStatus ) )
142141 return { valid : false , error : `Item ${ i + 1 } has invalid status` }
143142 }
144143 return { valid : true }
@@ -152,7 +151,7 @@ function validateTodos(todos: any[]): { valid: boolean; error?: string } {
152151 * @param handleError HandleError function
153152 * @param pushToolResult PushToolResult function
154153 * @param removeClosingTag RemoveClosingTag function
155- * @param userEdited If true, only show "User Edit Succee " and do nothing else
154+ * @param userEdited If true, only show "User Edit Succeeded " and do nothing else
156155 */
157156export async function updateTodoListTool (
158157 cline : Task ,
@@ -163,7 +162,7 @@ export async function updateTodoListTool(
163162 removeClosingTag : RemoveClosingTag ,
164163 userEdited ?: boolean ,
165164) {
166- // If userEdited is true, only show "User Edit Succee " and do nothing else
165+ // If userEdited is true, only show "User Edit Succeeded " and do nothing else
167166 if ( userEdited === true ) {
168167 pushToolResult ( "User Edit Succeeded" )
169168 return
0 commit comments