@qcobro/common 1.29.1 → 1.31.0

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.
Files changed (36) hide show
  1. package/dist/config.d.ts +12 -8
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js +40 -13
  4. package/dist/config.js.map +1 -1
  5. package/dist/schemas/agentEvaluations.d.ts +51 -91
  6. package/dist/schemas/agentEvaluations.d.ts.map +1 -1
  7. package/dist/schemas/agentEvaluations.js +12 -7
  8. package/dist/schemas/agentEvaluations.js.map +1 -1
  9. package/dist/schemas/contactLog.d.ts +92 -18
  10. package/dist/schemas/contactLog.d.ts.map +1 -1
  11. package/dist/schemas/contactLog.js +101 -12
  12. package/dist/schemas/contactLog.js.map +1 -1
  13. package/dist/schemas/email.d.ts +6 -6
  14. package/dist/schemas/email.js +6 -6
  15. package/dist/schemas/email.js.map +1 -1
  16. package/dist/schemas/emailEvent.d.ts +23 -0
  17. package/dist/schemas/emailEvent.d.ts.map +1 -0
  18. package/dist/schemas/emailEvent.js +27 -0
  19. package/dist/schemas/emailEvent.js.map +1 -0
  20. package/dist/schemas/index.d.ts +1 -0
  21. package/dist/schemas/index.d.ts.map +1 -1
  22. package/dist/schemas/index.js +1 -0
  23. package/dist/schemas/index.js.map +1 -1
  24. package/dist/schemas/whatsApp.d.ts +18 -0
  25. package/dist/schemas/whatsApp.d.ts.map +1 -1
  26. package/dist/schemas/whatsApp.js +17 -0
  27. package/dist/schemas/whatsApp.js.map +1 -1
  28. package/dist/types/agentEvaluations.d.ts +1 -1
  29. package/dist/types/agentEvaluations.d.ts.map +1 -1
  30. package/dist/types/campaigns.d.ts +6 -3
  31. package/dist/types/campaigns.d.ts.map +1 -1
  32. package/dist/types/dispatch.d.ts +7 -0
  33. package/dist/types/dispatch.d.ts.map +1 -1
  34. package/dist/types/email.d.ts +2 -2
  35. package/dist/types/email.d.ts.map +1 -1
  36. package/package.json +1 -1
@@ -1,22 +1,70 @@
1
1
  import { z } from "zod";
2
- export declare const contactOutcomeSchema: z.ZodEnum<{
2
+ /**
3
+ * A gestión answers up to three independent questions, one per axis. They were previously
4
+ * flattened into a single `outcome` enum, which is why no value meant one thing: `WRONG_NUMBER`
5
+ * described both a carrier rejection (a delivery failure) and a human saying "that's not me"
6
+ * (a delivery *success* carrying a valuable finding), and `OTHER` served as dispatch
7
+ * placeholder, escalation marker, and unclassifiable-conversation catch-all at once.
8
+ */
9
+ /** Did the attempt reach the account holder's device or inbox? Never null. */
10
+ export declare const entregaSchema: z.ZodEnum<{
11
+ DISPATCHED: "DISPATCHED";
3
12
  DELIVERED: "DELIVERED";
4
- NOT_DELIVERED: "NOT_DELIVERED";
13
+ FAILED: "FAILED";
14
+ }>;
15
+ export type Entrega = z.infer<typeof entregaSchema>;
16
+ /**
17
+ * Why delivery failed. Set if and only if `entrega` is `FAILED`. The values are chosen so a
18
+ * retry policy can branch on them: `NO_ANSWER` and `BUSY` are transient, `INVALID_DESTINATION`
19
+ * and `CHANNEL_UNSUPPORTED` are permanent for that contact point.
20
+ */
21
+ export declare const deliveryReasonSchema: z.ZodEnum<{
5
22
  NO_ANSWER: "NO_ANSWER";
23
+ BUSY: "BUSY";
24
+ UNREACHABLE: "UNREACHABLE";
25
+ PROVIDER_ERROR: "PROVIDER_ERROR";
26
+ CHANNEL_UNSUPPORTED: "CHANNEL_UNSUPPORTED";
27
+ INVALID_DESTINATION: "INVALID_DESTINATION";
28
+ REJECTED: "REJECTED";
29
+ }>;
30
+ export type DeliveryReason = z.infer<typeof deliveryReasonSchema>;
31
+ /**
32
+ * What path the interaction took once delivered. Null when no interaction was observed —
33
+ * which is always the case on the one-way channels, and often the case elsewhere.
34
+ * `VOICEMAIL` is reachable only on `VOICE_AI` and needs AMD before it can actually be
35
+ * detected (issue #83); it is defined now so the enum needs no second migration later.
36
+ */
37
+ export declare const caminoSchema: z.ZodEnum<{
38
+ ENGAGED: "ENGAGED";
39
+ ABANDONED: "ABANDONED";
40
+ VOICEMAIL: "VOICEMAIL";
41
+ }>;
42
+ export type Camino = z.infer<typeof caminoSchema>;
43
+ /**
44
+ * What came of the engagement. Nullable and single-valued; null is the common case and means
45
+ * nothing came of it, which is a real and frequent answer rather than missing data.
46
+ */
47
+ export declare const resultadoSchema: z.ZodEnum<{
6
48
  PAYMENT_PROMISE: "PAYMENT_PROMISE";
7
- PARTIAL_PAYMENT_AGREED: "PARTIAL_PAYMENT_AGREED";
8
49
  NEW_TERMS: "NEW_TERMS";
50
+ PAID: "PAID";
9
51
  CALLBACK_REQUESTED: "CALLBACK_REQUESTED";
10
52
  DISPUTE_RAISED: "DISPUTE_RAISED";
11
53
  INFORMATION_REQUEST: "INFORMATION_REQUEST";
12
- RESOLVED: "RESOLVED";
13
- PAID: "PAID";
14
- WRONG_NUMBER: "WRONG_NUMBER";
15
- OPT_OUT: "OPT_OUT";
16
54
  REFUSED: "REFUSED";
17
- OTHER: "OTHER";
55
+ OPT_OUT: "OPT_OUT";
56
+ WRONG_PARTY: "WRONG_PARTY";
57
+ RESOLVED: "RESOLVED";
18
58
  }>;
19
- export type ContactOutcome = z.infer<typeof contactOutcomeSchema>;
59
+ export type Resultado = z.infer<typeof resultadoSchema>;
60
+ /**
61
+ * Channels with an inbound path, and therefore the only ones that can observe a `camino` or
62
+ * produce a `resultado`. `SMS` and `VOICE_PRERECORDED` have no inbound ingestion at all, so
63
+ * both axes are not merely usually-null there — they are unreachable.
64
+ */
65
+ export declare const CHANNEL_CAN_ENGAGE: readonly ["VOICE_AI", "EMAIL", "WHATSAPP"];
66
+ /** Whether a channel can observe an interaction beyond delivery. */
67
+ export declare function channelCanEngage(agentType: string): boolean;
20
68
  export declare const aiSentimentSchema: z.ZodEnum<{
21
69
  POSITIVE: "POSITIVE";
22
70
  NEUTRAL: "NEUTRAL";
@@ -38,6 +86,17 @@ export declare const paymentPromiseStatusSchema: z.ZodEnum<{
38
86
  CANCELLED: "CANCELLED";
39
87
  }>;
40
88
  export type PaymentPromiseStatus = z.infer<typeof paymentPromiseStatusSchema>;
89
+ /**
90
+ * The axes are independent, but two combinations are incoherent rather than merely unusual,
91
+ * so they are rejected before the write rather than stored and worked around by every reader:
92
+ *
93
+ * - a failure reason without a failure (or a failure without a reason) — the reason is the
94
+ * only thing that makes `FAILED` actionable;
95
+ * - an interaction recorded on a channel that cannot observe one.
96
+ *
97
+ * Note there is deliberately no rule tying `resultado` to `entrega`: a `FAILED` delivery can
98
+ * still carry a `resultado` when someone answers and hangs up on a wrong-party identification.
99
+ */
41
100
  export declare const createContactLogSchema: z.ZodObject<{
42
101
  portfolioAccountId: z.ZodString;
43
102
  campaignId: z.ZodOptional<z.ZodString>;
@@ -52,23 +111,37 @@ export declare const createContactLogSchema: z.ZodObject<{
52
111
  }>;
53
112
  contactedAt: z.ZodString;
54
113
  durationSeconds: z.ZodOptional<z.ZodNumber>;
55
- outcome: z.ZodEnum<{
114
+ entrega: z.ZodDefault<z.ZodEnum<{
115
+ DISPATCHED: "DISPATCHED";
56
116
  DELIVERED: "DELIVERED";
57
- NOT_DELIVERED: "NOT_DELIVERED";
117
+ FAILED: "FAILED";
118
+ }>>;
119
+ deliveryReason: z.ZodOptional<z.ZodEnum<{
58
120
  NO_ANSWER: "NO_ANSWER";
121
+ BUSY: "BUSY";
122
+ UNREACHABLE: "UNREACHABLE";
123
+ PROVIDER_ERROR: "PROVIDER_ERROR";
124
+ CHANNEL_UNSUPPORTED: "CHANNEL_UNSUPPORTED";
125
+ INVALID_DESTINATION: "INVALID_DESTINATION";
126
+ REJECTED: "REJECTED";
127
+ }>>;
128
+ camino: z.ZodOptional<z.ZodEnum<{
129
+ ENGAGED: "ENGAGED";
130
+ ABANDONED: "ABANDONED";
131
+ VOICEMAIL: "VOICEMAIL";
132
+ }>>;
133
+ resultado: z.ZodOptional<z.ZodEnum<{
59
134
  PAYMENT_PROMISE: "PAYMENT_PROMISE";
60
- PARTIAL_PAYMENT_AGREED: "PARTIAL_PAYMENT_AGREED";
61
135
  NEW_TERMS: "NEW_TERMS";
136
+ PAID: "PAID";
62
137
  CALLBACK_REQUESTED: "CALLBACK_REQUESTED";
63
138
  DISPUTE_RAISED: "DISPUTE_RAISED";
64
139
  INFORMATION_REQUEST: "INFORMATION_REQUEST";
65
- RESOLVED: "RESOLVED";
66
- PAID: "PAID";
67
- WRONG_NUMBER: "WRONG_NUMBER";
68
- OPT_OUT: "OPT_OUT";
69
140
  REFUSED: "REFUSED";
70
- OTHER: "OTHER";
71
- }>;
141
+ OPT_OUT: "OPT_OUT";
142
+ WRONG_PARTY: "WRONG_PARTY";
143
+ RESOLVED: "RESOLVED";
144
+ }>>;
72
145
  notes: z.ZodOptional<z.ZodString>;
73
146
  debtAmountSnapshot: z.ZodOptional<z.ZodNumber>;
74
147
  aiSummary: z.ZodOptional<z.ZodString>;
@@ -84,6 +157,7 @@ export declare const createContactLogSchema: z.ZodObject<{
84
157
  intentMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
158
  channelData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
159
  providerRef: z.ZodOptional<z.ZodString>;
160
+ providerMessageId: z.ZodOptional<z.ZodString>;
87
161
  }, z.core.$strip>;
88
162
  export type CreateContactLogInput = z.infer<typeof createContactLogSchema>;
89
163
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"contactLog.d.ts","sourceRoot":"","sources":["../../src/schemas/contactLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;EAgB/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;EAAyD,CAAC;AACxF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;GAMG;AAC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,4BAA4B,CAAC,CAAC"}
@@ -1,22 +1,61 @@
1
1
  import { z } from "zod";
2
2
  import { agentTypeSchema } from "./agentTemplates.js";
3
- export const contactOutcomeSchema = z.enum([
4
- "DELIVERED",
5
- "NOT_DELIVERED",
3
+ /**
4
+ * A gestión answers up to three independent questions, one per axis. They were previously
5
+ * flattened into a single `outcome` enum, which is why no value meant one thing: `WRONG_NUMBER`
6
+ * described both a carrier rejection (a delivery failure) and a human saying "that's not me"
7
+ * (a delivery *success* carrying a valuable finding), and `OTHER` served as dispatch
8
+ * placeholder, escalation marker, and unclassifiable-conversation catch-all at once.
9
+ */
10
+ /** Did the attempt reach the account holder's device or inbox? Never null. */
11
+ export const entregaSchema = z.enum(["DISPATCHED", "DELIVERED", "FAILED"]);
12
+ /**
13
+ * Why delivery failed. Set if and only if `entrega` is `FAILED`. The values are chosen so a
14
+ * retry policy can branch on them: `NO_ANSWER` and `BUSY` are transient, `INVALID_DESTINATION`
15
+ * and `CHANNEL_UNSUPPORTED` are permanent for that contact point.
16
+ */
17
+ export const deliveryReasonSchema = z.enum([
6
18
  "NO_ANSWER",
19
+ "BUSY",
20
+ "UNREACHABLE",
21
+ "PROVIDER_ERROR",
22
+ "CHANNEL_UNSUPPORTED",
23
+ "INVALID_DESTINATION",
24
+ "REJECTED"
25
+ ]);
26
+ /**
27
+ * What path the interaction took once delivered. Null when no interaction was observed —
28
+ * which is always the case on the one-way channels, and often the case elsewhere.
29
+ * `VOICEMAIL` is reachable only on `VOICE_AI` and needs AMD before it can actually be
30
+ * detected (issue #83); it is defined now so the enum needs no second migration later.
31
+ */
32
+ export const caminoSchema = z.enum(["ENGAGED", "ABANDONED", "VOICEMAIL"]);
33
+ /**
34
+ * What came of the engagement. Nullable and single-valued; null is the common case and means
35
+ * nothing came of it, which is a real and frequent answer rather than missing data.
36
+ */
37
+ export const resultadoSchema = z.enum([
7
38
  "PAYMENT_PROMISE",
8
- "PARTIAL_PAYMENT_AGREED",
9
39
  "NEW_TERMS",
40
+ "PAID",
10
41
  "CALLBACK_REQUESTED",
11
42
  "DISPUTE_RAISED",
12
43
  "INFORMATION_REQUEST",
13
- "RESOLVED",
14
- "PAID",
15
- "WRONG_NUMBER",
16
- "OPT_OUT",
17
44
  "REFUSED",
18
- "OTHER"
45
+ "OPT_OUT",
46
+ "WRONG_PARTY",
47
+ "RESOLVED"
19
48
  ]);
49
+ /**
50
+ * Channels with an inbound path, and therefore the only ones that can observe a `camino` or
51
+ * produce a `resultado`. `SMS` and `VOICE_PRERECORDED` have no inbound ingestion at all, so
52
+ * both axes are not merely usually-null there — they are unreachable.
53
+ */
54
+ export const CHANNEL_CAN_ENGAGE = ["VOICE_AI", "EMAIL", "WHATSAPP"];
55
+ /** Whether a channel can observe an interaction beyond delivery. */
56
+ export function channelCanEngage(agentType) {
57
+ return CHANNEL_CAN_ENGAGE.includes(agentType);
58
+ }
20
59
  export const aiSentimentSchema = z.enum(["POSITIVE", "NEUTRAL", "NEGATIVE", "HOSTILE"]);
21
60
  /**
22
61
  * PaymentPromise is the only outcome QCobro tracks with a lifecycle, because a payment
@@ -26,7 +65,7 @@ export const aiSentimentSchema = z.enum(["POSITIVE", "NEUTRAL", "NEGATIVE", "HOS
26
65
  * portfolio.
27
66
  */
28
67
  export const paymentPromiseStatusSchema = z.enum(["PENDING", "MET", "EXPIRED", "CANCELLED"]);
29
- export const createContactLogSchema = z.object({
68
+ const createContactLogFields = z.object({
30
69
  portfolioAccountId: z.string().min(1),
31
70
  campaignId: z.string().min(1).optional(),
32
71
  /** Agent template used (campaign dispatch or ad-hoc follow-up). */
@@ -36,7 +75,11 @@ export const createContactLogSchema = z.object({
36
75
  agentType: agentTypeSchema,
37
76
  contactedAt: z.string().min(1),
38
77
  durationSeconds: z.number().int().nonnegative().optional(),
39
- outcome: contactOutcomeSchema,
78
+ /** Defaults to the dispatch-time state, so a dispatch call site need not spell it out. */
79
+ entrega: entregaSchema.default("DISPATCHED"),
80
+ deliveryReason: deliveryReasonSchema.optional(),
81
+ camino: caminoSchema.optional(),
82
+ resultado: resultadoSchema.optional(),
40
83
  notes: z.string().optional(),
41
84
  debtAmountSnapshot: z.number().nonnegative().optional(),
42
85
  aiSummary: z.string().optional(),
@@ -51,7 +94,53 @@ export const createContactLogSchema = z.object({
51
94
  * When present, `recordOutcome` upserts the gestión keyed by it (one row per
52
95
  * attempt, enriched by the async callback) instead of inserting a duplicate.
53
96
  */
54
- providerRef: z.string().min(1).optional()
97
+ providerRef: z.string().min(1).optional(),
98
+ /**
99
+ * The provider's own message id, used to correlate *outbound* delivery events. Distinct
100
+ * from `providerRef` and not a replacement for it: on EMAIL `providerRef` is the reply-to
101
+ * token, which is the only thing an inbound reply carries, while Resend's delivery/open
102
+ * events carry only the message id. Both keys are needed, so both are stored. Unset on the
103
+ * channels whose callbacks correlate on `providerRef` alone.
104
+ */
105
+ providerMessageId: z.string().min(1).optional()
106
+ });
107
+ /**
108
+ * The axes are independent, but two combinations are incoherent rather than merely unusual,
109
+ * so they are rejected before the write rather than stored and worked around by every reader:
110
+ *
111
+ * - a failure reason without a failure (or a failure without a reason) — the reason is the
112
+ * only thing that makes `FAILED` actionable;
113
+ * - an interaction recorded on a channel that cannot observe one.
114
+ *
115
+ * Note there is deliberately no rule tying `resultado` to `entrega`: a `FAILED` delivery can
116
+ * still carry a `resultado` when someone answers and hangs up on a wrong-party identification.
117
+ */
118
+ export const createContactLogSchema = createContactLogFields.superRefine((value, ctx) => {
119
+ if (value.entrega === "FAILED" && !value.deliveryReason) {
120
+ ctx.addIssue({
121
+ code: "custom",
122
+ path: ["deliveryReason"],
123
+ message: "deliveryReason is required when entrega is FAILED"
124
+ });
125
+ }
126
+ if (value.entrega !== "FAILED" && value.deliveryReason) {
127
+ ctx.addIssue({
128
+ code: "custom",
129
+ path: ["deliveryReason"],
130
+ message: `deliveryReason is only valid when entrega is FAILED (got ${value.entrega})`
131
+ });
132
+ }
133
+ if (!channelCanEngage(value.agentType)) {
134
+ for (const field of ["camino", "resultado"]) {
135
+ if (value[field]) {
136
+ ctx.addIssue({
137
+ code: "custom",
138
+ path: [field],
139
+ message: `${value.agentType} has no inbound path, so ${field} cannot be set`
140
+ });
141
+ }
142
+ }
143
+ }
55
144
  });
56
145
  /**
57
146
  * Input to reserve a campaign attempt before the provider call (the engine's
@@ -1 +1 @@
1
- {"version":3,"file":"contactLog.js","sourceRoot":"","sources":["../../src/schemas/contactLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,WAAW;IACX,eAAe;IACf,WAAW;IACX,iBAAiB;IACjB,wBAAwB;IACxB,WAAW;IACX,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,UAAU;IACV,MAAM;IACN,cAAc;IACd,SAAS;IACT,SAAS;IACT,OAAO;CACR,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAGxF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAG7F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,mEAAmE;IACnE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QA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,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,4CAA4C;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACtB,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;CACrC,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The structured decision the EMAIL/WHATSAPP autopilots return for an inbound reply.
4
- * Validated so a model can't drive the loop with malformed output. `outcome` mirrors the
5
- * contact-log outcomes; `objective` carries promise details when the reply implies one.
4
+ * Validated so a model can't drive the loop with malformed output. `resultado` mirrors the
5
+ * contact-log resultado axis; `objective` carries promise details when the reply implies one.
6
6
  *
7
- * `replyBody`/`outcome`/`objective` use `.nullish()`, not `.optional()`: Gemini's
7
+ * `replyBody`/`resultado`/`objective` use `.nullish()`, not `.optional()`: Gemini's
8
8
  * `responseMimeType: "application/json"` mode fills every key it considered rather than
9
- * omitting the ones that don't apply, so a plain reply with no outcome comes back as
10
- * `"outcome": null` (not an absent key) — `.optional()` alone rejects that.
9
+ * omitting the ones that don't apply, so a plain reply with no resultado comes back as
10
+ * `"resultado": null` (not an absent key) — `.optional()` alone rejects that.
11
11
  */
12
12
  export declare const emailAutopilotDecisionSchema: z.ZodObject<{
13
13
  action: z.ZodEnum<{
@@ -17,7 +17,7 @@ export declare const emailAutopilotDecisionSchema: z.ZodObject<{
17
17
  escalate: "escalate";
18
18
  }>;
19
19
  replyBody: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- outcome: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ resultado: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
21
  objective: z.ZodOptional<z.ZodNullable<z.ZodObject<{
22
22
  amount: z.ZodOptional<z.ZodNumber>;
23
23
  dueDate: z.ZodOptional<z.ZodString>;
@@ -1,18 +1,18 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The structured decision the EMAIL/WHATSAPP autopilots return for an inbound reply.
4
- * Validated so a model can't drive the loop with malformed output. `outcome` mirrors the
5
- * contact-log outcomes; `objective` carries promise details when the reply implies one.
4
+ * Validated so a model can't drive the loop with malformed output. `resultado` mirrors the
5
+ * contact-log resultado axis; `objective` carries promise details when the reply implies one.
6
6
  *
7
- * `replyBody`/`outcome`/`objective` use `.nullish()`, not `.optional()`: Gemini's
7
+ * `replyBody`/`resultado`/`objective` use `.nullish()`, not `.optional()`: Gemini's
8
8
  * `responseMimeType: "application/json"` mode fills every key it considered rather than
9
- * omitting the ones that don't apply, so a plain reply with no outcome comes back as
10
- * `"outcome": null` (not an absent key) — `.optional()` alone rejects that.
9
+ * omitting the ones that don't apply, so a plain reply with no resultado comes back as
10
+ * `"resultado": null` (not an absent key) — `.optional()` alone rejects that.
11
11
  */
12
12
  export const emailAutopilotDecisionSchema = z.object({
13
13
  action: z.enum(["reply", "ignore", "resolve", "escalate"]),
14
14
  replyBody: z.string().nullish(),
15
- outcome: z.string().nullish(),
15
+ resultado: z.string().nullish(),
16
16
  objective: z
17
17
  .object({
18
18
  amount: z.number().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/schemas/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC7B,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC5B,CAAC;SACD,OAAO,EAAE;CACb,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IA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AE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Resend's outbound email event. `type` is the raw event name (`email.sent`,
4
+ * `email.delivered`, `email.delivery_delayed`, `email.bounced`, `email.failed`,
5
+ * `email.complained`, `email.opened`, ...), kept as an open string rather than a closed enum
6
+ * for the same reason as the SMS callback: Resend's vocabulary is broader than the events
7
+ * this codebase acts on, and an unrecognized one should update visibility
8
+ * (`channelData.deliveryStatus`) rather than fail validation. See the email-events-hook
9
+ * capability.
10
+ *
11
+ * `providerMessageId` is Resend's `data.email_id` — the id returned by the send call, which
12
+ * is the only correlation handle an outbound event carries. It is deliberately not the
13
+ * gestión's `providerRef`, which on EMAIL holds the reply-to token for inbound replies.
14
+ */
15
+ export declare const emailEventCallbackSchema: z.ZodObject<{
16
+ providerMessageId: z.ZodString;
17
+ type: z.ZodString;
18
+ at: z.ZodString;
19
+ bounceType: z.ZodOptional<z.ZodString>;
20
+ bounceSubType: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export type EmailEventCallbackInput = z.infer<typeof emailEventCallbackSchema>;
23
+ //# sourceMappingURL=emailEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailEvent.d.ts","sourceRoot":"","sources":["../../src/schemas/emailEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB;;;;;;iBAWnC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Resend's outbound email event. `type` is the raw event name (`email.sent`,
4
+ * `email.delivered`, `email.delivery_delayed`, `email.bounced`, `email.failed`,
5
+ * `email.complained`, `email.opened`, ...), kept as an open string rather than a closed enum
6
+ * for the same reason as the SMS callback: Resend's vocabulary is broader than the events
7
+ * this codebase acts on, and an unrecognized one should update visibility
8
+ * (`channelData.deliveryStatus`) rather than fail validation. See the email-events-hook
9
+ * capability.
10
+ *
11
+ * `providerMessageId` is Resend's `data.email_id` — the id returned by the send call, which
12
+ * is the only correlation handle an outbound event carries. It is deliberately not the
13
+ * gestión's `providerRef`, which on EMAIL holds the reply-to token for inbound replies.
14
+ */
15
+ export const emailEventCallbackSchema = z.object({
16
+ providerMessageId: z.string().min(1),
17
+ type: z.string().min(1),
18
+ at: z.string().min(1),
19
+ /**
20
+ * Resend's `data.bounce` detail, present only on `email.bounced`. `type` is `Permanent` or
21
+ * `Transient`; `subType` is `General` / `NoEmail` / `Suppressed` / `MailboxFull` / ...
22
+ * Both open strings — an unmapped value falls back to the generic `PROVIDER_ERROR` bucket.
23
+ */
24
+ bounceType: z.string().optional(),
25
+ bounceSubType: z.string().optional()
26
+ });
27
+ //# sourceMappingURL=emailEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailEvent.js","sourceRoot":"","sources":["../../src/schemas/emailEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB;;;;OAIG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC"}
@@ -14,6 +14,7 @@ export * from "./email.js";
14
14
  export * from "./whatsApp.js";
15
15
  export * from "./voiceEvent.js";
16
16
  export * from "./smsEvent.js";
17
+ export * from "./emailEvent.js";
17
18
  export * from "./insight.js";
18
19
  export * from "./engineEvents.js";
19
20
  export * from "./billing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -14,6 +14,7 @@ export * from "./email.js";
14
14
  export * from "./whatsApp.js";
15
15
  export * from "./voiceEvent.js";
16
16
  export * from "./smsEvent.js";
17
+ export * from "./emailEvent.js";
17
18
  export * from "./insight.js";
18
19
  export * from "./engineEvents.js";
19
20
  export * from "./billing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -73,4 +73,22 @@ export declare const whatsAppWebhookSchema: z.ZodObject<{
73
73
  }, z.core.$strip>>>;
74
74
  }, z.core.$strip>;
75
75
  export type WhatsAppWebhookBody = z.infer<typeof whatsAppWebhookSchema>;
76
+ /**
77
+ * One entry of Meta's `statuses` array, normalized for the delivery-status recorder.
78
+ * `status` is the raw Meta value (`sent`/`delivered`/`read`/`failed`), kept as an open
79
+ * string rather than a closed enum for the same reason as the SMS and email callbacks: an
80
+ * unrecognized value should update visibility (`channelData.deliveryStatus`) rather than
81
+ * fail validation.
82
+ *
83
+ * `errorCodes` is the full list Meta sends, not just the first: a single `failed` status can
84
+ * carry several, and the one that matters (131050, the opt-out) is not always first. Present
85
+ * only on `failed`.
86
+ */
87
+ export declare const whatsAppStatusCallbackSchema: z.ZodObject<{
88
+ providerRef: z.ZodString;
89
+ status: z.ZodString;
90
+ at: z.ZodString;
91
+ errorCodes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
92
+ }, z.core.$strip>;
93
+ export type WhatsAppStatusCallbackInput = z.infer<typeof whatsAppStatusCallbackSchema>;
76
94
  //# sourceMappingURL=whatsApp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"whatsApp.d.ts","sourceRoot":"","sources":["../../src/schemas/whatsApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,gFAAgF;AAChF,eAAO,MAAM,+BAA+B;;;;;iBAQ1C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE7F,0DAA0D;AAC1D,eAAO,MAAM,6BAA6B;;;;iBAOxC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEzF,eAAO,MAAM,gCAAgC;;iBAE3C,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAkD/F,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"whatsApp.d.ts","sourceRoot":"","sources":["../../src/schemas/whatsApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,gFAAgF;AAChF,eAAO,MAAM,+BAA+B;;;;;iBAQ1C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE7F,0DAA0D;AAC1D,eAAO,MAAM,6BAA6B;;;;iBAOxC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEzF,eAAO,MAAM,gCAAgC;;iBAE3C,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAkD/F,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAExE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -82,4 +82,21 @@ export const whatsAppWebhookSchema = z.object({
82
82
  object: z.string().optional(),
83
83
  entry: z.array(whatsAppEntrySchema).optional()
84
84
  });
85
+ /**
86
+ * One entry of Meta's `statuses` array, normalized for the delivery-status recorder.
87
+ * `status` is the raw Meta value (`sent`/`delivered`/`read`/`failed`), kept as an open
88
+ * string rather than a closed enum for the same reason as the SMS and email callbacks: an
89
+ * unrecognized value should update visibility (`channelData.deliveryStatus`) rather than
90
+ * fail validation.
91
+ *
92
+ * `errorCodes` is the full list Meta sends, not just the first: a single `failed` status can
93
+ * carry several, and the one that matters (131050, the opt-out) is not always first. Present
94
+ * only on `failed`.
95
+ */
96
+ export const whatsAppStatusCallbackSchema = z.object({
97
+ providerRef: z.string().min(1),
98
+ status: z.string().min(1),
99
+ at: z.string().min(1),
100
+ errorCodes: z.array(z.number().int()).optional()
101
+ });
85
102
  //# sourceMappingURL=whatsApp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"whatsApp.js","sourceRoot":"","sources":["../../src/schemas/whatsApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGH,gFAAgF;AAChF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,sEAAsE;IACtE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B;qGACiG;IACjG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACnC,CAAC,CAAC;AAGH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,oFAAoF;IACpF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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AAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC"}
@@ -21,7 +21,7 @@ export interface EvalStepResult {
21
21
  }[];
22
22
  /** EMAIL/WHATSAPP (the autopilot decision actually taken). */
23
23
  action?: EmailAutopilotAction;
24
- outcome?: string | null;
24
+ resultado?: string | null;
25
25
  }
26
26
  export interface EvalScenarioSummary {
27
27
  ref: string;
@@ -1 +1 @@
1
- {"version":3,"file":"agentEvaluations.d.ts","sourceRoot":"","sources":["../../src/types/agentEvaluations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,eAAe,CAAC,EAAE;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;KACjB,EAAE,CAAC;IACJ,8DAA8D;IAC9D,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,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AAwF;AACxF,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE;QACb,gBAAgB,CAAC,IAAI,EAAE;YACrB,KAAK,EAAE;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,YAAY,EAAE,MAAM,CAAA;aAAE,CAAC;YAC5C,OAAO,EAAE;gBACP,aAAa,EAAE,IAAI,CAAC;gBACpB,sBAAsB,EAAE,IAAI,CAAC;gBAC7B,SAAS,EAAE,IAAI,CAAC;gBAChB,WAAW,EAAE,IAAI,CAAC;gBAClB,cAAc,EAAE,IAAI,CAAC;aACtB,CAAC;SACH,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KACnC,CAAC;CACH"}
@@ -1,6 +1,6 @@
1
1
  import type { AgentType } from "../schemas/agentTemplates.js";
2
2
  import type { CampaignStatus, CampaignPauseReason, CreateCampaignInput, UpdateCampaignInput, UpdateCampaignStatusInput, DeleteCampaignInput } from "../schemas/campaigns.js";
3
- import type { ContactOutcome, PaymentPromiseStatus, CreateContactLogInput, UpdatePaymentPromiseInput, FollowUpPaymentPromiseInput } from "../schemas/contactLog.js";
3
+ import type { Entrega, DeliveryReason, Camino, Resultado, PaymentPromiseStatus, CreateContactLogInput, UpdatePaymentPromiseInput, FollowUpPaymentPromiseInput } from "../schemas/contactLog.js";
4
4
  export interface CampaignRecord {
5
5
  id: string;
6
6
  workspaceRef: string;
@@ -21,7 +21,7 @@ export interface CampaignRecord {
21
21
  export interface CampaignTriggerRecord {
22
22
  id: string;
23
23
  campaignId: string;
24
- type: "MAX_ATTEMPTS_PER_DAY" | "DNC_CHECK" | "WRONG_NUMBER" | "OPT_OUT" | "PAYMENT_PROMISE" | "INTENT_MET" | "CALLBACK_REQUESTED";
24
+ type: "MAX_ATTEMPTS_PER_DAY" | "DNC_CHECK" | "PAYMENT_PROMISE" | "INTENT_MET" | "CALLBACK_REQUESTED";
25
25
  config: Record<string, unknown>;
26
26
  }
27
27
  export interface CampaignAccountStateRecord {
@@ -39,7 +39,10 @@ export interface AccountContactLogRecord {
39
39
  agentType: AgentType;
40
40
  contactedAt: Date;
41
41
  durationSeconds: number | null;
42
- outcome: ContactOutcome;
42
+ entrega: Entrega;
43
+ deliveryReason: DeliveryReason | null;
44
+ camino: Camino | null;
45
+ resultado: Resultado | null;
43
46
  notes: string | null;
44
47
  debtAmountSnapshot: number | null;
45
48
  aiSummary: string | null;