samva 0.13.0 → 0.15.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 (73) hide show
  1. package/AGENTS.md +9 -0
  2. package/README.md +55 -6
  3. package/dist/{categories-Bcwq5jPV.js → categories-BGUBFdH9.js} +9 -1
  4. package/dist/client/sdk.gen.d.ts +129 -27
  5. package/dist/client/types.gen.d.ts +920 -166
  6. package/dist/{client-DYPNDvVU.js → client-CDg7zJs0.js} +760 -147
  7. package/dist/effect/analytics.d.ts +6 -6
  8. package/dist/effect/analytics.js +1 -1
  9. package/dist/effect/api-keys.d.ts +20 -20
  10. package/dist/effect/api-keys.js +1 -1
  11. package/dist/effect/attachments.js +1 -1
  12. package/dist/effect/brands.js +2 -2
  13. package/dist/effect/campaigns.d.ts +12 -12
  14. package/dist/effect/campaigns.js +1 -1
  15. package/dist/effect/categories.js +1 -1
  16. package/dist/effect/client.js +1 -1
  17. package/dist/effect/contact-groups.d.ts +9 -9
  18. package/dist/effect/contact-groups.js +1 -1
  19. package/dist/effect/contacts.d.ts +126 -73
  20. package/dist/effect/contacts.js +1 -1
  21. package/dist/effect/conversations.d.ts +20 -20
  22. package/dist/effect/conversations.js +1 -1
  23. package/dist/effect/custom-fields.d.ts +1 -1
  24. package/dist/effect/custom-fields.js +1 -1
  25. package/dist/effect/email.d.ts +26 -26
  26. package/dist/effect/email.js +2 -2
  27. package/dist/effect/extension-installations.d.ts +3 -3
  28. package/dist/effect/extension-installations.js +1 -1
  29. package/dist/effect/extensions.d.ts +3 -3
  30. package/dist/effect/extensions.js +1 -1
  31. package/dist/effect/feedback.d.ts +1 -1
  32. package/dist/effect/feedback.js +2 -2
  33. package/dist/effect/generated-metadata.d.ts +8 -0
  34. package/dist/effect/generated.d.ts +6335 -1112
  35. package/dist/effect/index.d.ts +2 -1
  36. package/dist/effect/index.js +6 -5
  37. package/dist/effect/internal/client.d.ts +2 -2
  38. package/dist/effect/internal/operation.d.ts +9 -9
  39. package/dist/effect/mailboxes.d.ts +1775 -109
  40. package/dist/effect/mailboxes.js +3 -3
  41. package/dist/effect/media.d.ts +1 -1
  42. package/dist/effect/media.js +1 -1
  43. package/dist/effect/messages.d.ts +19 -17
  44. package/dist/effect/messages.js +1 -1
  45. package/dist/effect/namespaces.js +1 -1
  46. package/dist/effect/operations.d.ts +6 -6
  47. package/dist/effect/operations.js +1 -1
  48. package/dist/effect/organizations.d.ts +30 -0
  49. package/dist/effect/organizations.js +4 -2
  50. package/dist/effect/retry.js +1 -1
  51. package/dist/effect/scheduled-messages.d.ts +6 -6
  52. package/dist/effect/scheduled-messages.js +1 -1
  53. package/dist/effect/subscriptions.d.ts +15 -0
  54. package/dist/effect/subscriptions.js +9 -0
  55. package/dist/effect/templates.d.ts +52 -14
  56. package/dist/effect/templates.js +5 -3
  57. package/dist/effect/unsubscribe-groups.d.ts +1 -1
  58. package/dist/effect/unsubscribe-groups.js +1 -1
  59. package/dist/effect/webhooks.d.ts +15 -15
  60. package/dist/effect/webhooks.js +2 -2
  61. package/dist/index.js +4 -4
  62. package/dist/{inline-attachments-B56eS0MF.js → inline-attachments-UxLeyytJ.js} +2 -2
  63. package/dist/{mailbox-events-CsbF35vH.js → mailbox-events-VKR4f3qq.js} +6 -4
  64. package/dist/mailbox-events.d.ts +1 -1
  65. package/dist/{mailboxes-D3Kx7elM.js → mailboxes-BH_JPmOE.js} +17 -5
  66. package/dist/{operation-B_Ty1LG-.js → operation-BZ5Xov-x.js} +37 -3
  67. package/dist/promises/errors.gen.d.ts +26 -2
  68. package/dist/promises/index.d.ts +6 -4
  69. package/dist/promises/index.js +4 -4
  70. package/dist/promises/types.gen.d.ts +1 -1
  71. package/dist/{promises-D9FJyU0q.js → promises-Cd6Jamqk.js} +1004 -47
  72. package/dist/service-map.d.ts +45 -0
  73. package/package.json +7 -2
@@ -10,7 +10,7 @@ export declare const list: ((input?: {
10
10
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
11
11
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
12
12
  readonly slug: string;
13
- readonly displayName: string;
13
+ readonly name: string;
14
14
  readonly status: "active" | "paused";
15
15
  readonly primaryAddress: string | null;
16
16
  readonly createdAt: string;
@@ -27,7 +27,7 @@ export declare const list: ((input?: {
27
27
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
28
28
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
29
29
  readonly slug: string;
30
- readonly displayName: string;
30
+ readonly name: string;
31
31
  readonly status: "active" | "paused";
32
32
  readonly primaryAddress: string | null;
33
33
  readonly createdAt: string;
@@ -43,7 +43,7 @@ export declare const list: ((input?: {
43
43
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
44
44
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
45
45
  readonly slug: string;
46
- readonly displayName: string;
46
+ readonly name: string;
47
47
  readonly status: "active" | "paused";
48
48
  readonly primaryAddress: string | null;
49
49
  readonly createdAt: string;
@@ -51,17 +51,9 @@ export declare const list: ((input?: {
51
51
  };
52
52
  export declare const create: (input: {
53
53
  readonly namespaceId?: string | null | undefined;
54
- readonly displayName: string;
55
- readonly slug: string;
56
- readonly addresses: readonly {
57
- readonly address: string;
58
- readonly displayName?: string | null | undefined;
59
- readonly domainId?: string | null | undefined;
60
- }[];
61
- readonly defaultFrom?: {
62
- readonly address: string;
63
- readonly displayName?: string | null | undefined;
64
- } | null | undefined;
54
+ readonly address: string;
55
+ readonly name: string;
56
+ readonly slug?: string | null | undefined;
65
57
  readonly metadata?: {
66
58
  readonly [x: string]: string | undefined;
67
59
  } | null | undefined;
@@ -69,7 +61,7 @@ export declare const create: (input: {
69
61
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
70
62
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
71
63
  readonly slug: string;
72
- readonly displayName: string;
64
+ readonly name: string;
73
65
  readonly status: "active" | "paused";
74
66
  readonly primaryAddress: string | null;
75
67
  readonly createdAt: string;
@@ -96,7 +88,7 @@ export declare const get: (input: {
96
88
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
97
89
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
98
90
  readonly slug: string;
99
- readonly displayName: string;
91
+ readonly name: string;
100
92
  readonly status: "active" | "paused";
101
93
  readonly primaryAddress: string | null;
102
94
  readonly createdAt: string;
@@ -119,7 +111,7 @@ export declare const get: (input: {
119
111
  }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
120
112
  export declare const update: (input: {
121
113
  readonly id: string;
122
- readonly displayName?: string | null | undefined;
114
+ readonly name?: string | null | undefined;
123
115
  readonly metadata?: {
124
116
  readonly [x: string]: string | null | undefined;
125
117
  } | null | undefined;
@@ -131,7 +123,7 @@ export declare const update: (input: {
131
123
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
132
124
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
133
125
  readonly slug: string;
134
- readonly displayName: string;
126
+ readonly name: string;
135
127
  readonly status: "active" | "paused";
136
128
  readonly primaryAddress: string | null;
137
129
  readonly createdAt: string;
@@ -157,13 +149,70 @@ export declare const remove: (input: {
157
149
  }) => import("effect/Effect").Effect<{
158
150
  readonly success: boolean;
159
151
  }, import("./generated").BillingProviderError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
152
+ export declare const createAddress: (input: {
153
+ readonly id: string;
154
+ readonly address: string;
155
+ readonly displayName?: string | null | undefined;
156
+ }) => import("effect/Effect").Effect<{
157
+ readonly id: string & import("effect/Brand").Brand<"MailboxId">;
158
+ readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
159
+ readonly slug: string;
160
+ readonly name: string;
161
+ readonly status: "active" | "paused";
162
+ readonly primaryAddress: string | null;
163
+ readonly createdAt: string;
164
+ readonly description: string | null;
165
+ readonly metadata: {
166
+ readonly [x: string]: string;
167
+ };
168
+ readonly addresses: readonly {
169
+ readonly id: string & import("effect/Brand").Brand<"MailboxAddressId">;
170
+ readonly address: string;
171
+ readonly source: "samvaHosted" | "verifiedDomain";
172
+ readonly domainId: string | null;
173
+ readonly displayName: string | null;
174
+ }[];
175
+ readonly defaultFrom: {
176
+ readonly address: string;
177
+ readonly displayName: string | null;
178
+ } | null;
179
+ readonly updatedAt: string;
180
+ }, import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
181
+ export declare const removeAddress: (input: {
182
+ readonly id: string;
183
+ readonly addressId: string;
184
+ }) => import("effect/Effect").Effect<{
185
+ readonly id: string & import("effect/Brand").Brand<"MailboxId">;
186
+ readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
187
+ readonly slug: string;
188
+ readonly name: string;
189
+ readonly status: "active" | "paused";
190
+ readonly primaryAddress: string | null;
191
+ readonly createdAt: string;
192
+ readonly description: string | null;
193
+ readonly metadata: {
194
+ readonly [x: string]: string;
195
+ };
196
+ readonly addresses: readonly {
197
+ readonly id: string & import("effect/Brand").Brand<"MailboxAddressId">;
198
+ readonly address: string;
199
+ readonly source: "samvaHosted" | "verifiedDomain";
200
+ readonly domainId: string | null;
201
+ readonly displayName: string | null;
202
+ }[];
203
+ readonly defaultFrom: {
204
+ readonly address: string;
205
+ readonly displayName: string | null;
206
+ } | null;
207
+ readonly updatedAt: string;
208
+ }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
160
209
  export declare const pause: (input: {
161
210
  readonly id: string;
162
211
  }) => import("effect/Effect").Effect<{
163
212
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
164
213
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
165
214
  readonly slug: string;
166
- readonly displayName: string;
215
+ readonly name: string;
167
216
  readonly status: "active" | "paused";
168
217
  readonly primaryAddress: string | null;
169
218
  readonly createdAt: string;
@@ -190,7 +239,7 @@ export declare const resume: (input: {
190
239
  readonly id: string & import("effect/Brand").Brand<"MailboxId">;
191
240
  readonly namespaceId: (string & import("effect/Brand").Brand<"NamespaceId">) | null;
192
241
  readonly slug: string;
193
- readonly displayName: string;
242
+ readonly name: string;
194
243
  readonly status: "active" | "paused";
195
244
  readonly primaryAddress: string | null;
196
245
  readonly createdAt: string;
@@ -222,13 +271,13 @@ export declare const getAgentActivity: (input: {
222
271
  readonly count: number;
223
272
  }[];
224
273
  readonly byState: readonly {
225
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
274
+ readonly state: "accepted" | "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "completed" | "executed" | "executing" | "failed" | "notSent" | "policyDenied" | "proposed" | "queued" | "uncertain";
226
275
  readonly count: number;
227
276
  }[];
228
277
  };
229
278
  readonly events: {
230
279
  readonly byType: readonly {
231
- readonly type: "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "draft.created" | "draft.updated" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created" | "thread.updated";
280
+ readonly type: "action.accepted" | "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "address.detached" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created";
232
281
  readonly count: number;
233
282
  }[];
234
283
  };
@@ -289,8 +338,8 @@ export declare const listGrants: ((input: {
289
338
  export declare const createGrant: (input: {
290
339
  readonly id: string;
291
340
  readonly userId: string;
292
- readonly role: string;
293
- readonly sendMode?: string | null | undefined;
341
+ readonly role: "admin" | "collaborator" | "viewer";
342
+ readonly sendMode?: "approval" | "send" | null | undefined;
294
343
  }) => import("effect/Effect").Effect<{
295
344
  readonly id: string & import("effect/Brand").Brand<"MailboxGrantId">;
296
345
  readonly actor: {
@@ -305,8 +354,8 @@ export declare const createGrant: (input: {
305
354
  export declare const updateGrant: (input: {
306
355
  readonly id: string;
307
356
  readonly grantId: string;
308
- readonly role?: string | null | undefined;
309
- readonly sendMode?: string | null | undefined;
357
+ readonly role?: "admin" | "collaborator" | "viewer" | null | undefined;
358
+ readonly sendMode?: "approval" | "send" | null | undefined;
310
359
  }) => import("effect/Effect").Effect<{
311
360
  readonly id: string & import("effect/Brand").Brand<"MailboxGrantId">;
312
361
  readonly actor: {
@@ -340,7 +389,7 @@ export declare const listPolicies: (input: {
340
389
  export declare const createPolicy: (input: {
341
390
  readonly id: string;
342
391
  readonly name: string;
343
- readonly outcome: string;
392
+ readonly outcome: "deny" | "requireApproval";
344
393
  readonly reason?: string | null | undefined;
345
394
  readonly enabled?: boolean | null | undefined;
346
395
  }) => import("effect/Effect").Effect<{
@@ -368,7 +417,7 @@ export declare const updatePolicy: (input: {
368
417
  readonly id: string;
369
418
  readonly policyId: string;
370
419
  readonly name?: string | null | undefined;
371
- readonly outcome?: string | null | undefined;
420
+ readonly outcome?: "deny" | "requireApproval" | null | undefined;
372
421
  readonly reason?: string | null | undefined;
373
422
  readonly enabled?: boolean | null | undefined;
374
423
  }) => import("effect/Effect").Effect<{
@@ -411,7 +460,7 @@ export declare const createLabel: (input: {
411
460
  readonly id: string;
412
461
  readonly slug: string;
413
462
  readonly displayName: string;
414
- readonly color?: string | null | undefined;
463
+ readonly color?: "agent" | "billing" | "domain" | "important" | "neutral" | "routing" | null | undefined;
415
464
  }) => import("effect/Effect").Effect<{
416
465
  readonly id: string & import("effect/Brand").Brand<"MailboxLabelId">;
417
466
  readonly slug: string;
@@ -424,7 +473,7 @@ export declare const updateLabel: (input: {
424
473
  readonly id: string;
425
474
  readonly labelId: string;
426
475
  readonly displayName?: string | null | undefined;
427
- readonly color?: string | null | undefined;
476
+ readonly color?: "agent" | "billing" | "domain" | "important" | "neutral" | "routing" | null | undefined;
428
477
  }) => import("effect/Effect").Effect<{
429
478
  readonly id: string & import("effect/Brand").Brand<"MailboxLabelId">;
430
479
  readonly slug: string;
@@ -446,11 +495,11 @@ export declare const listThreads: ((input: {
446
495
  readonly after?: string | null | undefined;
447
496
  readonly before?: string | null | undefined;
448
497
  readonly q?: string | null | undefined;
449
- readonly folder?: string | null | undefined;
498
+ readonly folder?: "archived" | "assigned" | "inbox" | "pending" | "sent" | "trash" | null | undefined;
450
499
  readonly label?: string | null | undefined;
451
- readonly unread?: string | null | undefined;
452
- readonly starred?: string | null | undefined;
453
- readonly snoozed?: string | null | undefined;
500
+ readonly unread?: "false" | "true" | null | undefined;
501
+ readonly starred?: "false" | "true" | null | undefined;
502
+ readonly snoozed?: "false" | "true" | null | undefined;
454
503
  }) => import("effect/Effect").Effect<{
455
504
  readonly items: readonly {
456
505
  readonly id: string & import("effect/Brand").Brand<"MailboxThreadId">;
@@ -480,11 +529,11 @@ export declare const listThreads: ((input: {
480
529
  readonly after?: string | null | undefined;
481
530
  readonly before?: string | null | undefined;
482
531
  readonly q?: string | null | undefined;
483
- readonly folder?: string | null | undefined;
532
+ readonly folder?: "archived" | "assigned" | "inbox" | "pending" | "sent" | "trash" | null | undefined;
484
533
  readonly label?: string | null | undefined;
485
- readonly unread?: string | null | undefined;
486
- readonly starred?: string | null | undefined;
487
- readonly snoozed?: string | null | undefined;
534
+ readonly unread?: "false" | "true" | null | undefined;
535
+ readonly starred?: "false" | "true" | null | undefined;
536
+ readonly snoozed?: "false" | "true" | null | undefined;
488
537
  }) => import("effect/Stream").Stream<{
489
538
  readonly items: readonly {
490
539
  readonly id: string & import("effect/Brand").Brand<"MailboxThreadId">;
@@ -514,11 +563,11 @@ export declare const listThreads: ((input: {
514
563
  readonly after?: string | null | undefined;
515
564
  readonly before?: string | null | undefined;
516
565
  readonly q?: string | null | undefined;
517
- readonly folder?: string | null | undefined;
566
+ readonly folder?: "archived" | "assigned" | "inbox" | "pending" | "sent" | "trash" | null | undefined;
518
567
  readonly label?: string | null | undefined;
519
- readonly unread?: string | null | undefined;
520
- readonly starred?: string | null | undefined;
521
- readonly snoozed?: string | null | undefined;
568
+ readonly unread?: "false" | "true" | null | undefined;
569
+ readonly starred?: "false" | "true" | null | undefined;
570
+ readonly snoozed?: "false" | "true" | null | undefined;
522
571
  }) => import("effect/Stream").Stream<{
523
572
  readonly id: string & import("effect/Brand").Brand<"MailboxThreadId">;
524
573
  readonly subject: string | null;
@@ -575,8 +624,8 @@ export declare const getThread: (input: {
575
624
  export declare const updateThread: (input: {
576
625
  readonly id: string;
577
626
  readonly threadId: string;
578
- readonly folder?: string | null | undefined;
579
- readonly priority?: string | null | undefined;
627
+ readonly folder?: "archived" | "assigned" | "inbox" | "pending" | "sent" | "trash" | null | undefined;
628
+ readonly priority?: "high" | "low" | "normal" | "urgent" | null | undefined;
580
629
  readonly read?: boolean | null | undefined;
581
630
  readonly starred?: boolean | null | undefined;
582
631
  readonly snoozedUntil?: string | null | undefined;
@@ -999,18 +1048,141 @@ export declare const sendMessage: (input: {
999
1048
  readonly idempotencyKey?: string | undefined;
1000
1049
  }) => import("effect/Effect").Effect<{
1001
1050
  readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1051
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1002
1052
  readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1003
- readonly threadId: string & import("effect/Brand").Brand<"MailboxThreadId">;
1004
- readonly status: "pending_approval" | "sent";
1005
- readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
1053
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1054
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1055
+ readonly acceptedAt: string | null;
1056
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1057
+ readonly reviewExpectedAt: string | null;
1058
+ readonly skippedRecipients: readonly {
1059
+ readonly address: string;
1060
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1061
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1062
+ }[];
1063
+ readonly executeUntil: string | null;
1064
+ readonly retryAt: string | null;
1065
+ readonly problem: {
1066
+ readonly code: string;
1067
+ readonly message: string;
1068
+ readonly error?: {
1069
+ readonly _tag: "SenderNotReadyError";
1070
+ readonly message: string;
1071
+ readonly sender: string;
1072
+ readonly retryAfterSeconds?: number | null;
1073
+ } | {
1074
+ readonly _tag: "RateLimitedError";
1075
+ readonly message: string;
1076
+ readonly retryAfterSeconds: number;
1077
+ } | {
1078
+ readonly _tag: "OnboardingReviewRequiredError";
1079
+ readonly message: string;
1080
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1081
+ readonly decision: "approved" | "rejected" | "undecided";
1082
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1083
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1084
+ readonly identityId?: string | null;
1085
+ } | {
1086
+ readonly _tag: "PaymentRequiredError";
1087
+ readonly message: string;
1088
+ readonly resource: string;
1089
+ readonly currentUsage: number;
1090
+ readonly limit: number;
1091
+ } | {
1092
+ readonly _tag: "ValidationError";
1093
+ readonly message: string;
1094
+ readonly fields?: {
1095
+ readonly [x: string]: readonly string[];
1096
+ } | null;
1097
+ } | {
1098
+ readonly _tag: "ForbiddenError";
1099
+ readonly message: string;
1100
+ } | {
1101
+ readonly _tag: "ResourceNotFoundError";
1102
+ readonly resource: string;
1103
+ readonly id: string;
1104
+ readonly message: string;
1105
+ } | null;
1106
+ } | null;
1107
+ readonly retryEligible: boolean;
1108
+ readonly decision: {
1109
+ readonly outcome: "allow" | "deny" | "requireApproval";
1110
+ readonly reason: string | null;
1111
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1112
+ readonly source: "grant" | "installation" | "policy" | null;
1113
+ readonly decidedAt: string;
1114
+ } | null;
1115
+ readonly createdAt: string;
1116
+ readonly updatedAt: string;
1117
+ } | {
1118
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1119
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1120
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1121
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1122
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1123
+ readonly acceptedAt: string | null;
1124
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1006
1125
  readonly reviewExpectedAt: string | null;
1007
1126
  readonly skippedRecipients: readonly {
1008
1127
  readonly address: string;
1009
1128
  readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1010
1129
  readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1011
1130
  }[];
1131
+ readonly executeUntil: string | null;
1132
+ readonly retryAt: string | null;
1133
+ readonly problem: {
1134
+ readonly code: string;
1135
+ readonly message: string;
1136
+ readonly error?: {
1137
+ readonly _tag: "SenderNotReadyError";
1138
+ readonly message: string;
1139
+ readonly sender: string;
1140
+ readonly retryAfterSeconds?: number | null;
1141
+ } | {
1142
+ readonly _tag: "RateLimitedError";
1143
+ readonly message: string;
1144
+ readonly retryAfterSeconds: number;
1145
+ } | {
1146
+ readonly _tag: "OnboardingReviewRequiredError";
1147
+ readonly message: string;
1148
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1149
+ readonly decision: "approved" | "rejected" | "undecided";
1150
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1151
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1152
+ readonly identityId?: string | null;
1153
+ } | {
1154
+ readonly _tag: "PaymentRequiredError";
1155
+ readonly message: string;
1156
+ readonly resource: string;
1157
+ readonly currentUsage: number;
1158
+ readonly limit: number;
1159
+ } | {
1160
+ readonly _tag: "ValidationError";
1161
+ readonly message: string;
1162
+ readonly fields?: {
1163
+ readonly [x: string]: readonly string[];
1164
+ } | null;
1165
+ } | {
1166
+ readonly _tag: "ForbiddenError";
1167
+ readonly message: string;
1168
+ } | {
1169
+ readonly _tag: "ResourceNotFoundError";
1170
+ readonly resource: string;
1171
+ readonly id: string;
1172
+ readonly message: string;
1173
+ } | null;
1174
+ } | null;
1175
+ readonly retryEligible: boolean;
1176
+ readonly decision: {
1177
+ readonly outcome: "allow" | "deny" | "requireApproval";
1178
+ readonly reason: string | null;
1179
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1180
+ readonly source: "grant" | "installation" | "policy" | null;
1181
+ readonly decidedAt: string;
1182
+ } | null;
1012
1183
  readonly createdAt: string;
1013
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1184
+ readonly updatedAt: string;
1185
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1014
1186
  export declare const getMessage: (input: {
1015
1187
  readonly id: string;
1016
1188
  readonly messageId: string;
@@ -1082,6 +1254,17 @@ export declare const getMessageAttachment: (input: {
1082
1254
  readonly url: string;
1083
1255
  readonly expiresAt: string;
1084
1256
  }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1257
+ export declare const copyMessageAttachment: (input: {
1258
+ readonly id: string;
1259
+ readonly messageId: string;
1260
+ readonly attachmentId: string;
1261
+ }) => import("effect/Effect").Effect<{
1262
+ readonly filename: string;
1263
+ readonly content?: string | null;
1264
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
1265
+ readonly contentType: string;
1266
+ readonly size: number;
1267
+ }, import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1085
1268
  export declare const reply: (input: {
1086
1269
  readonly id: string;
1087
1270
  readonly messageId: string;
@@ -1100,18 +1283,141 @@ export declare const reply: (input: {
1100
1283
  readonly idempotencyKey?: string | undefined;
1101
1284
  }) => import("effect/Effect").Effect<{
1102
1285
  readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1286
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1103
1287
  readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1104
- readonly threadId: string & import("effect/Brand").Brand<"MailboxThreadId">;
1105
- readonly status: "pending_approval" | "sent";
1106
- readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
1288
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1289
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1290
+ readonly acceptedAt: string | null;
1291
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1107
1292
  readonly reviewExpectedAt: string | null;
1108
1293
  readonly skippedRecipients: readonly {
1109
1294
  readonly address: string;
1110
1295
  readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1111
1296
  readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1112
1297
  }[];
1298
+ readonly executeUntil: string | null;
1299
+ readonly retryAt: string | null;
1300
+ readonly problem: {
1301
+ readonly code: string;
1302
+ readonly message: string;
1303
+ readonly error?: {
1304
+ readonly _tag: "SenderNotReadyError";
1305
+ readonly message: string;
1306
+ readonly sender: string;
1307
+ readonly retryAfterSeconds?: number | null;
1308
+ } | {
1309
+ readonly _tag: "RateLimitedError";
1310
+ readonly message: string;
1311
+ readonly retryAfterSeconds: number;
1312
+ } | {
1313
+ readonly _tag: "OnboardingReviewRequiredError";
1314
+ readonly message: string;
1315
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1316
+ readonly decision: "approved" | "rejected" | "undecided";
1317
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1318
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1319
+ readonly identityId?: string | null;
1320
+ } | {
1321
+ readonly _tag: "PaymentRequiredError";
1322
+ readonly message: string;
1323
+ readonly resource: string;
1324
+ readonly currentUsage: number;
1325
+ readonly limit: number;
1326
+ } | {
1327
+ readonly _tag: "ValidationError";
1328
+ readonly message: string;
1329
+ readonly fields?: {
1330
+ readonly [x: string]: readonly string[];
1331
+ } | null;
1332
+ } | {
1333
+ readonly _tag: "ForbiddenError";
1334
+ readonly message: string;
1335
+ } | {
1336
+ readonly _tag: "ResourceNotFoundError";
1337
+ readonly resource: string;
1338
+ readonly id: string;
1339
+ readonly message: string;
1340
+ } | null;
1341
+ } | null;
1342
+ readonly retryEligible: boolean;
1343
+ readonly decision: {
1344
+ readonly outcome: "allow" | "deny" | "requireApproval";
1345
+ readonly reason: string | null;
1346
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1347
+ readonly source: "grant" | "installation" | "policy" | null;
1348
+ readonly decidedAt: string;
1349
+ } | null;
1350
+ readonly createdAt: string;
1351
+ readonly updatedAt: string;
1352
+ } | {
1353
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1354
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1355
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1356
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1357
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1358
+ readonly acceptedAt: string | null;
1359
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1360
+ readonly reviewExpectedAt: string | null;
1361
+ readonly skippedRecipients: readonly {
1362
+ readonly address: string;
1363
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1364
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1365
+ }[];
1366
+ readonly executeUntil: string | null;
1367
+ readonly retryAt: string | null;
1368
+ readonly problem: {
1369
+ readonly code: string;
1370
+ readonly message: string;
1371
+ readonly error?: {
1372
+ readonly _tag: "SenderNotReadyError";
1373
+ readonly message: string;
1374
+ readonly sender: string;
1375
+ readonly retryAfterSeconds?: number | null;
1376
+ } | {
1377
+ readonly _tag: "RateLimitedError";
1378
+ readonly message: string;
1379
+ readonly retryAfterSeconds: number;
1380
+ } | {
1381
+ readonly _tag: "OnboardingReviewRequiredError";
1382
+ readonly message: string;
1383
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1384
+ readonly decision: "approved" | "rejected" | "undecided";
1385
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1386
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1387
+ readonly identityId?: string | null;
1388
+ } | {
1389
+ readonly _tag: "PaymentRequiredError";
1390
+ readonly message: string;
1391
+ readonly resource: string;
1392
+ readonly currentUsage: number;
1393
+ readonly limit: number;
1394
+ } | {
1395
+ readonly _tag: "ValidationError";
1396
+ readonly message: string;
1397
+ readonly fields?: {
1398
+ readonly [x: string]: readonly string[];
1399
+ } | null;
1400
+ } | {
1401
+ readonly _tag: "ForbiddenError";
1402
+ readonly message: string;
1403
+ } | {
1404
+ readonly _tag: "ResourceNotFoundError";
1405
+ readonly resource: string;
1406
+ readonly id: string;
1407
+ readonly message: string;
1408
+ } | null;
1409
+ } | null;
1410
+ readonly retryEligible: boolean;
1411
+ readonly decision: {
1412
+ readonly outcome: "allow" | "deny" | "requireApproval";
1413
+ readonly reason: string | null;
1414
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1415
+ readonly source: "grant" | "installation" | "policy" | null;
1416
+ readonly decidedAt: string;
1417
+ } | null;
1113
1418
  readonly createdAt: string;
1114
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1419
+ readonly updatedAt: string;
1420
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1115
1421
  export declare const replyAll: (input: {
1116
1422
  readonly id: string;
1117
1423
  readonly messageId: string;
@@ -1130,18 +1436,141 @@ export declare const replyAll: (input: {
1130
1436
  readonly idempotencyKey?: string | undefined;
1131
1437
  }) => import("effect/Effect").Effect<{
1132
1438
  readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1439
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1133
1440
  readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1134
- readonly threadId: string & import("effect/Brand").Brand<"MailboxThreadId">;
1135
- readonly status: "pending_approval" | "sent";
1136
- readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
1441
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1442
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1443
+ readonly acceptedAt: string | null;
1444
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1445
+ readonly reviewExpectedAt: string | null;
1446
+ readonly skippedRecipients: readonly {
1447
+ readonly address: string;
1448
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1449
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1450
+ }[];
1451
+ readonly executeUntil: string | null;
1452
+ readonly retryAt: string | null;
1453
+ readonly problem: {
1454
+ readonly code: string;
1455
+ readonly message: string;
1456
+ readonly error?: {
1457
+ readonly _tag: "SenderNotReadyError";
1458
+ readonly message: string;
1459
+ readonly sender: string;
1460
+ readonly retryAfterSeconds?: number | null;
1461
+ } | {
1462
+ readonly _tag: "RateLimitedError";
1463
+ readonly message: string;
1464
+ readonly retryAfterSeconds: number;
1465
+ } | {
1466
+ readonly _tag: "OnboardingReviewRequiredError";
1467
+ readonly message: string;
1468
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1469
+ readonly decision: "approved" | "rejected" | "undecided";
1470
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1471
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1472
+ readonly identityId?: string | null;
1473
+ } | {
1474
+ readonly _tag: "PaymentRequiredError";
1475
+ readonly message: string;
1476
+ readonly resource: string;
1477
+ readonly currentUsage: number;
1478
+ readonly limit: number;
1479
+ } | {
1480
+ readonly _tag: "ValidationError";
1481
+ readonly message: string;
1482
+ readonly fields?: {
1483
+ readonly [x: string]: readonly string[];
1484
+ } | null;
1485
+ } | {
1486
+ readonly _tag: "ForbiddenError";
1487
+ readonly message: string;
1488
+ } | {
1489
+ readonly _tag: "ResourceNotFoundError";
1490
+ readonly resource: string;
1491
+ readonly id: string;
1492
+ readonly message: string;
1493
+ } | null;
1494
+ } | null;
1495
+ readonly retryEligible: boolean;
1496
+ readonly decision: {
1497
+ readonly outcome: "allow" | "deny" | "requireApproval";
1498
+ readonly reason: string | null;
1499
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1500
+ readonly source: "grant" | "installation" | "policy" | null;
1501
+ readonly decidedAt: string;
1502
+ } | null;
1503
+ readonly createdAt: string;
1504
+ readonly updatedAt: string;
1505
+ } | {
1506
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1507
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1508
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1509
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1510
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1511
+ readonly acceptedAt: string | null;
1512
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1137
1513
  readonly reviewExpectedAt: string | null;
1138
1514
  readonly skippedRecipients: readonly {
1139
1515
  readonly address: string;
1140
1516
  readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1141
1517
  readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1142
1518
  }[];
1519
+ readonly executeUntil: string | null;
1520
+ readonly retryAt: string | null;
1521
+ readonly problem: {
1522
+ readonly code: string;
1523
+ readonly message: string;
1524
+ readonly error?: {
1525
+ readonly _tag: "SenderNotReadyError";
1526
+ readonly message: string;
1527
+ readonly sender: string;
1528
+ readonly retryAfterSeconds?: number | null;
1529
+ } | {
1530
+ readonly _tag: "RateLimitedError";
1531
+ readonly message: string;
1532
+ readonly retryAfterSeconds: number;
1533
+ } | {
1534
+ readonly _tag: "OnboardingReviewRequiredError";
1535
+ readonly message: string;
1536
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1537
+ readonly decision: "approved" | "rejected" | "undecided";
1538
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1539
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1540
+ readonly identityId?: string | null;
1541
+ } | {
1542
+ readonly _tag: "PaymentRequiredError";
1543
+ readonly message: string;
1544
+ readonly resource: string;
1545
+ readonly currentUsage: number;
1546
+ readonly limit: number;
1547
+ } | {
1548
+ readonly _tag: "ValidationError";
1549
+ readonly message: string;
1550
+ readonly fields?: {
1551
+ readonly [x: string]: readonly string[];
1552
+ } | null;
1553
+ } | {
1554
+ readonly _tag: "ForbiddenError";
1555
+ readonly message: string;
1556
+ } | {
1557
+ readonly _tag: "ResourceNotFoundError";
1558
+ readonly resource: string;
1559
+ readonly id: string;
1560
+ readonly message: string;
1561
+ } | null;
1562
+ } | null;
1563
+ readonly retryEligible: boolean;
1564
+ readonly decision: {
1565
+ readonly outcome: "allow" | "deny" | "requireApproval";
1566
+ readonly reason: string | null;
1567
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1568
+ readonly source: "grant" | "installation" | "policy" | null;
1569
+ readonly decidedAt: string;
1570
+ } | null;
1143
1571
  readonly createdAt: string;
1144
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1572
+ readonly updatedAt: string;
1573
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1145
1574
  export declare const forward: (input: {
1146
1575
  readonly id: string;
1147
1576
  readonly messageId: string;
@@ -1161,18 +1590,141 @@ export declare const forward: (input: {
1161
1590
  readonly idempotencyKey?: string | undefined;
1162
1591
  }) => import("effect/Effect").Effect<{
1163
1592
  readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1593
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1164
1594
  readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1165
- readonly threadId: string & import("effect/Brand").Brand<"MailboxThreadId">;
1166
- readonly status: "pending_approval" | "sent";
1167
- readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
1595
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1596
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1597
+ readonly acceptedAt: string | null;
1598
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1599
+ readonly reviewExpectedAt: string | null;
1600
+ readonly skippedRecipients: readonly {
1601
+ readonly address: string;
1602
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1603
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1604
+ }[];
1605
+ readonly executeUntil: string | null;
1606
+ readonly retryAt: string | null;
1607
+ readonly problem: {
1608
+ readonly code: string;
1609
+ readonly message: string;
1610
+ readonly error?: {
1611
+ readonly _tag: "SenderNotReadyError";
1612
+ readonly message: string;
1613
+ readonly sender: string;
1614
+ readonly retryAfterSeconds?: number | null;
1615
+ } | {
1616
+ readonly _tag: "RateLimitedError";
1617
+ readonly message: string;
1618
+ readonly retryAfterSeconds: number;
1619
+ } | {
1620
+ readonly _tag: "OnboardingReviewRequiredError";
1621
+ readonly message: string;
1622
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1623
+ readonly decision: "approved" | "rejected" | "undecided";
1624
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1625
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1626
+ readonly identityId?: string | null;
1627
+ } | {
1628
+ readonly _tag: "PaymentRequiredError";
1629
+ readonly message: string;
1630
+ readonly resource: string;
1631
+ readonly currentUsage: number;
1632
+ readonly limit: number;
1633
+ } | {
1634
+ readonly _tag: "ValidationError";
1635
+ readonly message: string;
1636
+ readonly fields?: {
1637
+ readonly [x: string]: readonly string[];
1638
+ } | null;
1639
+ } | {
1640
+ readonly _tag: "ForbiddenError";
1641
+ readonly message: string;
1642
+ } | {
1643
+ readonly _tag: "ResourceNotFoundError";
1644
+ readonly resource: string;
1645
+ readonly id: string;
1646
+ readonly message: string;
1647
+ } | null;
1648
+ } | null;
1649
+ readonly retryEligible: boolean;
1650
+ readonly decision: {
1651
+ readonly outcome: "allow" | "deny" | "requireApproval";
1652
+ readonly reason: string | null;
1653
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1654
+ readonly source: "grant" | "installation" | "policy" | null;
1655
+ readonly decidedAt: string;
1656
+ } | null;
1657
+ readonly createdAt: string;
1658
+ readonly updatedAt: string;
1659
+ } | {
1660
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
1661
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1662
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1663
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1664
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
1665
+ readonly acceptedAt: string | null;
1666
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1168
1667
  readonly reviewExpectedAt: string | null;
1169
1668
  readonly skippedRecipients: readonly {
1170
1669
  readonly address: string;
1171
1670
  readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1172
1671
  readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1173
1672
  }[];
1673
+ readonly executeUntil: string | null;
1674
+ readonly retryAt: string | null;
1675
+ readonly problem: {
1676
+ readonly code: string;
1677
+ readonly message: string;
1678
+ readonly error?: {
1679
+ readonly _tag: "SenderNotReadyError";
1680
+ readonly message: string;
1681
+ readonly sender: string;
1682
+ readonly retryAfterSeconds?: number | null;
1683
+ } | {
1684
+ readonly _tag: "RateLimitedError";
1685
+ readonly message: string;
1686
+ readonly retryAfterSeconds: number;
1687
+ } | {
1688
+ readonly _tag: "OnboardingReviewRequiredError";
1689
+ readonly message: string;
1690
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
1691
+ readonly decision: "approved" | "rejected" | "undecided";
1692
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
1693
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
1694
+ readonly identityId?: string | null;
1695
+ } | {
1696
+ readonly _tag: "PaymentRequiredError";
1697
+ readonly message: string;
1698
+ readonly resource: string;
1699
+ readonly currentUsage: number;
1700
+ readonly limit: number;
1701
+ } | {
1702
+ readonly _tag: "ValidationError";
1703
+ readonly message: string;
1704
+ readonly fields?: {
1705
+ readonly [x: string]: readonly string[];
1706
+ } | null;
1707
+ } | {
1708
+ readonly _tag: "ForbiddenError";
1709
+ readonly message: string;
1710
+ } | {
1711
+ readonly _tag: "ResourceNotFoundError";
1712
+ readonly resource: string;
1713
+ readonly id: string;
1714
+ readonly message: string;
1715
+ } | null;
1716
+ } | null;
1717
+ readonly retryEligible: boolean;
1718
+ readonly decision: {
1719
+ readonly outcome: "allow" | "deny" | "requireApproval";
1720
+ readonly reason: string | null;
1721
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
1722
+ readonly source: "grant" | "installation" | "policy" | null;
1723
+ readonly decidedAt: string;
1724
+ } | null;
1174
1725
  readonly createdAt: string;
1175
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1726
+ readonly updatedAt: string;
1727
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1176
1728
  export declare const listQuarantine: ((input: {
1177
1729
  readonly id: string;
1178
1730
  readonly limit?: string | null | undefined;
@@ -1294,7 +1846,8 @@ export declare const listDrafts: ((input: {
1294
1846
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1295
1847
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1296
1848
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1297
- readonly state: "approvalPending" | "saved" | "sent";
1849
+ readonly state: "locked" | "saved" | "sent";
1850
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1298
1851
  readonly to: readonly string[];
1299
1852
  readonly subject: string | null;
1300
1853
  readonly createdAt: string;
@@ -1312,7 +1865,8 @@ export declare const listDrafts: ((input: {
1312
1865
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1313
1866
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1314
1867
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1315
- readonly state: "approvalPending" | "saved" | "sent";
1868
+ readonly state: "locked" | "saved" | "sent";
1869
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1316
1870
  readonly to: readonly string[];
1317
1871
  readonly subject: string | null;
1318
1872
  readonly createdAt: string;
@@ -1329,7 +1883,8 @@ export declare const listDrafts: ((input: {
1329
1883
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1330
1884
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1331
1885
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1332
- readonly state: "approvalPending" | "saved" | "sent";
1886
+ readonly state: "locked" | "saved" | "sent";
1887
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1333
1888
  readonly to: readonly string[];
1334
1889
  readonly subject: string | null;
1335
1890
  readonly createdAt: string;
@@ -1357,7 +1912,8 @@ export declare const createDraft: (input: {
1357
1912
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1358
1913
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1359
1914
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1360
- readonly state: "approvalPending" | "saved" | "sent";
1915
+ readonly state: "locked" | "saved" | "sent";
1916
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1361
1917
  readonly to: readonly string[];
1362
1918
  readonly subject: string | null;
1363
1919
  readonly createdAt: string;
@@ -1382,7 +1938,8 @@ export declare const getDraft: (input: {
1382
1938
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1383
1939
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1384
1940
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1385
- readonly state: "approvalPending" | "saved" | "sent";
1941
+ readonly state: "locked" | "saved" | "sent";
1942
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1386
1943
  readonly to: readonly string[];
1387
1944
  readonly subject: string | null;
1388
1945
  readonly createdAt: string;
@@ -1421,7 +1978,8 @@ export declare const updateDraft: (input: {
1421
1978
  readonly id: string & import("effect/Brand").Brand<"MailboxDraftId">;
1422
1979
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1423
1980
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1424
- readonly state: "approvalPending" | "saved" | "sent";
1981
+ readonly state: "locked" | "saved" | "sent";
1982
+ readonly lockedByActionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1425
1983
  readonly to: readonly string[];
1426
1984
  readonly subject: string | null;
1427
1985
  readonly createdAt: string;
@@ -1452,61 +2010,297 @@ export declare const sendDraft: (input: {
1452
2010
  readonly idempotencyKey?: string | undefined;
1453
2011
  }) => import("effect/Effect").Effect<{
1454
2012
  readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2013
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1455
2014
  readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1456
- readonly threadId: string & import("effect/Brand").Brand<"MailboxThreadId">;
1457
- readonly status: "pending_approval" | "sent";
1458
- readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "sending-paused" | "upstream-unavailable" | null;
2015
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2016
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2017
+ readonly acceptedAt: string | null;
2018
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
1459
2019
  readonly reviewExpectedAt: string | null;
1460
2020
  readonly skippedRecipients: readonly {
1461
2021
  readonly address: string;
1462
2022
  readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
1463
2023
  readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
1464
2024
  }[];
1465
- readonly createdAt: string;
1466
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1467
- export declare const listActions: ((input: {
1468
- readonly id: string;
1469
- readonly limit?: string | null | undefined;
1470
- readonly cursor?: string | null | undefined;
1471
- readonly state?: string | null | undefined;
1472
- readonly after?: string | null | undefined;
1473
- readonly before?: string | null | undefined;
1474
- }) => import("effect/Effect").Effect<{
1475
- readonly items: readonly {
1476
- readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1477
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "reply" | "sendMessage" | "updateDraft";
1478
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1479
- readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1480
- readonly proposedBy: {
1481
- readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2025
+ readonly executeUntil: string | null;
2026
+ readonly retryAt: string | null;
2027
+ readonly problem: {
2028
+ readonly code: string;
2029
+ readonly message: string;
2030
+ readonly error?: {
2031
+ readonly _tag: "SenderNotReadyError";
2032
+ readonly message: string;
2033
+ readonly sender: string;
2034
+ readonly retryAfterSeconds?: number | null;
2035
+ } | {
2036
+ readonly _tag: "RateLimitedError";
2037
+ readonly message: string;
2038
+ readonly retryAfterSeconds: number;
2039
+ } | {
2040
+ readonly _tag: "OnboardingReviewRequiredError";
2041
+ readonly message: string;
2042
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2043
+ readonly decision: "approved" | "rejected" | "undecided";
2044
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2045
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2046
+ readonly identityId?: string | null;
2047
+ } | {
2048
+ readonly _tag: "PaymentRequiredError";
2049
+ readonly message: string;
2050
+ readonly resource: string;
2051
+ readonly currentUsage: number;
2052
+ readonly limit: number;
2053
+ } | {
2054
+ readonly _tag: "ValidationError";
2055
+ readonly message: string;
2056
+ readonly fields?: {
2057
+ readonly [x: string]: readonly string[];
2058
+ } | null;
2059
+ } | {
2060
+ readonly _tag: "ForbiddenError";
2061
+ readonly message: string;
2062
+ } | {
2063
+ readonly _tag: "ResourceNotFoundError";
2064
+ readonly resource: string;
1482
2065
  readonly id: string;
1483
- readonly displayName?: string | null;
1484
- };
1485
- readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1486
- readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1487
- readonly decision: {
2066
+ readonly message: string;
2067
+ } | null;
2068
+ } | null;
2069
+ readonly retryEligible: boolean;
2070
+ readonly decision: {
2071
+ readonly outcome: "allow" | "deny" | "requireApproval";
2072
+ readonly reason: string | null;
2073
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2074
+ readonly source: "grant" | "installation" | "policy" | null;
2075
+ readonly decidedAt: string;
2076
+ } | null;
2077
+ readonly createdAt: string;
2078
+ readonly updatedAt: string;
2079
+ } | {
2080
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2081
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2082
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2083
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2084
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2085
+ readonly acceptedAt: string | null;
2086
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2087
+ readonly reviewExpectedAt: string | null;
2088
+ readonly skippedRecipients: readonly {
2089
+ readonly address: string;
2090
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2091
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2092
+ }[];
2093
+ readonly executeUntil: string | null;
2094
+ readonly retryAt: string | null;
2095
+ readonly problem: {
2096
+ readonly code: string;
2097
+ readonly message: string;
2098
+ readonly error?: {
2099
+ readonly _tag: "SenderNotReadyError";
2100
+ readonly message: string;
2101
+ readonly sender: string;
2102
+ readonly retryAfterSeconds?: number | null;
2103
+ } | {
2104
+ readonly _tag: "RateLimitedError";
2105
+ readonly message: string;
2106
+ readonly retryAfterSeconds: number;
2107
+ } | {
2108
+ readonly _tag: "OnboardingReviewRequiredError";
2109
+ readonly message: string;
2110
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2111
+ readonly decision: "approved" | "rejected" | "undecided";
2112
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2113
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2114
+ readonly identityId?: string | null;
2115
+ } | {
2116
+ readonly _tag: "PaymentRequiredError";
2117
+ readonly message: string;
2118
+ readonly resource: string;
2119
+ readonly currentUsage: number;
2120
+ readonly limit: number;
2121
+ } | {
2122
+ readonly _tag: "ValidationError";
2123
+ readonly message: string;
2124
+ readonly fields?: {
2125
+ readonly [x: string]: readonly string[];
2126
+ } | null;
2127
+ } | {
2128
+ readonly _tag: "ForbiddenError";
2129
+ readonly message: string;
2130
+ } | {
2131
+ readonly _tag: "ResourceNotFoundError";
2132
+ readonly resource: string;
2133
+ readonly id: string;
2134
+ readonly message: string;
2135
+ } | null;
2136
+ } | null;
2137
+ readonly retryEligible: boolean;
2138
+ readonly decision: {
2139
+ readonly outcome: "allow" | "deny" | "requireApproval";
2140
+ readonly reason: string | null;
2141
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2142
+ readonly source: "grant" | "installation" | "policy" | null;
2143
+ readonly decidedAt: string;
2144
+ } | null;
2145
+ readonly createdAt: string;
2146
+ readonly updatedAt: string;
2147
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
2148
+ export declare const listActions: ((input: {
2149
+ readonly id: string;
2150
+ readonly limit?: string | null | undefined;
2151
+ readonly cursor?: string | null | undefined;
2152
+ readonly threadId?: string | null | undefined;
2153
+ readonly state?: "accepted" | "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "completed" | "executed" | "executing" | "failed" | "notSent" | "policyDenied" | "proposed" | "queued" | "uncertain" | null | undefined;
2154
+ readonly after?: string | null | undefined;
2155
+ readonly before?: string | null | undefined;
2156
+ }) => import("effect/Effect").Effect<{
2157
+ readonly items: readonly ({
2158
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2159
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2160
+ readonly proposedBy: {
2161
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2162
+ readonly id: string;
2163
+ readonly displayName?: string | null;
2164
+ };
2165
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2166
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2167
+ readonly decision: {
1488
2168
  readonly outcome: "allow" | "deny" | "requireApproval";
1489
2169
  readonly reason: string | null;
1490
2170
  readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2171
+ readonly source: "grant" | "installation" | "policy" | null;
1491
2172
  readonly decidedAt: string;
1492
2173
  } | null;
1493
2174
  readonly createdAt: string;
1494
2175
  readonly updatedAt: string;
1495
- }[];
2176
+ readonly type: "reply" | "sendMessage";
2177
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2178
+ readonly send: {
2179
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2180
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2181
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2182
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2183
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2184
+ readonly acceptedAt: string | null;
2185
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2186
+ readonly reviewExpectedAt: string | null;
2187
+ readonly skippedRecipients: readonly {
2188
+ readonly address: string;
2189
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2190
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2191
+ }[];
2192
+ readonly executeUntil: string | null;
2193
+ readonly retryAt: string | null;
2194
+ readonly problem: {
2195
+ readonly code: string;
2196
+ readonly message: string;
2197
+ readonly error?: {
2198
+ readonly _tag: "SenderNotReadyError";
2199
+ readonly message: string;
2200
+ readonly sender: string;
2201
+ readonly retryAfterSeconds?: number | null;
2202
+ } | {
2203
+ readonly _tag: "RateLimitedError";
2204
+ readonly message: string;
2205
+ readonly retryAfterSeconds: number;
2206
+ } | {
2207
+ readonly _tag: "OnboardingReviewRequiredError";
2208
+ readonly message: string;
2209
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2210
+ readonly decision: "approved" | "rejected" | "undecided";
2211
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2212
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2213
+ readonly identityId?: string | null;
2214
+ } | {
2215
+ readonly _tag: "PaymentRequiredError";
2216
+ readonly message: string;
2217
+ readonly resource: string;
2218
+ readonly currentUsage: number;
2219
+ readonly limit: number;
2220
+ } | {
2221
+ readonly _tag: "ValidationError";
2222
+ readonly message: string;
2223
+ readonly fields?: {
2224
+ readonly [x: string]: readonly string[];
2225
+ } | null;
2226
+ } | {
2227
+ readonly _tag: "ForbiddenError";
2228
+ readonly message: string;
2229
+ } | {
2230
+ readonly _tag: "ResourceNotFoundError";
2231
+ readonly resource: string;
2232
+ readonly id: string;
2233
+ readonly message: string;
2234
+ } | null;
2235
+ } | null;
2236
+ readonly retryEligible: boolean;
2237
+ readonly decision: {
2238
+ readonly outcome: "allow" | "deny" | "requireApproval";
2239
+ readonly reason: string | null;
2240
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2241
+ readonly source: "grant" | "installation" | "policy" | null;
2242
+ readonly decidedAt: string;
2243
+ } | null;
2244
+ readonly createdAt: string;
2245
+ readonly updatedAt: string;
2246
+ };
2247
+ readonly intent: {
2248
+ readonly draftRevision: number;
2249
+ readonly from: string;
2250
+ readonly fromName: string | null;
2251
+ readonly to: readonly [string, ...string[]];
2252
+ readonly cc: readonly string[];
2253
+ readonly bcc: readonly string[];
2254
+ readonly replyTo: readonly string[];
2255
+ readonly subject: string;
2256
+ readonly text: string | null;
2257
+ readonly html: string | null;
2258
+ readonly attachments: readonly {
2259
+ readonly filename: string;
2260
+ readonly content?: string | null;
2261
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
2262
+ readonly contentType: string;
2263
+ readonly size: number;
2264
+ }[];
2265
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2266
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
2267
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2268
+ } | null;
2269
+ } | {
2270
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2271
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2272
+ readonly proposedBy: {
2273
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2274
+ readonly id: string;
2275
+ readonly displayName?: string | null;
2276
+ };
2277
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2278
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2279
+ readonly decision: {
2280
+ readonly outcome: "allow" | "deny" | "requireApproval";
2281
+ readonly reason: string | null;
2282
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2283
+ readonly source: "grant" | "installation" | "policy" | null;
2284
+ readonly decidedAt: string;
2285
+ } | null;
2286
+ readonly createdAt: string;
2287
+ readonly updatedAt: string;
2288
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
2289
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2290
+ })[];
1496
2291
  readonly nextCursor: string | null;
1497
2292
  }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>) & {
1498
2293
  readonly pages: (input: {
1499
2294
  readonly id: string;
1500
2295
  readonly limit?: string | null | undefined;
1501
2296
  readonly cursor?: string | null | undefined;
1502
- readonly state?: string | null | undefined;
2297
+ readonly threadId?: string | null | undefined;
2298
+ readonly state?: "accepted" | "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "completed" | "executed" | "executing" | "failed" | "notSent" | "policyDenied" | "proposed" | "queued" | "uncertain" | null | undefined;
1503
2299
  readonly after?: string | null | undefined;
1504
2300
  readonly before?: string | null | undefined;
1505
2301
  }) => import("effect/Stream").Stream<{
1506
- readonly items: readonly {
2302
+ readonly items: readonly ({
1507
2303
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1508
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "reply" | "sendMessage" | "updateDraft";
1509
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1510
2304
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1511
2305
  readonly proposedBy: {
1512
2306
  readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
@@ -1519,24 +2313,138 @@ export declare const listActions: ((input: {
1519
2313
  readonly outcome: "allow" | "deny" | "requireApproval";
1520
2314
  readonly reason: string | null;
1521
2315
  readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2316
+ readonly source: "grant" | "installation" | "policy" | null;
1522
2317
  readonly decidedAt: string;
1523
2318
  } | null;
1524
2319
  readonly createdAt: string;
1525
2320
  readonly updatedAt: string;
1526
- }[];
2321
+ readonly type: "reply" | "sendMessage";
2322
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2323
+ readonly send: {
2324
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2325
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2326
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2327
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2328
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2329
+ readonly acceptedAt: string | null;
2330
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2331
+ readonly reviewExpectedAt: string | null;
2332
+ readonly skippedRecipients: readonly {
2333
+ readonly address: string;
2334
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2335
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2336
+ }[];
2337
+ readonly executeUntil: string | null;
2338
+ readonly retryAt: string | null;
2339
+ readonly problem: {
2340
+ readonly code: string;
2341
+ readonly message: string;
2342
+ readonly error?: {
2343
+ readonly _tag: "SenderNotReadyError";
2344
+ readonly message: string;
2345
+ readonly sender: string;
2346
+ readonly retryAfterSeconds?: number | null;
2347
+ } | {
2348
+ readonly _tag: "RateLimitedError";
2349
+ readonly message: string;
2350
+ readonly retryAfterSeconds: number;
2351
+ } | {
2352
+ readonly _tag: "OnboardingReviewRequiredError";
2353
+ readonly message: string;
2354
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2355
+ readonly decision: "approved" | "rejected" | "undecided";
2356
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2357
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2358
+ readonly identityId?: string | null;
2359
+ } | {
2360
+ readonly _tag: "PaymentRequiredError";
2361
+ readonly message: string;
2362
+ readonly resource: string;
2363
+ readonly currentUsage: number;
2364
+ readonly limit: number;
2365
+ } | {
2366
+ readonly _tag: "ValidationError";
2367
+ readonly message: string;
2368
+ readonly fields?: {
2369
+ readonly [x: string]: readonly string[];
2370
+ } | null;
2371
+ } | {
2372
+ readonly _tag: "ForbiddenError";
2373
+ readonly message: string;
2374
+ } | {
2375
+ readonly _tag: "ResourceNotFoundError";
2376
+ readonly resource: string;
2377
+ readonly id: string;
2378
+ readonly message: string;
2379
+ } | null;
2380
+ } | null;
2381
+ readonly retryEligible: boolean;
2382
+ readonly decision: {
2383
+ readonly outcome: "allow" | "deny" | "requireApproval";
2384
+ readonly reason: string | null;
2385
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2386
+ readonly source: "grant" | "installation" | "policy" | null;
2387
+ readonly decidedAt: string;
2388
+ } | null;
2389
+ readonly createdAt: string;
2390
+ readonly updatedAt: string;
2391
+ };
2392
+ readonly intent: {
2393
+ readonly draftRevision: number;
2394
+ readonly from: string;
2395
+ readonly fromName: string | null;
2396
+ readonly to: readonly [string, ...string[]];
2397
+ readonly cc: readonly string[];
2398
+ readonly bcc: readonly string[];
2399
+ readonly replyTo: readonly string[];
2400
+ readonly subject: string;
2401
+ readonly text: string | null;
2402
+ readonly html: string | null;
2403
+ readonly attachments: readonly {
2404
+ readonly filename: string;
2405
+ readonly content?: string | null;
2406
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
2407
+ readonly contentType: string;
2408
+ readonly size: number;
2409
+ }[];
2410
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2411
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
2412
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2413
+ } | null;
2414
+ } | {
2415
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2416
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2417
+ readonly proposedBy: {
2418
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2419
+ readonly id: string;
2420
+ readonly displayName?: string | null;
2421
+ };
2422
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2423
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2424
+ readonly decision: {
2425
+ readonly outcome: "allow" | "deny" | "requireApproval";
2426
+ readonly reason: string | null;
2427
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2428
+ readonly source: "grant" | "installation" | "policy" | null;
2429
+ readonly decidedAt: string;
2430
+ } | null;
2431
+ readonly createdAt: string;
2432
+ readonly updatedAt: string;
2433
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
2434
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2435
+ })[];
1527
2436
  readonly nextCursor: string | null;
1528
2437
  }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1529
2438
  readonly items: (input: {
1530
2439
  readonly id: string;
1531
2440
  readonly limit?: string | null | undefined;
1532
2441
  readonly cursor?: string | null | undefined;
1533
- readonly state?: string | null | undefined;
2442
+ readonly threadId?: string | null | undefined;
2443
+ readonly state?: "accepted" | "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "completed" | "executed" | "executing" | "failed" | "notSent" | "policyDenied" | "proposed" | "queued" | "uncertain" | null | undefined;
1534
2444
  readonly after?: string | null | undefined;
1535
2445
  readonly before?: string | null | undefined;
1536
2446
  }) => import("effect/Stream").Stream<{
1537
2447
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1538
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "reply" | "sendMessage" | "updateDraft";
1539
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1540
2448
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1541
2449
  readonly proposedBy: {
1542
2450
  readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
@@ -1549,19 +2457,661 @@ export declare const listActions: ((input: {
1549
2457
  readonly outcome: "allow" | "deny" | "requireApproval";
1550
2458
  readonly reason: string | null;
1551
2459
  readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2460
+ readonly source: "grant" | "installation" | "policy" | null;
2461
+ readonly decidedAt: string;
2462
+ } | null;
2463
+ readonly createdAt: string;
2464
+ readonly updatedAt: string;
2465
+ readonly type: "reply" | "sendMessage";
2466
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2467
+ readonly send: {
2468
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2469
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2470
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2471
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2472
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2473
+ readonly acceptedAt: string | null;
2474
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2475
+ readonly reviewExpectedAt: string | null;
2476
+ readonly skippedRecipients: readonly {
2477
+ readonly address: string;
2478
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2479
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2480
+ }[];
2481
+ readonly executeUntil: string | null;
2482
+ readonly retryAt: string | null;
2483
+ readonly problem: {
2484
+ readonly code: string;
2485
+ readonly message: string;
2486
+ readonly error?: {
2487
+ readonly _tag: "SenderNotReadyError";
2488
+ readonly message: string;
2489
+ readonly sender: string;
2490
+ readonly retryAfterSeconds?: number | null;
2491
+ } | {
2492
+ readonly _tag: "RateLimitedError";
2493
+ readonly message: string;
2494
+ readonly retryAfterSeconds: number;
2495
+ } | {
2496
+ readonly _tag: "OnboardingReviewRequiredError";
2497
+ readonly message: string;
2498
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2499
+ readonly decision: "approved" | "rejected" | "undecided";
2500
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2501
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2502
+ readonly identityId?: string | null;
2503
+ } | {
2504
+ readonly _tag: "PaymentRequiredError";
2505
+ readonly message: string;
2506
+ readonly resource: string;
2507
+ readonly currentUsage: number;
2508
+ readonly limit: number;
2509
+ } | {
2510
+ readonly _tag: "ValidationError";
2511
+ readonly message: string;
2512
+ readonly fields?: {
2513
+ readonly [x: string]: readonly string[];
2514
+ } | null;
2515
+ } | {
2516
+ readonly _tag: "ForbiddenError";
2517
+ readonly message: string;
2518
+ } | {
2519
+ readonly _tag: "ResourceNotFoundError";
2520
+ readonly resource: string;
2521
+ readonly id: string;
2522
+ readonly message: string;
2523
+ } | null;
2524
+ } | null;
2525
+ readonly retryEligible: boolean;
2526
+ readonly decision: {
2527
+ readonly outcome: "allow" | "deny" | "requireApproval";
2528
+ readonly reason: string | null;
2529
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2530
+ readonly source: "grant" | "installation" | "policy" | null;
2531
+ readonly decidedAt: string;
2532
+ } | null;
2533
+ readonly createdAt: string;
2534
+ readonly updatedAt: string;
2535
+ };
2536
+ readonly intent: {
2537
+ readonly draftRevision: number;
2538
+ readonly from: string;
2539
+ readonly fromName: string | null;
2540
+ readonly to: readonly [string, ...string[]];
2541
+ readonly cc: readonly string[];
2542
+ readonly bcc: readonly string[];
2543
+ readonly replyTo: readonly string[];
2544
+ readonly subject: string;
2545
+ readonly text: string | null;
2546
+ readonly html: string | null;
2547
+ readonly attachments: readonly {
2548
+ readonly filename: string;
2549
+ readonly content?: string | null;
2550
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
2551
+ readonly contentType: string;
2552
+ readonly size: number;
2553
+ }[];
2554
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2555
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
2556
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2557
+ } | null;
2558
+ } | {
2559
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2560
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2561
+ readonly proposedBy: {
2562
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2563
+ readonly id: string;
2564
+ readonly displayName?: string | null;
2565
+ };
2566
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2567
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2568
+ readonly decision: {
2569
+ readonly outcome: "allow" | "deny" | "requireApproval";
2570
+ readonly reason: string | null;
2571
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2572
+ readonly source: "grant" | "installation" | "policy" | null;
1552
2573
  readonly decidedAt: string;
1553
2574
  } | null;
1554
2575
  readonly createdAt: string;
1555
2576
  readonly updatedAt: string;
2577
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
2578
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1556
2579
  }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1557
2580
  };
1558
- export declare const approveAction: (input: {
2581
+ export declare const getAction: (input: {
1559
2582
  readonly id: string;
1560
2583
  readonly actionId: string;
1561
2584
  }) => import("effect/Effect").Effect<{
1562
2585
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1563
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "reply" | "sendMessage" | "updateDraft";
2586
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2587
+ readonly proposedBy: {
2588
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2589
+ readonly id: string;
2590
+ readonly displayName?: string | null;
2591
+ };
2592
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2593
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2594
+ readonly decision: {
2595
+ readonly outcome: "allow" | "deny" | "requireApproval";
2596
+ readonly reason: string | null;
2597
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2598
+ readonly source: "grant" | "installation" | "policy" | null;
2599
+ readonly decidedAt: string;
2600
+ } | null;
2601
+ readonly createdAt: string;
2602
+ readonly updatedAt: string;
2603
+ readonly type: "reply" | "sendMessage";
2604
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2605
+ readonly send: {
2606
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2607
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2608
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2609
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2610
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2611
+ readonly acceptedAt: string | null;
2612
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2613
+ readonly reviewExpectedAt: string | null;
2614
+ readonly skippedRecipients: readonly {
2615
+ readonly address: string;
2616
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2617
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2618
+ }[];
2619
+ readonly executeUntil: string | null;
2620
+ readonly retryAt: string | null;
2621
+ readonly problem: {
2622
+ readonly code: string;
2623
+ readonly message: string;
2624
+ readonly error?: {
2625
+ readonly _tag: "SenderNotReadyError";
2626
+ readonly message: string;
2627
+ readonly sender: string;
2628
+ readonly retryAfterSeconds?: number | null;
2629
+ } | {
2630
+ readonly _tag: "RateLimitedError";
2631
+ readonly message: string;
2632
+ readonly retryAfterSeconds: number;
2633
+ } | {
2634
+ readonly _tag: "OnboardingReviewRequiredError";
2635
+ readonly message: string;
2636
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2637
+ readonly decision: "approved" | "rejected" | "undecided";
2638
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2639
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2640
+ readonly identityId?: string | null;
2641
+ } | {
2642
+ readonly _tag: "PaymentRequiredError";
2643
+ readonly message: string;
2644
+ readonly resource: string;
2645
+ readonly currentUsage: number;
2646
+ readonly limit: number;
2647
+ } | {
2648
+ readonly _tag: "ValidationError";
2649
+ readonly message: string;
2650
+ readonly fields?: {
2651
+ readonly [x: string]: readonly string[];
2652
+ } | null;
2653
+ } | {
2654
+ readonly _tag: "ForbiddenError";
2655
+ readonly message: string;
2656
+ } | {
2657
+ readonly _tag: "ResourceNotFoundError";
2658
+ readonly resource: string;
2659
+ readonly id: string;
2660
+ readonly message: string;
2661
+ } | null;
2662
+ } | null;
2663
+ readonly retryEligible: boolean;
2664
+ readonly decision: {
2665
+ readonly outcome: "allow" | "deny" | "requireApproval";
2666
+ readonly reason: string | null;
2667
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2668
+ readonly source: "grant" | "installation" | "policy" | null;
2669
+ readonly decidedAt: string;
2670
+ } | null;
2671
+ readonly createdAt: string;
2672
+ readonly updatedAt: string;
2673
+ };
2674
+ readonly intent: {
2675
+ readonly draftRevision: number;
2676
+ readonly from: string;
2677
+ readonly fromName: string | null;
2678
+ readonly to: readonly [string, ...string[]];
2679
+ readonly cc: readonly string[];
2680
+ readonly bcc: readonly string[];
2681
+ readonly replyTo: readonly string[];
2682
+ readonly subject: string;
2683
+ readonly text: string | null;
2684
+ readonly html: string | null;
2685
+ readonly attachments: readonly {
2686
+ readonly filename: string;
2687
+ readonly content?: string | null;
2688
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
2689
+ readonly contentType: string;
2690
+ readonly size: number;
2691
+ }[];
2692
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2693
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
2694
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2695
+ } | null;
2696
+ } | {
2697
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2698
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2699
+ readonly proposedBy: {
2700
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2701
+ readonly id: string;
2702
+ readonly displayName?: string | null;
2703
+ };
2704
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2705
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2706
+ readonly decision: {
2707
+ readonly outcome: "allow" | "deny" | "requireApproval";
2708
+ readonly reason: string | null;
2709
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2710
+ readonly source: "grant" | "installation" | "policy" | null;
2711
+ readonly decidedAt: string;
2712
+ } | null;
2713
+ readonly createdAt: string;
2714
+ readonly updatedAt: string;
2715
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
1564
2716
  readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2717
+ }, import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
2718
+ export declare const cancelAction: (input: {
2719
+ readonly id: string;
2720
+ readonly actionId: string;
2721
+ }) => import("effect/Effect").Effect<{
2722
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2723
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2724
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2725
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2726
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2727
+ readonly acceptedAt: string | null;
2728
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2729
+ readonly reviewExpectedAt: string | null;
2730
+ readonly skippedRecipients: readonly {
2731
+ readonly address: string;
2732
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2733
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2734
+ }[];
2735
+ readonly executeUntil: string | null;
2736
+ readonly retryAt: string | null;
2737
+ readonly problem: {
2738
+ readonly code: string;
2739
+ readonly message: string;
2740
+ readonly error?: {
2741
+ readonly _tag: "SenderNotReadyError";
2742
+ readonly message: string;
2743
+ readonly sender: string;
2744
+ readonly retryAfterSeconds?: number | null;
2745
+ } | {
2746
+ readonly _tag: "RateLimitedError";
2747
+ readonly message: string;
2748
+ readonly retryAfterSeconds: number;
2749
+ } | {
2750
+ readonly _tag: "OnboardingReviewRequiredError";
2751
+ readonly message: string;
2752
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2753
+ readonly decision: "approved" | "rejected" | "undecided";
2754
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2755
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2756
+ readonly identityId?: string | null;
2757
+ } | {
2758
+ readonly _tag: "PaymentRequiredError";
2759
+ readonly message: string;
2760
+ readonly resource: string;
2761
+ readonly currentUsage: number;
2762
+ readonly limit: number;
2763
+ } | {
2764
+ readonly _tag: "ValidationError";
2765
+ readonly message: string;
2766
+ readonly fields?: {
2767
+ readonly [x: string]: readonly string[];
2768
+ } | null;
2769
+ } | {
2770
+ readonly _tag: "ForbiddenError";
2771
+ readonly message: string;
2772
+ } | {
2773
+ readonly _tag: "ResourceNotFoundError";
2774
+ readonly resource: string;
2775
+ readonly id: string;
2776
+ readonly message: string;
2777
+ } | null;
2778
+ } | null;
2779
+ readonly retryEligible: boolean;
2780
+ readonly decision: {
2781
+ readonly outcome: "allow" | "deny" | "requireApproval";
2782
+ readonly reason: string | null;
2783
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2784
+ readonly source: "grant" | "installation" | "policy" | null;
2785
+ readonly decidedAt: string;
2786
+ } | null;
2787
+ readonly createdAt: string;
2788
+ readonly updatedAt: string;
2789
+ } | {
2790
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2791
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2792
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2793
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2794
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2795
+ readonly acceptedAt: string | null;
2796
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2797
+ readonly reviewExpectedAt: string | null;
2798
+ readonly skippedRecipients: readonly {
2799
+ readonly address: string;
2800
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2801
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2802
+ }[];
2803
+ readonly executeUntil: string | null;
2804
+ readonly retryAt: string | null;
2805
+ readonly problem: {
2806
+ readonly code: string;
2807
+ readonly message: string;
2808
+ readonly error?: {
2809
+ readonly _tag: "SenderNotReadyError";
2810
+ readonly message: string;
2811
+ readonly sender: string;
2812
+ readonly retryAfterSeconds?: number | null;
2813
+ } | {
2814
+ readonly _tag: "RateLimitedError";
2815
+ readonly message: string;
2816
+ readonly retryAfterSeconds: number;
2817
+ } | {
2818
+ readonly _tag: "OnboardingReviewRequiredError";
2819
+ readonly message: string;
2820
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2821
+ readonly decision: "approved" | "rejected" | "undecided";
2822
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2823
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2824
+ readonly identityId?: string | null;
2825
+ } | {
2826
+ readonly _tag: "PaymentRequiredError";
2827
+ readonly message: string;
2828
+ readonly resource: string;
2829
+ readonly currentUsage: number;
2830
+ readonly limit: number;
2831
+ } | {
2832
+ readonly _tag: "ValidationError";
2833
+ readonly message: string;
2834
+ readonly fields?: {
2835
+ readonly [x: string]: readonly string[];
2836
+ } | null;
2837
+ } | {
2838
+ readonly _tag: "ForbiddenError";
2839
+ readonly message: string;
2840
+ } | {
2841
+ readonly _tag: "ResourceNotFoundError";
2842
+ readonly resource: string;
2843
+ readonly id: string;
2844
+ readonly message: string;
2845
+ } | null;
2846
+ } | null;
2847
+ readonly retryEligible: boolean;
2848
+ readonly decision: {
2849
+ readonly outcome: "allow" | "deny" | "requireApproval";
2850
+ readonly reason: string | null;
2851
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2852
+ readonly source: "grant" | "installation" | "policy" | null;
2853
+ readonly decidedAt: string;
2854
+ } | null;
2855
+ readonly createdAt: string;
2856
+ readonly updatedAt: string;
2857
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
2858
+ export declare const retryAction: (input: {
2859
+ readonly id: string;
2860
+ readonly actionId: string;
2861
+ }) => import("effect/Effect").Effect<{
2862
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2863
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2864
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2865
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2866
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2867
+ readonly acceptedAt: string | null;
2868
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2869
+ readonly reviewExpectedAt: string | null;
2870
+ readonly skippedRecipients: readonly {
2871
+ readonly address: string;
2872
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2873
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2874
+ }[];
2875
+ readonly executeUntil: string | null;
2876
+ readonly retryAt: string | null;
2877
+ readonly problem: {
2878
+ readonly code: string;
2879
+ readonly message: string;
2880
+ readonly error?: {
2881
+ readonly _tag: "SenderNotReadyError";
2882
+ readonly message: string;
2883
+ readonly sender: string;
2884
+ readonly retryAfterSeconds?: number | null;
2885
+ } | {
2886
+ readonly _tag: "RateLimitedError";
2887
+ readonly message: string;
2888
+ readonly retryAfterSeconds: number;
2889
+ } | {
2890
+ readonly _tag: "OnboardingReviewRequiredError";
2891
+ readonly message: string;
2892
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2893
+ readonly decision: "approved" | "rejected" | "undecided";
2894
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2895
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2896
+ readonly identityId?: string | null;
2897
+ } | {
2898
+ readonly _tag: "PaymentRequiredError";
2899
+ readonly message: string;
2900
+ readonly resource: string;
2901
+ readonly currentUsage: number;
2902
+ readonly limit: number;
2903
+ } | {
2904
+ readonly _tag: "ValidationError";
2905
+ readonly message: string;
2906
+ readonly fields?: {
2907
+ readonly [x: string]: readonly string[];
2908
+ } | null;
2909
+ } | {
2910
+ readonly _tag: "ForbiddenError";
2911
+ readonly message: string;
2912
+ } | {
2913
+ readonly _tag: "ResourceNotFoundError";
2914
+ readonly resource: string;
2915
+ readonly id: string;
2916
+ readonly message: string;
2917
+ } | null;
2918
+ } | null;
2919
+ readonly retryEligible: boolean;
2920
+ readonly decision: {
2921
+ readonly outcome: "allow" | "deny" | "requireApproval";
2922
+ readonly reason: string | null;
2923
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2924
+ readonly source: "grant" | "installation" | "policy" | null;
2925
+ readonly decidedAt: string;
2926
+ } | null;
2927
+ readonly createdAt: string;
2928
+ readonly updatedAt: string;
2929
+ } | {
2930
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
2931
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2932
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2933
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2934
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
2935
+ readonly acceptedAt: string | null;
2936
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
2937
+ readonly reviewExpectedAt: string | null;
2938
+ readonly skippedRecipients: readonly {
2939
+ readonly address: string;
2940
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
2941
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
2942
+ }[];
2943
+ readonly executeUntil: string | null;
2944
+ readonly retryAt: string | null;
2945
+ readonly problem: {
2946
+ readonly code: string;
2947
+ readonly message: string;
2948
+ readonly error?: {
2949
+ readonly _tag: "SenderNotReadyError";
2950
+ readonly message: string;
2951
+ readonly sender: string;
2952
+ readonly retryAfterSeconds?: number | null;
2953
+ } | {
2954
+ readonly _tag: "RateLimitedError";
2955
+ readonly message: string;
2956
+ readonly retryAfterSeconds: number;
2957
+ } | {
2958
+ readonly _tag: "OnboardingReviewRequiredError";
2959
+ readonly message: string;
2960
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
2961
+ readonly decision: "approved" | "rejected" | "undecided";
2962
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
2963
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
2964
+ readonly identityId?: string | null;
2965
+ } | {
2966
+ readonly _tag: "PaymentRequiredError";
2967
+ readonly message: string;
2968
+ readonly resource: string;
2969
+ readonly currentUsage: number;
2970
+ readonly limit: number;
2971
+ } | {
2972
+ readonly _tag: "ValidationError";
2973
+ readonly message: string;
2974
+ readonly fields?: {
2975
+ readonly [x: string]: readonly string[];
2976
+ } | null;
2977
+ } | {
2978
+ readonly _tag: "ForbiddenError";
2979
+ readonly message: string;
2980
+ } | {
2981
+ readonly _tag: "ResourceNotFoundError";
2982
+ readonly resource: string;
2983
+ readonly id: string;
2984
+ readonly message: string;
2985
+ } | null;
2986
+ } | null;
2987
+ readonly retryEligible: boolean;
2988
+ readonly decision: {
2989
+ readonly outcome: "allow" | "deny" | "requireApproval";
2990
+ readonly reason: string | null;
2991
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
2992
+ readonly source: "grant" | "installation" | "policy" | null;
2993
+ readonly decidedAt: string;
2994
+ } | null;
2995
+ readonly createdAt: string;
2996
+ readonly updatedAt: string;
2997
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
2998
+ export declare const approveAction: (input: {
2999
+ readonly id: string;
3000
+ readonly actionId: string;
3001
+ }) => import("effect/Effect").Effect<{
3002
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
3003
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
3004
+ readonly proposedBy: {
3005
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
3006
+ readonly id: string;
3007
+ readonly displayName?: string | null;
3008
+ };
3009
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3010
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
3011
+ readonly decision: {
3012
+ readonly outcome: "allow" | "deny" | "requireApproval";
3013
+ readonly reason: string | null;
3014
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3015
+ readonly source: "grant" | "installation" | "policy" | null;
3016
+ readonly decidedAt: string;
3017
+ } | null;
3018
+ readonly createdAt: string;
3019
+ readonly updatedAt: string;
3020
+ readonly type: "reply" | "sendMessage";
3021
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
3022
+ readonly send: {
3023
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
3024
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
3025
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
3026
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3027
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
3028
+ readonly acceptedAt: string | null;
3029
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
3030
+ readonly reviewExpectedAt: string | null;
3031
+ readonly skippedRecipients: readonly {
3032
+ readonly address: string;
3033
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
3034
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
3035
+ }[];
3036
+ readonly executeUntil: string | null;
3037
+ readonly retryAt: string | null;
3038
+ readonly problem: {
3039
+ readonly code: string;
3040
+ readonly message: string;
3041
+ readonly error?: {
3042
+ readonly _tag: "SenderNotReadyError";
3043
+ readonly message: string;
3044
+ readonly sender: string;
3045
+ readonly retryAfterSeconds?: number | null;
3046
+ } | {
3047
+ readonly _tag: "RateLimitedError";
3048
+ readonly message: string;
3049
+ readonly retryAfterSeconds: number;
3050
+ } | {
3051
+ readonly _tag: "OnboardingReviewRequiredError";
3052
+ readonly message: string;
3053
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
3054
+ readonly decision: "approved" | "rejected" | "undecided";
3055
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
3056
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
3057
+ readonly identityId?: string | null;
3058
+ } | {
3059
+ readonly _tag: "PaymentRequiredError";
3060
+ readonly message: string;
3061
+ readonly resource: string;
3062
+ readonly currentUsage: number;
3063
+ readonly limit: number;
3064
+ } | {
3065
+ readonly _tag: "ValidationError";
3066
+ readonly message: string;
3067
+ readonly fields?: {
3068
+ readonly [x: string]: readonly string[];
3069
+ } | null;
3070
+ } | {
3071
+ readonly _tag: "ForbiddenError";
3072
+ readonly message: string;
3073
+ } | {
3074
+ readonly _tag: "ResourceNotFoundError";
3075
+ readonly resource: string;
3076
+ readonly id: string;
3077
+ readonly message: string;
3078
+ } | null;
3079
+ } | null;
3080
+ readonly retryEligible: boolean;
3081
+ readonly decision: {
3082
+ readonly outcome: "allow" | "deny" | "requireApproval";
3083
+ readonly reason: string | null;
3084
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3085
+ readonly source: "grant" | "installation" | "policy" | null;
3086
+ readonly decidedAt: string;
3087
+ } | null;
3088
+ readonly createdAt: string;
3089
+ readonly updatedAt: string;
3090
+ };
3091
+ readonly intent: {
3092
+ readonly draftRevision: number;
3093
+ readonly from: string;
3094
+ readonly fromName: string | null;
3095
+ readonly to: readonly [string, ...string[]];
3096
+ readonly cc: readonly string[];
3097
+ readonly bcc: readonly string[];
3098
+ readonly replyTo: readonly string[];
3099
+ readonly subject: string;
3100
+ readonly text: string | null;
3101
+ readonly html: string | null;
3102
+ readonly attachments: readonly {
3103
+ readonly filename: string;
3104
+ readonly content?: string | null;
3105
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
3106
+ readonly contentType: string;
3107
+ readonly size: number;
3108
+ }[];
3109
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3110
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
3111
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
3112
+ } | null;
3113
+ } | {
3114
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1565
3115
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1566
3116
  readonly proposedBy: {
1567
3117
  readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
@@ -1574,19 +3124,20 @@ export declare const approveAction: (input: {
1574
3124
  readonly outcome: "allow" | "deny" | "requireApproval";
1575
3125
  readonly reason: string | null;
1576
3126
  readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3127
+ readonly source: "grant" | "installation" | "policy" | null;
1577
3128
  readonly decidedAt: string;
1578
3129
  } | null;
1579
3130
  readonly createdAt: string;
1580
3131
  readonly updatedAt: string;
1581
- }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
3132
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
3133
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
3134
+ }, import("./generated").BillingProviderError | import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").MailboxSendRefusedError | import("./generated").OnboardingReviewRequiredError | import("./generated").PaymentRequiredError | import("./generated").RateLimitedError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").SenderNotReadyError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1582
3135
  export declare const denyAction: (input: {
1583
3136
  readonly id: string;
1584
3137
  readonly actionId: string;
1585
3138
  readonly reason: string;
1586
3139
  }) => import("effect/Effect").Effect<{
1587
3140
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1588
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "reply" | "sendMessage" | "updateDraft";
1589
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1590
3141
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1591
3142
  readonly proposedBy: {
1592
3143
  readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
@@ -1599,11 +3150,126 @@ export declare const denyAction: (input: {
1599
3150
  readonly outcome: "allow" | "deny" | "requireApproval";
1600
3151
  readonly reason: string | null;
1601
3152
  readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3153
+ readonly source: "grant" | "installation" | "policy" | null;
1602
3154
  readonly decidedAt: string;
1603
3155
  } | null;
1604
3156
  readonly createdAt: string;
1605
3157
  readonly updatedAt: string;
1606
- }, import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
3158
+ readonly type: "reply" | "sendMessage";
3159
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
3160
+ readonly send: {
3161
+ readonly actionId: string & import("effect/Brand").Brand<"MailboxActionId">;
3162
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
3163
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
3164
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3165
+ readonly state: "accepted" | "approvalRequired" | "completed" | "notSent" | "queued" | "uncertain";
3166
+ readonly acceptedAt: string | null;
3167
+ readonly waitReason: "campaign-paused" | "content-review" | "daily-quota" | "domain-health" | "domain-warming" | "onboarding-review" | "rate" | "retry" | "screening-unavailable" | "sending-paused" | "upstream-unavailable" | null;
3168
+ readonly reviewExpectedAt: string | null;
3169
+ readonly skippedRecipients: readonly {
3170
+ readonly address: string;
3171
+ readonly reason: "bounce" | "complaint" | "group-unsubscribe" | "manual" | "unsubscribe";
3172
+ readonly unsubscribeGroupId?: (string & import("effect/Brand").Brand<"UnsubscribeId">) | null;
3173
+ }[];
3174
+ readonly executeUntil: string | null;
3175
+ readonly retryAt: string | null;
3176
+ readonly problem: {
3177
+ readonly code: string;
3178
+ readonly message: string;
3179
+ readonly error?: {
3180
+ readonly _tag: "SenderNotReadyError";
3181
+ readonly message: string;
3182
+ readonly sender: string;
3183
+ readonly retryAfterSeconds?: number | null;
3184
+ } | {
3185
+ readonly _tag: "RateLimitedError";
3186
+ readonly message: string;
3187
+ readonly retryAfterSeconds: number;
3188
+ } | {
3189
+ readonly _tag: "OnboardingReviewRequiredError";
3190
+ readonly message: string;
3191
+ readonly code: "identity_changed" | "identity_review_rejected" | "identity_review_required" | "information_required" | "review_in_progress" | "review_rejected" | "review_required";
3192
+ readonly decision: "approved" | "rejected" | "undecided";
3193
+ readonly stage: "automated_review" | "collecting" | "complete" | "information_requested" | "manual_review";
3194
+ readonly nextAction: "contact_support" | "provide_information" | "reapply" | "verify_sending_identity" | "wait_for_review";
3195
+ readonly identityId?: string | null;
3196
+ } | {
3197
+ readonly _tag: "PaymentRequiredError";
3198
+ readonly message: string;
3199
+ readonly resource: string;
3200
+ readonly currentUsage: number;
3201
+ readonly limit: number;
3202
+ } | {
3203
+ readonly _tag: "ValidationError";
3204
+ readonly message: string;
3205
+ readonly fields?: {
3206
+ readonly [x: string]: readonly string[];
3207
+ } | null;
3208
+ } | {
3209
+ readonly _tag: "ForbiddenError";
3210
+ readonly message: string;
3211
+ } | {
3212
+ readonly _tag: "ResourceNotFoundError";
3213
+ readonly resource: string;
3214
+ readonly id: string;
3215
+ readonly message: string;
3216
+ } | null;
3217
+ } | null;
3218
+ readonly retryEligible: boolean;
3219
+ readonly decision: {
3220
+ readonly outcome: "allow" | "deny" | "requireApproval";
3221
+ readonly reason: string | null;
3222
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3223
+ readonly source: "grant" | "installation" | "policy" | null;
3224
+ readonly decidedAt: string;
3225
+ } | null;
3226
+ readonly createdAt: string;
3227
+ readonly updatedAt: string;
3228
+ };
3229
+ readonly intent: {
3230
+ readonly draftRevision: number;
3231
+ readonly from: string;
3232
+ readonly fromName: string | null;
3233
+ readonly to: readonly [string, ...string[]];
3234
+ readonly cc: readonly string[];
3235
+ readonly bcc: readonly string[];
3236
+ readonly replyTo: readonly string[];
3237
+ readonly subject: string;
3238
+ readonly text: string | null;
3239
+ readonly html: string | null;
3240
+ readonly attachments: readonly {
3241
+ readonly filename: string;
3242
+ readonly content?: string | null;
3243
+ readonly mediaId?: (string & import("effect/Brand").Brand<"MediaId">) | null;
3244
+ readonly contentType: string;
3245
+ readonly size: number;
3246
+ }[];
3247
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3248
+ readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
3249
+ readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
3250
+ } | null;
3251
+ } | {
3252
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
3253
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
3254
+ readonly proposedBy: {
3255
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
3256
+ readonly id: string;
3257
+ readonly displayName?: string | null;
3258
+ };
3259
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
3260
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
3261
+ readonly decision: {
3262
+ readonly outcome: "allow" | "deny" | "requireApproval";
3263
+ readonly reason: string | null;
3264
+ readonly policyId: (string & import("effect/Brand").Brand<"MailboxPolicyId">) | null;
3265
+ readonly source: "grant" | "installation" | "policy" | null;
3266
+ readonly decidedAt: string;
3267
+ } | null;
3268
+ readonly createdAt: string;
3269
+ readonly updatedAt: string;
3270
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "updateDraft";
3271
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
3272
+ }, import("./generated").ConflictError | import("./generated").ForbiddenError | import("./generated").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./generated").InternalError | import("./generated").MailboxSendConflictError | import("./generated").ResourceNotFoundError | import("effect/Schema").SchemaError | import("./generated").UnauthorizedError | import("./generated").ValidationError, import("./client").Service>;
1607
3273
  export declare const listEvents: ((input: {
1608
3274
  readonly id: string;
1609
3275
  readonly limit?: string | null | undefined;
@@ -1613,7 +3279,7 @@ export declare const listEvents: ((input: {
1613
3279
  }) => import("effect/Effect").Effect<{
1614
3280
  readonly items: readonly {
1615
3281
  readonly id: string & import("effect/Brand").Brand<"MailboxEventId">;
1616
- readonly type: "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "draft.created" | "draft.updated" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created" | "thread.updated";
3282
+ readonly type: "action.accepted" | "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "address.detached" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created";
1617
3283
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1618
3284
  readonly actionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1619
3285
  readonly actor: {
@@ -1637,7 +3303,7 @@ export declare const listEvents: ((input: {
1637
3303
  }) => import("effect/Stream").Stream<{
1638
3304
  readonly items: readonly {
1639
3305
  readonly id: string & import("effect/Brand").Brand<"MailboxEventId">;
1640
- readonly type: "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "draft.created" | "draft.updated" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created" | "thread.updated";
3306
+ readonly type: "action.accepted" | "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "address.detached" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created";
1641
3307
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1642
3308
  readonly actionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1643
3309
  readonly actor: {
@@ -1660,7 +3326,7 @@ export declare const listEvents: ((input: {
1660
3326
  readonly before?: string | null | undefined;
1661
3327
  }) => import("effect/Stream").Stream<{
1662
3328
  readonly id: string & import("effect/Brand").Brand<"MailboxEventId">;
1663
- readonly type: "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "draft.created" | "draft.updated" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created" | "thread.updated";
3329
+ readonly type: "action.accepted" | "action.approval_requested" | "action.approval_resolved" | "action.executed" | "action.failed" | "action.policy_decided" | "action.proposed" | "address.attached" | "address.detached" | "email.received" | "email.released" | "email.sent" | "mailbox.created" | "thread.created";
1664
3330
  readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1665
3331
  readonly actionId: (string & import("effect/Brand").Brand<"MailboxActionId">) | null;
1666
3332
  readonly actor: {