evo360-types 1.3.408 → 1.3.411

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,14 @@ export declare const zAutomationCronTriggerSchema: z.ZodObject<{
24
24
  timezone?: string | undefined;
25
25
  };
26
26
  }>;
27
- export declare const zAutomationTriggerSchema: z.ZodObject<{
27
+ export declare const zAutomationWebhookTriggerSchema: z.ZodObject<{
28
+ type: z.ZodLiteral<"webhook">;
29
+ }, "strip", z.ZodTypeAny, {
30
+ type: "webhook";
31
+ }, {
32
+ type: "webhook";
33
+ }>;
34
+ export declare const zAutomationTriggerSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
28
35
  type: z.ZodLiteral<"cron">;
29
36
  cron: z.ZodObject<{
30
37
  expression: z.ZodString;
@@ -48,7 +55,13 @@ export declare const zAutomationTriggerSchema: z.ZodObject<{
48
55
  expression: string;
49
56
  timezone?: string | undefined;
50
57
  };
51
- }>;
58
+ }>, z.ZodObject<{
59
+ type: z.ZodLiteral<"webhook">;
60
+ }, "strip", z.ZodTypeAny, {
61
+ type: "webhook";
62
+ }, {
63
+ type: "webhook";
64
+ }>]>;
52
65
  export declare const zAutomationDateOffsetModeSchema: z.ZodEnum<["calendar", "business"]>;
53
66
  export declare const zAutomationDateWindowSchema: z.ZodObject<{
54
67
  offset_days: z.ZodNumber;
@@ -77,6 +90,11 @@ export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
77
90
  status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
78
91
  status_base_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
79
92
  appointment_type_not_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
93
+ professional_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
94
+ procedure_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
95
+ insurance_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
+ address_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ payment_status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
98
  }, "strip", z.ZodTypeAny, {
81
99
  date_window: {
82
100
  offset_days: number;
@@ -86,6 +104,11 @@ export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
86
104
  status_in?: string[] | undefined;
87
105
  status_base_in?: string[] | undefined;
88
106
  appointment_type_not_in?: string[] | undefined;
107
+ professional_names?: string[] | undefined;
108
+ procedure_names?: string[] | undefined;
109
+ insurance_names?: string[] | undefined;
110
+ address_names?: string[] | undefined;
111
+ payment_status_in?: string[] | undefined;
89
112
  }, {
90
113
  date_window: {
91
114
  offset_days: number;
@@ -95,6 +118,11 @@ export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
95
118
  status_in?: string[] | undefined;
96
119
  status_base_in?: string[] | undefined;
97
120
  appointment_type_not_in?: string[] | undefined;
121
+ professional_names?: string[] | undefined;
122
+ procedure_names?: string[] | undefined;
123
+ insurance_names?: string[] | undefined;
124
+ address_names?: string[] | undefined;
125
+ payment_status_in?: string[] | undefined;
98
126
  }>;
99
127
  }, "strip", z.ZodTypeAny, {
100
128
  appointment: {
@@ -106,6 +134,11 @@ export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
106
134
  status_in?: string[] | undefined;
107
135
  status_base_in?: string[] | undefined;
108
136
  appointment_type_not_in?: string[] | undefined;
137
+ professional_names?: string[] | undefined;
138
+ procedure_names?: string[] | undefined;
139
+ insurance_names?: string[] | undefined;
140
+ address_names?: string[] | undefined;
141
+ payment_status_in?: string[] | undefined;
109
142
  };
110
143
  target: "appointment";
111
144
  }, {
@@ -118,6 +151,11 @@ export declare const zAutomationAppointmentSelectionSchema: z.ZodObject<{
118
151
  status_in?: string[] | undefined;
119
152
  status_base_in?: string[] | undefined;
120
153
  appointment_type_not_in?: string[] | undefined;
154
+ professional_names?: string[] | undefined;
155
+ procedure_names?: string[] | undefined;
156
+ insurance_names?: string[] | undefined;
157
+ address_names?: string[] | undefined;
158
+ payment_status_in?: string[] | undefined;
121
159
  };
122
160
  target: "appointment";
123
161
  }>;
@@ -138,6 +176,11 @@ export declare const zAutomationSelectionSchema: z.ZodObject<{
138
176
  status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
139
177
  status_base_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
140
178
  appointment_type_not_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
179
+ professional_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
180
+ procedure_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
181
+ insurance_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
182
+ address_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
183
+ payment_status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
141
184
  }, "strip", z.ZodTypeAny, {
142
185
  date_window: {
143
186
  offset_days: number;
@@ -147,6 +190,11 @@ export declare const zAutomationSelectionSchema: z.ZodObject<{
147
190
  status_in?: string[] | undefined;
148
191
  status_base_in?: string[] | undefined;
149
192
  appointment_type_not_in?: string[] | undefined;
193
+ professional_names?: string[] | undefined;
194
+ procedure_names?: string[] | undefined;
195
+ insurance_names?: string[] | undefined;
196
+ address_names?: string[] | undefined;
197
+ payment_status_in?: string[] | undefined;
150
198
  }, {
151
199
  date_window: {
152
200
  offset_days: number;
@@ -156,6 +204,11 @@ export declare const zAutomationSelectionSchema: z.ZodObject<{
156
204
  status_in?: string[] | undefined;
157
205
  status_base_in?: string[] | undefined;
158
206
  appointment_type_not_in?: string[] | undefined;
207
+ professional_names?: string[] | undefined;
208
+ procedure_names?: string[] | undefined;
209
+ insurance_names?: string[] | undefined;
210
+ address_names?: string[] | undefined;
211
+ payment_status_in?: string[] | undefined;
159
212
  }>;
160
213
  }, "strip", z.ZodTypeAny, {
161
214
  appointment: {
@@ -167,6 +220,11 @@ export declare const zAutomationSelectionSchema: z.ZodObject<{
167
220
  status_in?: string[] | undefined;
168
221
  status_base_in?: string[] | undefined;
169
222
  appointment_type_not_in?: string[] | undefined;
223
+ professional_names?: string[] | undefined;
224
+ procedure_names?: string[] | undefined;
225
+ insurance_names?: string[] | undefined;
226
+ address_names?: string[] | undefined;
227
+ payment_status_in?: string[] | undefined;
170
228
  };
171
229
  target: "appointment";
172
230
  }, {
@@ -179,6 +237,11 @@ export declare const zAutomationSelectionSchema: z.ZodObject<{
179
237
  status_in?: string[] | undefined;
180
238
  status_base_in?: string[] | undefined;
181
239
  appointment_type_not_in?: string[] | undefined;
240
+ professional_names?: string[] | undefined;
241
+ procedure_names?: string[] | undefined;
242
+ insurance_names?: string[] | undefined;
243
+ address_names?: string[] | undefined;
244
+ payment_status_in?: string[] | undefined;
182
245
  };
183
246
  target: "appointment";
184
247
  }>;
@@ -219,6 +282,15 @@ export declare const zAutomationExecuteAtSchema: z.ZodDiscriminatedUnion<"rule",
219
282
  base: "target_date" | "run_date";
220
283
  time: string;
221
284
  rule: "send_at_local";
285
+ }>, z.ZodObject<{
286
+ rule: z.ZodLiteral<"relative_to_appointment">;
287
+ offset_minutes: z.ZodNumber;
288
+ }, "strip", z.ZodTypeAny, {
289
+ rule: "relative_to_appointment";
290
+ offset_minutes: number;
291
+ }, {
292
+ rule: "relative_to_appointment";
293
+ offset_minutes: number;
222
294
  }>]>;
223
295
  export declare const zAutomationAutoTaskOutputSchema: z.ZodObject<{
224
296
  type: z.ZodLiteral<"auto_task">;
@@ -243,6 +315,15 @@ export declare const zAutomationAutoTaskOutputSchema: z.ZodObject<{
243
315
  base: "target_date" | "run_date";
244
316
  time: string;
245
317
  rule: "send_at_local";
318
+ }>, z.ZodObject<{
319
+ rule: z.ZodLiteral<"relative_to_appointment">;
320
+ offset_minutes: z.ZodNumber;
321
+ }, "strip", z.ZodTypeAny, {
322
+ rule: "relative_to_appointment";
323
+ offset_minutes: number;
324
+ }, {
325
+ rule: "relative_to_appointment";
326
+ offset_minutes: number;
246
327
  }>]>;
247
328
  retry: z.ZodOptional<z.ZodObject<{
248
329
  max_attempts: z.ZodNumber;
@@ -531,6 +612,9 @@ export declare const zAutomationAutoTaskOutputSchema: z.ZodObject<{
531
612
  base: "target_date" | "run_date";
532
613
  time: string;
533
614
  rule: "send_at_local";
615
+ } | {
616
+ rule: "relative_to_appointment";
617
+ offset_minutes: number;
534
618
  };
535
619
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
536
620
  payload: Record<string, unknown>;
@@ -637,6 +721,9 @@ export declare const zAutomationAutoTaskOutputSchema: z.ZodObject<{
637
721
  base: "target_date" | "run_date";
638
722
  time: string;
639
723
  rule: "send_at_local";
724
+ } | {
725
+ rule: "relative_to_appointment";
726
+ offset_minutes: number;
640
727
  };
641
728
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
642
729
  payload?: Record<string, unknown> | undefined;
@@ -774,6 +861,15 @@ export declare const zAutomationOutputSchema: z.ZodDiscriminatedUnion<"type", [z
774
861
  base: "target_date" | "run_date";
775
862
  time: string;
776
863
  rule: "send_at_local";
864
+ }>, z.ZodObject<{
865
+ rule: z.ZodLiteral<"relative_to_appointment">;
866
+ offset_minutes: z.ZodNumber;
867
+ }, "strip", z.ZodTypeAny, {
868
+ rule: "relative_to_appointment";
869
+ offset_minutes: number;
870
+ }, {
871
+ rule: "relative_to_appointment";
872
+ offset_minutes: number;
777
873
  }>]>;
778
874
  retry: z.ZodOptional<z.ZodObject<{
779
875
  max_attempts: z.ZodNumber;
@@ -1062,6 +1158,9 @@ export declare const zAutomationOutputSchema: z.ZodDiscriminatedUnion<"type", [z
1062
1158
  base: "target_date" | "run_date";
1063
1159
  time: string;
1064
1160
  rule: "send_at_local";
1161
+ } | {
1162
+ rule: "relative_to_appointment";
1163
+ offset_minutes: number;
1065
1164
  };
1066
1165
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1067
1166
  payload: Record<string, unknown>;
@@ -1168,6 +1267,9 @@ export declare const zAutomationOutputSchema: z.ZodDiscriminatedUnion<"type", [z
1168
1267
  base: "target_date" | "run_date";
1169
1268
  time: string;
1170
1269
  rule: "send_at_local";
1270
+ } | {
1271
+ rule: "relative_to_appointment";
1272
+ offset_minutes: number;
1171
1273
  };
1172
1274
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1173
1275
  payload?: Record<string, unknown> | undefined;
@@ -1309,6 +1411,15 @@ export declare const zAutomationBranchSchema: z.ZodObject<{
1309
1411
  base: "target_date" | "run_date";
1310
1412
  time: string;
1311
1413
  rule: "send_at_local";
1414
+ }>, z.ZodObject<{
1415
+ rule: z.ZodLiteral<"relative_to_appointment">;
1416
+ offset_minutes: z.ZodNumber;
1417
+ }, "strip", z.ZodTypeAny, {
1418
+ rule: "relative_to_appointment";
1419
+ offset_minutes: number;
1420
+ }, {
1421
+ rule: "relative_to_appointment";
1422
+ offset_minutes: number;
1312
1423
  }>]>;
1313
1424
  retry: z.ZodOptional<z.ZodObject<{
1314
1425
  max_attempts: z.ZodNumber;
@@ -1597,6 +1708,9 @@ export declare const zAutomationBranchSchema: z.ZodObject<{
1597
1708
  base: "target_date" | "run_date";
1598
1709
  time: string;
1599
1710
  rule: "send_at_local";
1711
+ } | {
1712
+ rule: "relative_to_appointment";
1713
+ offset_minutes: number;
1600
1714
  };
1601
1715
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1602
1716
  payload: Record<string, unknown>;
@@ -1703,6 +1817,9 @@ export declare const zAutomationBranchSchema: z.ZodObject<{
1703
1817
  base: "target_date" | "run_date";
1704
1818
  time: string;
1705
1819
  rule: "send_at_local";
1820
+ } | {
1821
+ rule: "relative_to_appointment";
1822
+ offset_minutes: number;
1706
1823
  };
1707
1824
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1708
1825
  payload?: Record<string, unknown> | undefined;
@@ -1828,6 +1945,9 @@ export declare const zAutomationBranchSchema: z.ZodObject<{
1828
1945
  base: "target_date" | "run_date";
1829
1946
  time: string;
1830
1947
  rule: "send_at_local";
1948
+ } | {
1949
+ rule: "relative_to_appointment";
1950
+ offset_minutes: number;
1831
1951
  };
1832
1952
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1833
1953
  payload: Record<string, unknown>;
@@ -1945,6 +2065,9 @@ export declare const zAutomationBranchSchema: z.ZodObject<{
1945
2065
  base: "target_date" | "run_date";
1946
2066
  time: string;
1947
2067
  rule: "send_at_local";
2068
+ } | {
2069
+ rule: "relative_to_appointment";
2070
+ offset_minutes: number;
1948
2071
  };
1949
2072
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
1950
2073
  payload?: Record<string, unknown> | undefined;
@@ -2058,7 +2181,7 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2058
2181
  description: z.ZodOptional<z.ZodString>;
2059
2182
  active: z.ZodDefault<z.ZodBoolean>;
2060
2183
  version: z.ZodDefault<z.ZodNumber>;
2061
- trigger: z.ZodObject<{
2184
+ trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2062
2185
  type: z.ZodLiteral<"cron">;
2063
2186
  cron: z.ZodObject<{
2064
2187
  expression: z.ZodString;
@@ -2082,7 +2205,13 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2082
2205
  expression: string;
2083
2206
  timezone?: string | undefined;
2084
2207
  };
2085
- }>;
2208
+ }>, z.ZodObject<{
2209
+ type: z.ZodLiteral<"webhook">;
2210
+ }, "strip", z.ZodTypeAny, {
2211
+ type: "webhook";
2212
+ }, {
2213
+ type: "webhook";
2214
+ }>]>;
2086
2215
  selection: z.ZodObject<{
2087
2216
  target: z.ZodLiteral<"appointment">;
2088
2217
  appointment: z.ZodObject<{
@@ -2100,6 +2229,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2100
2229
  status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2101
2230
  status_base_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2102
2231
  appointment_type_not_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2232
+ professional_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2233
+ procedure_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2234
+ insurance_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2235
+ address_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2236
+ payment_status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2103
2237
  }, "strip", z.ZodTypeAny, {
2104
2238
  date_window: {
2105
2239
  offset_days: number;
@@ -2109,6 +2243,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2109
2243
  status_in?: string[] | undefined;
2110
2244
  status_base_in?: string[] | undefined;
2111
2245
  appointment_type_not_in?: string[] | undefined;
2246
+ professional_names?: string[] | undefined;
2247
+ procedure_names?: string[] | undefined;
2248
+ insurance_names?: string[] | undefined;
2249
+ address_names?: string[] | undefined;
2250
+ payment_status_in?: string[] | undefined;
2112
2251
  }, {
2113
2252
  date_window: {
2114
2253
  offset_days: number;
@@ -2118,6 +2257,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2118
2257
  status_in?: string[] | undefined;
2119
2258
  status_base_in?: string[] | undefined;
2120
2259
  appointment_type_not_in?: string[] | undefined;
2260
+ professional_names?: string[] | undefined;
2261
+ procedure_names?: string[] | undefined;
2262
+ insurance_names?: string[] | undefined;
2263
+ address_names?: string[] | undefined;
2264
+ payment_status_in?: string[] | undefined;
2121
2265
  }>;
2122
2266
  }, "strip", z.ZodTypeAny, {
2123
2267
  appointment: {
@@ -2129,6 +2273,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2129
2273
  status_in?: string[] | undefined;
2130
2274
  status_base_in?: string[] | undefined;
2131
2275
  appointment_type_not_in?: string[] | undefined;
2276
+ professional_names?: string[] | undefined;
2277
+ procedure_names?: string[] | undefined;
2278
+ insurance_names?: string[] | undefined;
2279
+ address_names?: string[] | undefined;
2280
+ payment_status_in?: string[] | undefined;
2132
2281
  };
2133
2282
  target: "appointment";
2134
2283
  }, {
@@ -2141,6 +2290,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2141
2290
  status_in?: string[] | undefined;
2142
2291
  status_base_in?: string[] | undefined;
2143
2292
  appointment_type_not_in?: string[] | undefined;
2293
+ professional_names?: string[] | undefined;
2294
+ procedure_names?: string[] | undefined;
2295
+ insurance_names?: string[] | undefined;
2296
+ address_names?: string[] | undefined;
2297
+ payment_status_in?: string[] | undefined;
2144
2298
  };
2145
2299
  target: "appointment";
2146
2300
  }>;
@@ -2173,6 +2327,15 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2173
2327
  base: "target_date" | "run_date";
2174
2328
  time: string;
2175
2329
  rule: "send_at_local";
2330
+ }>, z.ZodObject<{
2331
+ rule: z.ZodLiteral<"relative_to_appointment">;
2332
+ offset_minutes: z.ZodNumber;
2333
+ }, "strip", z.ZodTypeAny, {
2334
+ rule: "relative_to_appointment";
2335
+ offset_minutes: number;
2336
+ }, {
2337
+ rule: "relative_to_appointment";
2338
+ offset_minutes: number;
2176
2339
  }>]>;
2177
2340
  retry: z.ZodOptional<z.ZodObject<{
2178
2341
  max_attempts: z.ZodNumber;
@@ -2461,6 +2624,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2461
2624
  base: "target_date" | "run_date";
2462
2625
  time: string;
2463
2626
  rule: "send_at_local";
2627
+ } | {
2628
+ rule: "relative_to_appointment";
2629
+ offset_minutes: number;
2464
2630
  };
2465
2631
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
2466
2632
  payload: Record<string, unknown>;
@@ -2567,6 +2733,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2567
2733
  base: "target_date" | "run_date";
2568
2734
  time: string;
2569
2735
  rule: "send_at_local";
2736
+ } | {
2737
+ rule: "relative_to_appointment";
2738
+ offset_minutes: number;
2570
2739
  };
2571
2740
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
2572
2741
  payload?: Record<string, unknown> | undefined;
@@ -2692,6 +2861,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2692
2861
  base: "target_date" | "run_date";
2693
2862
  time: string;
2694
2863
  rule: "send_at_local";
2864
+ } | {
2865
+ rule: "relative_to_appointment";
2866
+ offset_minutes: number;
2695
2867
  };
2696
2868
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
2697
2869
  payload: Record<string, unknown>;
@@ -2809,6 +2981,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2809
2981
  base: "target_date" | "run_date";
2810
2982
  time: string;
2811
2983
  rule: "send_at_local";
2984
+ } | {
2985
+ rule: "relative_to_appointment";
2986
+ offset_minutes: number;
2812
2987
  };
2813
2988
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
2814
2989
  payload?: Record<string, unknown> | undefined;
@@ -2970,6 +3145,8 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2970
3145
  expression: string;
2971
3146
  timezone?: string | undefined;
2972
3147
  };
3148
+ } | {
3149
+ type: "webhook";
2973
3150
  };
2974
3151
  selection: {
2975
3152
  appointment: {
@@ -2981,6 +3158,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2981
3158
  status_in?: string[] | undefined;
2982
3159
  status_base_in?: string[] | undefined;
2983
3160
  appointment_type_not_in?: string[] | undefined;
3161
+ professional_names?: string[] | undefined;
3162
+ procedure_names?: string[] | undefined;
3163
+ insurance_names?: string[] | undefined;
3164
+ address_names?: string[] | undefined;
3165
+ payment_status_in?: string[] | undefined;
2984
3166
  };
2985
3167
  target: "appointment";
2986
3168
  };
@@ -2997,6 +3179,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
2997
3179
  base: "target_date" | "run_date";
2998
3180
  time: string;
2999
3181
  rule: "send_at_local";
3182
+ } | {
3183
+ rule: "relative_to_appointment";
3184
+ offset_minutes: number;
3000
3185
  };
3001
3186
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3002
3187
  payload: Record<string, unknown>;
@@ -3131,6 +3316,8 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
3131
3316
  expression: string;
3132
3317
  timezone?: string | undefined;
3133
3318
  };
3319
+ } | {
3320
+ type: "webhook";
3134
3321
  };
3135
3322
  selection: {
3136
3323
  appointment: {
@@ -3142,6 +3329,11 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
3142
3329
  status_in?: string[] | undefined;
3143
3330
  status_base_in?: string[] | undefined;
3144
3331
  appointment_type_not_in?: string[] | undefined;
3332
+ professional_names?: string[] | undefined;
3333
+ procedure_names?: string[] | undefined;
3334
+ insurance_names?: string[] | undefined;
3335
+ address_names?: string[] | undefined;
3336
+ payment_status_in?: string[] | undefined;
3145
3337
  };
3146
3338
  target: "appointment";
3147
3339
  };
@@ -3158,6 +3350,9 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
3158
3350
  base: "target_date" | "run_date";
3159
3351
  time: string;
3160
3352
  rule: "send_at_local";
3353
+ } | {
3354
+ rule: "relative_to_appointment";
3355
+ offset_minutes: number;
3161
3356
  };
3162
3357
  handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3163
3358
  payload?: Record<string, unknown> | undefined;
@@ -3284,35 +3479,2837 @@ export declare const zAutomationRoutineSchema: z.ZodObject<{
3284
3479
  last_run_id?: string | undefined;
3285
3480
  } | undefined;
3286
3481
  }>;
3287
- export declare const zHubAutomationConfigSchema: z.ZodObject<{
3288
- active: z.ZodDefault<z.ZodBoolean>;
3289
- limits: z.ZodOptional<z.ZodObject<{
3290
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3291
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3292
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3293
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3294
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3295
- }, z.ZodTypeAny, "passthrough">>>;
3296
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3297
- active: z.ZodDefault<z.ZodBoolean>;
3298
- limits: z.ZodOptional<z.ZodObject<{
3299
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3300
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3301
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3302
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3303
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3304
- }, z.ZodTypeAny, "passthrough">>>;
3305
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3482
+ export declare const zAutomationRoutineWriteSchema: z.ZodObject<{
3483
+ id: z.ZodString;
3484
+ name: z.ZodString;
3485
+ description: z.ZodOptional<z.ZodString>;
3306
3486
  active: z.ZodDefault<z.ZodBoolean>;
3307
- limits: z.ZodOptional<z.ZodObject<{
3308
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3309
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3310
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3311
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3312
- max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
3313
- }, z.ZodTypeAny, "passthrough">>>;
3314
- }, z.ZodTypeAny, "passthrough">>;
3315
- export declare const zAutomationDryRunRequestSchema: z.ZodObject<{
3487
+ trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3488
+ type: z.ZodLiteral<"cron">;
3489
+ cron: z.ZodObject<{
3490
+ expression: z.ZodString;
3491
+ timezone: z.ZodOptional<z.ZodString>;
3492
+ }, "strip", z.ZodTypeAny, {
3493
+ expression: string;
3494
+ timezone?: string | undefined;
3495
+ }, {
3496
+ expression: string;
3497
+ timezone?: string | undefined;
3498
+ }>;
3499
+ }, "strip", z.ZodTypeAny, {
3500
+ type: "cron";
3501
+ cron: {
3502
+ expression: string;
3503
+ timezone?: string | undefined;
3504
+ };
3505
+ }, {
3506
+ type: "cron";
3507
+ cron: {
3508
+ expression: string;
3509
+ timezone?: string | undefined;
3510
+ };
3511
+ }>, z.ZodObject<{
3512
+ type: z.ZodLiteral<"webhook">;
3513
+ }, "strip", z.ZodTypeAny, {
3514
+ type: "webhook";
3515
+ }, {
3516
+ type: "webhook";
3517
+ }>]>;
3518
+ selection: z.ZodObject<{
3519
+ target: z.ZodLiteral<"appointment">;
3520
+ appointment: z.ZodObject<{
3521
+ calendar_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3522
+ date_window: z.ZodObject<{
3523
+ offset_days: z.ZodNumber;
3524
+ offset_mode: z.ZodEnum<["calendar", "business"]>;
3525
+ }, "strip", z.ZodTypeAny, {
3526
+ offset_days: number;
3527
+ offset_mode: "calendar" | "business";
3528
+ }, {
3529
+ offset_days: number;
3530
+ offset_mode: "calendar" | "business";
3531
+ }>;
3532
+ status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3533
+ status_base_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3534
+ appointment_type_not_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3535
+ professional_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3536
+ procedure_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3537
+ insurance_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3538
+ address_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3539
+ payment_status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3540
+ }, "strip", z.ZodTypeAny, {
3541
+ date_window: {
3542
+ offset_days: number;
3543
+ offset_mode: "calendar" | "business";
3544
+ };
3545
+ calendar_ids?: string[] | undefined;
3546
+ status_in?: string[] | undefined;
3547
+ status_base_in?: string[] | undefined;
3548
+ appointment_type_not_in?: string[] | undefined;
3549
+ professional_names?: string[] | undefined;
3550
+ procedure_names?: string[] | undefined;
3551
+ insurance_names?: string[] | undefined;
3552
+ address_names?: string[] | undefined;
3553
+ payment_status_in?: string[] | undefined;
3554
+ }, {
3555
+ date_window: {
3556
+ offset_days: number;
3557
+ offset_mode: "calendar" | "business";
3558
+ };
3559
+ calendar_ids?: string[] | undefined;
3560
+ status_in?: string[] | undefined;
3561
+ status_base_in?: string[] | undefined;
3562
+ appointment_type_not_in?: string[] | undefined;
3563
+ professional_names?: string[] | undefined;
3564
+ procedure_names?: string[] | undefined;
3565
+ insurance_names?: string[] | undefined;
3566
+ address_names?: string[] | undefined;
3567
+ payment_status_in?: string[] | undefined;
3568
+ }>;
3569
+ }, "strip", z.ZodTypeAny, {
3570
+ appointment: {
3571
+ date_window: {
3572
+ offset_days: number;
3573
+ offset_mode: "calendar" | "business";
3574
+ };
3575
+ calendar_ids?: string[] | undefined;
3576
+ status_in?: string[] | undefined;
3577
+ status_base_in?: string[] | undefined;
3578
+ appointment_type_not_in?: string[] | undefined;
3579
+ professional_names?: string[] | undefined;
3580
+ procedure_names?: string[] | undefined;
3581
+ insurance_names?: string[] | undefined;
3582
+ address_names?: string[] | undefined;
3583
+ payment_status_in?: string[] | undefined;
3584
+ };
3585
+ target: "appointment";
3586
+ }, {
3587
+ appointment: {
3588
+ date_window: {
3589
+ offset_days: number;
3590
+ offset_mode: "calendar" | "business";
3591
+ };
3592
+ calendar_ids?: string[] | undefined;
3593
+ status_in?: string[] | undefined;
3594
+ status_base_in?: string[] | undefined;
3595
+ appointment_type_not_in?: string[] | undefined;
3596
+ professional_names?: string[] | undefined;
3597
+ procedure_names?: string[] | undefined;
3598
+ insurance_names?: string[] | undefined;
3599
+ address_names?: string[] | undefined;
3600
+ payment_status_in?: string[] | undefined;
3601
+ };
3602
+ target: "appointment";
3603
+ }>;
3604
+ branch_mode: z.ZodEnum<["all", "exclusive"]>;
3605
+ branches: z.ZodArray<z.ZodObject<{
3606
+ id: z.ZodString;
3607
+ name: z.ZodString;
3608
+ when: z.ZodOptional<z.ZodType<ZAutomationConditionGroup, z.ZodTypeDef, ZAutomationConditionGroup>>;
3609
+ is_fallback: z.ZodOptional<z.ZodBoolean>;
3610
+ outputs: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3611
+ type: z.ZodLiteral<"auto_task">;
3612
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
3613
+ kind: z.ZodString;
3614
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3615
+ execute_at: z.ZodDiscriminatedUnion<"rule", [z.ZodObject<{
3616
+ rule: z.ZodLiteral<"immediate">;
3617
+ }, "strip", z.ZodTypeAny, {
3618
+ rule: "immediate";
3619
+ }, {
3620
+ rule: "immediate";
3621
+ }>, z.ZodObject<{
3622
+ rule: z.ZodLiteral<"send_at_local">;
3623
+ time: z.ZodString;
3624
+ base: z.ZodEnum<["target_date", "run_date"]>;
3625
+ }, "strip", z.ZodTypeAny, {
3626
+ base: "target_date" | "run_date";
3627
+ time: string;
3628
+ rule: "send_at_local";
3629
+ }, {
3630
+ base: "target_date" | "run_date";
3631
+ time: string;
3632
+ rule: "send_at_local";
3633
+ }>, z.ZodObject<{
3634
+ rule: z.ZodLiteral<"relative_to_appointment">;
3635
+ offset_minutes: z.ZodNumber;
3636
+ }, "strip", z.ZodTypeAny, {
3637
+ rule: "relative_to_appointment";
3638
+ offset_minutes: number;
3639
+ }, {
3640
+ rule: "relative_to_appointment";
3641
+ offset_minutes: number;
3642
+ }>]>;
3643
+ retry: z.ZodOptional<z.ZodObject<{
3644
+ max_attempts: z.ZodNumber;
3645
+ attempt: z.ZodNumber;
3646
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
3647
+ backoff_seconds: z.ZodNumber;
3648
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
3649
+ last_error: z.ZodOptional<z.ZodObject<{
3650
+ message: z.ZodString;
3651
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
3652
+ at: z.ZodDate;
3653
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3654
+ }, "strip", z.ZodTypeAny, {
3655
+ message: string;
3656
+ at: Date;
3657
+ code?: string | number | undefined;
3658
+ details?: Record<string, unknown> | undefined;
3659
+ }, {
3660
+ message: string;
3661
+ at: Date;
3662
+ code?: string | number | undefined;
3663
+ details?: Record<string, unknown> | undefined;
3664
+ }>>;
3665
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3666
+ max_attempts: z.ZodNumber;
3667
+ attempt: z.ZodNumber;
3668
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
3669
+ backoff_seconds: z.ZodNumber;
3670
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
3671
+ last_error: z.ZodOptional<z.ZodObject<{
3672
+ message: z.ZodString;
3673
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
3674
+ at: z.ZodDate;
3675
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3676
+ }, "strip", z.ZodTypeAny, {
3677
+ message: string;
3678
+ at: Date;
3679
+ code?: string | number | undefined;
3680
+ details?: Record<string, unknown> | undefined;
3681
+ }, {
3682
+ message: string;
3683
+ at: Date;
3684
+ code?: string | number | undefined;
3685
+ details?: Record<string, unknown> | undefined;
3686
+ }>>;
3687
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3688
+ max_attempts: z.ZodNumber;
3689
+ attempt: z.ZodNumber;
3690
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
3691
+ backoff_seconds: z.ZodNumber;
3692
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
3693
+ last_error: z.ZodOptional<z.ZodObject<{
3694
+ message: z.ZodString;
3695
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
3696
+ at: z.ZodDate;
3697
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3698
+ }, "strip", z.ZodTypeAny, {
3699
+ message: string;
3700
+ at: Date;
3701
+ code?: string | number | undefined;
3702
+ details?: Record<string, unknown> | undefined;
3703
+ }, {
3704
+ message: string;
3705
+ at: Date;
3706
+ code?: string | number | undefined;
3707
+ details?: Record<string, unknown> | undefined;
3708
+ }>>;
3709
+ }, z.ZodTypeAny, "passthrough">>>;
3710
+ on_failure: z.ZodOptional<z.ZodObject<{
3711
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
3712
+ name: z.ZodOptional<z.ZodString>;
3713
+ ref: z.ZodOptional<z.ZodAny>;
3714
+ }, "strip", z.ZodTypeAny, {
3715
+ name?: string | undefined;
3716
+ ref?: any;
3717
+ }, {
3718
+ name?: string | undefined;
3719
+ ref?: any;
3720
+ }>>;
3721
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
3722
+ title: z.ZodOptional<z.ZodString>;
3723
+ description: z.ZodOptional<z.ZodString>;
3724
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
3725
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
3726
+ name: z.ZodString;
3727
+ color: z.ZodOptional<z.ZodString>;
3728
+ hidden: z.ZodBoolean;
3729
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3730
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
3731
+ }, "strip", z.ZodTypeAny, {
3732
+ name: string;
3733
+ hidden: boolean;
3734
+ base?: boolean | undefined;
3735
+ color?: string | undefined;
3736
+ category?: string | null | undefined;
3737
+ }, {
3738
+ name: string;
3739
+ hidden: boolean;
3740
+ base?: boolean | undefined;
3741
+ color?: string | undefined;
3742
+ category?: string | null | undefined;
3743
+ }>, "many">>>;
3744
+ }, "strip", z.ZodTypeAny, {
3745
+ description?: string | undefined;
3746
+ tags?: {
3747
+ name: string;
3748
+ hidden: boolean;
3749
+ base?: boolean | undefined;
3750
+ color?: string | undefined;
3751
+ category?: string | null | undefined;
3752
+ }[] | null | undefined;
3753
+ title?: string | undefined;
3754
+ priority?: "low" | "medium" | "high" | undefined;
3755
+ }, {
3756
+ description?: string | undefined;
3757
+ tags?: {
3758
+ name: string;
3759
+ hidden: boolean;
3760
+ base?: boolean | undefined;
3761
+ color?: string | undefined;
3762
+ category?: string | null | undefined;
3763
+ }[] | null | undefined;
3764
+ title?: string | undefined;
3765
+ priority?: "low" | "medium" | "high" | undefined;
3766
+ }>>;
3767
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
3768
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
3769
+ kind: z.ZodString;
3770
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3771
+ }, "strip", z.ZodTypeAny, {
3772
+ kind: string;
3773
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3774
+ payload: Record<string, unknown>;
3775
+ }, {
3776
+ kind: string;
3777
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3778
+ payload: Record<string, unknown>;
3779
+ }>, "many">>;
3780
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3781
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
3782
+ name: z.ZodOptional<z.ZodString>;
3783
+ ref: z.ZodOptional<z.ZodAny>;
3784
+ }, "strip", z.ZodTypeAny, {
3785
+ name?: string | undefined;
3786
+ ref?: any;
3787
+ }, {
3788
+ name?: string | undefined;
3789
+ ref?: any;
3790
+ }>>;
3791
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
3792
+ title: z.ZodOptional<z.ZodString>;
3793
+ description: z.ZodOptional<z.ZodString>;
3794
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
3795
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
3796
+ name: z.ZodString;
3797
+ color: z.ZodOptional<z.ZodString>;
3798
+ hidden: z.ZodBoolean;
3799
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3800
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
3801
+ }, "strip", z.ZodTypeAny, {
3802
+ name: string;
3803
+ hidden: boolean;
3804
+ base?: boolean | undefined;
3805
+ color?: string | undefined;
3806
+ category?: string | null | undefined;
3807
+ }, {
3808
+ name: string;
3809
+ hidden: boolean;
3810
+ base?: boolean | undefined;
3811
+ color?: string | undefined;
3812
+ category?: string | null | undefined;
3813
+ }>, "many">>>;
3814
+ }, "strip", z.ZodTypeAny, {
3815
+ description?: string | undefined;
3816
+ tags?: {
3817
+ name: string;
3818
+ hidden: boolean;
3819
+ base?: boolean | undefined;
3820
+ color?: string | undefined;
3821
+ category?: string | null | undefined;
3822
+ }[] | null | undefined;
3823
+ title?: string | undefined;
3824
+ priority?: "low" | "medium" | "high" | undefined;
3825
+ }, {
3826
+ description?: string | undefined;
3827
+ tags?: {
3828
+ name: string;
3829
+ hidden: boolean;
3830
+ base?: boolean | undefined;
3831
+ color?: string | undefined;
3832
+ category?: string | null | undefined;
3833
+ }[] | null | undefined;
3834
+ title?: string | undefined;
3835
+ priority?: "low" | "medium" | "high" | undefined;
3836
+ }>>;
3837
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
3838
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
3839
+ kind: z.ZodString;
3840
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3841
+ }, "strip", z.ZodTypeAny, {
3842
+ kind: string;
3843
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3844
+ payload: Record<string, unknown>;
3845
+ }, {
3846
+ kind: string;
3847
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3848
+ payload: Record<string, unknown>;
3849
+ }>, "many">>;
3850
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3851
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
3852
+ name: z.ZodOptional<z.ZodString>;
3853
+ ref: z.ZodOptional<z.ZodAny>;
3854
+ }, "strip", z.ZodTypeAny, {
3855
+ name?: string | undefined;
3856
+ ref?: any;
3857
+ }, {
3858
+ name?: string | undefined;
3859
+ ref?: any;
3860
+ }>>;
3861
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
3862
+ title: z.ZodOptional<z.ZodString>;
3863
+ description: z.ZodOptional<z.ZodString>;
3864
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
3865
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
3866
+ name: z.ZodString;
3867
+ color: z.ZodOptional<z.ZodString>;
3868
+ hidden: z.ZodBoolean;
3869
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3870
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
3871
+ }, "strip", z.ZodTypeAny, {
3872
+ name: string;
3873
+ hidden: boolean;
3874
+ base?: boolean | undefined;
3875
+ color?: string | undefined;
3876
+ category?: string | null | undefined;
3877
+ }, {
3878
+ name: string;
3879
+ hidden: boolean;
3880
+ base?: boolean | undefined;
3881
+ color?: string | undefined;
3882
+ category?: string | null | undefined;
3883
+ }>, "many">>>;
3884
+ }, "strip", z.ZodTypeAny, {
3885
+ description?: string | undefined;
3886
+ tags?: {
3887
+ name: string;
3888
+ hidden: boolean;
3889
+ base?: boolean | undefined;
3890
+ color?: string | undefined;
3891
+ category?: string | null | undefined;
3892
+ }[] | null | undefined;
3893
+ title?: string | undefined;
3894
+ priority?: "low" | "medium" | "high" | undefined;
3895
+ }, {
3896
+ description?: string | undefined;
3897
+ tags?: {
3898
+ name: string;
3899
+ hidden: boolean;
3900
+ base?: boolean | undefined;
3901
+ color?: string | undefined;
3902
+ category?: string | null | undefined;
3903
+ }[] | null | undefined;
3904
+ title?: string | undefined;
3905
+ priority?: "low" | "medium" | "high" | undefined;
3906
+ }>>;
3907
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
3908
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
3909
+ kind: z.ZodString;
3910
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3911
+ }, "strip", z.ZodTypeAny, {
3912
+ kind: string;
3913
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3914
+ payload: Record<string, unknown>;
3915
+ }, {
3916
+ kind: string;
3917
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3918
+ payload: Record<string, unknown>;
3919
+ }>, "many">>;
3920
+ }, z.ZodTypeAny, "passthrough">>>;
3921
+ }, "strip", z.ZodTypeAny, {
3922
+ type: "auto_task";
3923
+ kind: string;
3924
+ execute_at: {
3925
+ rule: "immediate";
3926
+ } | {
3927
+ base: "target_date" | "run_date";
3928
+ time: string;
3929
+ rule: "send_at_local";
3930
+ } | {
3931
+ rule: "relative_to_appointment";
3932
+ offset_minutes: number;
3933
+ };
3934
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
3935
+ payload: Record<string, unknown>;
3936
+ retry?: z.objectOutputType<{
3937
+ max_attempts: z.ZodNumber;
3938
+ attempt: z.ZodNumber;
3939
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
3940
+ backoff_seconds: z.ZodNumber;
3941
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
3942
+ last_error: z.ZodOptional<z.ZodObject<{
3943
+ message: z.ZodString;
3944
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
3945
+ at: z.ZodDate;
3946
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3947
+ }, "strip", z.ZodTypeAny, {
3948
+ message: string;
3949
+ at: Date;
3950
+ code?: string | number | undefined;
3951
+ details?: Record<string, unknown> | undefined;
3952
+ }, {
3953
+ message: string;
3954
+ at: Date;
3955
+ code?: string | number | undefined;
3956
+ details?: Record<string, unknown> | undefined;
3957
+ }>>;
3958
+ }, z.ZodTypeAny, "passthrough"> | undefined;
3959
+ on_failure?: z.objectOutputType<{
3960
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
3961
+ name: z.ZodOptional<z.ZodString>;
3962
+ ref: z.ZodOptional<z.ZodAny>;
3963
+ }, "strip", z.ZodTypeAny, {
3964
+ name?: string | undefined;
3965
+ ref?: any;
3966
+ }, {
3967
+ name?: string | undefined;
3968
+ ref?: any;
3969
+ }>>;
3970
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
3971
+ title: z.ZodOptional<z.ZodString>;
3972
+ description: z.ZodOptional<z.ZodString>;
3973
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
3974
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
3975
+ name: z.ZodString;
3976
+ color: z.ZodOptional<z.ZodString>;
3977
+ hidden: z.ZodBoolean;
3978
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3979
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
3980
+ }, "strip", z.ZodTypeAny, {
3981
+ name: string;
3982
+ hidden: boolean;
3983
+ base?: boolean | undefined;
3984
+ color?: string | undefined;
3985
+ category?: string | null | undefined;
3986
+ }, {
3987
+ name: string;
3988
+ hidden: boolean;
3989
+ base?: boolean | undefined;
3990
+ color?: string | undefined;
3991
+ category?: string | null | undefined;
3992
+ }>, "many">>>;
3993
+ }, "strip", z.ZodTypeAny, {
3994
+ description?: string | undefined;
3995
+ tags?: {
3996
+ name: string;
3997
+ hidden: boolean;
3998
+ base?: boolean | undefined;
3999
+ color?: string | undefined;
4000
+ category?: string | null | undefined;
4001
+ }[] | null | undefined;
4002
+ title?: string | undefined;
4003
+ priority?: "low" | "medium" | "high" | undefined;
4004
+ }, {
4005
+ description?: string | undefined;
4006
+ tags?: {
4007
+ name: string;
4008
+ hidden: boolean;
4009
+ base?: boolean | undefined;
4010
+ color?: string | undefined;
4011
+ category?: string | null | undefined;
4012
+ }[] | null | undefined;
4013
+ title?: string | undefined;
4014
+ priority?: "low" | "medium" | "high" | undefined;
4015
+ }>>;
4016
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4017
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4018
+ kind: z.ZodString;
4019
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4020
+ }, "strip", z.ZodTypeAny, {
4021
+ kind: string;
4022
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4023
+ payload: Record<string, unknown>;
4024
+ }, {
4025
+ kind: string;
4026
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4027
+ payload: Record<string, unknown>;
4028
+ }>, "many">>;
4029
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4030
+ }, {
4031
+ type: "auto_task";
4032
+ kind: string;
4033
+ execute_at: {
4034
+ rule: "immediate";
4035
+ } | {
4036
+ base: "target_date" | "run_date";
4037
+ time: string;
4038
+ rule: "send_at_local";
4039
+ } | {
4040
+ rule: "relative_to_appointment";
4041
+ offset_minutes: number;
4042
+ };
4043
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4044
+ payload?: Record<string, unknown> | undefined;
4045
+ retry?: z.objectInputType<{
4046
+ max_attempts: z.ZodNumber;
4047
+ attempt: z.ZodNumber;
4048
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4049
+ backoff_seconds: z.ZodNumber;
4050
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4051
+ last_error: z.ZodOptional<z.ZodObject<{
4052
+ message: z.ZodString;
4053
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4054
+ at: z.ZodDate;
4055
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4056
+ }, "strip", z.ZodTypeAny, {
4057
+ message: string;
4058
+ at: Date;
4059
+ code?: string | number | undefined;
4060
+ details?: Record<string, unknown> | undefined;
4061
+ }, {
4062
+ message: string;
4063
+ at: Date;
4064
+ code?: string | number | undefined;
4065
+ details?: Record<string, unknown> | undefined;
4066
+ }>>;
4067
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4068
+ on_failure?: z.objectInputType<{
4069
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4070
+ name: z.ZodOptional<z.ZodString>;
4071
+ ref: z.ZodOptional<z.ZodAny>;
4072
+ }, "strip", z.ZodTypeAny, {
4073
+ name?: string | undefined;
4074
+ ref?: any;
4075
+ }, {
4076
+ name?: string | undefined;
4077
+ ref?: any;
4078
+ }>>;
4079
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4080
+ title: z.ZodOptional<z.ZodString>;
4081
+ description: z.ZodOptional<z.ZodString>;
4082
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4083
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4084
+ name: z.ZodString;
4085
+ color: z.ZodOptional<z.ZodString>;
4086
+ hidden: z.ZodBoolean;
4087
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4088
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4089
+ }, "strip", z.ZodTypeAny, {
4090
+ name: string;
4091
+ hidden: boolean;
4092
+ base?: boolean | undefined;
4093
+ color?: string | undefined;
4094
+ category?: string | null | undefined;
4095
+ }, {
4096
+ name: string;
4097
+ hidden: boolean;
4098
+ base?: boolean | undefined;
4099
+ color?: string | undefined;
4100
+ category?: string | null | undefined;
4101
+ }>, "many">>>;
4102
+ }, "strip", z.ZodTypeAny, {
4103
+ description?: string | undefined;
4104
+ tags?: {
4105
+ name: string;
4106
+ hidden: boolean;
4107
+ base?: boolean | undefined;
4108
+ color?: string | undefined;
4109
+ category?: string | null | undefined;
4110
+ }[] | null | undefined;
4111
+ title?: string | undefined;
4112
+ priority?: "low" | "medium" | "high" | undefined;
4113
+ }, {
4114
+ description?: string | undefined;
4115
+ tags?: {
4116
+ name: string;
4117
+ hidden: boolean;
4118
+ base?: boolean | undefined;
4119
+ color?: string | undefined;
4120
+ category?: string | null | undefined;
4121
+ }[] | null | undefined;
4122
+ title?: string | undefined;
4123
+ priority?: "low" | "medium" | "high" | undefined;
4124
+ }>>;
4125
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4126
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4127
+ kind: z.ZodString;
4128
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4129
+ }, "strip", z.ZodTypeAny, {
4130
+ kind: string;
4131
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4132
+ payload: Record<string, unknown>;
4133
+ }, {
4134
+ kind: string;
4135
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4136
+ payload: Record<string, unknown>;
4137
+ }>, "many">>;
4138
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4139
+ }>, z.ZodObject<{
4140
+ type: z.ZodLiteral<"human_task">;
4141
+ title: z.ZodString;
4142
+ description: z.ZodOptional<z.ZodString>;
4143
+ assignee_ref: z.ZodOptional<z.ZodString>;
4144
+ }, "strip", z.ZodTypeAny, {
4145
+ type: "human_task";
4146
+ title: string;
4147
+ description?: string | undefined;
4148
+ assignee_ref?: string | undefined;
4149
+ }, {
4150
+ type: "human_task";
4151
+ title: string;
4152
+ description?: string | undefined;
4153
+ assignee_ref?: string | undefined;
4154
+ }>]>, "many">;
4155
+ }, "strip", z.ZodTypeAny, {
4156
+ name: string;
4157
+ id: string;
4158
+ outputs: ({
4159
+ type: "auto_task";
4160
+ kind: string;
4161
+ execute_at: {
4162
+ rule: "immediate";
4163
+ } | {
4164
+ base: "target_date" | "run_date";
4165
+ time: string;
4166
+ rule: "send_at_local";
4167
+ } | {
4168
+ rule: "relative_to_appointment";
4169
+ offset_minutes: number;
4170
+ };
4171
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4172
+ payload: Record<string, unknown>;
4173
+ retry?: z.objectOutputType<{
4174
+ max_attempts: z.ZodNumber;
4175
+ attempt: z.ZodNumber;
4176
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4177
+ backoff_seconds: z.ZodNumber;
4178
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4179
+ last_error: z.ZodOptional<z.ZodObject<{
4180
+ message: z.ZodString;
4181
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4182
+ at: z.ZodDate;
4183
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4184
+ }, "strip", z.ZodTypeAny, {
4185
+ message: string;
4186
+ at: Date;
4187
+ code?: string | number | undefined;
4188
+ details?: Record<string, unknown> | undefined;
4189
+ }, {
4190
+ message: string;
4191
+ at: Date;
4192
+ code?: string | number | undefined;
4193
+ details?: Record<string, unknown> | undefined;
4194
+ }>>;
4195
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4196
+ on_failure?: z.objectOutputType<{
4197
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4198
+ name: z.ZodOptional<z.ZodString>;
4199
+ ref: z.ZodOptional<z.ZodAny>;
4200
+ }, "strip", z.ZodTypeAny, {
4201
+ name?: string | undefined;
4202
+ ref?: any;
4203
+ }, {
4204
+ name?: string | undefined;
4205
+ ref?: any;
4206
+ }>>;
4207
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4208
+ title: z.ZodOptional<z.ZodString>;
4209
+ description: z.ZodOptional<z.ZodString>;
4210
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4211
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4212
+ name: z.ZodString;
4213
+ color: z.ZodOptional<z.ZodString>;
4214
+ hidden: z.ZodBoolean;
4215
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4216
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4217
+ }, "strip", z.ZodTypeAny, {
4218
+ name: string;
4219
+ hidden: boolean;
4220
+ base?: boolean | undefined;
4221
+ color?: string | undefined;
4222
+ category?: string | null | undefined;
4223
+ }, {
4224
+ name: string;
4225
+ hidden: boolean;
4226
+ base?: boolean | undefined;
4227
+ color?: string | undefined;
4228
+ category?: string | null | undefined;
4229
+ }>, "many">>>;
4230
+ }, "strip", z.ZodTypeAny, {
4231
+ description?: string | undefined;
4232
+ tags?: {
4233
+ name: string;
4234
+ hidden: boolean;
4235
+ base?: boolean | undefined;
4236
+ color?: string | undefined;
4237
+ category?: string | null | undefined;
4238
+ }[] | null | undefined;
4239
+ title?: string | undefined;
4240
+ priority?: "low" | "medium" | "high" | undefined;
4241
+ }, {
4242
+ description?: string | undefined;
4243
+ tags?: {
4244
+ name: string;
4245
+ hidden: boolean;
4246
+ base?: boolean | undefined;
4247
+ color?: string | undefined;
4248
+ category?: string | null | undefined;
4249
+ }[] | null | undefined;
4250
+ title?: string | undefined;
4251
+ priority?: "low" | "medium" | "high" | undefined;
4252
+ }>>;
4253
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4254
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4255
+ kind: z.ZodString;
4256
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4257
+ }, "strip", z.ZodTypeAny, {
4258
+ kind: string;
4259
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4260
+ payload: Record<string, unknown>;
4261
+ }, {
4262
+ kind: string;
4263
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4264
+ payload: Record<string, unknown>;
4265
+ }>, "many">>;
4266
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4267
+ } | {
4268
+ type: "human_task";
4269
+ title: string;
4270
+ description?: string | undefined;
4271
+ assignee_ref?: string | undefined;
4272
+ })[];
4273
+ when?: ZAutomationConditionGroup | undefined;
4274
+ is_fallback?: boolean | undefined;
4275
+ }, {
4276
+ name: string;
4277
+ id: string;
4278
+ outputs: ({
4279
+ type: "auto_task";
4280
+ kind: string;
4281
+ execute_at: {
4282
+ rule: "immediate";
4283
+ } | {
4284
+ base: "target_date" | "run_date";
4285
+ time: string;
4286
+ rule: "send_at_local";
4287
+ } | {
4288
+ rule: "relative_to_appointment";
4289
+ offset_minutes: number;
4290
+ };
4291
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4292
+ payload?: Record<string, unknown> | undefined;
4293
+ retry?: z.objectInputType<{
4294
+ max_attempts: z.ZodNumber;
4295
+ attempt: z.ZodNumber;
4296
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4297
+ backoff_seconds: z.ZodNumber;
4298
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4299
+ last_error: z.ZodOptional<z.ZodObject<{
4300
+ message: z.ZodString;
4301
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4302
+ at: z.ZodDate;
4303
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4304
+ }, "strip", z.ZodTypeAny, {
4305
+ message: string;
4306
+ at: Date;
4307
+ code?: string | number | undefined;
4308
+ details?: Record<string, unknown> | undefined;
4309
+ }, {
4310
+ message: string;
4311
+ at: Date;
4312
+ code?: string | number | undefined;
4313
+ details?: Record<string, unknown> | undefined;
4314
+ }>>;
4315
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4316
+ on_failure?: z.objectInputType<{
4317
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4318
+ name: z.ZodOptional<z.ZodString>;
4319
+ ref: z.ZodOptional<z.ZodAny>;
4320
+ }, "strip", z.ZodTypeAny, {
4321
+ name?: string | undefined;
4322
+ ref?: any;
4323
+ }, {
4324
+ name?: string | undefined;
4325
+ ref?: any;
4326
+ }>>;
4327
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4328
+ title: z.ZodOptional<z.ZodString>;
4329
+ description: z.ZodOptional<z.ZodString>;
4330
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4331
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4332
+ name: z.ZodString;
4333
+ color: z.ZodOptional<z.ZodString>;
4334
+ hidden: z.ZodBoolean;
4335
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4336
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4337
+ }, "strip", z.ZodTypeAny, {
4338
+ name: string;
4339
+ hidden: boolean;
4340
+ base?: boolean | undefined;
4341
+ color?: string | undefined;
4342
+ category?: string | null | undefined;
4343
+ }, {
4344
+ name: string;
4345
+ hidden: boolean;
4346
+ base?: boolean | undefined;
4347
+ color?: string | undefined;
4348
+ category?: string | null | undefined;
4349
+ }>, "many">>>;
4350
+ }, "strip", z.ZodTypeAny, {
4351
+ description?: string | undefined;
4352
+ tags?: {
4353
+ name: string;
4354
+ hidden: boolean;
4355
+ base?: boolean | undefined;
4356
+ color?: string | undefined;
4357
+ category?: string | null | undefined;
4358
+ }[] | null | undefined;
4359
+ title?: string | undefined;
4360
+ priority?: "low" | "medium" | "high" | undefined;
4361
+ }, {
4362
+ description?: string | undefined;
4363
+ tags?: {
4364
+ name: string;
4365
+ hidden: boolean;
4366
+ base?: boolean | undefined;
4367
+ color?: string | undefined;
4368
+ category?: string | null | undefined;
4369
+ }[] | null | undefined;
4370
+ title?: string | undefined;
4371
+ priority?: "low" | "medium" | "high" | undefined;
4372
+ }>>;
4373
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4374
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4375
+ kind: z.ZodString;
4376
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4377
+ }, "strip", z.ZodTypeAny, {
4378
+ kind: string;
4379
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4380
+ payload: Record<string, unknown>;
4381
+ }, {
4382
+ kind: string;
4383
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4384
+ payload: Record<string, unknown>;
4385
+ }>, "many">>;
4386
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4387
+ } | {
4388
+ type: "human_task";
4389
+ title: string;
4390
+ description?: string | undefined;
4391
+ assignee_ref?: string | undefined;
4392
+ })[];
4393
+ when?: ZAutomationConditionGroup | undefined;
4394
+ is_fallback?: boolean | undefined;
4395
+ }>, "many">;
4396
+ guards: z.ZodObject<{
4397
+ max_tasks_per_run: z.ZodNumber;
4398
+ }, "strip", z.ZodTypeAny, {
4399
+ max_tasks_per_run: number;
4400
+ }, {
4401
+ max_tasks_per_run: number;
4402
+ }>;
4403
+ }, "strip", z.ZodTypeAny, {
4404
+ name: string;
4405
+ id: string;
4406
+ active: boolean;
4407
+ trigger: {
4408
+ type: "cron";
4409
+ cron: {
4410
+ expression: string;
4411
+ timezone?: string | undefined;
4412
+ };
4413
+ } | {
4414
+ type: "webhook";
4415
+ };
4416
+ selection: {
4417
+ appointment: {
4418
+ date_window: {
4419
+ offset_days: number;
4420
+ offset_mode: "calendar" | "business";
4421
+ };
4422
+ calendar_ids?: string[] | undefined;
4423
+ status_in?: string[] | undefined;
4424
+ status_base_in?: string[] | undefined;
4425
+ appointment_type_not_in?: string[] | undefined;
4426
+ professional_names?: string[] | undefined;
4427
+ procedure_names?: string[] | undefined;
4428
+ insurance_names?: string[] | undefined;
4429
+ address_names?: string[] | undefined;
4430
+ payment_status_in?: string[] | undefined;
4431
+ };
4432
+ target: "appointment";
4433
+ };
4434
+ branch_mode: "all" | "exclusive";
4435
+ branches: {
4436
+ name: string;
4437
+ id: string;
4438
+ outputs: ({
4439
+ type: "auto_task";
4440
+ kind: string;
4441
+ execute_at: {
4442
+ rule: "immediate";
4443
+ } | {
4444
+ base: "target_date" | "run_date";
4445
+ time: string;
4446
+ rule: "send_at_local";
4447
+ } | {
4448
+ rule: "relative_to_appointment";
4449
+ offset_minutes: number;
4450
+ };
4451
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4452
+ payload: Record<string, unknown>;
4453
+ retry?: z.objectOutputType<{
4454
+ max_attempts: z.ZodNumber;
4455
+ attempt: z.ZodNumber;
4456
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4457
+ backoff_seconds: z.ZodNumber;
4458
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4459
+ last_error: z.ZodOptional<z.ZodObject<{
4460
+ message: z.ZodString;
4461
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4462
+ at: z.ZodDate;
4463
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4464
+ }, "strip", z.ZodTypeAny, {
4465
+ message: string;
4466
+ at: Date;
4467
+ code?: string | number | undefined;
4468
+ details?: Record<string, unknown> | undefined;
4469
+ }, {
4470
+ message: string;
4471
+ at: Date;
4472
+ code?: string | number | undefined;
4473
+ details?: Record<string, unknown> | undefined;
4474
+ }>>;
4475
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4476
+ on_failure?: z.objectOutputType<{
4477
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4478
+ name: z.ZodOptional<z.ZodString>;
4479
+ ref: z.ZodOptional<z.ZodAny>;
4480
+ }, "strip", z.ZodTypeAny, {
4481
+ name?: string | undefined;
4482
+ ref?: any;
4483
+ }, {
4484
+ name?: string | undefined;
4485
+ ref?: any;
4486
+ }>>;
4487
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4488
+ title: z.ZodOptional<z.ZodString>;
4489
+ description: z.ZodOptional<z.ZodString>;
4490
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4491
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4492
+ name: z.ZodString;
4493
+ color: z.ZodOptional<z.ZodString>;
4494
+ hidden: z.ZodBoolean;
4495
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4496
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4497
+ }, "strip", z.ZodTypeAny, {
4498
+ name: string;
4499
+ hidden: boolean;
4500
+ base?: boolean | undefined;
4501
+ color?: string | undefined;
4502
+ category?: string | null | undefined;
4503
+ }, {
4504
+ name: string;
4505
+ hidden: boolean;
4506
+ base?: boolean | undefined;
4507
+ color?: string | undefined;
4508
+ category?: string | null | undefined;
4509
+ }>, "many">>>;
4510
+ }, "strip", z.ZodTypeAny, {
4511
+ description?: string | undefined;
4512
+ tags?: {
4513
+ name: string;
4514
+ hidden: boolean;
4515
+ base?: boolean | undefined;
4516
+ color?: string | undefined;
4517
+ category?: string | null | undefined;
4518
+ }[] | null | undefined;
4519
+ title?: string | undefined;
4520
+ priority?: "low" | "medium" | "high" | undefined;
4521
+ }, {
4522
+ description?: string | undefined;
4523
+ tags?: {
4524
+ name: string;
4525
+ hidden: boolean;
4526
+ base?: boolean | undefined;
4527
+ color?: string | undefined;
4528
+ category?: string | null | undefined;
4529
+ }[] | null | undefined;
4530
+ title?: string | undefined;
4531
+ priority?: "low" | "medium" | "high" | undefined;
4532
+ }>>;
4533
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4534
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4535
+ kind: z.ZodString;
4536
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4537
+ }, "strip", z.ZodTypeAny, {
4538
+ kind: string;
4539
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4540
+ payload: Record<string, unknown>;
4541
+ }, {
4542
+ kind: string;
4543
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4544
+ payload: Record<string, unknown>;
4545
+ }>, "many">>;
4546
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4547
+ } | {
4548
+ type: "human_task";
4549
+ title: string;
4550
+ description?: string | undefined;
4551
+ assignee_ref?: string | undefined;
4552
+ })[];
4553
+ when?: ZAutomationConditionGroup | undefined;
4554
+ is_fallback?: boolean | undefined;
4555
+ }[];
4556
+ guards: {
4557
+ max_tasks_per_run: number;
4558
+ };
4559
+ description?: string | undefined;
4560
+ }, {
4561
+ name: string;
4562
+ id: string;
4563
+ trigger: {
4564
+ type: "cron";
4565
+ cron: {
4566
+ expression: string;
4567
+ timezone?: string | undefined;
4568
+ };
4569
+ } | {
4570
+ type: "webhook";
4571
+ };
4572
+ selection: {
4573
+ appointment: {
4574
+ date_window: {
4575
+ offset_days: number;
4576
+ offset_mode: "calendar" | "business";
4577
+ };
4578
+ calendar_ids?: string[] | undefined;
4579
+ status_in?: string[] | undefined;
4580
+ status_base_in?: string[] | undefined;
4581
+ appointment_type_not_in?: string[] | undefined;
4582
+ professional_names?: string[] | undefined;
4583
+ procedure_names?: string[] | undefined;
4584
+ insurance_names?: string[] | undefined;
4585
+ address_names?: string[] | undefined;
4586
+ payment_status_in?: string[] | undefined;
4587
+ };
4588
+ target: "appointment";
4589
+ };
4590
+ branch_mode: "all" | "exclusive";
4591
+ branches: {
4592
+ name: string;
4593
+ id: string;
4594
+ outputs: ({
4595
+ type: "auto_task";
4596
+ kind: string;
4597
+ execute_at: {
4598
+ rule: "immediate";
4599
+ } | {
4600
+ base: "target_date" | "run_date";
4601
+ time: string;
4602
+ rule: "send_at_local";
4603
+ } | {
4604
+ rule: "relative_to_appointment";
4605
+ offset_minutes: number;
4606
+ };
4607
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4608
+ payload?: Record<string, unknown> | undefined;
4609
+ retry?: z.objectInputType<{
4610
+ max_attempts: z.ZodNumber;
4611
+ attempt: z.ZodNumber;
4612
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4613
+ backoff_seconds: z.ZodNumber;
4614
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4615
+ last_error: z.ZodOptional<z.ZodObject<{
4616
+ message: z.ZodString;
4617
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4618
+ at: z.ZodDate;
4619
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4620
+ }, "strip", z.ZodTypeAny, {
4621
+ message: string;
4622
+ at: Date;
4623
+ code?: string | number | undefined;
4624
+ details?: Record<string, unknown> | undefined;
4625
+ }, {
4626
+ message: string;
4627
+ at: Date;
4628
+ code?: string | number | undefined;
4629
+ details?: Record<string, unknown> | undefined;
4630
+ }>>;
4631
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4632
+ on_failure?: z.objectInputType<{
4633
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4634
+ name: z.ZodOptional<z.ZodString>;
4635
+ ref: z.ZodOptional<z.ZodAny>;
4636
+ }, "strip", z.ZodTypeAny, {
4637
+ name?: string | undefined;
4638
+ ref?: any;
4639
+ }, {
4640
+ name?: string | undefined;
4641
+ ref?: any;
4642
+ }>>;
4643
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4644
+ title: z.ZodOptional<z.ZodString>;
4645
+ description: z.ZodOptional<z.ZodString>;
4646
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4647
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4648
+ name: z.ZodString;
4649
+ color: z.ZodOptional<z.ZodString>;
4650
+ hidden: z.ZodBoolean;
4651
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4652
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4653
+ }, "strip", z.ZodTypeAny, {
4654
+ name: string;
4655
+ hidden: boolean;
4656
+ base?: boolean | undefined;
4657
+ color?: string | undefined;
4658
+ category?: string | null | undefined;
4659
+ }, {
4660
+ name: string;
4661
+ hidden: boolean;
4662
+ base?: boolean | undefined;
4663
+ color?: string | undefined;
4664
+ category?: string | null | undefined;
4665
+ }>, "many">>>;
4666
+ }, "strip", z.ZodTypeAny, {
4667
+ description?: string | undefined;
4668
+ tags?: {
4669
+ name: string;
4670
+ hidden: boolean;
4671
+ base?: boolean | undefined;
4672
+ color?: string | undefined;
4673
+ category?: string | null | undefined;
4674
+ }[] | null | undefined;
4675
+ title?: string | undefined;
4676
+ priority?: "low" | "medium" | "high" | undefined;
4677
+ }, {
4678
+ description?: string | undefined;
4679
+ tags?: {
4680
+ name: string;
4681
+ hidden: boolean;
4682
+ base?: boolean | undefined;
4683
+ color?: string | undefined;
4684
+ category?: string | null | undefined;
4685
+ }[] | null | undefined;
4686
+ title?: string | undefined;
4687
+ priority?: "low" | "medium" | "high" | undefined;
4688
+ }>>;
4689
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
4690
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4691
+ kind: z.ZodString;
4692
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4693
+ }, "strip", z.ZodTypeAny, {
4694
+ kind: string;
4695
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4696
+ payload: Record<string, unknown>;
4697
+ }, {
4698
+ kind: string;
4699
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
4700
+ payload: Record<string, unknown>;
4701
+ }>, "many">>;
4702
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4703
+ } | {
4704
+ type: "human_task";
4705
+ title: string;
4706
+ description?: string | undefined;
4707
+ assignee_ref?: string | undefined;
4708
+ })[];
4709
+ when?: ZAutomationConditionGroup | undefined;
4710
+ is_fallback?: boolean | undefined;
4711
+ }[];
4712
+ guards: {
4713
+ max_tasks_per_run: number;
4714
+ };
4715
+ active?: boolean | undefined;
4716
+ description?: string | undefined;
4717
+ }>;
4718
+ export declare const zAutomationRoutineUpdateRequestSchema: z.ZodObject<{
4719
+ routine: z.ZodObject<{
4720
+ id: z.ZodString;
4721
+ name: z.ZodString;
4722
+ description: z.ZodOptional<z.ZodString>;
4723
+ active: z.ZodDefault<z.ZodBoolean>;
4724
+ trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4725
+ type: z.ZodLiteral<"cron">;
4726
+ cron: z.ZodObject<{
4727
+ expression: z.ZodString;
4728
+ timezone: z.ZodOptional<z.ZodString>;
4729
+ }, "strip", z.ZodTypeAny, {
4730
+ expression: string;
4731
+ timezone?: string | undefined;
4732
+ }, {
4733
+ expression: string;
4734
+ timezone?: string | undefined;
4735
+ }>;
4736
+ }, "strip", z.ZodTypeAny, {
4737
+ type: "cron";
4738
+ cron: {
4739
+ expression: string;
4740
+ timezone?: string | undefined;
4741
+ };
4742
+ }, {
4743
+ type: "cron";
4744
+ cron: {
4745
+ expression: string;
4746
+ timezone?: string | undefined;
4747
+ };
4748
+ }>, z.ZodObject<{
4749
+ type: z.ZodLiteral<"webhook">;
4750
+ }, "strip", z.ZodTypeAny, {
4751
+ type: "webhook";
4752
+ }, {
4753
+ type: "webhook";
4754
+ }>]>;
4755
+ selection: z.ZodObject<{
4756
+ target: z.ZodLiteral<"appointment">;
4757
+ appointment: z.ZodObject<{
4758
+ calendar_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4759
+ date_window: z.ZodObject<{
4760
+ offset_days: z.ZodNumber;
4761
+ offset_mode: z.ZodEnum<["calendar", "business"]>;
4762
+ }, "strip", z.ZodTypeAny, {
4763
+ offset_days: number;
4764
+ offset_mode: "calendar" | "business";
4765
+ }, {
4766
+ offset_days: number;
4767
+ offset_mode: "calendar" | "business";
4768
+ }>;
4769
+ status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4770
+ status_base_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4771
+ appointment_type_not_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4772
+ professional_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4773
+ procedure_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4774
+ insurance_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4775
+ address_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4776
+ payment_status_in: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4777
+ }, "strip", z.ZodTypeAny, {
4778
+ date_window: {
4779
+ offset_days: number;
4780
+ offset_mode: "calendar" | "business";
4781
+ };
4782
+ calendar_ids?: string[] | undefined;
4783
+ status_in?: string[] | undefined;
4784
+ status_base_in?: string[] | undefined;
4785
+ appointment_type_not_in?: string[] | undefined;
4786
+ professional_names?: string[] | undefined;
4787
+ procedure_names?: string[] | undefined;
4788
+ insurance_names?: string[] | undefined;
4789
+ address_names?: string[] | undefined;
4790
+ payment_status_in?: string[] | undefined;
4791
+ }, {
4792
+ date_window: {
4793
+ offset_days: number;
4794
+ offset_mode: "calendar" | "business";
4795
+ };
4796
+ calendar_ids?: string[] | undefined;
4797
+ status_in?: string[] | undefined;
4798
+ status_base_in?: string[] | undefined;
4799
+ appointment_type_not_in?: string[] | undefined;
4800
+ professional_names?: string[] | undefined;
4801
+ procedure_names?: string[] | undefined;
4802
+ insurance_names?: string[] | undefined;
4803
+ address_names?: string[] | undefined;
4804
+ payment_status_in?: string[] | undefined;
4805
+ }>;
4806
+ }, "strip", z.ZodTypeAny, {
4807
+ appointment: {
4808
+ date_window: {
4809
+ offset_days: number;
4810
+ offset_mode: "calendar" | "business";
4811
+ };
4812
+ calendar_ids?: string[] | undefined;
4813
+ status_in?: string[] | undefined;
4814
+ status_base_in?: string[] | undefined;
4815
+ appointment_type_not_in?: string[] | undefined;
4816
+ professional_names?: string[] | undefined;
4817
+ procedure_names?: string[] | undefined;
4818
+ insurance_names?: string[] | undefined;
4819
+ address_names?: string[] | undefined;
4820
+ payment_status_in?: string[] | undefined;
4821
+ };
4822
+ target: "appointment";
4823
+ }, {
4824
+ appointment: {
4825
+ date_window: {
4826
+ offset_days: number;
4827
+ offset_mode: "calendar" | "business";
4828
+ };
4829
+ calendar_ids?: string[] | undefined;
4830
+ status_in?: string[] | undefined;
4831
+ status_base_in?: string[] | undefined;
4832
+ appointment_type_not_in?: string[] | undefined;
4833
+ professional_names?: string[] | undefined;
4834
+ procedure_names?: string[] | undefined;
4835
+ insurance_names?: string[] | undefined;
4836
+ address_names?: string[] | undefined;
4837
+ payment_status_in?: string[] | undefined;
4838
+ };
4839
+ target: "appointment";
4840
+ }>;
4841
+ branch_mode: z.ZodEnum<["all", "exclusive"]>;
4842
+ branches: z.ZodArray<z.ZodObject<{
4843
+ id: z.ZodString;
4844
+ name: z.ZodString;
4845
+ when: z.ZodOptional<z.ZodType<ZAutomationConditionGroup, z.ZodTypeDef, ZAutomationConditionGroup>>;
4846
+ is_fallback: z.ZodOptional<z.ZodBoolean>;
4847
+ outputs: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4848
+ type: z.ZodLiteral<"auto_task">;
4849
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
4850
+ kind: z.ZodString;
4851
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4852
+ execute_at: z.ZodDiscriminatedUnion<"rule", [z.ZodObject<{
4853
+ rule: z.ZodLiteral<"immediate">;
4854
+ }, "strip", z.ZodTypeAny, {
4855
+ rule: "immediate";
4856
+ }, {
4857
+ rule: "immediate";
4858
+ }>, z.ZodObject<{
4859
+ rule: z.ZodLiteral<"send_at_local">;
4860
+ time: z.ZodString;
4861
+ base: z.ZodEnum<["target_date", "run_date"]>;
4862
+ }, "strip", z.ZodTypeAny, {
4863
+ base: "target_date" | "run_date";
4864
+ time: string;
4865
+ rule: "send_at_local";
4866
+ }, {
4867
+ base: "target_date" | "run_date";
4868
+ time: string;
4869
+ rule: "send_at_local";
4870
+ }>, z.ZodObject<{
4871
+ rule: z.ZodLiteral<"relative_to_appointment">;
4872
+ offset_minutes: z.ZodNumber;
4873
+ }, "strip", z.ZodTypeAny, {
4874
+ rule: "relative_to_appointment";
4875
+ offset_minutes: number;
4876
+ }, {
4877
+ rule: "relative_to_appointment";
4878
+ offset_minutes: number;
4879
+ }>]>;
4880
+ retry: z.ZodOptional<z.ZodObject<{
4881
+ max_attempts: z.ZodNumber;
4882
+ attempt: z.ZodNumber;
4883
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4884
+ backoff_seconds: z.ZodNumber;
4885
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4886
+ last_error: z.ZodOptional<z.ZodObject<{
4887
+ message: z.ZodString;
4888
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4889
+ at: z.ZodDate;
4890
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4891
+ }, "strip", z.ZodTypeAny, {
4892
+ message: string;
4893
+ at: Date;
4894
+ code?: string | number | undefined;
4895
+ details?: Record<string, unknown> | undefined;
4896
+ }, {
4897
+ message: string;
4898
+ at: Date;
4899
+ code?: string | number | undefined;
4900
+ details?: Record<string, unknown> | undefined;
4901
+ }>>;
4902
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4903
+ max_attempts: z.ZodNumber;
4904
+ attempt: z.ZodNumber;
4905
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4906
+ backoff_seconds: z.ZodNumber;
4907
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4908
+ last_error: z.ZodOptional<z.ZodObject<{
4909
+ message: z.ZodString;
4910
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4911
+ at: z.ZodDate;
4912
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4913
+ }, "strip", z.ZodTypeAny, {
4914
+ message: string;
4915
+ at: Date;
4916
+ code?: string | number | undefined;
4917
+ details?: Record<string, unknown> | undefined;
4918
+ }, {
4919
+ message: string;
4920
+ at: Date;
4921
+ code?: string | number | undefined;
4922
+ details?: Record<string, unknown> | undefined;
4923
+ }>>;
4924
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4925
+ max_attempts: z.ZodNumber;
4926
+ attempt: z.ZodNumber;
4927
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
4928
+ backoff_seconds: z.ZodNumber;
4929
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
4930
+ last_error: z.ZodOptional<z.ZodObject<{
4931
+ message: z.ZodString;
4932
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
4933
+ at: z.ZodDate;
4934
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4935
+ }, "strip", z.ZodTypeAny, {
4936
+ message: string;
4937
+ at: Date;
4938
+ code?: string | number | undefined;
4939
+ details?: Record<string, unknown> | undefined;
4940
+ }, {
4941
+ message: string;
4942
+ at: Date;
4943
+ code?: string | number | undefined;
4944
+ details?: Record<string, unknown> | undefined;
4945
+ }>>;
4946
+ }, z.ZodTypeAny, "passthrough">>>;
4947
+ on_failure: z.ZodOptional<z.ZodObject<{
4948
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
4949
+ name: z.ZodOptional<z.ZodString>;
4950
+ ref: z.ZodOptional<z.ZodAny>;
4951
+ }, "strip", z.ZodTypeAny, {
4952
+ name?: string | undefined;
4953
+ ref?: any;
4954
+ }, {
4955
+ name?: string | undefined;
4956
+ ref?: any;
4957
+ }>>;
4958
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
4959
+ title: z.ZodOptional<z.ZodString>;
4960
+ description: z.ZodOptional<z.ZodString>;
4961
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
4962
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
4963
+ name: z.ZodString;
4964
+ color: z.ZodOptional<z.ZodString>;
4965
+ hidden: z.ZodBoolean;
4966
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4967
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4968
+ }, "strip", z.ZodTypeAny, {
4969
+ name: string;
4970
+ hidden: boolean;
4971
+ base?: boolean | undefined;
4972
+ color?: string | undefined;
4973
+ category?: string | null | undefined;
4974
+ }, {
4975
+ name: string;
4976
+ hidden: boolean;
4977
+ base?: boolean | undefined;
4978
+ color?: string | undefined;
4979
+ category?: string | null | undefined;
4980
+ }>, "many">>>;
4981
+ }, "strip", z.ZodTypeAny, {
4982
+ description?: string | undefined;
4983
+ tags?: {
4984
+ name: string;
4985
+ hidden: boolean;
4986
+ base?: boolean | undefined;
4987
+ color?: string | undefined;
4988
+ category?: string | null | undefined;
4989
+ }[] | null | undefined;
4990
+ title?: string | undefined;
4991
+ priority?: "low" | "medium" | "high" | undefined;
4992
+ }, {
4993
+ description?: string | undefined;
4994
+ tags?: {
4995
+ name: string;
4996
+ hidden: boolean;
4997
+ base?: boolean | undefined;
4998
+ color?: string | undefined;
4999
+ category?: string | null | undefined;
5000
+ }[] | null | undefined;
5001
+ title?: string | undefined;
5002
+ priority?: "low" | "medium" | "high" | undefined;
5003
+ }>>;
5004
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5005
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5006
+ kind: z.ZodString;
5007
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5008
+ }, "strip", z.ZodTypeAny, {
5009
+ kind: string;
5010
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5011
+ payload: Record<string, unknown>;
5012
+ }, {
5013
+ kind: string;
5014
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5015
+ payload: Record<string, unknown>;
5016
+ }>, "many">>;
5017
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5018
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5019
+ name: z.ZodOptional<z.ZodString>;
5020
+ ref: z.ZodOptional<z.ZodAny>;
5021
+ }, "strip", z.ZodTypeAny, {
5022
+ name?: string | undefined;
5023
+ ref?: any;
5024
+ }, {
5025
+ name?: string | undefined;
5026
+ ref?: any;
5027
+ }>>;
5028
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5029
+ title: z.ZodOptional<z.ZodString>;
5030
+ description: z.ZodOptional<z.ZodString>;
5031
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5032
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5033
+ name: z.ZodString;
5034
+ color: z.ZodOptional<z.ZodString>;
5035
+ hidden: z.ZodBoolean;
5036
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5037
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5038
+ }, "strip", z.ZodTypeAny, {
5039
+ name: string;
5040
+ hidden: boolean;
5041
+ base?: boolean | undefined;
5042
+ color?: string | undefined;
5043
+ category?: string | null | undefined;
5044
+ }, {
5045
+ name: string;
5046
+ hidden: boolean;
5047
+ base?: boolean | undefined;
5048
+ color?: string | undefined;
5049
+ category?: string | null | undefined;
5050
+ }>, "many">>>;
5051
+ }, "strip", z.ZodTypeAny, {
5052
+ description?: string | undefined;
5053
+ tags?: {
5054
+ name: string;
5055
+ hidden: boolean;
5056
+ base?: boolean | undefined;
5057
+ color?: string | undefined;
5058
+ category?: string | null | undefined;
5059
+ }[] | null | undefined;
5060
+ title?: string | undefined;
5061
+ priority?: "low" | "medium" | "high" | undefined;
5062
+ }, {
5063
+ description?: string | undefined;
5064
+ tags?: {
5065
+ name: string;
5066
+ hidden: boolean;
5067
+ base?: boolean | undefined;
5068
+ color?: string | undefined;
5069
+ category?: string | null | undefined;
5070
+ }[] | null | undefined;
5071
+ title?: string | undefined;
5072
+ priority?: "low" | "medium" | "high" | undefined;
5073
+ }>>;
5074
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5075
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5076
+ kind: z.ZodString;
5077
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5078
+ }, "strip", z.ZodTypeAny, {
5079
+ kind: string;
5080
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5081
+ payload: Record<string, unknown>;
5082
+ }, {
5083
+ kind: string;
5084
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5085
+ payload: Record<string, unknown>;
5086
+ }>, "many">>;
5087
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5088
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5089
+ name: z.ZodOptional<z.ZodString>;
5090
+ ref: z.ZodOptional<z.ZodAny>;
5091
+ }, "strip", z.ZodTypeAny, {
5092
+ name?: string | undefined;
5093
+ ref?: any;
5094
+ }, {
5095
+ name?: string | undefined;
5096
+ ref?: any;
5097
+ }>>;
5098
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5099
+ title: z.ZodOptional<z.ZodString>;
5100
+ description: z.ZodOptional<z.ZodString>;
5101
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5102
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5103
+ name: z.ZodString;
5104
+ color: z.ZodOptional<z.ZodString>;
5105
+ hidden: z.ZodBoolean;
5106
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5107
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5108
+ }, "strip", z.ZodTypeAny, {
5109
+ name: string;
5110
+ hidden: boolean;
5111
+ base?: boolean | undefined;
5112
+ color?: string | undefined;
5113
+ category?: string | null | undefined;
5114
+ }, {
5115
+ name: string;
5116
+ hidden: boolean;
5117
+ base?: boolean | undefined;
5118
+ color?: string | undefined;
5119
+ category?: string | null | undefined;
5120
+ }>, "many">>>;
5121
+ }, "strip", z.ZodTypeAny, {
5122
+ description?: string | undefined;
5123
+ tags?: {
5124
+ name: string;
5125
+ hidden: boolean;
5126
+ base?: boolean | undefined;
5127
+ color?: string | undefined;
5128
+ category?: string | null | undefined;
5129
+ }[] | null | undefined;
5130
+ title?: string | undefined;
5131
+ priority?: "low" | "medium" | "high" | undefined;
5132
+ }, {
5133
+ description?: string | undefined;
5134
+ tags?: {
5135
+ name: string;
5136
+ hidden: boolean;
5137
+ base?: boolean | undefined;
5138
+ color?: string | undefined;
5139
+ category?: string | null | undefined;
5140
+ }[] | null | undefined;
5141
+ title?: string | undefined;
5142
+ priority?: "low" | "medium" | "high" | undefined;
5143
+ }>>;
5144
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5145
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5146
+ kind: z.ZodString;
5147
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5148
+ }, "strip", z.ZodTypeAny, {
5149
+ kind: string;
5150
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5151
+ payload: Record<string, unknown>;
5152
+ }, {
5153
+ kind: string;
5154
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5155
+ payload: Record<string, unknown>;
5156
+ }>, "many">>;
5157
+ }, z.ZodTypeAny, "passthrough">>>;
5158
+ }, "strip", z.ZodTypeAny, {
5159
+ type: "auto_task";
5160
+ kind: string;
5161
+ execute_at: {
5162
+ rule: "immediate";
5163
+ } | {
5164
+ base: "target_date" | "run_date";
5165
+ time: string;
5166
+ rule: "send_at_local";
5167
+ } | {
5168
+ rule: "relative_to_appointment";
5169
+ offset_minutes: number;
5170
+ };
5171
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5172
+ payload: Record<string, unknown>;
5173
+ retry?: z.objectOutputType<{
5174
+ max_attempts: z.ZodNumber;
5175
+ attempt: z.ZodNumber;
5176
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5177
+ backoff_seconds: z.ZodNumber;
5178
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5179
+ last_error: z.ZodOptional<z.ZodObject<{
5180
+ message: z.ZodString;
5181
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5182
+ at: z.ZodDate;
5183
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5184
+ }, "strip", z.ZodTypeAny, {
5185
+ message: string;
5186
+ at: Date;
5187
+ code?: string | number | undefined;
5188
+ details?: Record<string, unknown> | undefined;
5189
+ }, {
5190
+ message: string;
5191
+ at: Date;
5192
+ code?: string | number | undefined;
5193
+ details?: Record<string, unknown> | undefined;
5194
+ }>>;
5195
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5196
+ on_failure?: z.objectOutputType<{
5197
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5198
+ name: z.ZodOptional<z.ZodString>;
5199
+ ref: z.ZodOptional<z.ZodAny>;
5200
+ }, "strip", z.ZodTypeAny, {
5201
+ name?: string | undefined;
5202
+ ref?: any;
5203
+ }, {
5204
+ name?: string | undefined;
5205
+ ref?: any;
5206
+ }>>;
5207
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5208
+ title: z.ZodOptional<z.ZodString>;
5209
+ description: z.ZodOptional<z.ZodString>;
5210
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5211
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5212
+ name: z.ZodString;
5213
+ color: z.ZodOptional<z.ZodString>;
5214
+ hidden: z.ZodBoolean;
5215
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5216
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5217
+ }, "strip", z.ZodTypeAny, {
5218
+ name: string;
5219
+ hidden: boolean;
5220
+ base?: boolean | undefined;
5221
+ color?: string | undefined;
5222
+ category?: string | null | undefined;
5223
+ }, {
5224
+ name: string;
5225
+ hidden: boolean;
5226
+ base?: boolean | undefined;
5227
+ color?: string | undefined;
5228
+ category?: string | null | undefined;
5229
+ }>, "many">>>;
5230
+ }, "strip", z.ZodTypeAny, {
5231
+ description?: string | undefined;
5232
+ tags?: {
5233
+ name: string;
5234
+ hidden: boolean;
5235
+ base?: boolean | undefined;
5236
+ color?: string | undefined;
5237
+ category?: string | null | undefined;
5238
+ }[] | null | undefined;
5239
+ title?: string | undefined;
5240
+ priority?: "low" | "medium" | "high" | undefined;
5241
+ }, {
5242
+ description?: string | undefined;
5243
+ tags?: {
5244
+ name: string;
5245
+ hidden: boolean;
5246
+ base?: boolean | undefined;
5247
+ color?: string | undefined;
5248
+ category?: string | null | undefined;
5249
+ }[] | null | undefined;
5250
+ title?: string | undefined;
5251
+ priority?: "low" | "medium" | "high" | undefined;
5252
+ }>>;
5253
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5254
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5255
+ kind: z.ZodString;
5256
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5257
+ }, "strip", z.ZodTypeAny, {
5258
+ kind: string;
5259
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5260
+ payload: Record<string, unknown>;
5261
+ }, {
5262
+ kind: string;
5263
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5264
+ payload: Record<string, unknown>;
5265
+ }>, "many">>;
5266
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5267
+ }, {
5268
+ type: "auto_task";
5269
+ kind: string;
5270
+ execute_at: {
5271
+ rule: "immediate";
5272
+ } | {
5273
+ base: "target_date" | "run_date";
5274
+ time: string;
5275
+ rule: "send_at_local";
5276
+ } | {
5277
+ rule: "relative_to_appointment";
5278
+ offset_minutes: number;
5279
+ };
5280
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5281
+ payload?: Record<string, unknown> | undefined;
5282
+ retry?: z.objectInputType<{
5283
+ max_attempts: z.ZodNumber;
5284
+ attempt: z.ZodNumber;
5285
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5286
+ backoff_seconds: z.ZodNumber;
5287
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5288
+ last_error: z.ZodOptional<z.ZodObject<{
5289
+ message: z.ZodString;
5290
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5291
+ at: z.ZodDate;
5292
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5293
+ }, "strip", z.ZodTypeAny, {
5294
+ message: string;
5295
+ at: Date;
5296
+ code?: string | number | undefined;
5297
+ details?: Record<string, unknown> | undefined;
5298
+ }, {
5299
+ message: string;
5300
+ at: Date;
5301
+ code?: string | number | undefined;
5302
+ details?: Record<string, unknown> | undefined;
5303
+ }>>;
5304
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5305
+ on_failure?: z.objectInputType<{
5306
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5307
+ name: z.ZodOptional<z.ZodString>;
5308
+ ref: z.ZodOptional<z.ZodAny>;
5309
+ }, "strip", z.ZodTypeAny, {
5310
+ name?: string | undefined;
5311
+ ref?: any;
5312
+ }, {
5313
+ name?: string | undefined;
5314
+ ref?: any;
5315
+ }>>;
5316
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5317
+ title: z.ZodOptional<z.ZodString>;
5318
+ description: z.ZodOptional<z.ZodString>;
5319
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5320
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5321
+ name: z.ZodString;
5322
+ color: z.ZodOptional<z.ZodString>;
5323
+ hidden: z.ZodBoolean;
5324
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5325
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5326
+ }, "strip", z.ZodTypeAny, {
5327
+ name: string;
5328
+ hidden: boolean;
5329
+ base?: boolean | undefined;
5330
+ color?: string | undefined;
5331
+ category?: string | null | undefined;
5332
+ }, {
5333
+ name: string;
5334
+ hidden: boolean;
5335
+ base?: boolean | undefined;
5336
+ color?: string | undefined;
5337
+ category?: string | null | undefined;
5338
+ }>, "many">>>;
5339
+ }, "strip", z.ZodTypeAny, {
5340
+ description?: string | undefined;
5341
+ tags?: {
5342
+ name: string;
5343
+ hidden: boolean;
5344
+ base?: boolean | undefined;
5345
+ color?: string | undefined;
5346
+ category?: string | null | undefined;
5347
+ }[] | null | undefined;
5348
+ title?: string | undefined;
5349
+ priority?: "low" | "medium" | "high" | undefined;
5350
+ }, {
5351
+ description?: string | undefined;
5352
+ tags?: {
5353
+ name: string;
5354
+ hidden: boolean;
5355
+ base?: boolean | undefined;
5356
+ color?: string | undefined;
5357
+ category?: string | null | undefined;
5358
+ }[] | null | undefined;
5359
+ title?: string | undefined;
5360
+ priority?: "low" | "medium" | "high" | undefined;
5361
+ }>>;
5362
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5363
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5364
+ kind: z.ZodString;
5365
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5366
+ }, "strip", z.ZodTypeAny, {
5367
+ kind: string;
5368
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5369
+ payload: Record<string, unknown>;
5370
+ }, {
5371
+ kind: string;
5372
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5373
+ payload: Record<string, unknown>;
5374
+ }>, "many">>;
5375
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5376
+ }>, z.ZodObject<{
5377
+ type: z.ZodLiteral<"human_task">;
5378
+ title: z.ZodString;
5379
+ description: z.ZodOptional<z.ZodString>;
5380
+ assignee_ref: z.ZodOptional<z.ZodString>;
5381
+ }, "strip", z.ZodTypeAny, {
5382
+ type: "human_task";
5383
+ title: string;
5384
+ description?: string | undefined;
5385
+ assignee_ref?: string | undefined;
5386
+ }, {
5387
+ type: "human_task";
5388
+ title: string;
5389
+ description?: string | undefined;
5390
+ assignee_ref?: string | undefined;
5391
+ }>]>, "many">;
5392
+ }, "strip", z.ZodTypeAny, {
5393
+ name: string;
5394
+ id: string;
5395
+ outputs: ({
5396
+ type: "auto_task";
5397
+ kind: string;
5398
+ execute_at: {
5399
+ rule: "immediate";
5400
+ } | {
5401
+ base: "target_date" | "run_date";
5402
+ time: string;
5403
+ rule: "send_at_local";
5404
+ } | {
5405
+ rule: "relative_to_appointment";
5406
+ offset_minutes: number;
5407
+ };
5408
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5409
+ payload: Record<string, unknown>;
5410
+ retry?: z.objectOutputType<{
5411
+ max_attempts: z.ZodNumber;
5412
+ attempt: z.ZodNumber;
5413
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5414
+ backoff_seconds: z.ZodNumber;
5415
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5416
+ last_error: z.ZodOptional<z.ZodObject<{
5417
+ message: z.ZodString;
5418
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5419
+ at: z.ZodDate;
5420
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5421
+ }, "strip", z.ZodTypeAny, {
5422
+ message: string;
5423
+ at: Date;
5424
+ code?: string | number | undefined;
5425
+ details?: Record<string, unknown> | undefined;
5426
+ }, {
5427
+ message: string;
5428
+ at: Date;
5429
+ code?: string | number | undefined;
5430
+ details?: Record<string, unknown> | undefined;
5431
+ }>>;
5432
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5433
+ on_failure?: z.objectOutputType<{
5434
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5435
+ name: z.ZodOptional<z.ZodString>;
5436
+ ref: z.ZodOptional<z.ZodAny>;
5437
+ }, "strip", z.ZodTypeAny, {
5438
+ name?: string | undefined;
5439
+ ref?: any;
5440
+ }, {
5441
+ name?: string | undefined;
5442
+ ref?: any;
5443
+ }>>;
5444
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5445
+ title: z.ZodOptional<z.ZodString>;
5446
+ description: z.ZodOptional<z.ZodString>;
5447
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5448
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5449
+ name: z.ZodString;
5450
+ color: z.ZodOptional<z.ZodString>;
5451
+ hidden: z.ZodBoolean;
5452
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5453
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5454
+ }, "strip", z.ZodTypeAny, {
5455
+ name: string;
5456
+ hidden: boolean;
5457
+ base?: boolean | undefined;
5458
+ color?: string | undefined;
5459
+ category?: string | null | undefined;
5460
+ }, {
5461
+ name: string;
5462
+ hidden: boolean;
5463
+ base?: boolean | undefined;
5464
+ color?: string | undefined;
5465
+ category?: string | null | undefined;
5466
+ }>, "many">>>;
5467
+ }, "strip", z.ZodTypeAny, {
5468
+ description?: string | undefined;
5469
+ tags?: {
5470
+ name: string;
5471
+ hidden: boolean;
5472
+ base?: boolean | undefined;
5473
+ color?: string | undefined;
5474
+ category?: string | null | undefined;
5475
+ }[] | null | undefined;
5476
+ title?: string | undefined;
5477
+ priority?: "low" | "medium" | "high" | undefined;
5478
+ }, {
5479
+ description?: string | undefined;
5480
+ tags?: {
5481
+ name: string;
5482
+ hidden: boolean;
5483
+ base?: boolean | undefined;
5484
+ color?: string | undefined;
5485
+ category?: string | null | undefined;
5486
+ }[] | null | undefined;
5487
+ title?: string | undefined;
5488
+ priority?: "low" | "medium" | "high" | undefined;
5489
+ }>>;
5490
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5491
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5492
+ kind: z.ZodString;
5493
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5494
+ }, "strip", z.ZodTypeAny, {
5495
+ kind: string;
5496
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5497
+ payload: Record<string, unknown>;
5498
+ }, {
5499
+ kind: string;
5500
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5501
+ payload: Record<string, unknown>;
5502
+ }>, "many">>;
5503
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5504
+ } | {
5505
+ type: "human_task";
5506
+ title: string;
5507
+ description?: string | undefined;
5508
+ assignee_ref?: string | undefined;
5509
+ })[];
5510
+ when?: ZAutomationConditionGroup | undefined;
5511
+ is_fallback?: boolean | undefined;
5512
+ }, {
5513
+ name: string;
5514
+ id: string;
5515
+ outputs: ({
5516
+ type: "auto_task";
5517
+ kind: string;
5518
+ execute_at: {
5519
+ rule: "immediate";
5520
+ } | {
5521
+ base: "target_date" | "run_date";
5522
+ time: string;
5523
+ rule: "send_at_local";
5524
+ } | {
5525
+ rule: "relative_to_appointment";
5526
+ offset_minutes: number;
5527
+ };
5528
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5529
+ payload?: Record<string, unknown> | undefined;
5530
+ retry?: z.objectInputType<{
5531
+ max_attempts: z.ZodNumber;
5532
+ attempt: z.ZodNumber;
5533
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5534
+ backoff_seconds: z.ZodNumber;
5535
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5536
+ last_error: z.ZodOptional<z.ZodObject<{
5537
+ message: z.ZodString;
5538
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5539
+ at: z.ZodDate;
5540
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5541
+ }, "strip", z.ZodTypeAny, {
5542
+ message: string;
5543
+ at: Date;
5544
+ code?: string | number | undefined;
5545
+ details?: Record<string, unknown> | undefined;
5546
+ }, {
5547
+ message: string;
5548
+ at: Date;
5549
+ code?: string | number | undefined;
5550
+ details?: Record<string, unknown> | undefined;
5551
+ }>>;
5552
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5553
+ on_failure?: z.objectInputType<{
5554
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5555
+ name: z.ZodOptional<z.ZodString>;
5556
+ ref: z.ZodOptional<z.ZodAny>;
5557
+ }, "strip", z.ZodTypeAny, {
5558
+ name?: string | undefined;
5559
+ ref?: any;
5560
+ }, {
5561
+ name?: string | undefined;
5562
+ ref?: any;
5563
+ }>>;
5564
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5565
+ title: z.ZodOptional<z.ZodString>;
5566
+ description: z.ZodOptional<z.ZodString>;
5567
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5568
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5569
+ name: z.ZodString;
5570
+ color: z.ZodOptional<z.ZodString>;
5571
+ hidden: z.ZodBoolean;
5572
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5573
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5574
+ }, "strip", z.ZodTypeAny, {
5575
+ name: string;
5576
+ hidden: boolean;
5577
+ base?: boolean | undefined;
5578
+ color?: string | undefined;
5579
+ category?: string | null | undefined;
5580
+ }, {
5581
+ name: string;
5582
+ hidden: boolean;
5583
+ base?: boolean | undefined;
5584
+ color?: string | undefined;
5585
+ category?: string | null | undefined;
5586
+ }>, "many">>>;
5587
+ }, "strip", z.ZodTypeAny, {
5588
+ description?: string | undefined;
5589
+ tags?: {
5590
+ name: string;
5591
+ hidden: boolean;
5592
+ base?: boolean | undefined;
5593
+ color?: string | undefined;
5594
+ category?: string | null | undefined;
5595
+ }[] | null | undefined;
5596
+ title?: string | undefined;
5597
+ priority?: "low" | "medium" | "high" | undefined;
5598
+ }, {
5599
+ description?: string | undefined;
5600
+ tags?: {
5601
+ name: string;
5602
+ hidden: boolean;
5603
+ base?: boolean | undefined;
5604
+ color?: string | undefined;
5605
+ category?: string | null | undefined;
5606
+ }[] | null | undefined;
5607
+ title?: string | undefined;
5608
+ priority?: "low" | "medium" | "high" | undefined;
5609
+ }>>;
5610
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5611
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5612
+ kind: z.ZodString;
5613
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5614
+ }, "strip", z.ZodTypeAny, {
5615
+ kind: string;
5616
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5617
+ payload: Record<string, unknown>;
5618
+ }, {
5619
+ kind: string;
5620
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5621
+ payload: Record<string, unknown>;
5622
+ }>, "many">>;
5623
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5624
+ } | {
5625
+ type: "human_task";
5626
+ title: string;
5627
+ description?: string | undefined;
5628
+ assignee_ref?: string | undefined;
5629
+ })[];
5630
+ when?: ZAutomationConditionGroup | undefined;
5631
+ is_fallback?: boolean | undefined;
5632
+ }>, "many">;
5633
+ guards: z.ZodObject<{
5634
+ max_tasks_per_run: z.ZodNumber;
5635
+ }, "strip", z.ZodTypeAny, {
5636
+ max_tasks_per_run: number;
5637
+ }, {
5638
+ max_tasks_per_run: number;
5639
+ }>;
5640
+ }, "strip", z.ZodTypeAny, {
5641
+ name: string;
5642
+ id: string;
5643
+ active: boolean;
5644
+ trigger: {
5645
+ type: "cron";
5646
+ cron: {
5647
+ expression: string;
5648
+ timezone?: string | undefined;
5649
+ };
5650
+ } | {
5651
+ type: "webhook";
5652
+ };
5653
+ selection: {
5654
+ appointment: {
5655
+ date_window: {
5656
+ offset_days: number;
5657
+ offset_mode: "calendar" | "business";
5658
+ };
5659
+ calendar_ids?: string[] | undefined;
5660
+ status_in?: string[] | undefined;
5661
+ status_base_in?: string[] | undefined;
5662
+ appointment_type_not_in?: string[] | undefined;
5663
+ professional_names?: string[] | undefined;
5664
+ procedure_names?: string[] | undefined;
5665
+ insurance_names?: string[] | undefined;
5666
+ address_names?: string[] | undefined;
5667
+ payment_status_in?: string[] | undefined;
5668
+ };
5669
+ target: "appointment";
5670
+ };
5671
+ branch_mode: "all" | "exclusive";
5672
+ branches: {
5673
+ name: string;
5674
+ id: string;
5675
+ outputs: ({
5676
+ type: "auto_task";
5677
+ kind: string;
5678
+ execute_at: {
5679
+ rule: "immediate";
5680
+ } | {
5681
+ base: "target_date" | "run_date";
5682
+ time: string;
5683
+ rule: "send_at_local";
5684
+ } | {
5685
+ rule: "relative_to_appointment";
5686
+ offset_minutes: number;
5687
+ };
5688
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5689
+ payload: Record<string, unknown>;
5690
+ retry?: z.objectOutputType<{
5691
+ max_attempts: z.ZodNumber;
5692
+ attempt: z.ZodNumber;
5693
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5694
+ backoff_seconds: z.ZodNumber;
5695
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5696
+ last_error: z.ZodOptional<z.ZodObject<{
5697
+ message: z.ZodString;
5698
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5699
+ at: z.ZodDate;
5700
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5701
+ }, "strip", z.ZodTypeAny, {
5702
+ message: string;
5703
+ at: Date;
5704
+ code?: string | number | undefined;
5705
+ details?: Record<string, unknown> | undefined;
5706
+ }, {
5707
+ message: string;
5708
+ at: Date;
5709
+ code?: string | number | undefined;
5710
+ details?: Record<string, unknown> | undefined;
5711
+ }>>;
5712
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5713
+ on_failure?: z.objectOutputType<{
5714
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5715
+ name: z.ZodOptional<z.ZodString>;
5716
+ ref: z.ZodOptional<z.ZodAny>;
5717
+ }, "strip", z.ZodTypeAny, {
5718
+ name?: string | undefined;
5719
+ ref?: any;
5720
+ }, {
5721
+ name?: string | undefined;
5722
+ ref?: any;
5723
+ }>>;
5724
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5725
+ title: z.ZodOptional<z.ZodString>;
5726
+ description: z.ZodOptional<z.ZodString>;
5727
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5728
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5729
+ name: z.ZodString;
5730
+ color: z.ZodOptional<z.ZodString>;
5731
+ hidden: z.ZodBoolean;
5732
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5733
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5734
+ }, "strip", z.ZodTypeAny, {
5735
+ name: string;
5736
+ hidden: boolean;
5737
+ base?: boolean | undefined;
5738
+ color?: string | undefined;
5739
+ category?: string | null | undefined;
5740
+ }, {
5741
+ name: string;
5742
+ hidden: boolean;
5743
+ base?: boolean | undefined;
5744
+ color?: string | undefined;
5745
+ category?: string | null | undefined;
5746
+ }>, "many">>>;
5747
+ }, "strip", z.ZodTypeAny, {
5748
+ description?: string | undefined;
5749
+ tags?: {
5750
+ name: string;
5751
+ hidden: boolean;
5752
+ base?: boolean | undefined;
5753
+ color?: string | undefined;
5754
+ category?: string | null | undefined;
5755
+ }[] | null | undefined;
5756
+ title?: string | undefined;
5757
+ priority?: "low" | "medium" | "high" | undefined;
5758
+ }, {
5759
+ description?: string | undefined;
5760
+ tags?: {
5761
+ name: string;
5762
+ hidden: boolean;
5763
+ base?: boolean | undefined;
5764
+ color?: string | undefined;
5765
+ category?: string | null | undefined;
5766
+ }[] | null | undefined;
5767
+ title?: string | undefined;
5768
+ priority?: "low" | "medium" | "high" | undefined;
5769
+ }>>;
5770
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5771
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5772
+ kind: z.ZodString;
5773
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5774
+ }, "strip", z.ZodTypeAny, {
5775
+ kind: string;
5776
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5777
+ payload: Record<string, unknown>;
5778
+ }, {
5779
+ kind: string;
5780
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5781
+ payload: Record<string, unknown>;
5782
+ }>, "many">>;
5783
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5784
+ } | {
5785
+ type: "human_task";
5786
+ title: string;
5787
+ description?: string | undefined;
5788
+ assignee_ref?: string | undefined;
5789
+ })[];
5790
+ when?: ZAutomationConditionGroup | undefined;
5791
+ is_fallback?: boolean | undefined;
5792
+ }[];
5793
+ guards: {
5794
+ max_tasks_per_run: number;
5795
+ };
5796
+ description?: string | undefined;
5797
+ }, {
5798
+ name: string;
5799
+ id: string;
5800
+ trigger: {
5801
+ type: "cron";
5802
+ cron: {
5803
+ expression: string;
5804
+ timezone?: string | undefined;
5805
+ };
5806
+ } | {
5807
+ type: "webhook";
5808
+ };
5809
+ selection: {
5810
+ appointment: {
5811
+ date_window: {
5812
+ offset_days: number;
5813
+ offset_mode: "calendar" | "business";
5814
+ };
5815
+ calendar_ids?: string[] | undefined;
5816
+ status_in?: string[] | undefined;
5817
+ status_base_in?: string[] | undefined;
5818
+ appointment_type_not_in?: string[] | undefined;
5819
+ professional_names?: string[] | undefined;
5820
+ procedure_names?: string[] | undefined;
5821
+ insurance_names?: string[] | undefined;
5822
+ address_names?: string[] | undefined;
5823
+ payment_status_in?: string[] | undefined;
5824
+ };
5825
+ target: "appointment";
5826
+ };
5827
+ branch_mode: "all" | "exclusive";
5828
+ branches: {
5829
+ name: string;
5830
+ id: string;
5831
+ outputs: ({
5832
+ type: "auto_task";
5833
+ kind: string;
5834
+ execute_at: {
5835
+ rule: "immediate";
5836
+ } | {
5837
+ base: "target_date" | "run_date";
5838
+ time: string;
5839
+ rule: "send_at_local";
5840
+ } | {
5841
+ rule: "relative_to_appointment";
5842
+ offset_minutes: number;
5843
+ };
5844
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5845
+ payload?: Record<string, unknown> | undefined;
5846
+ retry?: z.objectInputType<{
5847
+ max_attempts: z.ZodNumber;
5848
+ attempt: z.ZodNumber;
5849
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
5850
+ backoff_seconds: z.ZodNumber;
5851
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
5852
+ last_error: z.ZodOptional<z.ZodObject<{
5853
+ message: z.ZodString;
5854
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5855
+ at: z.ZodDate;
5856
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5857
+ }, "strip", z.ZodTypeAny, {
5858
+ message: string;
5859
+ at: Date;
5860
+ code?: string | number | undefined;
5861
+ details?: Record<string, unknown> | undefined;
5862
+ }, {
5863
+ message: string;
5864
+ at: Date;
5865
+ code?: string | number | undefined;
5866
+ details?: Record<string, unknown> | undefined;
5867
+ }>>;
5868
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5869
+ on_failure?: z.objectInputType<{
5870
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
5871
+ name: z.ZodOptional<z.ZodString>;
5872
+ ref: z.ZodOptional<z.ZodAny>;
5873
+ }, "strip", z.ZodTypeAny, {
5874
+ name?: string | undefined;
5875
+ ref?: any;
5876
+ }, {
5877
+ name?: string | undefined;
5878
+ ref?: any;
5879
+ }>>;
5880
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
5881
+ title: z.ZodOptional<z.ZodString>;
5882
+ description: z.ZodOptional<z.ZodString>;
5883
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
5884
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
5885
+ name: z.ZodString;
5886
+ color: z.ZodOptional<z.ZodString>;
5887
+ hidden: z.ZodBoolean;
5888
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5889
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
5890
+ }, "strip", z.ZodTypeAny, {
5891
+ name: string;
5892
+ hidden: boolean;
5893
+ base?: boolean | undefined;
5894
+ color?: string | undefined;
5895
+ category?: string | null | undefined;
5896
+ }, {
5897
+ name: string;
5898
+ hidden: boolean;
5899
+ base?: boolean | undefined;
5900
+ color?: string | undefined;
5901
+ category?: string | null | undefined;
5902
+ }>, "many">>>;
5903
+ }, "strip", z.ZodTypeAny, {
5904
+ description?: string | undefined;
5905
+ tags?: {
5906
+ name: string;
5907
+ hidden: boolean;
5908
+ base?: boolean | undefined;
5909
+ color?: string | undefined;
5910
+ category?: string | null | undefined;
5911
+ }[] | null | undefined;
5912
+ title?: string | undefined;
5913
+ priority?: "low" | "medium" | "high" | undefined;
5914
+ }, {
5915
+ description?: string | undefined;
5916
+ tags?: {
5917
+ name: string;
5918
+ hidden: boolean;
5919
+ base?: boolean | undefined;
5920
+ color?: string | undefined;
5921
+ category?: string | null | undefined;
5922
+ }[] | null | undefined;
5923
+ title?: string | undefined;
5924
+ priority?: "low" | "medium" | "high" | undefined;
5925
+ }>>;
5926
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
5927
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
5928
+ kind: z.ZodString;
5929
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
5930
+ }, "strip", z.ZodTypeAny, {
5931
+ kind: string;
5932
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5933
+ payload: Record<string, unknown>;
5934
+ }, {
5935
+ kind: string;
5936
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
5937
+ payload: Record<string, unknown>;
5938
+ }>, "many">>;
5939
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5940
+ } | {
5941
+ type: "human_task";
5942
+ title: string;
5943
+ description?: string | undefined;
5944
+ assignee_ref?: string | undefined;
5945
+ })[];
5946
+ when?: ZAutomationConditionGroup | undefined;
5947
+ is_fallback?: boolean | undefined;
5948
+ }[];
5949
+ guards: {
5950
+ max_tasks_per_run: number;
5951
+ };
5952
+ active?: boolean | undefined;
5953
+ description?: string | undefined;
5954
+ }>;
5955
+ expected_version: z.ZodNumber;
5956
+ }, "strip", z.ZodTypeAny, {
5957
+ routine: {
5958
+ name: string;
5959
+ id: string;
5960
+ active: boolean;
5961
+ trigger: {
5962
+ type: "cron";
5963
+ cron: {
5964
+ expression: string;
5965
+ timezone?: string | undefined;
5966
+ };
5967
+ } | {
5968
+ type: "webhook";
5969
+ };
5970
+ selection: {
5971
+ appointment: {
5972
+ date_window: {
5973
+ offset_days: number;
5974
+ offset_mode: "calendar" | "business";
5975
+ };
5976
+ calendar_ids?: string[] | undefined;
5977
+ status_in?: string[] | undefined;
5978
+ status_base_in?: string[] | undefined;
5979
+ appointment_type_not_in?: string[] | undefined;
5980
+ professional_names?: string[] | undefined;
5981
+ procedure_names?: string[] | undefined;
5982
+ insurance_names?: string[] | undefined;
5983
+ address_names?: string[] | undefined;
5984
+ payment_status_in?: string[] | undefined;
5985
+ };
5986
+ target: "appointment";
5987
+ };
5988
+ branch_mode: "all" | "exclusive";
5989
+ branches: {
5990
+ name: string;
5991
+ id: string;
5992
+ outputs: ({
5993
+ type: "auto_task";
5994
+ kind: string;
5995
+ execute_at: {
5996
+ rule: "immediate";
5997
+ } | {
5998
+ base: "target_date" | "run_date";
5999
+ time: string;
6000
+ rule: "send_at_local";
6001
+ } | {
6002
+ rule: "relative_to_appointment";
6003
+ offset_minutes: number;
6004
+ };
6005
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6006
+ payload: Record<string, unknown>;
6007
+ retry?: z.objectOutputType<{
6008
+ max_attempts: z.ZodNumber;
6009
+ attempt: z.ZodNumber;
6010
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
6011
+ backoff_seconds: z.ZodNumber;
6012
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
6013
+ last_error: z.ZodOptional<z.ZodObject<{
6014
+ message: z.ZodString;
6015
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
6016
+ at: z.ZodDate;
6017
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6018
+ }, "strip", z.ZodTypeAny, {
6019
+ message: string;
6020
+ at: Date;
6021
+ code?: string | number | undefined;
6022
+ details?: Record<string, unknown> | undefined;
6023
+ }, {
6024
+ message: string;
6025
+ at: Date;
6026
+ code?: string | number | undefined;
6027
+ details?: Record<string, unknown> | undefined;
6028
+ }>>;
6029
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6030
+ on_failure?: z.objectOutputType<{
6031
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
6032
+ name: z.ZodOptional<z.ZodString>;
6033
+ ref: z.ZodOptional<z.ZodAny>;
6034
+ }, "strip", z.ZodTypeAny, {
6035
+ name?: string | undefined;
6036
+ ref?: any;
6037
+ }, {
6038
+ name?: string | undefined;
6039
+ ref?: any;
6040
+ }>>;
6041
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
6042
+ title: z.ZodOptional<z.ZodString>;
6043
+ description: z.ZodOptional<z.ZodString>;
6044
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
6045
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6046
+ name: z.ZodString;
6047
+ color: z.ZodOptional<z.ZodString>;
6048
+ hidden: z.ZodBoolean;
6049
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6050
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
6051
+ }, "strip", z.ZodTypeAny, {
6052
+ name: string;
6053
+ hidden: boolean;
6054
+ base?: boolean | undefined;
6055
+ color?: string | undefined;
6056
+ category?: string | null | undefined;
6057
+ }, {
6058
+ name: string;
6059
+ hidden: boolean;
6060
+ base?: boolean | undefined;
6061
+ color?: string | undefined;
6062
+ category?: string | null | undefined;
6063
+ }>, "many">>>;
6064
+ }, "strip", z.ZodTypeAny, {
6065
+ description?: string | undefined;
6066
+ tags?: {
6067
+ name: string;
6068
+ hidden: boolean;
6069
+ base?: boolean | undefined;
6070
+ color?: string | undefined;
6071
+ category?: string | null | undefined;
6072
+ }[] | null | undefined;
6073
+ title?: string | undefined;
6074
+ priority?: "low" | "medium" | "high" | undefined;
6075
+ }, {
6076
+ description?: string | undefined;
6077
+ tags?: {
6078
+ name: string;
6079
+ hidden: boolean;
6080
+ base?: boolean | undefined;
6081
+ color?: string | undefined;
6082
+ category?: string | null | undefined;
6083
+ }[] | null | undefined;
6084
+ title?: string | undefined;
6085
+ priority?: "low" | "medium" | "high" | undefined;
6086
+ }>>;
6087
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
6088
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
6089
+ kind: z.ZodString;
6090
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6091
+ }, "strip", z.ZodTypeAny, {
6092
+ kind: string;
6093
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6094
+ payload: Record<string, unknown>;
6095
+ }, {
6096
+ kind: string;
6097
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6098
+ payload: Record<string, unknown>;
6099
+ }>, "many">>;
6100
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6101
+ } | {
6102
+ type: "human_task";
6103
+ title: string;
6104
+ description?: string | undefined;
6105
+ assignee_ref?: string | undefined;
6106
+ })[];
6107
+ when?: ZAutomationConditionGroup | undefined;
6108
+ is_fallback?: boolean | undefined;
6109
+ }[];
6110
+ guards: {
6111
+ max_tasks_per_run: number;
6112
+ };
6113
+ description?: string | undefined;
6114
+ };
6115
+ expected_version: number;
6116
+ }, {
6117
+ routine: {
6118
+ name: string;
6119
+ id: string;
6120
+ trigger: {
6121
+ type: "cron";
6122
+ cron: {
6123
+ expression: string;
6124
+ timezone?: string | undefined;
6125
+ };
6126
+ } | {
6127
+ type: "webhook";
6128
+ };
6129
+ selection: {
6130
+ appointment: {
6131
+ date_window: {
6132
+ offset_days: number;
6133
+ offset_mode: "calendar" | "business";
6134
+ };
6135
+ calendar_ids?: string[] | undefined;
6136
+ status_in?: string[] | undefined;
6137
+ status_base_in?: string[] | undefined;
6138
+ appointment_type_not_in?: string[] | undefined;
6139
+ professional_names?: string[] | undefined;
6140
+ procedure_names?: string[] | undefined;
6141
+ insurance_names?: string[] | undefined;
6142
+ address_names?: string[] | undefined;
6143
+ payment_status_in?: string[] | undefined;
6144
+ };
6145
+ target: "appointment";
6146
+ };
6147
+ branch_mode: "all" | "exclusive";
6148
+ branches: {
6149
+ name: string;
6150
+ id: string;
6151
+ outputs: ({
6152
+ type: "auto_task";
6153
+ kind: string;
6154
+ execute_at: {
6155
+ rule: "immediate";
6156
+ } | {
6157
+ base: "target_date" | "run_date";
6158
+ time: string;
6159
+ rule: "send_at_local";
6160
+ } | {
6161
+ rule: "relative_to_appointment";
6162
+ offset_minutes: number;
6163
+ };
6164
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6165
+ payload?: Record<string, unknown> | undefined;
6166
+ retry?: z.objectInputType<{
6167
+ max_attempts: z.ZodNumber;
6168
+ attempt: z.ZodNumber;
6169
+ strategy: z.ZodEnum<["fixed", "exponential"]>;
6170
+ backoff_seconds: z.ZodNumber;
6171
+ next_attempt_at: z.ZodOptional<z.ZodDate>;
6172
+ last_error: z.ZodOptional<z.ZodObject<{
6173
+ message: z.ZodString;
6174
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
6175
+ at: z.ZodDate;
6176
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
6177
+ }, "strip", z.ZodTypeAny, {
6178
+ message: string;
6179
+ at: Date;
6180
+ code?: string | number | undefined;
6181
+ details?: Record<string, unknown> | undefined;
6182
+ }, {
6183
+ message: string;
6184
+ at: Date;
6185
+ code?: string | number | undefined;
6186
+ details?: Record<string, unknown> | undefined;
6187
+ }>>;
6188
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6189
+ on_failure?: z.objectInputType<{
6190
+ handoff_to_user: z.ZodOptional<z.ZodObject<{
6191
+ name: z.ZodOptional<z.ZodString>;
6192
+ ref: z.ZodOptional<z.ZodAny>;
6193
+ }, "strip", z.ZodTypeAny, {
6194
+ name?: string | undefined;
6195
+ ref?: any;
6196
+ }, {
6197
+ name?: string | undefined;
6198
+ ref?: any;
6199
+ }>>;
6200
+ create_handoff_task: z.ZodOptional<z.ZodObject<{
6201
+ title: z.ZodOptional<z.ZodString>;
6202
+ description: z.ZodOptional<z.ZodString>;
6203
+ priority: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
6204
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6205
+ name: z.ZodString;
6206
+ color: z.ZodOptional<z.ZodString>;
6207
+ hidden: z.ZodBoolean;
6208
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6209
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
6210
+ }, "strip", z.ZodTypeAny, {
6211
+ name: string;
6212
+ hidden: boolean;
6213
+ base?: boolean | undefined;
6214
+ color?: string | undefined;
6215
+ category?: string | null | undefined;
6216
+ }, {
6217
+ name: string;
6218
+ hidden: boolean;
6219
+ base?: boolean | undefined;
6220
+ color?: string | undefined;
6221
+ category?: string | null | undefined;
6222
+ }>, "many">>>;
6223
+ }, "strip", z.ZodTypeAny, {
6224
+ description?: string | undefined;
6225
+ tags?: {
6226
+ name: string;
6227
+ hidden: boolean;
6228
+ base?: boolean | undefined;
6229
+ color?: string | undefined;
6230
+ category?: string | null | undefined;
6231
+ }[] | null | undefined;
6232
+ title?: string | undefined;
6233
+ priority?: "low" | "medium" | "high" | undefined;
6234
+ }, {
6235
+ description?: string | undefined;
6236
+ tags?: {
6237
+ name: string;
6238
+ hidden: boolean;
6239
+ base?: boolean | undefined;
6240
+ color?: string | undefined;
6241
+ category?: string | null | undefined;
6242
+ }[] | null | undefined;
6243
+ title?: string | undefined;
6244
+ priority?: "low" | "medium" | "high" | undefined;
6245
+ }>>;
6246
+ auto_fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
6247
+ handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "evo-integrations.sync-run"]>;
6248
+ kind: z.ZodString;
6249
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6250
+ }, "strip", z.ZodTypeAny, {
6251
+ kind: string;
6252
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6253
+ payload: Record<string, unknown>;
6254
+ }, {
6255
+ kind: string;
6256
+ handler: "notifications" | "ai_agent" | "invoices" | "webhook" | "custom" | "lead_reactivation" | "appointment_action" | "appointment_reminder" | "evo-integrations.sync-run";
6257
+ payload: Record<string, unknown>;
6258
+ }>, "many">>;
6259
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6260
+ } | {
6261
+ type: "human_task";
6262
+ title: string;
6263
+ description?: string | undefined;
6264
+ assignee_ref?: string | undefined;
6265
+ })[];
6266
+ when?: ZAutomationConditionGroup | undefined;
6267
+ is_fallback?: boolean | undefined;
6268
+ }[];
6269
+ guards: {
6270
+ max_tasks_per_run: number;
6271
+ };
6272
+ active?: boolean | undefined;
6273
+ description?: string | undefined;
6274
+ };
6275
+ expected_version: number;
6276
+ }>;
6277
+ export declare const zHubAutomationConfigSchema: z.ZodObject<{
6278
+ active: z.ZodDefault<z.ZodBoolean>;
6279
+ limits: z.ZodOptional<z.ZodObject<{
6280
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6281
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6282
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6283
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6284
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6285
+ }, z.ZodTypeAny, "passthrough">>>;
6286
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6287
+ active: z.ZodDefault<z.ZodBoolean>;
6288
+ limits: z.ZodOptional<z.ZodObject<{
6289
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6290
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6291
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6292
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6293
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6294
+ }, z.ZodTypeAny, "passthrough">>>;
6295
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6296
+ active: z.ZodDefault<z.ZodBoolean>;
6297
+ limits: z.ZodOptional<z.ZodObject<{
6298
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6299
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6300
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6301
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6302
+ max_tasks_per_run_default: z.ZodOptional<z.ZodNumber>;
6303
+ }, z.ZodTypeAny, "passthrough">>>;
6304
+ }, z.ZodTypeAny, "passthrough">>;
6305
+ export declare const zAutomationDryRunRequestSchema: z.ZodObject<{
6306
+ run_date: z.ZodOptional<z.ZodString>;
6307
+ }, "strip", z.ZodTypeAny, {
6308
+ run_date?: string | undefined;
6309
+ }, {
6310
+ run_date?: string | undefined;
6311
+ }>;
6312
+ export declare const zAutomationTriggerRequestSchema: z.ZodObject<{
3316
6313
  run_date: z.ZodOptional<z.ZodString>;
3317
6314
  }, "strip", z.ZodTypeAny, {
3318
6315
  run_date?: string | undefined;