evo360-types 1.3.723 → 1.3.728

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.
@@ -36,6 +36,33 @@ export const zMessagePricingSchema = z.object({
36
36
  pricing_model: z.string().nullable().optional(),
37
37
  }).passthrough();
38
38
 
39
+ /** Campos `nullable` por tolerância: o doc de e-mail tem vários produtores e não pode derrubar o parse da mensagem. */
40
+ export const zThreadMessageEmailSchema = z.object({
41
+ subject: z.string().nullable().optional(),
42
+ from_address: z.string().nullable().optional(),
43
+ from_name: z.string().nullable().optional(),
44
+ html: z.string().nullable().optional(),
45
+ message_id: z.string().nullable().optional(),
46
+ in_reply_to: z.string().nullable().optional(),
47
+ references: z.array(z.string()).nullable().optional(),
48
+ reply_to_addresses: z.array(z.string()).nullable().optional(),
49
+ recipient_address: z.string().nullable().optional(),
50
+ body_text: z.string().nullable().optional(),
51
+ body_html: z.string().nullable().optional(),
52
+ thread_id: z.string().nullable().optional(),
53
+ }).passthrough();
54
+
55
+ export const zThreadMessageEmailAttachmentSchema = z.object({
56
+ filename: z.string().nullable().optional(),
57
+ mime_type: z.string().nullable().optional(),
58
+ content_type: z.string().nullable().optional(),
59
+ size_bytes: z.number().nullable().optional(),
60
+ gcs_uri: z.string().nullable().optional(),
61
+ blocked: z.boolean().nullable().optional(),
62
+ blocked_reason: z.string().nullable().optional(),
63
+ quarantine_uri: z.string().nullable().optional(),
64
+ }).passthrough();
65
+
39
66
  export const zThreadMessageSchema = zFireDocSchema
40
67
  .extend({
41
68
  model_ver: z.number().default(1),
@@ -69,6 +96,8 @@ export const zThreadMessageSchema = zFireDocSchema
69
96
  message_id: z.string(),
70
97
  from: z.string().optional(),
71
98
  }).optional(),
99
+ email: zThreadMessageEmailSchema.optional(),
100
+ attachments: z.array(zThreadMessageEmailAttachmentSchema).optional(),
72
101
  forward: zMessageForwardSchema.optional(),
73
102
  forward_count: z.number().optional(),
74
103
  provider_message_id: z.string().optional(),
@@ -908,6 +908,22 @@ export declare const zCreateTaskActionInputSchema: z.ZodObject<{
908
908
  idempotency_key: z.ZodOptional<z.ZodString>;
909
909
  }, z.ZodTypeAny, "passthrough">>;
910
910
  export type ICreateTaskActionInputParsed = z.infer<typeof zCreateTaskActionInputSchema>;
911
+ /** Input da action `send_quick_reply` (feat-286) — envia a resposta rápida do
912
+ * canal do turno, por id. Só regras (nunca exposta ao LLM), fases `pre_llm` e
913
+ * `post_llm`. O corpo e a mídia são lidos na execução; as variáveis do texto e
914
+ * da legenda são resolvidas no backend em modo lenient. `preserve_unread`
915
+ * evita zerar o contador de não respondidas (paridade com `send_message`). */
916
+ export declare const zSendQuickReplyActionInputSchema: z.ZodObject<{
917
+ quick_reply_id: z.ZodString;
918
+ preserve_unread: z.ZodOptional<z.ZodBoolean>;
919
+ }, "strip", z.ZodTypeAny, {
920
+ quick_reply_id: string;
921
+ preserve_unread?: boolean | undefined;
922
+ }, {
923
+ quick_reply_id: string;
924
+ preserve_unread?: boolean | undefined;
925
+ }>;
926
+ export type ISendQuickReplyActionInput = z.infer<typeof zSendQuickReplyActionInputSchema>;
911
927
  /** Master switch do binding. `dry_run` força TODAS as regras do binding a
912
928
  * modo seco (kill switch). Default runtime quando ausente: `live`. */
913
929
  export declare const zHubiaRulesModeSchema: z.ZodEnum<["live", "dry_run"]>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zHubiaTicketClosedEventSchema = exports.zHubiaTicketClosedCloseSchema = exports.zAiBindingSchema = exports.zHubiaRuleSchema = exports.zHubiaRulesModeSchema = exports.zCreateTaskActionInputSchema = exports.zHubiaRuleActionSchema = exports.zHubiaRuleScopeSchema = exports.zHubiaConditionGroupSchema = exports.zHubiaConditionSchema = exports.zHubiaScheduleSchema = exports.zHubiaScheduleWindowSchema = exports.zHubiaConditionOpSchema = exports.zHubiaOutboundSourceSchema = exports.zHubiaRuleAppliesToSchema = exports.zHubiaRuleOutcomeSchema = exports.zHubiaRuleTriggerSchema = exports.zHubiaRulePhaseSchema = exports.zHubiaConversationModeSchema = exports.zHubiaConversationMessageSchema = exports.zHubiaV1ChannelConfigSchema = exports.zHubiaAttendanceModeSchema = void 0;
3
+ exports.zHubiaTicketClosedEventSchema = exports.zHubiaTicketClosedCloseSchema = exports.zAiBindingSchema = exports.zHubiaRuleSchema = exports.zHubiaRulesModeSchema = exports.zSendQuickReplyActionInputSchema = exports.zCreateTaskActionInputSchema = exports.zHubiaRuleActionSchema = exports.zHubiaRuleScopeSchema = exports.zHubiaConditionGroupSchema = exports.zHubiaConditionSchema = exports.zHubiaScheduleSchema = exports.zHubiaScheduleWindowSchema = exports.zHubiaConditionOpSchema = exports.zHubiaOutboundSourceSchema = exports.zHubiaRuleAppliesToSchema = exports.zHubiaRuleOutcomeSchema = exports.zHubiaRuleTriggerSchema = exports.zHubiaRulePhaseSchema = exports.zHubiaConversationModeSchema = exports.zHubiaConversationMessageSchema = exports.zHubiaV1ChannelConfigSchema = exports.zHubiaAttendanceModeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../../shared/zod-schemas");
6
6
  const zod_schemas_2 = require("../../evo-csq/zod-schemas");
@@ -245,6 +245,15 @@ exports.zCreateTaskActionInputSchema = zod_1.z.object({
245
245
  external_links: zod_1.z.array(zCreateTaskExternalLinkSchema).optional(),
246
246
  idempotency_key: zod_1.z.string().optional(),
247
247
  }).passthrough();
248
+ /** Input da action `send_quick_reply` (feat-286) — envia a resposta rápida do
249
+ * canal do turno, por id. Só regras (nunca exposta ao LLM), fases `pre_llm` e
250
+ * `post_llm`. O corpo e a mídia são lidos na execução; as variáveis do texto e
251
+ * da legenda são resolvidas no backend em modo lenient. `preserve_unread`
252
+ * evita zerar o contador de não respondidas (paridade com `send_message`). */
253
+ exports.zSendQuickReplyActionInputSchema = zod_1.z.object({
254
+ quick_reply_id: zod_1.z.string().min(1),
255
+ preserve_unread: zod_1.z.boolean().optional(),
256
+ });
248
257
  /** Master switch do binding. `dry_run` força TODAS as regras do binding a
249
258
  * modo seco (kill switch). Default runtime quando ausente: `live`. */
250
259
  exports.zHubiaRulesModeSchema = zod_1.z.enum(["live", "dry_run"]);
@@ -280,6 +280,18 @@ export const zCreateTaskActionInputSchema = z.object({
280
280
 
281
281
  export type ICreateTaskActionInputParsed = z.infer<typeof zCreateTaskActionInputSchema>;
282
282
 
283
+ /** Input da action `send_quick_reply` (feat-286) — envia a resposta rápida do
284
+ * canal do turno, por id. Só regras (nunca exposta ao LLM), fases `pre_llm` e
285
+ * `post_llm`. O corpo e a mídia são lidos na execução; as variáveis do texto e
286
+ * da legenda são resolvidas no backend em modo lenient. `preserve_unread`
287
+ * evita zerar o contador de não respondidas (paridade com `send_message`). */
288
+ export const zSendQuickReplyActionInputSchema = z.object({
289
+ quick_reply_id: z.string().min(1),
290
+ preserve_unread: z.boolean().optional(),
291
+ });
292
+
293
+ export type ISendQuickReplyActionInput = z.infer<typeof zSendQuickReplyActionInputSchema>;
294
+
283
295
  /** Master switch do binding. `dry_run` força TODAS as regras do binding a
284
296
  * modo seco (kill switch). Default runtime quando ausente: `live`. */
285
297
  export const zHubiaRulesModeSchema = z.enum(["live", "dry_run"]);
@@ -87,26 +87,26 @@ export declare const zNotificationEmailContentSchema: z.ZodEffects<z.ZodObject<{
87
87
  reply_to_message_id: z.ZodOptional<z.ZodString>;
88
88
  }, "strict", z.ZodTypeAny, {
89
89
  thread_id?: string | undefined;
90
- body_text?: string | undefined;
91
90
  subject?: string | undefined;
91
+ body_text?: string | undefined;
92
92
  body_html?: string | undefined;
93
93
  reply_to_message_id?: string | undefined;
94
94
  }, {
95
95
  thread_id?: string | undefined;
96
- body_text?: string | undefined;
97
96
  subject?: string | undefined;
97
+ body_text?: string | undefined;
98
98
  body_html?: string | undefined;
99
99
  reply_to_message_id?: string | undefined;
100
100
  }>, {
101
101
  thread_id?: string | undefined;
102
- body_text?: string | undefined;
103
102
  subject?: string | undefined;
103
+ body_text?: string | undefined;
104
104
  body_html?: string | undefined;
105
105
  reply_to_message_id?: string | undefined;
106
106
  }, {
107
107
  thread_id?: string | undefined;
108
- body_text?: string | undefined;
109
108
  subject?: string | undefined;
109
+ body_text?: string | undefined;
110
110
  body_html?: string | undefined;
111
111
  reply_to_message_id?: string | undefined;
112
112
  }>;
@@ -182,26 +182,26 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
182
182
  reply_to_message_id: z.ZodOptional<z.ZodString>;
183
183
  }, "strict", z.ZodTypeAny, {
184
184
  thread_id?: string | undefined;
185
- body_text?: string | undefined;
186
185
  subject?: string | undefined;
186
+ body_text?: string | undefined;
187
187
  body_html?: string | undefined;
188
188
  reply_to_message_id?: string | undefined;
189
189
  }, {
190
190
  thread_id?: string | undefined;
191
- body_text?: string | undefined;
192
191
  subject?: string | undefined;
192
+ body_text?: string | undefined;
193
193
  body_html?: string | undefined;
194
194
  reply_to_message_id?: string | undefined;
195
195
  }>, {
196
196
  thread_id?: string | undefined;
197
- body_text?: string | undefined;
198
197
  subject?: string | undefined;
198
+ body_text?: string | undefined;
199
199
  body_html?: string | undefined;
200
200
  reply_to_message_id?: string | undefined;
201
201
  }, {
202
202
  thread_id?: string | undefined;
203
- body_text?: string | undefined;
204
203
  subject?: string | undefined;
204
+ body_text?: string | undefined;
205
205
  body_html?: string | undefined;
206
206
  reply_to_message_id?: string | undefined;
207
207
  }>>;
@@ -408,26 +408,26 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
408
408
  reply_to_message_id: z.ZodOptional<z.ZodString>;
409
409
  }, "strict", z.ZodTypeAny, {
410
410
  thread_id?: string | undefined;
411
- body_text?: string | undefined;
412
411
  subject?: string | undefined;
412
+ body_text?: string | undefined;
413
413
  body_html?: string | undefined;
414
414
  reply_to_message_id?: string | undefined;
415
415
  }, {
416
416
  thread_id?: string | undefined;
417
- body_text?: string | undefined;
418
417
  subject?: string | undefined;
418
+ body_text?: string | undefined;
419
419
  body_html?: string | undefined;
420
420
  reply_to_message_id?: string | undefined;
421
421
  }>, {
422
422
  thread_id?: string | undefined;
423
- body_text?: string | undefined;
424
423
  subject?: string | undefined;
424
+ body_text?: string | undefined;
425
425
  body_html?: string | undefined;
426
426
  reply_to_message_id?: string | undefined;
427
427
  }, {
428
428
  thread_id?: string | undefined;
429
- body_text?: string | undefined;
430
429
  subject?: string | undefined;
430
+ body_text?: string | undefined;
431
431
  body_html?: string | undefined;
432
432
  reply_to_message_id?: string | undefined;
433
433
  }>>;
@@ -634,26 +634,26 @@ export declare const zNotificationMessageSchema: z.ZodObject<{
634
634
  reply_to_message_id: z.ZodOptional<z.ZodString>;
635
635
  }, "strict", z.ZodTypeAny, {
636
636
  thread_id?: string | undefined;
637
- body_text?: string | undefined;
638
637
  subject?: string | undefined;
638
+ body_text?: string | undefined;
639
639
  body_html?: string | undefined;
640
640
  reply_to_message_id?: string | undefined;
641
641
  }, {
642
642
  thread_id?: string | undefined;
643
- body_text?: string | undefined;
644
643
  subject?: string | undefined;
644
+ body_text?: string | undefined;
645
645
  body_html?: string | undefined;
646
646
  reply_to_message_id?: string | undefined;
647
647
  }>, {
648
648
  thread_id?: string | undefined;
649
- body_text?: string | undefined;
650
649
  subject?: string | undefined;
650
+ body_text?: string | undefined;
651
651
  body_html?: string | undefined;
652
652
  reply_to_message_id?: string | undefined;
653
653
  }, {
654
654
  thread_id?: string | undefined;
655
- body_text?: string | undefined;
656
655
  subject?: string | undefined;
656
+ body_text?: string | undefined;
657
657
  body_html?: string | undefined;
658
658
  reply_to_message_id?: string | undefined;
659
659
  }>>;
@@ -1134,26 +1134,26 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1134
1134
  reply_to_message_id: z.ZodOptional<z.ZodString>;
1135
1135
  }, "strict", z.ZodTypeAny, {
1136
1136
  thread_id?: string | undefined;
1137
- body_text?: string | undefined;
1138
1137
  subject?: string | undefined;
1138
+ body_text?: string | undefined;
1139
1139
  body_html?: string | undefined;
1140
1140
  reply_to_message_id?: string | undefined;
1141
1141
  }, {
1142
1142
  thread_id?: string | undefined;
1143
- body_text?: string | undefined;
1144
1143
  subject?: string | undefined;
1144
+ body_text?: string | undefined;
1145
1145
  body_html?: string | undefined;
1146
1146
  reply_to_message_id?: string | undefined;
1147
1147
  }>, {
1148
1148
  thread_id?: string | undefined;
1149
- body_text?: string | undefined;
1150
1149
  subject?: string | undefined;
1150
+ body_text?: string | undefined;
1151
1151
  body_html?: string | undefined;
1152
1152
  reply_to_message_id?: string | undefined;
1153
1153
  }, {
1154
1154
  thread_id?: string | undefined;
1155
- body_text?: string | undefined;
1156
1155
  subject?: string | undefined;
1156
+ body_text?: string | undefined;
1157
1157
  body_html?: string | undefined;
1158
1158
  reply_to_message_id?: string | undefined;
1159
1159
  }>>;
@@ -1392,26 +1392,26 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1392
1392
  reply_to_message_id: z.ZodOptional<z.ZodString>;
1393
1393
  }, "strict", z.ZodTypeAny, {
1394
1394
  thread_id?: string | undefined;
1395
- body_text?: string | undefined;
1396
1395
  subject?: string | undefined;
1396
+ body_text?: string | undefined;
1397
1397
  body_html?: string | undefined;
1398
1398
  reply_to_message_id?: string | undefined;
1399
1399
  }, {
1400
1400
  thread_id?: string | undefined;
1401
- body_text?: string | undefined;
1402
1401
  subject?: string | undefined;
1402
+ body_text?: string | undefined;
1403
1403
  body_html?: string | undefined;
1404
1404
  reply_to_message_id?: string | undefined;
1405
1405
  }>, {
1406
1406
  thread_id?: string | undefined;
1407
- body_text?: string | undefined;
1408
1407
  subject?: string | undefined;
1408
+ body_text?: string | undefined;
1409
1409
  body_html?: string | undefined;
1410
1410
  reply_to_message_id?: string | undefined;
1411
1411
  }, {
1412
1412
  thread_id?: string | undefined;
1413
- body_text?: string | undefined;
1414
1413
  subject?: string | undefined;
1414
+ body_text?: string | undefined;
1415
1415
  body_html?: string | undefined;
1416
1416
  reply_to_message_id?: string | undefined;
1417
1417
  }>>;
@@ -1650,26 +1650,26 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1650
1650
  reply_to_message_id: z.ZodOptional<z.ZodString>;
1651
1651
  }, "strict", z.ZodTypeAny, {
1652
1652
  thread_id?: string | undefined;
1653
- body_text?: string | undefined;
1654
1653
  subject?: string | undefined;
1654
+ body_text?: string | undefined;
1655
1655
  body_html?: string | undefined;
1656
1656
  reply_to_message_id?: string | undefined;
1657
1657
  }, {
1658
1658
  thread_id?: string | undefined;
1659
- body_text?: string | undefined;
1660
1659
  subject?: string | undefined;
1660
+ body_text?: string | undefined;
1661
1661
  body_html?: string | undefined;
1662
1662
  reply_to_message_id?: string | undefined;
1663
1663
  }>, {
1664
1664
  thread_id?: string | undefined;
1665
- body_text?: string | undefined;
1666
1665
  subject?: string | undefined;
1666
+ body_text?: string | undefined;
1667
1667
  body_html?: string | undefined;
1668
1668
  reply_to_message_id?: string | undefined;
1669
1669
  }, {
1670
1670
  thread_id?: string | undefined;
1671
- body_text?: string | undefined;
1672
1671
  subject?: string | undefined;
1672
+ body_text?: string | undefined;
1673
1673
  body_html?: string | undefined;
1674
1674
  reply_to_message_id?: string | undefined;
1675
1675
  }>>;
@@ -1908,26 +1908,26 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
1908
1908
  reply_to_message_id: z.ZodOptional<z.ZodString>;
1909
1909
  }, "strict", z.ZodTypeAny, {
1910
1910
  thread_id?: string | undefined;
1911
- body_text?: string | undefined;
1912
1911
  subject?: string | undefined;
1912
+ body_text?: string | undefined;
1913
1913
  body_html?: string | undefined;
1914
1914
  reply_to_message_id?: string | undefined;
1915
1915
  }, {
1916
1916
  thread_id?: string | undefined;
1917
- body_text?: string | undefined;
1918
1917
  subject?: string | undefined;
1918
+ body_text?: string | undefined;
1919
1919
  body_html?: string | undefined;
1920
1920
  reply_to_message_id?: string | undefined;
1921
1921
  }>, {
1922
1922
  thread_id?: string | undefined;
1923
- body_text?: string | undefined;
1924
1923
  subject?: string | undefined;
1924
+ body_text?: string | undefined;
1925
1925
  body_html?: string | undefined;
1926
1926
  reply_to_message_id?: string | undefined;
1927
1927
  }, {
1928
1928
  thread_id?: string | undefined;
1929
- body_text?: string | undefined;
1930
1929
  subject?: string | undefined;
1930
+ body_text?: string | undefined;
1931
1931
  body_html?: string | undefined;
1932
1932
  reply_to_message_id?: string | undefined;
1933
1933
  }>>;
@@ -2166,26 +2166,26 @@ export declare const zDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2166
2166
  reply_to_message_id: z.ZodOptional<z.ZodString>;
2167
2167
  }, "strict", z.ZodTypeAny, {
2168
2168
  thread_id?: string | undefined;
2169
- body_text?: string | undefined;
2170
2169
  subject?: string | undefined;
2170
+ body_text?: string | undefined;
2171
2171
  body_html?: string | undefined;
2172
2172
  reply_to_message_id?: string | undefined;
2173
2173
  }, {
2174
2174
  thread_id?: string | undefined;
2175
- body_text?: string | undefined;
2176
2175
  subject?: string | undefined;
2176
+ body_text?: string | undefined;
2177
2177
  body_html?: string | undefined;
2178
2178
  reply_to_message_id?: string | undefined;
2179
2179
  }>, {
2180
2180
  thread_id?: string | undefined;
2181
- body_text?: string | undefined;
2182
2181
  subject?: string | undefined;
2182
+ body_text?: string | undefined;
2183
2183
  body_html?: string | undefined;
2184
2184
  reply_to_message_id?: string | undefined;
2185
2185
  }, {
2186
2186
  thread_id?: string | undefined;
2187
- body_text?: string | undefined;
2188
2187
  subject?: string | undefined;
2188
+ body_text?: string | undefined;
2189
2189
  body_html?: string | undefined;
2190
2190
  reply_to_message_id?: string | undefined;
2191
2191
  }>>;
@@ -2425,26 +2425,26 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2425
2425
  reply_to_message_id: z.ZodOptional<z.ZodString>;
2426
2426
  }, "strict", z.ZodTypeAny, {
2427
2427
  thread_id?: string | undefined;
2428
- body_text?: string | undefined;
2429
2428
  subject?: string | undefined;
2429
+ body_text?: string | undefined;
2430
2430
  body_html?: string | undefined;
2431
2431
  reply_to_message_id?: string | undefined;
2432
2432
  }, {
2433
2433
  thread_id?: string | undefined;
2434
- body_text?: string | undefined;
2435
2434
  subject?: string | undefined;
2435
+ body_text?: string | undefined;
2436
2436
  body_html?: string | undefined;
2437
2437
  reply_to_message_id?: string | undefined;
2438
2438
  }>, {
2439
2439
  thread_id?: string | undefined;
2440
- body_text?: string | undefined;
2441
2440
  subject?: string | undefined;
2441
+ body_text?: string | undefined;
2442
2442
  body_html?: string | undefined;
2443
2443
  reply_to_message_id?: string | undefined;
2444
2444
  }, {
2445
2445
  thread_id?: string | undefined;
2446
- body_text?: string | undefined;
2447
2446
  subject?: string | undefined;
2447
+ body_text?: string | undefined;
2448
2448
  body_html?: string | undefined;
2449
2449
  reply_to_message_id?: string | undefined;
2450
2450
  }>>;
@@ -2647,26 +2647,26 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2647
2647
  reply_to_message_id: z.ZodOptional<z.ZodString>;
2648
2648
  }, "strict", z.ZodTypeAny, {
2649
2649
  thread_id?: string | undefined;
2650
- body_text?: string | undefined;
2651
2650
  subject?: string | undefined;
2651
+ body_text?: string | undefined;
2652
2652
  body_html?: string | undefined;
2653
2653
  reply_to_message_id?: string | undefined;
2654
2654
  }, {
2655
2655
  thread_id?: string | undefined;
2656
- body_text?: string | undefined;
2657
2656
  subject?: string | undefined;
2657
+ body_text?: string | undefined;
2658
2658
  body_html?: string | undefined;
2659
2659
  reply_to_message_id?: string | undefined;
2660
2660
  }>, {
2661
2661
  thread_id?: string | undefined;
2662
- body_text?: string | undefined;
2663
2662
  subject?: string | undefined;
2663
+ body_text?: string | undefined;
2664
2664
  body_html?: string | undefined;
2665
2665
  reply_to_message_id?: string | undefined;
2666
2666
  }, {
2667
2667
  thread_id?: string | undefined;
2668
- body_text?: string | undefined;
2669
2668
  subject?: string | undefined;
2669
+ body_text?: string | undefined;
2670
2670
  body_html?: string | undefined;
2671
2671
  reply_to_message_id?: string | undefined;
2672
2672
  }>>;
@@ -2869,26 +2869,26 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
2869
2869
  reply_to_message_id: z.ZodOptional<z.ZodString>;
2870
2870
  }, "strict", z.ZodTypeAny, {
2871
2871
  thread_id?: string | undefined;
2872
- body_text?: string | undefined;
2873
2872
  subject?: string | undefined;
2873
+ body_text?: string | undefined;
2874
2874
  body_html?: string | undefined;
2875
2875
  reply_to_message_id?: string | undefined;
2876
2876
  }, {
2877
2877
  thread_id?: string | undefined;
2878
- body_text?: string | undefined;
2879
2878
  subject?: string | undefined;
2879
+ body_text?: string | undefined;
2880
2880
  body_html?: string | undefined;
2881
2881
  reply_to_message_id?: string | undefined;
2882
2882
  }>, {
2883
2883
  thread_id?: string | undefined;
2884
- body_text?: string | undefined;
2885
2884
  subject?: string | undefined;
2885
+ body_text?: string | undefined;
2886
2886
  body_html?: string | undefined;
2887
2887
  reply_to_message_id?: string | undefined;
2888
2888
  }, {
2889
2889
  thread_id?: string | undefined;
2890
- body_text?: string | undefined;
2891
2890
  subject?: string | undefined;
2891
+ body_text?: string | undefined;
2892
2892
  body_html?: string | undefined;
2893
2893
  reply_to_message_id?: string | undefined;
2894
2894
  }>>;
@@ -3091,26 +3091,26 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
3091
3091
  reply_to_message_id: z.ZodOptional<z.ZodString>;
3092
3092
  }, "strict", z.ZodTypeAny, {
3093
3093
  thread_id?: string | undefined;
3094
- body_text?: string | undefined;
3095
3094
  subject?: string | undefined;
3095
+ body_text?: string | undefined;
3096
3096
  body_html?: string | undefined;
3097
3097
  reply_to_message_id?: string | undefined;
3098
3098
  }, {
3099
3099
  thread_id?: string | undefined;
3100
- body_text?: string | undefined;
3101
3100
  subject?: string | undefined;
3101
+ body_text?: string | undefined;
3102
3102
  body_html?: string | undefined;
3103
3103
  reply_to_message_id?: string | undefined;
3104
3104
  }>, {
3105
3105
  thread_id?: string | undefined;
3106
- body_text?: string | undefined;
3107
3106
  subject?: string | undefined;
3107
+ body_text?: string | undefined;
3108
3108
  body_html?: string | undefined;
3109
3109
  reply_to_message_id?: string | undefined;
3110
3110
  }, {
3111
3111
  thread_id?: string | undefined;
3112
- body_text?: string | undefined;
3113
3112
  subject?: string | undefined;
3113
+ body_text?: string | undefined;
3114
3114
  body_html?: string | undefined;
3115
3115
  reply_to_message_id?: string | undefined;
3116
3116
  }>>;
@@ -3313,26 +3313,26 @@ export declare const zNexusDirectSendPayloadSchema: z.ZodEffects<z.ZodObject<{
3313
3313
  reply_to_message_id: z.ZodOptional<z.ZodString>;
3314
3314
  }, "strict", z.ZodTypeAny, {
3315
3315
  thread_id?: string | undefined;
3316
- body_text?: string | undefined;
3317
3316
  subject?: string | undefined;
3317
+ body_text?: string | undefined;
3318
3318
  body_html?: string | undefined;
3319
3319
  reply_to_message_id?: string | undefined;
3320
3320
  }, {
3321
3321
  thread_id?: string | undefined;
3322
- body_text?: string | undefined;
3323
3322
  subject?: string | undefined;
3323
+ body_text?: string | undefined;
3324
3324
  body_html?: string | undefined;
3325
3325
  reply_to_message_id?: string | undefined;
3326
3326
  }>, {
3327
3327
  thread_id?: string | undefined;
3328
- body_text?: string | undefined;
3329
3328
  subject?: string | undefined;
3329
+ body_text?: string | undefined;
3330
3330
  body_html?: string | undefined;
3331
3331
  reply_to_message_id?: string | undefined;
3332
3332
  }, {
3333
3333
  thread_id?: string | undefined;
3334
- body_text?: string | undefined;
3335
3334
  subject?: string | undefined;
3335
+ body_text?: string | undefined;
3336
3336
  body_html?: string | undefined;
3337
3337
  reply_to_message_id?: string | undefined;
3338
3338
  }>>;
@@ -19,6 +19,12 @@ export declare const FORWARD_MAX_RECIPIENTS = 10;
19
19
  export declare const FORWARD_INTRO_MAX_CHARS = 1000;
20
20
  /** Teto do assunto (RFC 5322), igual ao do composer de e-mail do Omni. */
21
21
  export declare const FORWARD_EMAIL_SUBJECT_MAX_CHARS = 998;
22
+ /**
23
+ * Envios por destinatário WhatsApp/Instagram: intro + texto + anexos de cada
24
+ * mensagem. Segura o disjuntor do WhatsApp (40 envios em 6 h por par) quando a
25
+ * origem é e-mail com anexos.
26
+ */
27
+ export declare const FORWARD_MAX_PARTS_PER_RECIPIENT = 30;
22
28
  /** Lote `running` sem atualização há mais que isto é mostrado como interrompido. */
23
29
  export declare const FORWARD_STALE_AFTER_MS: number;
24
30
  /** Evento de timeline gravado na thread de ORIGEM ao criar o lote. */
@@ -26,11 +32,18 @@ export declare const FORWARD_TIMELINE_EVENT_TYPE: "messages_forwarded";
26
32
  export type ForwardBatchStatus = "running" | "done" | "done_with_failures";
27
33
  export type ForwardItemStatus = "pending" | "sending" | "sent" | "failed" | "skipped";
28
34
  /** Motivos decididos na pré-validação (item nasce `skipped`, nenhuma chamada ao provedor). */
29
- export type ForwardSkipReason = "window_closed" | "type_not_supported" | "media_too_large" | "media_unavailable" | "channel_not_supported" | "attachments_over_limit" | "recipient_address_missing" | "email_identity_conflict";
35
+ export type ForwardSkipReason = "window_closed" | "type_not_supported" | "media_too_large" | "media_unavailable" | "channel_not_supported" | "attachments_over_limit" | "recipient_address_missing" | "email_identity_conflict"
36
+ /** Destinatário é a própria thread de origem e a mensagem já está no canal escolhido. */
37
+ | "same_channel"
38
+ /** A mensagem passaria do `FORWARD_MAX_PARTS_PER_RECIPIENT` (corte cronológico). */
39
+ | "parts_over_limit";
30
40
  /** Motivos de falha no envio (item passou por `sending`). */
31
41
  export type ForwardFailReason = "provider_error" | "window_closed" | "send_budget_exceeded" | "interrupted";
32
42
  export type ForwardItemReason = ForwardSkipReason | ForwardFailReason;
33
- export type ForwardContentKind = "text" | "image" | "video" | "audio" | "document";
43
+ /** `email`: mensagem de origem e-mail (assunto + corpo + anexos), entregue em `parts`. */
44
+ export type ForwardContentKind = "text" | "image" | "video" | "audio" | "document" | "email";
45
+ /** Por que um anexo de origem e-mail ficou fora do item (o texto e os outros anexos seguem). */
46
+ export type ForwardAttachmentSkipReason = "quarantined" | "type_not_supported" | "media_too_large" | "media_unavailable" | "attachments_over_limit";
34
47
  /** Canais aceitos como DESTINO. E-mail é agregado: um e-mail por destinatário. SMS fica fora. */
35
48
  export type ForwardDestinationKind = "whatsapp" | "instagram" | "email";
36
49
  /** `hub-waba`, `hub-instagram` ou o provider do canal de e-mail (`smtp`, `amazon-ses`, ...). */
@@ -91,6 +104,17 @@ export interface IForwardBatch extends IFireDoc {
91
104
  /** Um assunto por lote; gravado só quando há destinatário e-mail. */
92
105
  email_subject?: string | null;
93
106
  }
107
+ /** Origem e-mail: o que o item entrega. `has_text` = a parte principal (texto, ou o PDF do e-mail no WhatsApp). */
108
+ export interface IForwardItemParts {
109
+ has_text: boolean;
110
+ /** Posições em `attachments[]` da origem; o worker envia exatamente estas, nesta ordem. */
111
+ attachment_indexes: number[];
112
+ /** `has_text` + `attachment_indexes.length`. */
113
+ total: number;
114
+ /** Só no item gravado: partes aceitas pelo provedor até agora. */
115
+ sent?: number;
116
+ skipped_attachments?: Partial<Record<ForwardAttachmentSkipReason, number>>;
117
+ }
94
118
  export interface IForwardItem {
95
119
  /** `${recipient_thread_id}__${message_id}` ou `${recipient_thread_id}__intro`. */
96
120
  item_id: string;
@@ -110,6 +134,7 @@ export interface IForwardItem {
110
134
  /** Destino e-mail: o N de `[Anexo N]` no corpo. */
111
135
  attachment_index?: number | null;
112
136
  dest_notification_message_id?: string | null;
137
+ parts?: IForwardItemParts | null;
113
138
  sent_at?: Date | null;
114
139
  updated_at?: Date;
115
140
  }
@@ -125,6 +150,7 @@ export interface IForwardPlanItem {
125
150
  filename: string;
126
151
  size_bytes: number | null;
127
152
  } | null;
153
+ parts?: IForwardItemParts | null;
128
154
  }
129
155
  export interface IForwardPlanEmailAttachments {
130
156
  count: number;
@@ -188,7 +214,7 @@ export interface IMessageForward {
188
214
  source_message_ids?: string[];
189
215
  item_ids?: string[];
190
216
  }
191
- export type ForwardableMessage = Pick<IThreadMessage, "type" | "direction" | "channel_type" | "body" | "media" | "template"> & {
217
+ export type ForwardableMessage = Pick<IThreadMessage, "type" | "direction" | "channel_type" | "channel_id" | "body" | "media" | "template" | "email" | "attachments"> & {
192
218
  revoked?: unknown;
193
219
  deleted_at?: unknown;
194
220
  };
@@ -209,5 +235,43 @@ export type ForwardContentResolution = {
209
235
  * anexo NÃO ficam aqui: dependem do objeto no Storage e da allowlist do provider.
210
236
  */
211
237
  export declare function resolveForwardContent(m: ForwardableMessage, dest: ForwardDestinationKind | null): ForwardContentResolution;
238
+ export interface ForwardEmailSourceAttachment {
239
+ /** Posição em `attachments[]` da mensagem de origem. */
240
+ source_index: number;
241
+ filename: string;
242
+ mime_type: string;
243
+ size_bytes: number | null;
244
+ gcs_uri: string;
245
+ /** Destino e-mail ou `null`: sempre `null` (vai como anexo). */
246
+ send_as: "image" | "document" | null;
247
+ }
248
+ export type ForwardEmailSourceResolution = {
249
+ ok: true;
250
+ kind: "email";
251
+ subject: string;
252
+ body: string;
253
+ attachments: ForwardEmailSourceAttachment[];
254
+ skipped_attachments: Partial<Record<ForwardAttachmentSkipReason, number>>;
255
+ } | {
256
+ ok: false;
257
+ reason: ForwardSkipReason;
258
+ };
259
+ /**
260
+ * Como um anexo de e-mail sai no WhatsApp/Instagram. Lista conservadora: o que
261
+ * fica fora (gif e webp no WhatsApp, documento no Instagram) a Meta recusa ou
262
+ * entrega mal.
263
+ */
264
+ export declare function forwardEmailAttachmentSendAs(mime: string, dest: "whatsapp" | "instagram"): "image" | "document" | null;
265
+ /**
266
+ * Origem e-mail (recebido `type:'text'`, enviado `type:'system'`) para qualquer
267
+ * destino. `html`/`body_html` nunca são lidos. Guarda de bucket/tenant, tamanho,
268
+ * allowlist do e-mail e tetos ficam no backend.
269
+ */
270
+ export declare function resolveForwardEmailContent(m: ForwardableMessage, dest: ForwardDestinationKind | null): ForwardEmailSourceResolution;
271
+ /**
272
+ * Ponto de entrada da origem: e-mail vai para `resolveForwardEmailContent`; o
273
+ * resto (SMS incluído, que continua recusado) para `resolveForwardContent`.
274
+ */
275
+ export declare function resolveForwardSource(m: ForwardableMessage, dest: ForwardDestinationKind | null): ForwardContentResolution | ForwardEmailSourceResolution;
212
276
  /** Id determinístico do item: um destinatário aparece uma vez no lote, então é único. */
213
277
  export declare function buildForwardItemId(recipientThreadId: string, messageId: string | null): string;