@@ -22,9 +22,9 @@ import {
2222 askDecompositionConfirmation ,
2323 askStatusSelection ,
2424 askDisplayOptions ,
25- askTaskIdInput ,
25+ askHierarchicalTaskId ,
2626 askTaskPrompt ,
27- askSubtaskParentId ,
27+ askTaskId ,
2828 askNumSubtasks ,
2929 askSubtaskManualParams ,
3030 askBackupSlot ,
@@ -74,7 +74,6 @@ export async function tmaiGenAsync() {
7474
7575 if ( choice . tmaiGenDecMenu === "tmai-parse" ) {
7676 const tasksJsonPath = path . join ( ".taskmaster" , "tasks" , "tasks.json" ) ;
77-
7877 if ( await existsAsync ( tasksJsonPath ) ) {
7978 const overwrite = await askOverwriteConfirmation ( ) ;
8079 if ( ! overwrite ) {
@@ -126,7 +125,7 @@ export async function tmaiManageAsync() {
126125 console . log (
127126 await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
128127 ) ;
129- const taskId = await askTaskIdInput ( ) ;
128+ const taskId = await askHierarchicalTaskId ( ) ;
130129 await tmai . showAsync ( taskId ) ;
131130 } else if ( tmaiListNavMenu === "tmai-next" ) {
132131 await tmai . nextAsync ( ) ;
@@ -163,7 +162,7 @@ export async function tmaiManageAsync() {
163162 console . log (
164163 await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
165164 ) ;
166- const parentId = await askSubtaskParentId ( tasks . master . tasks . length ) ;
165+ const parentId = await askTaskId ( tasks . master . tasks . length ) ;
167166 const numTasksToGenerate = await askNumSubtasks ( ) ;
168167 const research = await askAdvancedResearchConfirmation ( ) ;
169168 await tmai . addSubtasksByAIAsync (
@@ -177,7 +176,7 @@ export async function tmaiManageAsync() {
177176 console . log (
178177 await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
179178 ) ;
180- const parentId = await askSubtaskParentId ( tasks . master . tasks . length ) ;
179+ const parentId = await askTaskId ( tasks . master . tasks . length ) ;
181180 const { title, description } = await askSubtaskManualParams ( ) ;
182181 await tmai . addSubtaskManuallyAsync ( parentId , title , description ) ;
183182 break ;
@@ -189,8 +188,65 @@ export async function tmaiManageAsync() {
189188 const { tmaiUpdateTasksMenu } = await inquirer . prompt (
190189 tmaiUpdateTasksMenu_prompt ,
191190 ) ;
192- if ( tmaiUpdateTasksMenu === "tmai-updatetasks" ) {
193- console . log ( "Executing task update..." ) ;
191+ const tag = await askTaskTag ( ) ;
192+
193+ switch ( tmaiUpdateTasksMenu ) {
194+ case "tmai-updatetaskai" : {
195+ console . log (
196+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , false ) ,
197+ ) ;
198+ const parentId = await askTaskId ( tasks . master . tasks . length ) ;
199+ const prompt = await askTaskPrompt ( ) ;
200+ const research = await askAdvancedResearchConfirmation ( ) ;
201+ await tmai . updateTaskByAIAsync ( parentId , prompt , research , tag ) ;
202+ console . log (
203+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , false ) ,
204+ ) ;
205+ break ;
206+ }
207+ case "tmai-updatemultipletasksai" : {
208+ console . log (
209+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , false ) ,
210+ ) ;
211+ const startingId = await askTaskId ( tasks . master . tasks . length ) ;
212+ const prompt = await askTaskPrompt ( ) ;
213+ const research = await askAdvancedResearchConfirmation ( ) ;
214+ await tmai . updateMultipleTasksByAIAsync (
215+ startingId ,
216+ prompt ,
217+ research ,
218+ tag ,
219+ ) ;
220+ console . log (
221+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
222+ ) ;
223+ break ;
224+ }
225+ case "tmai-updatesubtaskai" : {
226+ console . log (
227+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
228+ ) ;
229+ const subtaskId = await askHierarchicalTaskId ( ) ;
230+ const prompt = await askTaskPrompt ( ) ;
231+ const research = await askAdvancedResearchConfirmation ( ) ;
232+ await tmai . updateSubtaskByAIAsync ( subtaskId , prompt , research , tag ) ;
233+ console . log (
234+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
235+ ) ;
236+ break ;
237+ }
238+ case "tmai-converttasktosubtask" : {
239+ console . log (
240+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , false ) ,
241+ ) ;
242+ const subtaskId = await askTaskId ( tasks . master . tasks . length ) ;
243+ const parentId = await askTaskId ( tasks . master . tasks . length ) ;
244+ await tmai . convertTaskToSubtaskAsync ( subtaskId , parentId ) ;
245+ console . log (
246+ await tmai . listQuickAsync ( tasks , TASKS_STATUSES . join ( "," ) , true ) ,
247+ ) ;
248+ break ;
249+ }
194250 }
195251 break ;
196252 }
0 commit comments