agentmail-toolkit 0.1.27 → 0.1.29

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.
@@ -0,0 +1,71 @@
1
+ import {
2
+ tools
3
+ } from "./chunk-IDOYVQL3.mjs";
4
+
5
+ // src/wrapper.ts
6
+ import { AgentMailClient } from "agentmail";
7
+ var Wrapper = class {
8
+ constructor(client = new AgentMailClient()) {
9
+ this.client = client;
10
+ }
11
+ async call(method, args) {
12
+ const parts = method.split(".");
13
+ const methodKey = parts.pop();
14
+ if (!methodKey) throw new Error("Method name empty");
15
+ let parent = this.client;
16
+ for (const part of parts) parent = parent[part];
17
+ const { inbox_id, thread_id, message_id, draft_id, attachment_id, ...options } = args;
18
+ const methodArgs = [inbox_id, thread_id, message_id, draft_id, attachment_id, options].filter(Boolean);
19
+ return await parent[methodKey].call(parent, ...methodArgs);
20
+ }
21
+ async safeCall(method, args) {
22
+ try {
23
+ return { isError: false, result: await this.call(method, args) };
24
+ } catch (error) {
25
+ if (error instanceof Error) return { isError: true, result: error.message };
26
+ else return { isError: true, result: "Unknown error" };
27
+ }
28
+ }
29
+ };
30
+
31
+ // src/toolkit.ts
32
+ var BaseToolkit = class extends Wrapper {
33
+ tools = {};
34
+ constructor(client) {
35
+ super(client);
36
+ this.tools = tools.reduce(
37
+ (acc, tool) => {
38
+ acc[tool.name] = this.buildTool(tool);
39
+ return acc;
40
+ },
41
+ {}
42
+ );
43
+ }
44
+ };
45
+ var ListToolkit = class extends BaseToolkit {
46
+ getTools(names) {
47
+ if (!names) return Object.values(this.tools);
48
+ return names.reduce((acc, name) => {
49
+ if (name in this.tools) acc.push(this.tools[name]);
50
+ return acc;
51
+ }, []);
52
+ }
53
+ };
54
+ var MapToolkit = class extends BaseToolkit {
55
+ getTools(names) {
56
+ if (!names) return this.tools;
57
+ return names.reduce(
58
+ (acc, name) => {
59
+ if (name in this.tools) acc[name] = this.tools[name];
60
+ return acc;
61
+ },
62
+ {}
63
+ );
64
+ }
65
+ };
66
+
67
+ export {
68
+ ListToolkit,
69
+ MapToolkit
70
+ };
71
+ //# sourceMappingURL=chunk-ODPS3RJ3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wrapper.ts","../src/toolkit.ts"],"sourcesContent":["import { AgentMailClient } from 'agentmail'\n\nexport class Wrapper {\n constructor(private readonly client = new AgentMailClient()) {}\n\n public async call(method: string, args: any) {\n const parts = method.split('.')\n const methodKey = parts.pop()\n\n if (!methodKey) throw new Error('Method name empty')\n\n let parent: any = this.client\n for (const part of parts) parent = parent[part]\n\n const { inbox_id, thread_id, message_id, draft_id, attachment_id, ...options } = args\n const methodArgs = [inbox_id, thread_id, message_id, draft_id, attachment_id, options].filter(Boolean)\n\n return await parent[methodKey].call(parent, ...methodArgs)\n }\n\n public async safeCall(method: string, args: any) {\n try {\n return { isError: false, result: await this.call(method, args) }\n } catch (error) {\n if (error instanceof Error) return { isError: true, result: error.message }\n else return { isError: true, result: 'Unknown error' }\n }\n }\n}\n","import { AgentMailClient } from 'agentmail'\n\nimport { Wrapper } from './wrapper'\nimport { type Tool, tools } from './tools'\n\nexport abstract class BaseToolkit<T> extends Wrapper {\n protected readonly tools: Record<string, T> = {}\n\n constructor(client?: AgentMailClient) {\n super(client)\n\n this.tools = tools.reduce(\n (acc, tool) => {\n acc[tool.name] = this.buildTool(tool)\n return acc\n },\n {} as Record<string, T>\n )\n }\n\n protected abstract buildTool(tool: Tool): T\n}\n\nexport abstract class ListToolkit<T> extends BaseToolkit<T> {\n public getTools(names?: string[]) {\n if (!names) return Object.values(this.tools)\n\n return names.reduce((acc, name) => {\n if (name in this.tools) acc.push(this.tools[name])\n return acc\n }, [] as T[])\n }\n}\n\nexport abstract class MapToolkit<T> extends BaseToolkit<T> {\n public getTools(names?: string[]) {\n if (!names) return this.tools\n\n return names.reduce(\n (acc, name) => {\n if (name in this.tools) acc[name] = this.tools[name]\n return acc\n },\n {} as Record<string, T>\n )\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAEzB,IAAM,UAAN,MAAc;AAAA,EACjB,YAA6B,SAAS,IAAI,gBAAgB,GAAG;AAAhC;AAAA,EAAiC;AAAA,EAE9D,MAAa,KAAK,QAAgB,MAAW;AACzC,UAAM,QAAQ,OAAO,MAAM,GAAG;AAC9B,UAAM,YAAY,MAAM,IAAI;AAE5B,QAAI,CAAC,UAAW,OAAM,IAAI,MAAM,mBAAmB;AAEnD,QAAI,SAAc,KAAK;AACvB,eAAW,QAAQ,MAAO,UAAS,OAAO,IAAI;AAE9C,UAAM,EAAE,UAAU,WAAW,YAAY,UAAU,eAAe,GAAG,QAAQ,IAAI;AACjF,UAAM,aAAa,CAAC,UAAU,WAAW,YAAY,UAAU,eAAe,OAAO,EAAE,OAAO,OAAO;AAErG,WAAO,MAAM,OAAO,SAAS,EAAE,KAAK,QAAQ,GAAG,UAAU;AAAA,EAC7D;AAAA,EAEA,MAAa,SAAS,QAAgB,MAAW;AAC7C,QAAI;AACA,aAAO,EAAE,SAAS,OAAO,QAAQ,MAAM,KAAK,KAAK,QAAQ,IAAI,EAAE;AAAA,IACnE,SAAS,OAAO;AACZ,UAAI,iBAAiB,MAAO,QAAO,EAAE,SAAS,MAAM,QAAQ,MAAM,QAAQ;AAAA,UACrE,QAAO,EAAE,SAAS,MAAM,QAAQ,gBAAgB;AAAA,IACzD;AAAA,EACJ;AACJ;;;ACvBO,IAAe,cAAf,cAAsC,QAAQ;AAAA,EAC9B,QAA2B,CAAC;AAAA,EAE/C,YAAY,QAA0B;AAClC,UAAM,MAAM;AAEZ,SAAK,QAAQ,MAAM;AAAA,MACf,CAAC,KAAK,SAAS;AACX,YAAI,KAAK,IAAI,IAAI,KAAK,UAAU,IAAI;AACpC,eAAO;AAAA,MACX;AAAA,MACA,CAAC;AAAA,IACL;AAAA,EACJ;AAGJ;AAEO,IAAe,cAAf,cAAsC,YAAe;AAAA,EACjD,SAAS,OAAkB;AAC9B,QAAI,CAAC,MAAO,QAAO,OAAO,OAAO,KAAK,KAAK;AAE3C,WAAO,MAAM,OAAO,CAAC,KAAK,SAAS;AAC/B,UAAI,QAAQ,KAAK,MAAO,KAAI,KAAK,KAAK,MAAM,IAAI,CAAC;AACjD,aAAO;AAAA,IACX,GAAG,CAAC,CAAQ;AAAA,EAChB;AACJ;AAEO,IAAe,aAAf,cAAqC,YAAe;AAAA,EAChD,SAAS,OAAkB;AAC9B,QAAI,CAAC,MAAO,QAAO,KAAK;AAExB,WAAO,MAAM;AAAA,MACT,CAAC,KAAK,SAAS;AACX,YAAI,QAAQ,KAAK,MAAO,KAAI,IAAI,IAAI,KAAK,MAAM,IAAI;AACnD,eAAO;AAAA,MACX;AAAA,MACA,CAAC;AAAA,IACL;AAAA,EACJ;AACJ;","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,249 +1,20 @@
1
1
  import { z } from 'zod';
2
- export { T as Tool, t as tools } from './tools-Dzp_FZN_.mjs';
2
+ import { L as ListToolkit, T as Tool$1 } from './toolkit-B8QHBdtC.mjs';
3
+ import 'agentmail';
3
4
 
4
- declare const ListItemsParams: z.ZodObject<{
5
- limit: z.ZodOptional<z.ZodNumber>;
6
- page_token: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- limit?: number | undefined;
9
- page_token?: string | undefined;
10
- }, {
11
- limit?: number | undefined;
12
- page_token?: string | undefined;
13
- }>;
14
- declare const ListInboxItemsParams: z.ZodObject<{
15
- limit: z.ZodOptional<z.ZodNumber>;
16
- page_token: z.ZodOptional<z.ZodString>;
17
- } & {
18
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
- ascending: z.ZodOptional<z.ZodBoolean>;
20
- }, "strip", z.ZodTypeAny, {
21
- limit?: number | undefined;
22
- page_token?: string | undefined;
23
- labels?: string[] | undefined;
24
- ascending?: boolean | undefined;
25
- }, {
26
- limit?: number | undefined;
27
- page_token?: string | undefined;
28
- labels?: string[] | undefined;
29
- ascending?: boolean | undefined;
30
- }>;
31
- declare const GetInboxParams: z.ZodObject<{
32
- inbox_id: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- inbox_id: string;
35
- }, {
36
- inbox_id: string;
37
- }>;
38
- declare const CreateInboxParams: z.ZodObject<{
39
- username: z.ZodOptional<z.ZodString>;
40
- domain: z.ZodOptional<z.ZodString>;
41
- display_name: z.ZodOptional<z.ZodString>;
42
- }, "strip", z.ZodTypeAny, {
43
- username?: string | undefined;
44
- domain?: string | undefined;
45
- display_name?: string | undefined;
46
- }, {
47
- username?: string | undefined;
48
- domain?: string | undefined;
49
- display_name?: string | undefined;
50
- }>;
51
- declare const ListThreadsParams: z.ZodObject<{
52
- limit: z.ZodOptional<z.ZodNumber>;
53
- page_token: z.ZodOptional<z.ZodString>;
54
- } & {
55
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
- ascending: z.ZodOptional<z.ZodBoolean>;
57
- } & {
58
- inbox_id: z.ZodString;
59
- }, "strip", z.ZodTypeAny, {
60
- inbox_id: string;
61
- limit?: number | undefined;
62
- page_token?: string | undefined;
63
- labels?: string[] | undefined;
64
- ascending?: boolean | undefined;
65
- }, {
66
- inbox_id: string;
67
- limit?: number | undefined;
68
- page_token?: string | undefined;
69
- labels?: string[] | undefined;
70
- ascending?: boolean | undefined;
71
- }>;
72
- declare const GetThreadParams: z.ZodObject<{
73
- thread_id: z.ZodString;
74
- }, "strip", z.ZodTypeAny, {
75
- thread_id: string;
76
- }, {
77
- thread_id: string;
78
- }>;
79
- declare const ListMessagesParams: z.ZodObject<{
80
- limit: z.ZodOptional<z.ZodNumber>;
81
- page_token: z.ZodOptional<z.ZodString>;
82
- } & {
83
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
- ascending: z.ZodOptional<z.ZodBoolean>;
85
- } & {
86
- inbox_id: z.ZodString;
87
- }, "strip", z.ZodTypeAny, {
88
- inbox_id: string;
89
- limit?: number | undefined;
90
- page_token?: string | undefined;
91
- labels?: string[] | undefined;
92
- ascending?: boolean | undefined;
93
- }, {
94
- inbox_id: string;
95
- limit?: number | undefined;
96
- page_token?: string | undefined;
97
- labels?: string[] | undefined;
98
- ascending?: boolean | undefined;
99
- }>;
100
- declare const GetMessageParams: z.ZodObject<{
101
- inbox_id: z.ZodString;
102
- message_id: z.ZodString;
103
- }, "strip", z.ZodTypeAny, {
104
- inbox_id: string;
105
- message_id: string;
106
- }, {
107
- inbox_id: string;
108
- message_id: string;
109
- }>;
110
- declare const SendMessageParams: z.ZodObject<{
111
- inbox_id: z.ZodString;
112
- to: z.ZodArray<z.ZodString, "many">;
113
- cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
114
- bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
115
- subject: z.ZodOptional<z.ZodString>;
116
- text: z.ZodOptional<z.ZodString>;
117
- html: z.ZodOptional<z.ZodString>;
118
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
119
- }, "strip", z.ZodTypeAny, {
120
- inbox_id: string;
121
- to: string[];
122
- labels?: string[] | undefined;
123
- cc?: string[] | undefined;
124
- bcc?: string[] | undefined;
125
- subject?: string | undefined;
126
- text?: string | undefined;
127
- html?: string | undefined;
128
- }, {
129
- inbox_id: string;
130
- to: string[];
131
- labels?: string[] | undefined;
132
- cc?: string[] | undefined;
133
- bcc?: string[] | undefined;
134
- subject?: string | undefined;
135
- text?: string | undefined;
136
- html?: string | undefined;
137
- }>;
138
- declare const ReplyToMessageParams: z.ZodObject<{
139
- inbox_id: z.ZodString;
140
- message_id: z.ZodString;
141
- text: z.ZodOptional<z.ZodString>;
142
- html: z.ZodOptional<z.ZodString>;
143
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
- }, "strip", z.ZodTypeAny, {
145
- inbox_id: string;
146
- message_id: string;
147
- labels?: string[] | undefined;
148
- text?: string | undefined;
149
- html?: string | undefined;
150
- }, {
151
- inbox_id: string;
152
- message_id: string;
153
- labels?: string[] | undefined;
154
- text?: string | undefined;
155
- html?: string | undefined;
156
- }>;
157
- declare const UpdateMessageParams: z.ZodObject<{
158
- inbox_id: z.ZodString;
159
- message_id: z.ZodString;
160
- add_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
161
- remove_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
- }, "strip", z.ZodTypeAny, {
163
- inbox_id: string;
164
- message_id: string;
165
- add_labels?: string[] | undefined;
166
- remove_labels?: string[] | undefined;
167
- }, {
168
- inbox_id: string;
169
- message_id: string;
170
- add_labels?: string[] | undefined;
171
- remove_labels?: string[] | undefined;
172
- }>;
173
- declare const ListDraftsParams: z.ZodObject<{
174
- limit: z.ZodOptional<z.ZodNumber>;
175
- page_token: z.ZodOptional<z.ZodString>;
176
- } & {
177
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
- ascending: z.ZodOptional<z.ZodBoolean>;
179
- } & {
180
- inbox_id: z.ZodString;
181
- }, "strip", z.ZodTypeAny, {
182
- inbox_id: string;
183
- limit?: number | undefined;
184
- page_token?: string | undefined;
185
- labels?: string[] | undefined;
186
- ascending?: boolean | undefined;
187
- }, {
188
- inbox_id: string;
189
- limit?: number | undefined;
190
- page_token?: string | undefined;
191
- labels?: string[] | undefined;
192
- ascending?: boolean | undefined;
193
- }>;
194
- declare const GetDraftParams: z.ZodObject<{
195
- inbox_id: z.ZodString;
196
- draft_id: z.ZodString;
197
- }, "strip", z.ZodTypeAny, {
198
- inbox_id: string;
199
- draft_id: string;
200
- }, {
201
- inbox_id: string;
202
- draft_id: string;
203
- }>;
204
- declare const CreateDraftParams: z.ZodObject<{
205
- inbox_id: z.ZodString;
206
- to: z.ZodArray<z.ZodString, "many">;
207
- cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
208
- bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
209
- subject: z.ZodOptional<z.ZodString>;
210
- text: z.ZodOptional<z.ZodString>;
211
- html: z.ZodOptional<z.ZodString>;
212
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
213
- }, "strip", z.ZodTypeAny, {
214
- inbox_id: string;
215
- to: string[];
216
- labels?: string[] | undefined;
217
- cc?: string[] | undefined;
218
- bcc?: string[] | undefined;
219
- subject?: string | undefined;
220
- text?: string | undefined;
221
- html?: string | undefined;
222
- }, {
223
- inbox_id: string;
224
- to: string[];
225
- labels?: string[] | undefined;
226
- cc?: string[] | undefined;
227
- bcc?: string[] | undefined;
228
- subject?: string | undefined;
229
- text?: string | undefined;
230
- html?: string | undefined;
231
- }>;
232
- declare const SendDraftParams: z.ZodObject<{
233
- inbox_id: z.ZodString;
234
- draft_id: z.ZodString;
235
- add_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
- remove_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
237
- }, "strip", z.ZodTypeAny, {
238
- inbox_id: string;
239
- draft_id: string;
240
- add_labels?: string[] | undefined;
241
- remove_labels?: string[] | undefined;
242
- }, {
243
- inbox_id: string;
244
- draft_id: string;
245
- add_labels?: string[] | undefined;
246
- remove_labels?: string[] | undefined;
247
- }>;
5
+ type Tool = {
6
+ name: string;
7
+ description: string;
8
+ schema: z.AnyZodObject;
9
+ fn: (args: any) => Promise<any>;
10
+ };
11
+ declare class AgentMailToolkit extends ListToolkit<Tool> {
12
+ protected buildTool(tool: Tool$1): {
13
+ name: string;
14
+ description: string;
15
+ schema: z.AnyZodObject;
16
+ fn: (args: z.infer<typeof tool.schema>) => Promise<any>;
17
+ };
18
+ }
248
19
 
249
- export { CreateDraftParams, CreateInboxParams, GetDraftParams, GetInboxParams, GetMessageParams, GetThreadParams, ListDraftsParams, ListInboxItemsParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendDraftParams, SendMessageParams, UpdateMessageParams };
20
+ export { AgentMailToolkit };
package/dist/index.d.ts CHANGED
@@ -1,249 +1,20 @@
1
1
  import { z } from 'zod';
2
- export { T as Tool, t as tools } from './tools-Dzp_FZN_.js';
2
+ import { L as ListToolkit, T as Tool$1 } from './toolkit-B8QHBdtC.js';
3
+ import 'agentmail';
3
4
 
4
- declare const ListItemsParams: z.ZodObject<{
5
- limit: z.ZodOptional<z.ZodNumber>;
6
- page_token: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- limit?: number | undefined;
9
- page_token?: string | undefined;
10
- }, {
11
- limit?: number | undefined;
12
- page_token?: string | undefined;
13
- }>;
14
- declare const ListInboxItemsParams: z.ZodObject<{
15
- limit: z.ZodOptional<z.ZodNumber>;
16
- page_token: z.ZodOptional<z.ZodString>;
17
- } & {
18
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
- ascending: z.ZodOptional<z.ZodBoolean>;
20
- }, "strip", z.ZodTypeAny, {
21
- limit?: number | undefined;
22
- page_token?: string | undefined;
23
- labels?: string[] | undefined;
24
- ascending?: boolean | undefined;
25
- }, {
26
- limit?: number | undefined;
27
- page_token?: string | undefined;
28
- labels?: string[] | undefined;
29
- ascending?: boolean | undefined;
30
- }>;
31
- declare const GetInboxParams: z.ZodObject<{
32
- inbox_id: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- inbox_id: string;
35
- }, {
36
- inbox_id: string;
37
- }>;
38
- declare const CreateInboxParams: z.ZodObject<{
39
- username: z.ZodOptional<z.ZodString>;
40
- domain: z.ZodOptional<z.ZodString>;
41
- display_name: z.ZodOptional<z.ZodString>;
42
- }, "strip", z.ZodTypeAny, {
43
- username?: string | undefined;
44
- domain?: string | undefined;
45
- display_name?: string | undefined;
46
- }, {
47
- username?: string | undefined;
48
- domain?: string | undefined;
49
- display_name?: string | undefined;
50
- }>;
51
- declare const ListThreadsParams: z.ZodObject<{
52
- limit: z.ZodOptional<z.ZodNumber>;
53
- page_token: z.ZodOptional<z.ZodString>;
54
- } & {
55
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
- ascending: z.ZodOptional<z.ZodBoolean>;
57
- } & {
58
- inbox_id: z.ZodString;
59
- }, "strip", z.ZodTypeAny, {
60
- inbox_id: string;
61
- limit?: number | undefined;
62
- page_token?: string | undefined;
63
- labels?: string[] | undefined;
64
- ascending?: boolean | undefined;
65
- }, {
66
- inbox_id: string;
67
- limit?: number | undefined;
68
- page_token?: string | undefined;
69
- labels?: string[] | undefined;
70
- ascending?: boolean | undefined;
71
- }>;
72
- declare const GetThreadParams: z.ZodObject<{
73
- thread_id: z.ZodString;
74
- }, "strip", z.ZodTypeAny, {
75
- thread_id: string;
76
- }, {
77
- thread_id: string;
78
- }>;
79
- declare const ListMessagesParams: z.ZodObject<{
80
- limit: z.ZodOptional<z.ZodNumber>;
81
- page_token: z.ZodOptional<z.ZodString>;
82
- } & {
83
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
- ascending: z.ZodOptional<z.ZodBoolean>;
85
- } & {
86
- inbox_id: z.ZodString;
87
- }, "strip", z.ZodTypeAny, {
88
- inbox_id: string;
89
- limit?: number | undefined;
90
- page_token?: string | undefined;
91
- labels?: string[] | undefined;
92
- ascending?: boolean | undefined;
93
- }, {
94
- inbox_id: string;
95
- limit?: number | undefined;
96
- page_token?: string | undefined;
97
- labels?: string[] | undefined;
98
- ascending?: boolean | undefined;
99
- }>;
100
- declare const GetMessageParams: z.ZodObject<{
101
- inbox_id: z.ZodString;
102
- message_id: z.ZodString;
103
- }, "strip", z.ZodTypeAny, {
104
- inbox_id: string;
105
- message_id: string;
106
- }, {
107
- inbox_id: string;
108
- message_id: string;
109
- }>;
110
- declare const SendMessageParams: z.ZodObject<{
111
- inbox_id: z.ZodString;
112
- to: z.ZodArray<z.ZodString, "many">;
113
- cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
114
- bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
115
- subject: z.ZodOptional<z.ZodString>;
116
- text: z.ZodOptional<z.ZodString>;
117
- html: z.ZodOptional<z.ZodString>;
118
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
119
- }, "strip", z.ZodTypeAny, {
120
- inbox_id: string;
121
- to: string[];
122
- labels?: string[] | undefined;
123
- cc?: string[] | undefined;
124
- bcc?: string[] | undefined;
125
- subject?: string | undefined;
126
- text?: string | undefined;
127
- html?: string | undefined;
128
- }, {
129
- inbox_id: string;
130
- to: string[];
131
- labels?: string[] | undefined;
132
- cc?: string[] | undefined;
133
- bcc?: string[] | undefined;
134
- subject?: string | undefined;
135
- text?: string | undefined;
136
- html?: string | undefined;
137
- }>;
138
- declare const ReplyToMessageParams: z.ZodObject<{
139
- inbox_id: z.ZodString;
140
- message_id: z.ZodString;
141
- text: z.ZodOptional<z.ZodString>;
142
- html: z.ZodOptional<z.ZodString>;
143
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
- }, "strip", z.ZodTypeAny, {
145
- inbox_id: string;
146
- message_id: string;
147
- labels?: string[] | undefined;
148
- text?: string | undefined;
149
- html?: string | undefined;
150
- }, {
151
- inbox_id: string;
152
- message_id: string;
153
- labels?: string[] | undefined;
154
- text?: string | undefined;
155
- html?: string | undefined;
156
- }>;
157
- declare const UpdateMessageParams: z.ZodObject<{
158
- inbox_id: z.ZodString;
159
- message_id: z.ZodString;
160
- add_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
161
- remove_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
- }, "strip", z.ZodTypeAny, {
163
- inbox_id: string;
164
- message_id: string;
165
- add_labels?: string[] | undefined;
166
- remove_labels?: string[] | undefined;
167
- }, {
168
- inbox_id: string;
169
- message_id: string;
170
- add_labels?: string[] | undefined;
171
- remove_labels?: string[] | undefined;
172
- }>;
173
- declare const ListDraftsParams: z.ZodObject<{
174
- limit: z.ZodOptional<z.ZodNumber>;
175
- page_token: z.ZodOptional<z.ZodString>;
176
- } & {
177
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
- ascending: z.ZodOptional<z.ZodBoolean>;
179
- } & {
180
- inbox_id: z.ZodString;
181
- }, "strip", z.ZodTypeAny, {
182
- inbox_id: string;
183
- limit?: number | undefined;
184
- page_token?: string | undefined;
185
- labels?: string[] | undefined;
186
- ascending?: boolean | undefined;
187
- }, {
188
- inbox_id: string;
189
- limit?: number | undefined;
190
- page_token?: string | undefined;
191
- labels?: string[] | undefined;
192
- ascending?: boolean | undefined;
193
- }>;
194
- declare const GetDraftParams: z.ZodObject<{
195
- inbox_id: z.ZodString;
196
- draft_id: z.ZodString;
197
- }, "strip", z.ZodTypeAny, {
198
- inbox_id: string;
199
- draft_id: string;
200
- }, {
201
- inbox_id: string;
202
- draft_id: string;
203
- }>;
204
- declare const CreateDraftParams: z.ZodObject<{
205
- inbox_id: z.ZodString;
206
- to: z.ZodArray<z.ZodString, "many">;
207
- cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
208
- bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
209
- subject: z.ZodOptional<z.ZodString>;
210
- text: z.ZodOptional<z.ZodString>;
211
- html: z.ZodOptional<z.ZodString>;
212
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
213
- }, "strip", z.ZodTypeAny, {
214
- inbox_id: string;
215
- to: string[];
216
- labels?: string[] | undefined;
217
- cc?: string[] | undefined;
218
- bcc?: string[] | undefined;
219
- subject?: string | undefined;
220
- text?: string | undefined;
221
- html?: string | undefined;
222
- }, {
223
- inbox_id: string;
224
- to: string[];
225
- labels?: string[] | undefined;
226
- cc?: string[] | undefined;
227
- bcc?: string[] | undefined;
228
- subject?: string | undefined;
229
- text?: string | undefined;
230
- html?: string | undefined;
231
- }>;
232
- declare const SendDraftParams: z.ZodObject<{
233
- inbox_id: z.ZodString;
234
- draft_id: z.ZodString;
235
- add_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
236
- remove_labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
237
- }, "strip", z.ZodTypeAny, {
238
- inbox_id: string;
239
- draft_id: string;
240
- add_labels?: string[] | undefined;
241
- remove_labels?: string[] | undefined;
242
- }, {
243
- inbox_id: string;
244
- draft_id: string;
245
- add_labels?: string[] | undefined;
246
- remove_labels?: string[] | undefined;
247
- }>;
5
+ type Tool = {
6
+ name: string;
7
+ description: string;
8
+ schema: z.AnyZodObject;
9
+ fn: (args: any) => Promise<any>;
10
+ };
11
+ declare class AgentMailToolkit extends ListToolkit<Tool> {
12
+ protected buildTool(tool: Tool$1): {
13
+ name: string;
14
+ description: string;
15
+ schema: z.AnyZodObject;
16
+ fn: (args: z.infer<typeof tool.schema>) => Promise<any>;
17
+ };
18
+ }
248
19
 
249
- export { CreateDraftParams, CreateInboxParams, GetDraftParams, GetInboxParams, GetMessageParams, GetThreadParams, ListDraftsParams, ListInboxItemsParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendDraftParams, SendMessageParams, UpdateMessageParams };
20
+ export { AgentMailToolkit };