@@ -81,32 +81,40 @@ export type TaskExecutionEvents =
8181 'taskExecution.status.changed' |
8282 'taskExecution.finished' ;
8383
84- export type TaskExecutionResult =
85- // Success case - no reason needed
86- | {
87- success : true ;
88- variables : ElementOutputVariables ;
89- }
90- // Failure cases - always have reason
91- | {
92- success : false ;
93- reason : typeof TASK_EXECUTION_REASON . INCIDENT ;
94- incident : any ;
95- variables ?: ElementOutputVariables ;
96- }
97- | {
98- success : false ;
99- reason : typeof TASK_EXECUTION_REASON . USER_CANCEL ;
100- }
101- | {
102- success : false ;
103- reason : typeof TASK_EXECUTION_REASON . USER_SELECTION_CHANGED ;
104- }
105- | {
106- success : false ;
107- reason : typeof TASK_EXECUTION_REASON . ERROR ;
108- error : TaskExecutionError ;
109- } ;
84+ export type TaskExecutionSuccessResult = {
85+ success : true ;
86+ variables : ElementOutputVariables ;
87+ } ;
88+
89+ export type TaskExecutionIncidentResult = {
90+ success : false ;
91+ reason : typeof TASK_EXECUTION_REASON . INCIDENT ;
92+ incident : any ;
93+ variables ?: ElementOutputVariables ;
94+ } ;
95+
96+ export type TaskExecutionUserCancelResult = {
97+ success : false ;
98+ reason : typeof TASK_EXECUTION_REASON . USER_CANCEL ;
99+ } ;
100+
101+ export type TaskExecutionUserSelectionChangedResult = {
102+ success : false ;
103+ reason : typeof TASK_EXECUTION_REASON . USER_SELECTION_CHANGED ;
104+ } ;
105+
106+ export type TaskExecutionErrorResult = {
107+ success : false ;
108+ reason : typeof TASK_EXECUTION_REASON . ERROR ;
109+ error : TaskExecutionError ;
110+ } ;
111+
112+ export type TaskExecutionResult =
113+ | TaskExecutionSuccessResult
114+ | TaskExecutionIncidentResult
115+ | TaskExecutionUserCancelResult
116+ | TaskExecutionUserSelectionChangedResult
117+ | TaskExecutionErrorResult ;
110118
111119export type TaskExecutionError = {
112120 message : string ;
0 commit comments