agentmail-toolkit 0.1.23 → 0.1.25

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.
package/dist/index.js CHANGED
@@ -20,15 +20,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ CreateDraftParams: () => CreateDraftParams,
23
24
  CreateInboxParams: () => CreateInboxParams,
25
+ GetDraftParams: () => GetDraftParams,
24
26
  GetInboxParams: () => GetInboxParams,
25
27
  GetMessageParams: () => GetMessageParams,
26
28
  GetThreadParams: () => GetThreadParams,
29
+ ListDraftsParams: () => ListDraftsParams,
30
+ ListInboxItemsParams: () => ListInboxItemsParams,
27
31
  ListItemsParams: () => ListItemsParams,
28
32
  ListMessagesParams: () => ListMessagesParams,
29
33
  ListThreadsParams: () => ListThreadsParams,
30
34
  ReplyToMessageParams: () => ReplyToMessageParams,
35
+ SendDraftParams: () => SendDraftParams,
31
36
  SendMessageParams: () => SendMessageParams,
37
+ UpdateMessageParams: () => UpdateMessageParams,
32
38
  tools: () => tools
33
39
  });
34
40
  module.exports = __toCommonJS(index_exports);
@@ -39,6 +45,10 @@ var ListItemsParams = import_zod.z.object({
39
45
  limit: import_zod.z.number().optional().describe("Max number of items to return"),
40
46
  page_token: import_zod.z.string().optional().describe("Page token for pagination")
41
47
  });
48
+ var ListInboxItemsParams = ListItemsParams.extend({
49
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter items by"),
50
+ ascending: import_zod.z.boolean().optional().describe("Sort items in ascending order")
51
+ });
42
52
  var GetInboxParams = import_zod.z.object({
43
53
  inbox_id: import_zod.z.string().describe("ID of inbox to get")
44
54
  });
@@ -47,17 +57,14 @@ var CreateInboxParams = import_zod.z.object({
47
57
  domain: import_zod.z.string().optional().describe("Domain of inbox to create"),
48
58
  display_name: import_zod.z.string().optional().describe("Display name of inbox to create")
49
59
  });
50
- var ListThreadsParams = ListItemsParams.extend({
51
- inbox_id: import_zod.z.string().describe("ID of inbox to list threads from"),
52
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter threads by")
60
+ var ListThreadsParams = ListInboxItemsParams.extend({
61
+ inbox_id: import_zod.z.string().describe("ID of inbox to list threads from")
53
62
  });
54
63
  var GetThreadParams = import_zod.z.object({
55
- inbox_id: import_zod.z.string().describe("ID of inbox to get thread from"),
56
64
  thread_id: import_zod.z.string().describe("ID of thread to get")
57
65
  });
58
- var ListMessagesParams = ListItemsParams.extend({
59
- inbox_id: import_zod.z.string().describe("ID of inbox to list messages from"),
60
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter messages by")
66
+ var ListMessagesParams = ListInboxItemsParams.extend({
67
+ inbox_id: import_zod.z.string().describe("ID of inbox to list messages from")
61
68
  });
62
69
  var GetMessageParams = import_zod.z.object({
63
70
  inbox_id: import_zod.z.string().describe("ID of inbox to get message from"),
@@ -70,13 +77,44 @@ var SendMessageParams = import_zod.z.object({
70
77
  bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of message"),
71
78
  subject: import_zod.z.string().optional().describe("Subject of message"),
72
79
  text: import_zod.z.string().optional().describe("Plain text body of message"),
73
- html: import_zod.z.string().optional().describe("HTML body of message")
80
+ html: import_zod.z.string().optional().describe("HTML body of message"),
81
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message")
74
82
  });
75
83
  var ReplyToMessageParams = import_zod.z.object({
76
84
  inbox_id: import_zod.z.string().describe("ID of inbox to reply to message from"),
77
85
  message_id: import_zod.z.string().describe("ID of message to reply to"),
78
86
  text: import_zod.z.string().optional().describe("Plain text body of reply"),
79
- html: import_zod.z.string().optional().describe("HTML body of reply")
87
+ html: import_zod.z.string().optional().describe("HTML body of reply"),
88
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to reply")
89
+ });
90
+ var UpdateMessageParams = import_zod.z.object({
91
+ inbox_id: import_zod.z.string().describe("ID of inbox to update message from"),
92
+ message_id: import_zod.z.string().describe("ID of message to update"),
93
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message"),
94
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from message")
95
+ });
96
+ var ListDraftsParams = ListInboxItemsParams.extend({
97
+ inbox_id: import_zod.z.string().describe("ID of inbox to list drafts from")
98
+ });
99
+ var GetDraftParams = import_zod.z.object({
100
+ inbox_id: import_zod.z.string().describe("ID of inbox to get draft from"),
101
+ draft_id: import_zod.z.string().describe("ID of draft to get")
102
+ });
103
+ var CreateDraftParams = import_zod.z.object({
104
+ inbox_id: import_zod.z.string().describe("ID of inbox to create draft from"),
105
+ to: import_zod.z.array(import_zod.z.string()).describe("Recipients of draft"),
106
+ cc: import_zod.z.array(import_zod.z.string()).optional().describe("CC recipients of draft"),
107
+ bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of draft"),
108
+ subject: import_zod.z.string().optional().describe("Subject of draft"),
109
+ text: import_zod.z.string().optional().describe("Plain text body of draft"),
110
+ html: import_zod.z.string().optional().describe("HTML body of draft"),
111
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to draft")
112
+ });
113
+ var SendDraftParams = import_zod.z.object({
114
+ inbox_id: import_zod.z.string().describe("ID of inbox to send draft from"),
115
+ draft_id: import_zod.z.string().describe("ID of draft to send"),
116
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to sent message"),
117
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from sent message")
80
118
  });
81
119
 
82
120
  // src/tools.ts
@@ -96,7 +134,7 @@ var tools = [
96
134
  {
97
135
  name: "create_inbox",
98
136
  method: "inboxes.create",
99
- description: "Create inbox. Use default username, domain, and display name unless otherwise specified.",
137
+ description: "Create inbox",
100
138
  schema: CreateInboxParams
101
139
  },
102
140
  {
@@ -105,9 +143,15 @@ var tools = [
105
143
  description: "List threads in inbox",
106
144
  schema: ListThreadsParams
107
145
  },
146
+ {
147
+ name: "list_all_threads",
148
+ method: "threads.list",
149
+ description: "List threads in all inboxes",
150
+ schema: ListInboxItemsParams
151
+ },
108
152
  {
109
153
  name: "get_thread",
110
- method: "inboxes.threads.get",
154
+ method: "threads.get",
111
155
  description: "Get thread",
112
156
  schema: GetThreadParams
113
157
  },
@@ -134,19 +178,61 @@ var tools = [
134
178
  method: "inboxes.messages.reply",
135
179
  description: "Reply to message",
136
180
  schema: ReplyToMessageParams
181
+ },
182
+ {
183
+ name: "update_message",
184
+ method: "inboxes.messages.update",
185
+ description: "Update message",
186
+ schema: UpdateMessageParams
187
+ },
188
+ {
189
+ name: "list_drafts",
190
+ method: "inboxes.drafts.list",
191
+ description: "List drafts in inbox",
192
+ schema: ListDraftsParams
193
+ },
194
+ {
195
+ name: "list_all_drafts",
196
+ method: "drafts.list",
197
+ description: "List drafts in all inboxes",
198
+ schema: ListInboxItemsParams
199
+ },
200
+ {
201
+ name: "get_draft",
202
+ method: "drafts.get",
203
+ description: "Get draft",
204
+ schema: GetDraftParams
205
+ },
206
+ {
207
+ name: "create_draft",
208
+ method: "inboxes.drafts.create",
209
+ description: "Create draft",
210
+ schema: CreateDraftParams
211
+ },
212
+ {
213
+ name: "send_draft",
214
+ method: "inboxes.drafts.send",
215
+ description: "Send draft",
216
+ schema: SendDraftParams
137
217
  }
138
218
  ];
139
219
  // Annotate the CommonJS export names for ESM import in node:
140
220
  0 && (module.exports = {
221
+ CreateDraftParams,
141
222
  CreateInboxParams,
223
+ GetDraftParams,
142
224
  GetInboxParams,
143
225
  GetMessageParams,
144
226
  GetThreadParams,
227
+ ListDraftsParams,
228
+ ListInboxItemsParams,
145
229
  ListItemsParams,
146
230
  ListMessagesParams,
147
231
  ListThreadsParams,
148
232
  ReplyToMessageParams,
233
+ SendDraftParams,
149
234
  SendMessageParams,
235
+ UpdateMessageParams,
150
236
  tools
151
237
  });
152
238
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/schemas.ts","../src/tools.ts"],"sourcesContent":["export * from './schemas'\nexport * from './tools'\n","import { z } from 'zod'\n\nexport const ListItemsParams = z.object({\n limit: z.number().optional().describe('Max number of items to return'),\n page_token: z.string().optional().describe('Page token for pagination'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('Username of inbox to create'),\n domain: z.string().optional().describe('Domain of inbox to create'),\n display_name: z.string().optional().describe('Display name of inbox to create'),\n})\n\nexport const ListThreadsParams = ListItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list threads from'),\n labels: z.array(z.string()).optional().describe('Labels to filter threads by'),\n})\n\nexport const GetThreadParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get thread from'),\n thread_id: z.string().describe('ID of thread to get'),\n})\n\nexport const ListMessagesParams = ListItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list messages from'),\n labels: z.array(z.string()).optional().describe('Labels to filter messages by'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get message from'),\n message_id: z.string().describe('ID of message to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send message from'),\n to: z.array(z.string()).describe('Recipients of message'),\n cc: z.array(z.string()).optional().describe('CC recipients of message'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of message'),\n subject: z.string().optional().describe('Subject of message'),\n text: z.string().optional().describe('Plain text body of message'),\n html: z.string().optional().describe('HTML body of message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to reply to message from'),\n message_id: z.string().describe('ID of message to reply to'),\n text: z.string().optional().describe('Plain text body of reply'),\n html: z.string().optional().describe('HTML body of reply'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n SendMessageParams,\n ReplyToMessageParams,\n} from './schemas'\n\nexport interface Tool {\n name: string\n method: string\n description: string\n schema: AnyZodObject\n}\n\nexport const tools: Tool[] = [\n {\n name: 'list_inboxes',\n method: 'inboxes.list',\n description: 'List inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get inbox',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create inbox. Use default username, domain, and display name unless otherwise specified.',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'inboxes.threads.list',\n description: 'List threads in inbox',\n schema: ListThreadsParams,\n },\n {\n name: 'get_thread',\n method: 'inboxes.threads.get',\n description: 'Get thread',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'inboxes.messages.list',\n description: 'List messages in inbox',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'inboxes.messages.get',\n description: 'Get message',\n schema: GetMessageParams,\n },\n {\n name: 'send_message',\n method: 'inboxes.messages.send',\n description: 'Send message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'inboxes.messages.reply',\n description: 'Reply to message',\n schema: ReplyToMessageParams,\n },\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,kBAAkB,aAAE,OAAO;AAAA,EACpC,OAAO,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,+BAA+B;AAAA,EACrE,YAAY,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B;AAC1E,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACnC,UAAU,aAAE,OAAO,EAAE,SAAS,oBAAoB;AACtD,CAAC;AA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M;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/schemas.ts","../src/tools.ts"],"sourcesContent":["export * from './schemas'\nexport * from './tools'\n","import { z } from 'zod'\n\nexport const ListItemsParams = z.object({\n limit: z.number().optional().describe('Max number of items to return'),\n page_token: z.string().optional().describe('Page token for pagination'),\n})\n\nexport const ListInboxItemsParams = ListItemsParams.extend({\n labels: z.array(z.string()).optional().describe('Labels to filter items by'),\n ascending: z.boolean().optional().describe('Sort items in ascending order'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('Username of inbox to create'),\n domain: z.string().optional().describe('Domain of inbox to create'),\n display_name: z.string().optional().describe('Display name of inbox to create'),\n})\n\nexport const ListThreadsParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list threads from'),\n})\n\nexport const GetThreadParams = z.object({\n thread_id: z.string().describe('ID of thread to get'),\n})\n\nexport const ListMessagesParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list messages from'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get message from'),\n message_id: z.string().describe('ID of message to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send message from'),\n to: z.array(z.string()).describe('Recipients of message'),\n cc: z.array(z.string()).optional().describe('CC recipients of message'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of message'),\n subject: z.string().optional().describe('Subject of message'),\n text: z.string().optional().describe('Plain text body of message'),\n html: z.string().optional().describe('HTML body of message'),\n labels: z.array(z.string()).optional().describe('Labels to add to message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to reply to message from'),\n message_id: z.string().describe('ID of message to reply to'),\n text: z.string().optional().describe('Plain text body of reply'),\n html: z.string().optional().describe('HTML body of reply'),\n labels: z.array(z.string()).optional().describe('Labels to add to reply'),\n})\n\nexport const UpdateMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to update message from'),\n message_id: z.string().describe('ID of message to update'),\n add_labels: z.array(z.string()).optional().describe('Labels to add to message'),\n remove_labels: z.array(z.string()).optional().describe('Labels to remove from message'),\n})\n\nexport const ListDraftsParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list drafts from'),\n})\n\nexport const GetDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get draft from'),\n draft_id: z.string().describe('ID of draft to get'),\n})\n\nexport const CreateDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to create draft from'),\n to: z.array(z.string()).describe('Recipients of draft'),\n cc: z.array(z.string()).optional().describe('CC recipients of draft'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of draft'),\n subject: z.string().optional().describe('Subject of draft'),\n text: z.string().optional().describe('Plain text body of draft'),\n html: z.string().optional().describe('HTML body of draft'),\n labels: z.array(z.string()).optional().describe('Labels to add to draft'),\n})\n\nexport const SendDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send draft from'),\n draft_id: z.string().describe('ID of draft to send'),\n add_labels: z.array(z.string()).optional().describe('Labels to add to sent message'),\n remove_labels: z.array(z.string()).optional().describe('Labels to remove from sent message'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n ListInboxItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n SendMessageParams,\n ReplyToMessageParams,\n UpdateMessageParams,\n ListDraftsParams,\n GetDraftParams,\n CreateDraftParams,\n SendDraftParams,\n} from './schemas'\n\nexport interface Tool {\n name: string\n method: string\n description: string\n schema: AnyZodObject\n}\n\nexport const tools: Tool[] = [\n {\n name: 'list_inboxes',\n method: 'inboxes.list',\n description: 'List inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get inbox',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create inbox',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'inboxes.threads.list',\n description: 'List threads in inbox',\n schema: ListThreadsParams,\n },\n {\n name: 'list_all_threads',\n method: 'threads.list',\n description: 'List threads in all inboxes',\n schema: ListInboxItemsParams,\n },\n {\n name: 'get_thread',\n method: 'threads.get',\n description: 'Get thread',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'inboxes.messages.list',\n description: 'List messages in inbox',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'inboxes.messages.get',\n description: 'Get message',\n schema: GetMessageParams,\n },\n {\n name: 'send_message',\n method: 'inboxes.messages.send',\n description: 'Send message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'inboxes.messages.reply',\n description: 'Reply to message',\n schema: ReplyToMessageParams,\n },\n {\n name: 'update_message',\n method: 'inboxes.messages.update',\n description: 'Update message',\n schema: UpdateMessageParams,\n },\n {\n name: 'list_drafts',\n method: 'inboxes.drafts.list',\n description: 'List drafts in inbox',\n schema: ListDraftsParams,\n },\n {\n name: 'list_all_drafts',\n method: 'drafts.list',\n description: 'List drafts in all inboxes',\n schema: ListInboxItemsParams,\n },\n {\n name: 'get_draft',\n method: 'drafts.get',\n description: 'Get draft',\n schema: GetDraftParams,\n },\n {\n name: 'create_draft',\n method: 'inboxes.drafts.create',\n description: 'Create draft',\n schema: CreateDraftParams,\n },\n {\n name: 'send_draft',\n method: 'inboxes.drafts.send',\n description: 'Send draft',\n schema: SendDraftParams,\n },\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAE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AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AACJ;","names":[]}
package/dist/index.mjs CHANGED
@@ -1,25 +1,37 @@
1
1
  import {
2
+ CreateDraftParams,
2
3
  CreateInboxParams,
4
+ GetDraftParams,
3
5
  GetInboxParams,
4
6
  GetMessageParams,
5
7
  GetThreadParams,
8
+ ListDraftsParams,
9
+ ListInboxItemsParams,
6
10
  ListItemsParams,
7
11
  ListMessagesParams,
8
12
  ListThreadsParams,
9
13
  ReplyToMessageParams,
14
+ SendDraftParams,
10
15
  SendMessageParams,
16
+ UpdateMessageParams,
11
17
  tools
12
- } from "./chunk-CIU3KR25.mjs";
18
+ } from "./chunk-HKK5SMM3.mjs";
13
19
  export {
20
+ CreateDraftParams,
14
21
  CreateInboxParams,
22
+ GetDraftParams,
15
23
  GetInboxParams,
16
24
  GetMessageParams,
17
25
  GetThreadParams,
26
+ ListDraftsParams,
27
+ ListInboxItemsParams,
18
28
  ListItemsParams,
19
29
  ListMessagesParams,
20
30
  ListThreadsParams,
21
31
  ReplyToMessageParams,
32
+ SendDraftParams,
22
33
  SendMessageParams,
34
+ UpdateMessageParams,
23
35
  tools
24
36
  };
25
37
  //# sourceMappingURL=index.mjs.map
package/dist/langchain.js CHANGED
@@ -57,6 +57,10 @@ var ListItemsParams = import_zod.z.object({
57
57
  limit: import_zod.z.number().optional().describe("Max number of items to return"),
58
58
  page_token: import_zod.z.string().optional().describe("Page token for pagination")
59
59
  });
60
+ var ListInboxItemsParams = ListItemsParams.extend({
61
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter items by"),
62
+ ascending: import_zod.z.boolean().optional().describe("Sort items in ascending order")
63
+ });
60
64
  var GetInboxParams = import_zod.z.object({
61
65
  inbox_id: import_zod.z.string().describe("ID of inbox to get")
62
66
  });
@@ -65,17 +69,14 @@ var CreateInboxParams = import_zod.z.object({
65
69
  domain: import_zod.z.string().optional().describe("Domain of inbox to create"),
66
70
  display_name: import_zod.z.string().optional().describe("Display name of inbox to create")
67
71
  });
68
- var ListThreadsParams = ListItemsParams.extend({
69
- inbox_id: import_zod.z.string().describe("ID of inbox to list threads from"),
70
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter threads by")
72
+ var ListThreadsParams = ListInboxItemsParams.extend({
73
+ inbox_id: import_zod.z.string().describe("ID of inbox to list threads from")
71
74
  });
72
75
  var GetThreadParams = import_zod.z.object({
73
- inbox_id: import_zod.z.string().describe("ID of inbox to get thread from"),
74
76
  thread_id: import_zod.z.string().describe("ID of thread to get")
75
77
  });
76
- var ListMessagesParams = ListItemsParams.extend({
77
- inbox_id: import_zod.z.string().describe("ID of inbox to list messages from"),
78
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter messages by")
78
+ var ListMessagesParams = ListInboxItemsParams.extend({
79
+ inbox_id: import_zod.z.string().describe("ID of inbox to list messages from")
79
80
  });
80
81
  var GetMessageParams = import_zod.z.object({
81
82
  inbox_id: import_zod.z.string().describe("ID of inbox to get message from"),
@@ -88,13 +89,44 @@ var SendMessageParams = import_zod.z.object({
88
89
  bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of message"),
89
90
  subject: import_zod.z.string().optional().describe("Subject of message"),
90
91
  text: import_zod.z.string().optional().describe("Plain text body of message"),
91
- html: import_zod.z.string().optional().describe("HTML body of message")
92
+ html: import_zod.z.string().optional().describe("HTML body of message"),
93
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message")
92
94
  });
93
95
  var ReplyToMessageParams = import_zod.z.object({
94
96
  inbox_id: import_zod.z.string().describe("ID of inbox to reply to message from"),
95
97
  message_id: import_zod.z.string().describe("ID of message to reply to"),
96
98
  text: import_zod.z.string().optional().describe("Plain text body of reply"),
97
- html: import_zod.z.string().optional().describe("HTML body of reply")
99
+ html: import_zod.z.string().optional().describe("HTML body of reply"),
100
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to reply")
101
+ });
102
+ var UpdateMessageParams = import_zod.z.object({
103
+ inbox_id: import_zod.z.string().describe("ID of inbox to update message from"),
104
+ message_id: import_zod.z.string().describe("ID of message to update"),
105
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message"),
106
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from message")
107
+ });
108
+ var ListDraftsParams = ListInboxItemsParams.extend({
109
+ inbox_id: import_zod.z.string().describe("ID of inbox to list drafts from")
110
+ });
111
+ var GetDraftParams = import_zod.z.object({
112
+ inbox_id: import_zod.z.string().describe("ID of inbox to get draft from"),
113
+ draft_id: import_zod.z.string().describe("ID of draft to get")
114
+ });
115
+ var CreateDraftParams = import_zod.z.object({
116
+ inbox_id: import_zod.z.string().describe("ID of inbox to create draft from"),
117
+ to: import_zod.z.array(import_zod.z.string()).describe("Recipients of draft"),
118
+ cc: import_zod.z.array(import_zod.z.string()).optional().describe("CC recipients of draft"),
119
+ bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of draft"),
120
+ subject: import_zod.z.string().optional().describe("Subject of draft"),
121
+ text: import_zod.z.string().optional().describe("Plain text body of draft"),
122
+ html: import_zod.z.string().optional().describe("HTML body of draft"),
123
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to draft")
124
+ });
125
+ var SendDraftParams = import_zod.z.object({
126
+ inbox_id: import_zod.z.string().describe("ID of inbox to send draft from"),
127
+ draft_id: import_zod.z.string().describe("ID of draft to send"),
128
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to sent message"),
129
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from sent message")
98
130
  });
99
131
 
100
132
  // src/tools.ts
@@ -114,7 +146,7 @@ var tools = [
114
146
  {
115
147
  name: "create_inbox",
116
148
  method: "inboxes.create",
117
- description: "Create inbox. Use default username, domain, and display name unless otherwise specified.",
149
+ description: "Create inbox",
118
150
  schema: CreateInboxParams
119
151
  },
120
152
  {
@@ -123,9 +155,15 @@ var tools = [
123
155
  description: "List threads in inbox",
124
156
  schema: ListThreadsParams
125
157
  },
158
+ {
159
+ name: "list_all_threads",
160
+ method: "threads.list",
161
+ description: "List threads in all inboxes",
162
+ schema: ListInboxItemsParams
163
+ },
126
164
  {
127
165
  name: "get_thread",
128
- method: "inboxes.threads.get",
166
+ method: "threads.get",
129
167
  description: "Get thread",
130
168
  schema: GetThreadParams
131
169
  },
@@ -152,6 +190,42 @@ var tools = [
152
190
  method: "inboxes.messages.reply",
153
191
  description: "Reply to message",
154
192
  schema: ReplyToMessageParams
193
+ },
194
+ {
195
+ name: "update_message",
196
+ method: "inboxes.messages.update",
197
+ description: "Update message",
198
+ schema: UpdateMessageParams
199
+ },
200
+ {
201
+ name: "list_drafts",
202
+ method: "inboxes.drafts.list",
203
+ description: "List drafts in inbox",
204
+ schema: ListDraftsParams
205
+ },
206
+ {
207
+ name: "list_all_drafts",
208
+ method: "drafts.list",
209
+ description: "List drafts in all inboxes",
210
+ schema: ListInboxItemsParams
211
+ },
212
+ {
213
+ name: "get_draft",
214
+ method: "drafts.get",
215
+ description: "Get draft",
216
+ schema: GetDraftParams
217
+ },
218
+ {
219
+ name: "create_draft",
220
+ method: "inboxes.drafts.create",
221
+ description: "Create draft",
222
+ schema: CreateDraftParams
223
+ },
224
+ {
225
+ name: "send_draft",
226
+ method: "inboxes.drafts.send",
227
+ description: "Send draft",
228
+ schema: SendDraftParams
155
229
  }
156
230
  ];
157
231
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/langchain.ts","../src/wrapper.ts","../src/schemas.ts","../src/tools.ts","../src/toolkit.ts"],"sourcesContent":["import { type StructuredTool, tool as langchainTool } from '@langchain/core/tools'\n\nimport { ListToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends ListToolkit<StructuredTool> {\n protected buildTool(tool: Tool): StructuredTool {\n return langchainTool(async (args) => JSON.stringify((await this.safeCall(tool.method, args)).result, null, 2), {\n name: tool.name,\n description: tool.description,\n schema: tool.schema,\n })\n }\n}\n","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 { z } from 'zod'\n\nexport const ListItemsParams = z.object({\n limit: z.number().optional().describe('Max number of items to return'),\n page_token: z.string().optional().describe('Page token for pagination'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('Username of inbox to create'),\n domain: z.string().optional().describe('Domain of inbox to create'),\n display_name: z.string().optional().describe('Display name of inbox to create'),\n})\n\nexport const ListThreadsParams = ListItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list threads from'),\n labels: z.array(z.string()).optional().describe('Labels to filter threads by'),\n})\n\nexport const GetThreadParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get thread from'),\n thread_id: z.string().describe('ID of thread to get'),\n})\n\nexport const ListMessagesParams = ListItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list messages from'),\n labels: z.array(z.string()).optional().describe('Labels to filter messages by'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get message from'),\n message_id: z.string().describe('ID of message to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send message from'),\n to: z.array(z.string()).describe('Recipients of message'),\n cc: z.array(z.string()).optional().describe('CC recipients of message'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of message'),\n subject: z.string().optional().describe('Subject of message'),\n text: z.string().optional().describe('Plain text body of message'),\n html: z.string().optional().describe('HTML body of message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to reply to message from'),\n message_id: z.string().describe('ID of message to reply to'),\n text: z.string().optional().describe('Plain text body of reply'),\n html: z.string().optional().describe('HTML body of reply'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n SendMessageParams,\n ReplyToMessageParams,\n} from './schemas'\n\nexport interface Tool {\n name: string\n method: string\n description: string\n schema: AnyZodObject\n}\n\nexport const tools: Tool[] = [\n {\n name: 'list_inboxes',\n method: 'inboxes.list',\n description: 'List inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get inbox',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create inbox. Use default username, domain, and display name unless otherwise specified.',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'inboxes.threads.list',\n description: 'List threads in inbox',\n schema: ListThreadsParams,\n },\n {\n name: 'get_thread',\n method: 'inboxes.threads.get',\n description: 'Get thread',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'inboxes.messages.list',\n description: 'List messages in inbox',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'inboxes.messages.get',\n description: 'Get message',\n schema: GetMessageParams,\n },\n {\n name: 'send_message',\n method: 'inboxes.messages.send',\n description: 'Send message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'inboxes.messages.reply',\n description: 'Reply to message',\n schema: ReplyToMessageParams,\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;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA2D;;;ACA3D,uBAAgC;AAEzB,IAAM,UAAN,MAAc;AAAA,EACjB,YAA6B,SAAS,IAAI,iCAAgB,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,EAA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,CAAC,CAAQ;AAAA,EAChB;AACJ;;;AJ3BO,IAAM,mBAAN,cAA+B,YAA4B;AAAA,EACpD,UAAU,MAA4B;AAC5C,eAAO,cAAAC,MAAc,OAAO,SAAS,KAAK,WAAW,MAAM,KAAK,SAAS,KAAK,QAAQ,IAAI,GAAG,QAAQ,MAAM,CAAC,GAAG;AAAA,MAC3G,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL;AACJ;","names":["import_tools","langchainTool"]}
1
+ {"version":3,"sources":["../src/langchain.ts","../src/wrapper.ts","../src/schemas.ts","../src/tools.ts","../src/toolkit.ts"],"sourcesContent":["import { type StructuredTool, tool as langchainTool } from '@langchain/core/tools'\n\nimport { ListToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends ListToolkit<StructuredTool> {\n protected buildTool(tool: Tool): StructuredTool {\n return langchainTool(async (args) => JSON.stringify((await this.safeCall(tool.method, args)).result, null, 2), {\n name: tool.name,\n description: tool.description,\n schema: tool.schema,\n })\n }\n}\n","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 { z } from 'zod'\n\nexport const ListItemsParams = z.object({\n limit: z.number().optional().describe('Max number of items to return'),\n page_token: z.string().optional().describe('Page token for pagination'),\n})\n\nexport const ListInboxItemsParams = ListItemsParams.extend({\n labels: z.array(z.string()).optional().describe('Labels to filter items by'),\n ascending: z.boolean().optional().describe('Sort items in ascending order'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('Username of inbox to create'),\n domain: z.string().optional().describe('Domain of inbox to create'),\n display_name: z.string().optional().describe('Display name of inbox to create'),\n})\n\nexport const ListThreadsParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list threads from'),\n})\n\nexport const GetThreadParams = z.object({\n thread_id: z.string().describe('ID of thread to get'),\n})\n\nexport const ListMessagesParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list messages from'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get message from'),\n message_id: z.string().describe('ID of message to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send message from'),\n to: z.array(z.string()).describe('Recipients of message'),\n cc: z.array(z.string()).optional().describe('CC recipients of message'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of message'),\n subject: z.string().optional().describe('Subject of message'),\n text: z.string().optional().describe('Plain text body of message'),\n html: z.string().optional().describe('HTML body of message'),\n labels: z.array(z.string()).optional().describe('Labels to add to message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to reply to message from'),\n message_id: z.string().describe('ID of message to reply to'),\n text: z.string().optional().describe('Plain text body of reply'),\n html: z.string().optional().describe('HTML body of reply'),\n labels: z.array(z.string()).optional().describe('Labels to add to reply'),\n})\n\nexport const UpdateMessageParams = z.object({\n inbox_id: z.string().describe('ID of inbox to update message from'),\n message_id: z.string().describe('ID of message to update'),\n add_labels: z.array(z.string()).optional().describe('Labels to add to message'),\n remove_labels: z.array(z.string()).optional().describe('Labels to remove from message'),\n})\n\nexport const ListDraftsParams = ListInboxItemsParams.extend({\n inbox_id: z.string().describe('ID of inbox to list drafts from'),\n})\n\nexport const GetDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to get draft from'),\n draft_id: z.string().describe('ID of draft to get'),\n})\n\nexport const CreateDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to create draft from'),\n to: z.array(z.string()).describe('Recipients of draft'),\n cc: z.array(z.string()).optional().describe('CC recipients of draft'),\n bcc: z.array(z.string()).optional().describe('BCC recipients of draft'),\n subject: z.string().optional().describe('Subject of draft'),\n text: z.string().optional().describe('Plain text body of draft'),\n html: z.string().optional().describe('HTML body of draft'),\n labels: z.array(z.string()).optional().describe('Labels to add to draft'),\n})\n\nexport const SendDraftParams = z.object({\n inbox_id: z.string().describe('ID of inbox to send draft from'),\n draft_id: z.string().describe('ID of draft to send'),\n add_labels: z.array(z.string()).optional().describe('Labels to add to sent message'),\n remove_labels: z.array(z.string()).optional().describe('Labels to remove from sent message'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n ListInboxItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n SendMessageParams,\n ReplyToMessageParams,\n UpdateMessageParams,\n ListDraftsParams,\n GetDraftParams,\n CreateDraftParams,\n SendDraftParams,\n} from './schemas'\n\nexport interface Tool {\n name: string\n method: string\n description: string\n schema: AnyZodObject\n}\n\nexport const tools: Tool[] = [\n {\n name: 'list_inboxes',\n method: 'inboxes.list',\n description: 'List inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get inbox',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create inbox',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'inboxes.threads.list',\n description: 'List threads in inbox',\n schema: ListThreadsParams,\n },\n {\n name: 'list_all_threads',\n method: 'threads.list',\n description: 'List threads in all inboxes',\n schema: ListInboxItemsParams,\n },\n {\n name: 'get_thread',\n method: 'threads.get',\n description: 'Get thread',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'inboxes.messages.list',\n description: 'List messages in inbox',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'inboxes.messages.get',\n description: 'Get message',\n schema: GetMessageParams,\n },\n {\n name: 'send_message',\n method: 'inboxes.messages.send',\n description: 'Send message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'inboxes.messages.reply',\n description: 'Reply to message',\n schema: ReplyToMessageParams,\n },\n {\n name: 'update_message',\n method: 'inboxes.messages.update',\n description: 'Update message',\n schema: UpdateMessageParams,\n },\n {\n name: 'list_drafts',\n method: 'inboxes.drafts.list',\n description: 'List drafts in inbox',\n schema: ListDraftsParams,\n },\n {\n name: 'list_all_drafts',\n method: 'drafts.list',\n description: 'List drafts in all inboxes',\n schema: ListInboxItemsParams,\n },\n {\n name: 'get_draft',\n method: 'drafts.get',\n description: 'Get draft',\n schema: GetDraftParams,\n },\n {\n name: 'create_draft',\n method: 'inboxes.drafts.create',\n description: 'Create draft',\n schema: CreateDraftParams,\n },\n {\n name: 'send_draft',\n method: 'inboxes.drafts.send',\n description: 'Send draft',\n schema: SendDraftParams,\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;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA2D;;;ACA3D,uBAAgC;AAEzB,IAAM,UAAN,MAAc;AAAA,EACjB,YAA6B,SAAS,IAAI,iCAAgB,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;;;AC5BA,iBAAkB;AAEX,IAAM,kBAAkB,aAAE,OAAO;AAAA,EACpC,OAAO,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,+BAA+B;AAAA,EACrE,Y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AAQ;AAAA,EACZ;AACJ;;;ACvHO,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;;;AJ3BO,IAAM,mBAAN,cAA+B,YAA4B;AAAA,EACpD,UAAU,MAA4B;AAC5C,eAAO,cAAAC,MAAc,OAAO,SAAS,KAAK,WAAW,MAAM,KAAK,SAAS,KAAK,QAAQ,IAAI,GAAG,QAAQ,MAAM,CAAC,GAAG;AAAA,MAC3G,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL;AACJ;","names":["import_tools","langchainTool"]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ListToolkit
3
- } from "./chunk-VI3J3SMQ.mjs";
4
- import "./chunk-CIU3KR25.mjs";
3
+ } from "./chunk-EZFSHUCP.mjs";
4
+ import "./chunk-HKK5SMM3.mjs";
5
5
 
6
6
  // src/langchain.ts
7
7
  import { tool as langchainTool } from "@langchain/core/tools";
package/dist/mcp.js CHANGED
@@ -56,6 +56,10 @@ var ListItemsParams = import_zod.z.object({
56
56
  limit: import_zod.z.number().optional().describe("Max number of items to return"),
57
57
  page_token: import_zod.z.string().optional().describe("Page token for pagination")
58
58
  });
59
+ var ListInboxItemsParams = ListItemsParams.extend({
60
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter items by"),
61
+ ascending: import_zod.z.boolean().optional().describe("Sort items in ascending order")
62
+ });
59
63
  var GetInboxParams = import_zod.z.object({
60
64
  inbox_id: import_zod.z.string().describe("ID of inbox to get")
61
65
  });
@@ -64,17 +68,14 @@ var CreateInboxParams = import_zod.z.object({
64
68
  domain: import_zod.z.string().optional().describe("Domain of inbox to create"),
65
69
  display_name: import_zod.z.string().optional().describe("Display name of inbox to create")
66
70
  });
67
- var ListThreadsParams = ListItemsParams.extend({
68
- inbox_id: import_zod.z.string().describe("ID of inbox to list threads from"),
69
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter threads by")
71
+ var ListThreadsParams = ListInboxItemsParams.extend({
72
+ inbox_id: import_zod.z.string().describe("ID of inbox to list threads from")
70
73
  });
71
74
  var GetThreadParams = import_zod.z.object({
72
- inbox_id: import_zod.z.string().describe("ID of inbox to get thread from"),
73
75
  thread_id: import_zod.z.string().describe("ID of thread to get")
74
76
  });
75
- var ListMessagesParams = ListItemsParams.extend({
76
- inbox_id: import_zod.z.string().describe("ID of inbox to list messages from"),
77
- labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to filter messages by")
77
+ var ListMessagesParams = ListInboxItemsParams.extend({
78
+ inbox_id: import_zod.z.string().describe("ID of inbox to list messages from")
78
79
  });
79
80
  var GetMessageParams = import_zod.z.object({
80
81
  inbox_id: import_zod.z.string().describe("ID of inbox to get message from"),
@@ -87,13 +88,44 @@ var SendMessageParams = import_zod.z.object({
87
88
  bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of message"),
88
89
  subject: import_zod.z.string().optional().describe("Subject of message"),
89
90
  text: import_zod.z.string().optional().describe("Plain text body of message"),
90
- html: import_zod.z.string().optional().describe("HTML body of message")
91
+ html: import_zod.z.string().optional().describe("HTML body of message"),
92
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message")
91
93
  });
92
94
  var ReplyToMessageParams = import_zod.z.object({
93
95
  inbox_id: import_zod.z.string().describe("ID of inbox to reply to message from"),
94
96
  message_id: import_zod.z.string().describe("ID of message to reply to"),
95
97
  text: import_zod.z.string().optional().describe("Plain text body of reply"),
96
- html: import_zod.z.string().optional().describe("HTML body of reply")
98
+ html: import_zod.z.string().optional().describe("HTML body of reply"),
99
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to reply")
100
+ });
101
+ var UpdateMessageParams = import_zod.z.object({
102
+ inbox_id: import_zod.z.string().describe("ID of inbox to update message from"),
103
+ message_id: import_zod.z.string().describe("ID of message to update"),
104
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to message"),
105
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from message")
106
+ });
107
+ var ListDraftsParams = ListInboxItemsParams.extend({
108
+ inbox_id: import_zod.z.string().describe("ID of inbox to list drafts from")
109
+ });
110
+ var GetDraftParams = import_zod.z.object({
111
+ inbox_id: import_zod.z.string().describe("ID of inbox to get draft from"),
112
+ draft_id: import_zod.z.string().describe("ID of draft to get")
113
+ });
114
+ var CreateDraftParams = import_zod.z.object({
115
+ inbox_id: import_zod.z.string().describe("ID of inbox to create draft from"),
116
+ to: import_zod.z.array(import_zod.z.string()).describe("Recipients of draft"),
117
+ cc: import_zod.z.array(import_zod.z.string()).optional().describe("CC recipients of draft"),
118
+ bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of draft"),
119
+ subject: import_zod.z.string().optional().describe("Subject of draft"),
120
+ text: import_zod.z.string().optional().describe("Plain text body of draft"),
121
+ html: import_zod.z.string().optional().describe("HTML body of draft"),
122
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to draft")
123
+ });
124
+ var SendDraftParams = import_zod.z.object({
125
+ inbox_id: import_zod.z.string().describe("ID of inbox to send draft from"),
126
+ draft_id: import_zod.z.string().describe("ID of draft to send"),
127
+ add_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to add to sent message"),
128
+ remove_labels: import_zod.z.array(import_zod.z.string()).optional().describe("Labels to remove from sent message")
97
129
  });
98
130
 
99
131
  // src/tools.ts
@@ -113,7 +145,7 @@ var tools = [
113
145
  {
114
146
  name: "create_inbox",
115
147
  method: "inboxes.create",
116
- description: "Create inbox. Use default username, domain, and display name unless otherwise specified.",
148
+ description: "Create inbox",
117
149
  schema: CreateInboxParams
118
150
  },
119
151
  {
@@ -122,9 +154,15 @@ var tools = [
122
154
  description: "List threads in inbox",
123
155
  schema: ListThreadsParams
124
156
  },
157
+ {
158
+ name: "list_all_threads",
159
+ method: "threads.list",
160
+ description: "List threads in all inboxes",
161
+ schema: ListInboxItemsParams
162
+ },
125
163
  {
126
164
  name: "get_thread",
127
- method: "inboxes.threads.get",
165
+ method: "threads.get",
128
166
  description: "Get thread",
129
167
  schema: GetThreadParams
130
168
  },
@@ -151,6 +189,42 @@ var tools = [
151
189
  method: "inboxes.messages.reply",
152
190
  description: "Reply to message",
153
191
  schema: ReplyToMessageParams
192
+ },
193
+ {
194
+ name: "update_message",
195
+ method: "inboxes.messages.update",
196
+ description: "Update message",
197
+ schema: UpdateMessageParams
198
+ },
199
+ {
200
+ name: "list_drafts",
201
+ method: "inboxes.drafts.list",
202
+ description: "List drafts in inbox",
203
+ schema: ListDraftsParams
204
+ },
205
+ {
206
+ name: "list_all_drafts",
207
+ method: "drafts.list",
208
+ description: "List drafts in all inboxes",
209
+ schema: ListInboxItemsParams
210
+ },
211
+ {
212
+ name: "get_draft",
213
+ method: "drafts.get",
214
+ description: "Get draft",
215
+ schema: GetDraftParams
216
+ },
217
+ {
218
+ name: "create_draft",
219
+ method: "inboxes.drafts.create",
220
+ description: "Create draft",
221
+ schema: CreateDraftParams
222
+ },
223
+ {
224
+ name: "send_draft",
225
+ method: "inboxes.drafts.send",
226
+ description: "Send draft",
227
+ schema: SendDraftParams
154
228
  }
155
229
  ];
156
230