samva 0.51.0 → 0.53.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 (89) hide show
  1. package/AGENTS.md +5 -2
  2. package/README.md +1 -0
  3. package/dist/client/sdk.gen.d.ts +82 -36
  4. package/dist/client/sdk.gen.js +192 -57
  5. package/dist/client/types.gen.d.ts +607 -291
  6. package/dist/effect/campaigns.d.ts +56 -56
  7. package/dist/effect/descriptors/integrations-catalog.d.ts +1 -1
  8. package/dist/effect/descriptors/integrations-catalog.js +1 -1
  9. package/dist/effect/descriptors/integrations.d.ts +1 -1
  10. package/dist/effect/descriptors/integrations.js +1 -1
  11. package/dist/effect/descriptors/logs.d.ts +21 -0
  12. package/dist/effect/descriptors/logs.js +23 -0
  13. package/dist/effect/descriptors/whats-app.d.ts +1 -1
  14. package/dist/effect/descriptors/whats-app.js +1 -1
  15. package/dist/effect/events.d.ts +16 -0
  16. package/dist/effect/generated/agents.js +4 -4
  17. package/dist/effect/generated/campaigns.d.ts +18 -6
  18. package/dist/effect/generated/campaigns.js +2 -6
  19. package/dist/effect/generated/email.js +3 -3
  20. package/dist/effect/generated/events.d.ts +48 -0
  21. package/dist/effect/generated/events.js +1 -1
  22. package/dist/effect/generated/index.d.ts +3 -1
  23. package/dist/effect/generated/integrations-catalog.d.ts +93 -49
  24. package/dist/effect/generated/integrations-catalog.js +17 -28
  25. package/dist/effect/generated/integrations.d.ts +20 -40
  26. package/dist/effect/generated/integrations.js +9 -13
  27. package/dist/effect/generated/journeys.d.ts +1113 -67
  28. package/dist/effect/generated/journeys.js +14 -8
  29. package/dist/effect/generated/logs.d.ts +2323 -0
  30. package/dist/effect/generated/logs.js +312 -0
  31. package/dist/effect/generated/mailboxes.d.ts +38 -24
  32. package/dist/effect/generated/mailboxes.js +22 -21
  33. package/dist/effect/generated/messages.d.ts +11 -882
  34. package/dist/effect/generated/messages.js +4 -243
  35. package/dist/effect/generated/newsletter-domains.d.ts +61 -13
  36. package/dist/effect/generated/newsletter-domains.js +5 -5
  37. package/dist/effect/generated/newsletter-issues.d.ts +166 -34
  38. package/dist/effect/generated/newsletter-issues.js +12 -12
  39. package/dist/effect/generated/newsletters.d.ts +76 -16
  40. package/dist/effect/generated/newsletters.js +6 -6
  41. package/dist/effect/generated/organizations.js +1 -1
  42. package/dist/effect/generated/scheduled-messages.d.ts +36 -0
  43. package/dist/effect/generated/scheduled-messages.js +1 -1
  44. package/dist/effect/generated/shared.d.ts +1706 -442
  45. package/dist/effect/generated/shared.js +370 -93
  46. package/dist/effect/generated/subscriptions.d.ts +4 -4
  47. package/dist/effect/generated/subscriptions.js +2 -6
  48. package/dist/effect/generated/template-registrations.d.ts +46 -10
  49. package/dist/effect/generated/template-registrations.js +4 -4
  50. package/dist/effect/generated/templates.js +2 -2
  51. package/dist/effect/generated/whats-app-flows.d.ts +173 -35
  52. package/dist/effect/generated/whats-app-flows.js +19 -17
  53. package/dist/effect/generated/whats-app-setup-links.d.ts +61 -13
  54. package/dist/effect/generated/whats-app-setup-links.js +5 -5
  55. package/dist/effect/generated/whats-app.d.ts +187 -65
  56. package/dist/effect/generated/whats-app.js +18 -24
  57. package/dist/effect/generated-metadata.d.ts +15 -3
  58. package/dist/effect/generated-metadata.js +375 -349
  59. package/dist/effect/index.d.ts +1 -0
  60. package/dist/effect/index.js +2 -1
  61. package/dist/effect/integrations-catalog.d.ts +92 -4
  62. package/dist/effect/integrations.d.ts +40 -8
  63. package/dist/effect/internal/client.js +25 -3
  64. package/dist/effect/internal/log-events.d.ts +19 -0
  65. package/dist/effect/internal/log-events.js +53 -0
  66. package/dist/effect/internal/mailbox-events.d.ts +6 -2
  67. package/dist/effect/internal/mailbox-events.js +4 -3
  68. package/dist/effect/journeys.d.ts +212 -146
  69. package/dist/effect/logs.d.ts +149 -0
  70. package/dist/effect/logs.js +18 -0
  71. package/dist/effect/mailboxes.d.ts +158 -150
  72. package/dist/effect/mailboxes.js +1 -1
  73. package/dist/effect/newsletter-domains.d.ts +2 -2
  74. package/dist/effect/scheduled-messages.d.ts +66 -0
  75. package/dist/effect/whatsapp-flows.d.ts +30 -0
  76. package/dist/effect/whatsapp-setup-links.d.ts +2 -2
  77. package/dist/effect/whatsapp.d.ts +73 -3
  78. package/dist/mailbox-events.d.ts +50 -3
  79. package/dist/mailbox-events.js +38 -19
  80. package/dist/package.js +1 -1
  81. package/dist/promises/client.d.ts +3 -1
  82. package/dist/promises/client.js +3 -1
  83. package/dist/promises/errors.gen.d.ts +2 -0
  84. package/dist/promises/errors.gen.js +137 -34
  85. package/dist/promises/types.gen.d.ts +1 -1
  86. package/dist/request-id.d.ts +3 -0
  87. package/dist/request-id.js +7 -0
  88. package/dist/service-map.d.ts +14 -3
  89. package/package.json +6 -2
@@ -0,0 +1,149 @@
1
+ export { events, streamCursor, type LogEvent, type LogEventStreamOptions, } from "./internal/log-events.js";
2
+ export declare const list: ((input?: {
3
+ readonly limit?: number | null | undefined;
4
+ readonly cursor?: string | undefined;
5
+ readonly after?: string | undefined;
6
+ readonly orderBy?: "recorded" | "timestamp" | undefined;
7
+ readonly order?: "asc" | "desc" | undefined;
8
+ readonly since?: Date | undefined;
9
+ readonly until?: Date | undefined;
10
+ readonly status?: string | undefined;
11
+ readonly event?: string | undefined;
12
+ readonly channel?: "email" | "sms" | "whatsapp" | undefined;
13
+ readonly direction?: "inbound" | "outbound" | undefined;
14
+ readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
15
+ readonly credential?: string | undefined;
16
+ readonly from?: string | undefined;
17
+ readonly messageId?: string | undefined;
18
+ readonly mailboxId?: string | undefined;
19
+ readonly requestId?: string | undefined;
20
+ } | undefined, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"logsList">) & {
21
+ readonly pages: (input?: {
22
+ readonly limit?: number | null | undefined;
23
+ readonly cursor?: string | undefined;
24
+ readonly after?: string | undefined;
25
+ readonly orderBy?: "recorded" | "timestamp" | undefined;
26
+ readonly order?: "asc" | "desc" | undefined;
27
+ readonly since?: Date | undefined;
28
+ readonly until?: Date | undefined;
29
+ readonly status?: string | undefined;
30
+ readonly event?: string | undefined;
31
+ readonly channel?: "email" | "sms" | "whatsapp" | undefined;
32
+ readonly direction?: "inbound" | "outbound" | undefined;
33
+ readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
34
+ readonly credential?: string | undefined;
35
+ readonly from?: string | undefined;
36
+ readonly messageId?: string | undefined;
37
+ readonly mailboxId?: string | undefined;
38
+ readonly requestId?: string | undefined;
39
+ } | undefined) => import("effect/Stream").Stream<{
40
+ readonly items: readonly {
41
+ readonly id: string;
42
+ readonly cursor: string;
43
+ readonly timestamp: string;
44
+ readonly event: "accepted" | "agent_escalation" | "agent_handoff" | "agent_processing_completed" | "agent_processing_started" | "archived" | "bounced" | "clicked" | "complained" | "cost_calculated" | "created" | "deleted" | "delivered" | "failed" | "forwarded" | "marked_spam" | "opened" | "processing" | "queued" | "read" | "received" | "rejected" | "replied" | "retry_attempted" | "retry_scheduled" | "sent" | "unsubscribed" | "waiting" | "whatsapp_deleted" | "whatsapp_read";
45
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
46
+ readonly channel: "email" | "sms" | "whatsapp" | null;
47
+ readonly direction: "inbound" | "outbound";
48
+ readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | null;
49
+ readonly from: {
50
+ readonly address: string;
51
+ readonly name: string | null;
52
+ } | null;
53
+ readonly recipient: string | null;
54
+ readonly subject: string | null;
55
+ readonly submission: {
56
+ readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled";
57
+ readonly transport: "http" | "smtp" | null;
58
+ readonly credential: {
59
+ readonly kind: "api_key";
60
+ readonly apiKeyId: (string & import("effect/Brand").Brand<"ApiKeyId">) | null;
61
+ readonly name: string | null;
62
+ } | {
63
+ readonly kind: "oauth";
64
+ readonly clientId: string | null;
65
+ readonly name: string | null;
66
+ } | {
67
+ readonly kind: "session";
68
+ } | null;
69
+ readonly user?: {
70
+ readonly id: string & import("effect/Brand").Brand<"UserId">;
71
+ readonly email: string;
72
+ readonly name: string;
73
+ } | null;
74
+ readonly client: {
75
+ readonly surface: "cli" | "mcp" | "typescript-effect" | "typescript-promise";
76
+ readonly version: string;
77
+ } | null;
78
+ } | null;
79
+ readonly requestId: string | null;
80
+ readonly reason: string | null;
81
+ readonly errorTag: string | null;
82
+ }[];
83
+ readonly nextCursor: string | null;
84
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
85
+ readonly items: (input?: {
86
+ readonly limit?: number | null | undefined;
87
+ readonly cursor?: string | undefined;
88
+ readonly after?: string | undefined;
89
+ readonly orderBy?: "recorded" | "timestamp" | undefined;
90
+ readonly order?: "asc" | "desc" | undefined;
91
+ readonly since?: Date | undefined;
92
+ readonly until?: Date | undefined;
93
+ readonly status?: string | undefined;
94
+ readonly event?: string | undefined;
95
+ readonly channel?: "email" | "sms" | "whatsapp" | undefined;
96
+ readonly direction?: "inbound" | "outbound" | undefined;
97
+ readonly origin?: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | undefined;
98
+ readonly credential?: string | undefined;
99
+ readonly from?: string | undefined;
100
+ readonly messageId?: string | undefined;
101
+ readonly mailboxId?: string | undefined;
102
+ readonly requestId?: string | undefined;
103
+ } | undefined) => import("effect/Stream").Stream<{
104
+ readonly id: string;
105
+ readonly cursor: string;
106
+ readonly timestamp: string;
107
+ readonly event: "accepted" | "agent_escalation" | "agent_handoff" | "agent_processing_completed" | "agent_processing_started" | "archived" | "bounced" | "clicked" | "complained" | "cost_calculated" | "created" | "deleted" | "delivered" | "failed" | "forwarded" | "marked_spam" | "opened" | "processing" | "queued" | "read" | "received" | "rejected" | "replied" | "retry_attempted" | "retry_scheduled" | "sent" | "unsubscribed" | "waiting" | "whatsapp_deleted" | "whatsapp_read";
108
+ readonly messageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
109
+ readonly channel: "email" | "sms" | "whatsapp" | null;
110
+ readonly direction: "inbound" | "outbound";
111
+ readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled" | null;
112
+ readonly from: {
113
+ readonly address: string;
114
+ readonly name: string | null;
115
+ } | null;
116
+ readonly recipient: string | null;
117
+ readonly subject: string | null;
118
+ readonly submission: {
119
+ readonly origin: "businessApp" | "campaign" | "direct" | "forwarding" | "journey" | "mailbox" | "scheduled";
120
+ readonly transport: "http" | "smtp" | null;
121
+ readonly credential: {
122
+ readonly kind: "api_key";
123
+ readonly apiKeyId: (string & import("effect/Brand").Brand<"ApiKeyId">) | null;
124
+ readonly name: string | null;
125
+ } | {
126
+ readonly kind: "oauth";
127
+ readonly clientId: string | null;
128
+ readonly name: string | null;
129
+ } | {
130
+ readonly kind: "session";
131
+ } | null;
132
+ readonly user?: {
133
+ readonly id: string & import("effect/Brand").Brand<"UserId">;
134
+ readonly email: string;
135
+ readonly name: string;
136
+ } | null;
137
+ readonly client: {
138
+ readonly surface: "cli" | "mcp" | "typescript-effect" | "typescript-promise";
139
+ readonly version: string;
140
+ } | null;
141
+ } | null;
142
+ readonly requestId: string | null;
143
+ readonly reason: string | null;
144
+ readonly errorTag: string | null;
145
+ }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
146
+ };
147
+ export declare const get: (input: {
148
+ readonly id: string;
149
+ }, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"logsGet">;
@@ -0,0 +1,18 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { forGroup } from "./internal/operation.js";
3
+ import { logsOperations } from "./descriptors/logs.js";
4
+ import { LogsGroup } from "./generated/logs.js";
5
+ import { events, streamCursor } from "./internal/log-events.js";
6
+ // src/effect/logs.ts
7
+ var logs_exports = /* @__PURE__ */ __exportAll({
8
+ events: () => events,
9
+ get: () => get,
10
+ list: () => list,
11
+ streamCursor: () => streamCursor
12
+ });
13
+ const make = /* @__PURE__ */ forGroup(LogsGroup, logsOperations);
14
+ const list = /* @__PURE__ */ make("logsList");
15
+ const get = /* @__PURE__ */ make("logsGet");
16
+ export { events, get, list, logs_exports, streamCursor };
17
+
18
+ //# sourceMappingURL=logs.js.map
@@ -663,6 +663,7 @@ export declare const listOrganizationThreads: ((input?: {
663
663
  readonly unread?: boolean | null | undefined;
664
664
  readonly starred?: boolean | null | undefined;
665
665
  readonly snoozed?: boolean | null | undefined;
666
+ readonly order?: "wake" | undefined;
666
667
  readonly mailboxId?: string | readonly string[] | undefined;
667
668
  readonly kind?: "personal" | "shared" | undefined;
668
669
  readonly conversation?: string | undefined;
@@ -682,6 +683,7 @@ export declare const listOrganizationThreads: ((input?: {
682
683
  readonly unread?: boolean | null | undefined;
683
684
  readonly starred?: boolean | null | undefined;
684
685
  readonly snoozed?: boolean | null | undefined;
686
+ readonly order?: "wake" | undefined;
685
687
  readonly mailboxId?: string | readonly string[] | undefined;
686
688
  readonly kind?: "personal" | "shared" | undefined;
687
689
  readonly conversation?: string | undefined;
@@ -743,6 +745,7 @@ export declare const listOrganizationThreads: ((input?: {
743
745
  readonly unread?: boolean | null | undefined;
744
746
  readonly starred?: boolean | null | undefined;
745
747
  readonly snoozed?: boolean | null | undefined;
748
+ readonly order?: "wake" | undefined;
746
749
  readonly mailboxId?: string | readonly string[] | undefined;
747
750
  readonly kind?: "personal" | "shared" | undefined;
748
751
  readonly conversation?: string | undefined;
@@ -803,6 +806,7 @@ export declare const listThreads: ((input: {
803
806
  readonly unread?: boolean | null | undefined;
804
807
  readonly starred?: boolean | null | undefined;
805
808
  readonly snoozed?: boolean | null | undefined;
809
+ readonly order?: "wake" | undefined;
806
810
  }, options?: import("./internal/operation.js").OperationOptions) => import("./internal/client.js").OperationResult<"mailboxesListThreads">) & {
807
811
  readonly pages: (input: {
808
812
  readonly id: string;
@@ -820,6 +824,7 @@ export declare const listThreads: ((input: {
820
824
  readonly unread?: boolean | null | undefined;
821
825
  readonly starred?: boolean | null | undefined;
822
826
  readonly snoozed?: boolean | null | undefined;
827
+ readonly order?: "wake" | undefined;
823
828
  }) => import("effect/Stream").Stream<{
824
829
  readonly items: readonly {
825
830
  readonly id: string & import("effect/Brand").Brand<"MailboxThreadId">;
@@ -874,6 +879,7 @@ export declare const listThreads: ((input: {
874
879
  readonly unread?: boolean | null | undefined;
875
880
  readonly starred?: boolean | null | undefined;
876
881
  readonly snoozed?: boolean | null | undefined;
882
+ readonly order?: "wake" | undefined;
877
883
  }) => import("effect/Stream").Stream<{
878
884
  readonly id: string & import("effect/Brand").Brand<"MailboxThreadId">;
879
885
  readonly channel: "email" | "sms" | "whatsapp";
@@ -1121,6 +1127,7 @@ export declare const getThreadContent: ((input: {
1121
1127
  } | null;
1122
1128
  readonly summary: string | null;
1123
1129
  readonly contextMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1130
+ readonly flowSubmissionHandledBy?: "app";
1124
1131
  })[];
1125
1132
  readonly nextCursor: string | null;
1126
1133
  }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
@@ -1225,6 +1232,7 @@ export declare const getThreadContent: ((input: {
1225
1232
  } | null;
1226
1233
  readonly summary: string | null;
1227
1234
  readonly contextMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1235
+ readonly flowSubmissionHandledBy?: "app";
1228
1236
  }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
1229
1237
  };
1230
1238
  export declare const listThreadNotes: ((input: {
@@ -1749,6 +1757,81 @@ export declare const listActions: ((input: {
1749
1757
  readonly before?: string | undefined;
1750
1758
  }) => import("effect/Stream").Stream<{
1751
1759
  readonly items: readonly ({
1760
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1761
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1762
+ readonly proposedBy: {
1763
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
1764
+ readonly id: string;
1765
+ readonly displayName?: string | null;
1766
+ };
1767
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1768
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1769
+ readonly decision: {
1770
+ readonly id: string & import("effect/Brand").Brand<"PolicyDecisionId">;
1771
+ readonly reviewRound: number;
1772
+ readonly requirement: "model" | "never" | "person" | "run";
1773
+ readonly decider: "agent" | "model" | "person" | "rule";
1774
+ readonly outcome: "allow" | "hold" | "refuse";
1775
+ readonly reason: string;
1776
+ readonly scopes: readonly {
1777
+ readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
1778
+ readonly id: string;
1779
+ }[];
1780
+ readonly rule?: {
1781
+ readonly scope: {
1782
+ readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
1783
+ readonly id: string;
1784
+ };
1785
+ readonly index: number;
1786
+ } | null;
1787
+ readonly guard?: string | null;
1788
+ readonly guardReason?: string | null;
1789
+ readonly resolution?: {
1790
+ readonly by: string & import("effect/Brand").Brand<"UserId">;
1791
+ readonly at: string;
1792
+ readonly as: "alwaysAllowed" | "approved" | "denied" | "edited";
1793
+ readonly diff?: {
1794
+ readonly text?: {
1795
+ readonly before: string | null;
1796
+ readonly after: string | null;
1797
+ } | null;
1798
+ readonly html?: {
1799
+ readonly before: string | null;
1800
+ readonly after: string | null;
1801
+ } | null;
1802
+ } | null;
1803
+ } | null;
1804
+ } | null;
1805
+ readonly resolution: {
1806
+ readonly outcome: "approved" | "cancelled" | "denied";
1807
+ readonly actor: {
1808
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
1809
+ readonly id: string;
1810
+ readonly displayName?: string | null;
1811
+ readonly source: "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1812
+ };
1813
+ readonly resolvedAt: string;
1814
+ readonly reason: string | null;
1815
+ } | null;
1816
+ readonly alwaysAllow: {
1817
+ readonly by: "admin" | "approver" | "owner";
1818
+ readonly allowed: boolean;
1819
+ } | null;
1820
+ readonly createdAt: string;
1821
+ readonly updatedAt: string;
1822
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "handoff" | "toolCall" | "updateDraft";
1823
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
1824
+ readonly tool: {
1825
+ readonly name: string;
1826
+ readonly argumentsHash: string;
1827
+ readonly arguments: {
1828
+ readonly [x: string]: import("./generated/index.js").JsonValue;
1829
+ };
1830
+ } | null;
1831
+ readonly handoff: {
1832
+ readonly reason: string;
1833
+ } | null;
1834
+ } | {
1752
1835
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1753
1836
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1754
1837
  readonly proposedBy: {
@@ -1958,81 +2041,6 @@ export declare const listActions: ((input: {
1958
2041
  readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
1959
2042
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
1960
2043
  } | null;
1961
- } | {
1962
- readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
1963
- readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
1964
- readonly proposedBy: {
1965
- readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
1966
- readonly id: string;
1967
- readonly displayName?: string | null;
1968
- };
1969
- readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
1970
- readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
1971
- readonly decision: {
1972
- readonly id: string & import("effect/Brand").Brand<"PolicyDecisionId">;
1973
- readonly reviewRound: number;
1974
- readonly requirement: "model" | "never" | "person" | "run";
1975
- readonly decider: "agent" | "model" | "person" | "rule";
1976
- readonly outcome: "allow" | "hold" | "refuse";
1977
- readonly reason: string;
1978
- readonly scopes: readonly {
1979
- readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
1980
- readonly id: string;
1981
- }[];
1982
- readonly rule?: {
1983
- readonly scope: {
1984
- readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
1985
- readonly id: string;
1986
- };
1987
- readonly index: number;
1988
- } | null;
1989
- readonly guard?: string | null;
1990
- readonly guardReason?: string | null;
1991
- readonly resolution?: {
1992
- readonly by: string & import("effect/Brand").Brand<"UserId">;
1993
- readonly at: string;
1994
- readonly as: "alwaysAllowed" | "approved" | "denied" | "edited";
1995
- readonly diff?: {
1996
- readonly text?: {
1997
- readonly before: string | null;
1998
- readonly after: string | null;
1999
- } | null;
2000
- readonly html?: {
2001
- readonly before: string | null;
2002
- readonly after: string | null;
2003
- } | null;
2004
- } | null;
2005
- } | null;
2006
- } | null;
2007
- readonly resolution: {
2008
- readonly outcome: "approved" | "cancelled" | "denied";
2009
- readonly actor: {
2010
- readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2011
- readonly id: string;
2012
- readonly displayName?: string | null;
2013
- readonly source: "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2014
- };
2015
- readonly resolvedAt: string;
2016
- readonly reason: string | null;
2017
- } | null;
2018
- readonly alwaysAllow: {
2019
- readonly by: "admin" | "approver" | "owner";
2020
- readonly allowed: boolean;
2021
- } | null;
2022
- readonly createdAt: string;
2023
- readonly updatedAt: string;
2024
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "handoff" | "toolCall" | "updateDraft";
2025
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2026
- readonly tool: {
2027
- readonly name: string;
2028
- readonly argumentsHash: string;
2029
- readonly arguments: {
2030
- readonly [x: string]: import("./generated/index.js").JsonValue;
2031
- };
2032
- } | null;
2033
- readonly handoff: {
2034
- readonly reason: string;
2035
- } | null;
2036
2044
  })[];
2037
2045
  readonly nextCursor: string | null;
2038
2046
  }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
@@ -2045,6 +2053,81 @@ export declare const listActions: ((input: {
2045
2053
  readonly after?: string | undefined;
2046
2054
  readonly before?: string | undefined;
2047
2055
  }) => import("effect/Stream").Stream<{
2056
+ readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2057
+ readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2058
+ readonly proposedBy: {
2059
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2060
+ readonly id: string;
2061
+ readonly displayName?: string | null;
2062
+ };
2063
+ readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2064
+ readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2065
+ readonly decision: {
2066
+ readonly id: string & import("effect/Brand").Brand<"PolicyDecisionId">;
2067
+ readonly reviewRound: number;
2068
+ readonly requirement: "model" | "never" | "person" | "run";
2069
+ readonly decider: "agent" | "model" | "person" | "rule";
2070
+ readonly outcome: "allow" | "hold" | "refuse";
2071
+ readonly reason: string;
2072
+ readonly scopes: readonly {
2073
+ readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
2074
+ readonly id: string;
2075
+ }[];
2076
+ readonly rule?: {
2077
+ readonly scope: {
2078
+ readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
2079
+ readonly id: string;
2080
+ };
2081
+ readonly index: number;
2082
+ } | null;
2083
+ readonly guard?: string | null;
2084
+ readonly guardReason?: string | null;
2085
+ readonly resolution?: {
2086
+ readonly by: string & import("effect/Brand").Brand<"UserId">;
2087
+ readonly at: string;
2088
+ readonly as: "alwaysAllowed" | "approved" | "denied" | "edited";
2089
+ readonly diff?: {
2090
+ readonly text?: {
2091
+ readonly before: string | null;
2092
+ readonly after: string | null;
2093
+ } | null;
2094
+ readonly html?: {
2095
+ readonly before: string | null;
2096
+ readonly after: string | null;
2097
+ } | null;
2098
+ } | null;
2099
+ } | null;
2100
+ } | null;
2101
+ readonly resolution: {
2102
+ readonly outcome: "approved" | "cancelled" | "denied";
2103
+ readonly actor: {
2104
+ readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2105
+ readonly id: string;
2106
+ readonly displayName?: string | null;
2107
+ readonly source: "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2108
+ };
2109
+ readonly resolvedAt: string;
2110
+ readonly reason: string | null;
2111
+ } | null;
2112
+ readonly alwaysAllow: {
2113
+ readonly by: "admin" | "approver" | "owner";
2114
+ readonly allowed: boolean;
2115
+ } | null;
2116
+ readonly createdAt: string;
2117
+ readonly updatedAt: string;
2118
+ readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "handoff" | "toolCall" | "updateDraft";
2119
+ readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2120
+ readonly tool: {
2121
+ readonly name: string;
2122
+ readonly argumentsHash: string;
2123
+ readonly arguments: {
2124
+ readonly [x: string]: import("./generated/index.js").JsonValue;
2125
+ };
2126
+ } | null;
2127
+ readonly handoff: {
2128
+ readonly reason: string;
2129
+ } | null;
2130
+ } | {
2048
2131
  readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2049
2132
  readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2050
2133
  readonly proposedBy: {
@@ -2254,81 +2337,6 @@ export declare const listActions: ((input: {
2254
2337
  readonly conversationId: (string & import("effect/Brand").Brand<"ConversationId">) | null;
2255
2338
  readonly inReplyToMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
2256
2339
  } | null;
2257
- } | {
2258
- readonly id: string & import("effect/Brand").Brand<"MailboxActionId">;
2259
- readonly source: "aiSdkTool" | "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2260
- readonly proposedBy: {
2261
- readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2262
- readonly id: string;
2263
- readonly displayName?: string | null;
2264
- };
2265
- readonly threadId: (string & import("effect/Brand").Brand<"MailboxThreadId">) | null;
2266
- readonly draftId: (string & import("effect/Brand").Brand<"MailboxDraftId">) | null;
2267
- readonly decision: {
2268
- readonly id: string & import("effect/Brand").Brand<"PolicyDecisionId">;
2269
- readonly reviewRound: number;
2270
- readonly requirement: "model" | "never" | "person" | "run";
2271
- readonly decider: "agent" | "model" | "person" | "rule";
2272
- readonly outcome: "allow" | "hold" | "refuse";
2273
- readonly reason: string;
2274
- readonly scopes: readonly {
2275
- readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
2276
- readonly id: string;
2277
- }[];
2278
- readonly rule?: {
2279
- readonly scope: {
2280
- readonly kind: "agent" | "apiKey" | "integration" | "mailbox" | "organization";
2281
- readonly id: string;
2282
- };
2283
- readonly index: number;
2284
- } | null;
2285
- readonly guard?: string | null;
2286
- readonly guardReason?: string | null;
2287
- readonly resolution?: {
2288
- readonly by: string & import("effect/Brand").Brand<"UserId">;
2289
- readonly at: string;
2290
- readonly as: "alwaysAllowed" | "approved" | "denied" | "edited";
2291
- readonly diff?: {
2292
- readonly text?: {
2293
- readonly before: string | null;
2294
- readonly after: string | null;
2295
- } | null;
2296
- readonly html?: {
2297
- readonly before: string | null;
2298
- readonly after: string | null;
2299
- } | null;
2300
- } | null;
2301
- } | null;
2302
- } | null;
2303
- readonly resolution: {
2304
- readonly outcome: "approved" | "cancelled" | "denied";
2305
- readonly actor: {
2306
- readonly kind: "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system" | "user";
2307
- readonly id: string;
2308
- readonly displayName?: string | null;
2309
- readonly source: "extension" | "externalAgent" | "externalApi" | "humanUi" | "samvaManagedAgent" | "system";
2310
- };
2311
- readonly resolvedAt: string;
2312
- readonly reason: string | null;
2313
- } | null;
2314
- readonly alwaysAllow: {
2315
- readonly by: "admin" | "approver" | "owner";
2316
- readonly allowed: boolean;
2317
- } | null;
2318
- readonly createdAt: string;
2319
- readonly updatedAt: string;
2320
- readonly type: "assignThread" | "call" | "changeThreadState" | "createNote" | "extensionRequest" | "handoff" | "toolCall" | "updateDraft";
2321
- readonly state: "allowed" | "approvalDenied" | "approvalRequired" | "approved" | "executed" | "executing" | "failed" | "policyDenied" | "proposed";
2322
- readonly tool: {
2323
- readonly name: string;
2324
- readonly argumentsHash: string;
2325
- readonly arguments: {
2326
- readonly [x: string]: import("./generated/index.js").JsonValue;
2327
- };
2328
- } | null;
2329
- readonly handoff: {
2330
- readonly reason: string;
2331
- } | null;
2332
2340
  }, import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
2333
2341
  };
2334
2342
  export declare const getAction: (input: {
@@ -1,9 +1,9 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { MailboxEventStreamError } from "../mailbox-events.js";
3
3
  import { forGroup } from "./internal/operation.js";
4
+ import { events } from "./internal/mailbox-events.js";
4
5
  import { mailboxesOperations } from "./descriptors/mailboxes.js";
5
6
  import { MailboxesGroup } from "./generated/mailboxes.js";
6
- import { events } from "./internal/mailbox-events.js";
7
7
  // src/effect/mailboxes.ts
8
8
  var mailboxes_exports = /* @__PURE__ */ __exportAll({
9
9
  MailboxEventStreamError: () => MailboxEventStreamError,
@@ -30,7 +30,7 @@ export declare const list: ((input: {
30
30
  readonly verificationErrors: readonly string[];
31
31
  }[];
32
32
  readonly nextCursor: string | null;
33
- }, import("./errors.js").ConflictError | import("./errors.js").FlagDisabledError | import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
33
+ }, import("./errors.js").ConflictError | import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
34
34
  readonly items: (input: {
35
35
  readonly id: string;
36
36
  readonly limit?: number | null | undefined;
@@ -55,7 +55,7 @@ export declare const list: ((input: {
55
55
  readonly value: string;
56
56
  }[];
57
57
  readonly verificationErrors: readonly string[];
58
- }, import("./errors.js").ConflictError | import("./errors.js").FlagDisabledError | import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
58
+ }, import("./errors.js").ConflictError | import("./errors.js").ForbiddenError | import("./errors.js").GatewayTimeoutError | import("effect/http/HttpClientError").HttpClientError | import("./errors.js").InternalError | import("./errors.js").MalformedRequestError | import("./errors.js").ResourceNotFoundError | import("./errors.js").SamvaTimeoutError | import("effect/Schema").SchemaError | import("./errors.js").UnauthorizedError | import("./errors.js").ValidationError, import("./client.js").Service>;
59
59
  };
60
60
  export declare const add: (input: {
61
61
  readonly id: string;