agentmail-toolkit 0.1.17 → 0.1.18

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/ai-sdk.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Tool } from 'ai';
2
2
  import { AgentMailClient } from 'agentmail';
3
- import { M as MapToolkit, T as Tool$1 } from './toolkit-oWNeOd1D.mjs';
3
+ import { M as MapToolkit } from './toolkit-DtDXApKD.mjs';
4
+ import { T as Tool$1 } from './tools-DFoMkoW0.mjs';
4
5
  import 'zod';
5
6
 
6
7
  declare class AgentMailToolkit extends MapToolkit<Tool> {
package/dist/ai-sdk.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Tool } from 'ai';
2
2
  import { AgentMailClient } from 'agentmail';
3
- import { M as MapToolkit, T as Tool$1 } from './toolkit-oWNeOd1D.js';
3
+ import { M as MapToolkit } from './toolkit-Dc7siZcx.js';
4
+ import { T as Tool$1 } from './tools-DFoMkoW0.js';
4
5
  import 'zod';
5
6
 
6
7
  declare class AgentMailToolkit extends MapToolkit<Tool> {
package/dist/ai-sdk.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  MapToolkit
3
- } from "./chunk-UCWHGUXO.mjs";
4
- import "./chunk-GZAAHMW6.mjs";
3
+ } from "./chunk-H3V5ORVZ.mjs";
4
+ import "./chunk-3TR24M4E.mjs";
5
+ import "./chunk-QBOE34GE.mjs";
5
6
 
6
7
  // src/ai-sdk.ts
7
8
  var AgentMailToolkit = class extends MapToolkit {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ai-sdk.ts"],"sourcesContent":["import { type Tool as AiSdkTool } from 'ai'\nimport { AgentMailClient } from 'agentmail'\n\nimport { MapToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends MapToolkit<AiSdkTool> {\n constructor(client?: AgentMailClient) {\n super(client)\n }\n\n protected buildTool(tool: Tool): AiSdkTool {\n return {\n description: tool.description,\n parameters: tool.schema,\n execute: (args) => this.callMethod(tool.method, args),\n }\n }\n}\n"],"mappings":";;;;;;AAMO,IAAM,mBAAN,cAA+B,WAAsB;AAAA,EACxD,YAAY,QAA0B;AAClC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,UAAU,MAAuB;AACvC,WAAO;AAAA,MACH,aAAa,KAAK;AAAA,MAClB,YAAY,KAAK;AAAA,MACjB,SAAS,CAAC,SAAS,KAAK,WAAW,KAAK,QAAQ,IAAI;AAAA,IACxD;AAAA,EACJ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/ai-sdk.ts"],"sourcesContent":["import { type Tool as AiSdkTool } from 'ai'\nimport { AgentMailClient } from 'agentmail'\n\nimport { MapToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends MapToolkit<AiSdkTool> {\n constructor(client?: AgentMailClient) {\n super(client)\n }\n\n protected buildTool(tool: Tool): AiSdkTool {\n return {\n description: tool.description,\n parameters: tool.schema,\n execute: (args) => this.callMethod(tool.method, args),\n }\n }\n}\n"],"mappings":";;;;;;;AAMO,IAAM,mBAAN,cAA+B,WAAsB;AAAA,EACxD,YAAY,QAA0B;AAClC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,UAAU,MAAuB;AACvC,WAAO;AAAA,MACH,aAAa,KAAK;AAAA,MAClB,YAAY,KAAK;AAAA,MACjB,SAAS,CAAC,SAAS,KAAK,WAAW,KAAK,QAAQ,IAAI;AAAA,IACxD;AAAA,EACJ;AACJ;","names":[]}
@@ -0,0 +1,29 @@
1
+ // src/wrapper.ts
2
+ import { AgentMailClient } from "agentmail";
3
+ var Wrapper = class {
4
+ constructor(client) {
5
+ this.client = client;
6
+ if (!this.client) this.client = new AgentMailClient();
7
+ }
8
+ async callMethod(method, args) {
9
+ const parts = method.split(".");
10
+ const methodKey = parts.pop();
11
+ if (!methodKey) throw new Error("Method name empty");
12
+ let parent = this.client;
13
+ for (const part of parts) parent = parent[part];
14
+ return await parent[methodKey].call(parent, args);
15
+ }
16
+ async callMethodAndStringify(method, args) {
17
+ try {
18
+ const result = await this.callMethod(method, args);
19
+ return JSON.stringify(result, null, 2);
20
+ } catch (error) {
21
+ return JSON.stringify(error, null, 2);
22
+ }
23
+ }
24
+ };
25
+
26
+ export {
27
+ Wrapper
28
+ };
29
+ //# sourceMappingURL=chunk-3TR24M4E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/wrapper.ts"],"sourcesContent":["import { AgentMailClient } from 'agentmail'\n\nexport class Wrapper {\n constructor(private readonly client?: AgentMailClient) {\n if (!this.client) this.client = new AgentMailClient()\n }\n\n public async callMethod(method: string, args: unknown) {\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 return await parent[methodKey].call(parent, args)\n }\n\n public async callMethodAndStringify(method: string, args: unknown) {\n try {\n const result = await this.callMethod(method, args)\n return JSON.stringify(result, null, 2)\n } catch (error) {\n return JSON.stringify(error, null, 2)\n }\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAEzB,IAAM,UAAN,MAAc;AAAA,EACjB,YAA6B,QAA0B;AAA1B;AACzB,QAAI,CAAC,KAAK,OAAQ,MAAK,SAAS,IAAI,gBAAgB;AAAA,EACxD;AAAA,EAEA,MAAa,WAAW,QAAgB,MAAe;AACnD,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,WAAO,MAAM,OAAO,SAAS,EAAE,KAAK,QAAQ,IAAI;AAAA,EACpD;AAAA,EAEA,MAAa,uBAAuB,QAAgB,MAAe;AAC/D,QAAI;AACA,YAAM,SAAS,MAAM,KAAK,WAAW,QAAQ,IAAI;AACjD,aAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AAAA,IACzC,SAAS,OAAO;AACZ,aAAO,KAAK,UAAU,OAAO,MAAM,CAAC;AAAA,IACxC;AAAA,EACJ;AACJ;","names":[]}
@@ -0,0 +1,40 @@
1
+ import {
2
+ Wrapper
3
+ } from "./chunk-3TR24M4E.mjs";
4
+ import {
5
+ tools
6
+ } from "./chunk-QBOE34GE.mjs";
7
+
8
+ // src/toolkit.ts
9
+ var ListToolkit = class extends Wrapper {
10
+ tools = [];
11
+ constructor(client) {
12
+ super(client);
13
+ this.tools = tools.map((tool) => this.buildTool(tool));
14
+ }
15
+ getTools() {
16
+ return this.tools;
17
+ }
18
+ };
19
+ var MapToolkit = class extends Wrapper {
20
+ tools = {};
21
+ constructor(client) {
22
+ super(client);
23
+ this.tools = tools.reduce(
24
+ (acc, tool) => {
25
+ acc[tool.name] = this.buildTool(tool);
26
+ return acc;
27
+ },
28
+ {}
29
+ );
30
+ }
31
+ getTools() {
32
+ return this.tools;
33
+ }
34
+ };
35
+
36
+ export {
37
+ ListToolkit,
38
+ MapToolkit
39
+ };
40
+ //# sourceMappingURL=chunk-H3V5ORVZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/toolkit.ts"],"sourcesContent":["import { AgentMailClient } from 'agentmail'\n\nimport { Wrapper } from './wrapper'\nimport { type Tool, tools } from './tools'\n\nexport abstract class ListToolkit<T> extends Wrapper {\n protected readonly tools: T[] = []\n\n constructor(client?: AgentMailClient) {\n super(client)\n\n this.tools = tools.map((tool) => this.buildTool(tool))\n }\n\n protected abstract buildTool(tool: Tool): T\n\n public getTools() {\n return this.tools\n }\n}\n\nexport abstract class MapToolkit<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 public getTools() {\n return this.tools\n }\n}\n"],"mappings":";;;;;;;;AAKO,IAAe,cAAf,cAAsC,QAAQ;AAAA,EAC9B,QAAa,CAAC;AAAA,EAEjC,YAAY,QAA0B;AAClC,UAAM,MAAM;AAEZ,SAAK,QAAQ,MAAM,IAAI,CAAC,SAAS,KAAK,UAAU,IAAI,CAAC;AAAA,EACzD;AAAA,EAIO,WAAW;AACd,WAAO,KAAK;AAAA,EAChB;AACJ;AAEO,IAAe,aAAf,cAAqC,QAAQ;AAAA,EAC7B,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;AAAA,EAIO,WAAW;AACd,WAAO,KAAK;AAAA,EAChB;AACJ;","names":[]}
@@ -0,0 +1,129 @@
1
+ // src/schemas.ts
2
+ import { z } from "zod";
3
+ var ListItemsParams = z.object({
4
+ limit: z.number().optional().describe("The maximum number of items to return"),
5
+ last_key: z.string().optional().describe("The last key to use for pagination")
6
+ });
7
+ var GetInboxParams = z.object({
8
+ inbox_id: z.string().describe("The ID of the inbox to get")
9
+ });
10
+ var CreateInboxParams = z.object({
11
+ username: z.string().optional().describe("The username of the inbox to create"),
12
+ domain: z.string().optional().describe("The domain of the inbox to create"),
13
+ display_name: z.string().optional().describe("The display name of the inbox to create")
14
+ });
15
+ var ListThreadsParams = ListItemsParams.extend({
16
+ inbox_id: z.string().describe("The ID of the inbox to list threads for"),
17
+ labels: z.array(z.string()).optional().describe("The labels to filter threads by")
18
+ });
19
+ var GetThreadParams = z.object({
20
+ inbox_id: z.string().describe("The ID of the inbox to get the thread for"),
21
+ thread_id: z.string().describe("The ID of the thread to get")
22
+ });
23
+ var ListMessagesParams = ListItemsParams.extend({
24
+ inbox_id: z.string().describe("The ID of the inbox to list messages for"),
25
+ labels: z.array(z.string()).optional().describe("The labels to filter messages by")
26
+ });
27
+ var GetMessageParams = z.object({
28
+ inbox_id: z.string().describe("The ID of the inbox to get the message for"),
29
+ message_id: z.string().describe("The ID of the message to get")
30
+ });
31
+ var GetAttachmentParams = z.object({
32
+ inbox_id: z.string().describe("The ID of the inbox to get the attachment for"),
33
+ message_id: z.string().describe("The ID of the message to get the attachment for"),
34
+ attachment_id: z.string().describe("The ID of the attachment to get")
35
+ });
36
+ var SendMessageParams = z.object({
37
+ inbox_id: z.string().describe("The ID of the inbox to send the message from"),
38
+ to: z.array(z.string()).describe("The list of recipients"),
39
+ cc: z.array(z.string()).optional().describe("The list of CC recipients"),
40
+ bcc: z.array(z.string()).optional().describe("The list of BCC recipients"),
41
+ subject: z.string().optional().describe("The subject of the message"),
42
+ text: z.string().optional().describe("The plain text body of the message"),
43
+ html: z.string().optional().describe("The HTML body of the message")
44
+ });
45
+ var ReplyToMessageParams = z.object({
46
+ inbox_id: z.string().describe("The inbox ID of the inbox to reply to the message from"),
47
+ message_id: z.string().describe("The message ID of the message you wish to reply to"),
48
+ text: z.string().optional().describe("The plain text body of the reply"),
49
+ html: z.string().optional().describe("The HTML body of the reply")
50
+ });
51
+
52
+ // src/tools.ts
53
+ var tools = [
54
+ {
55
+ name: "list_inboxes",
56
+ method: "inboxes.list",
57
+ description: "List all inboxes",
58
+ schema: ListItemsParams
59
+ },
60
+ {
61
+ name: "get_inbox",
62
+ method: "inboxes.get",
63
+ description: "Get an inbox by ID",
64
+ schema: GetInboxParams
65
+ },
66
+ {
67
+ name: "create_inbox",
68
+ method: "inboxes.create",
69
+ description: "Create a new inbox",
70
+ schema: CreateInboxParams
71
+ },
72
+ {
73
+ name: "list_threads",
74
+ method: "threads.list",
75
+ description: "List all threads",
76
+ schema: ListThreadsParams
77
+ },
78
+ {
79
+ name: "get_thread",
80
+ method: "threads.get",
81
+ description: "Get a thread by ID",
82
+ schema: GetThreadParams
83
+ },
84
+ {
85
+ name: "list_messages",
86
+ method: "messages.list",
87
+ description: "List all messages",
88
+ schema: ListMessagesParams
89
+ },
90
+ {
91
+ name: "get_message",
92
+ method: "messages.get",
93
+ description: "Get a message by ID",
94
+ schema: GetMessageParams
95
+ },
96
+ {
97
+ name: "get_attachment",
98
+ method: "attachments.get",
99
+ description: "Get an attachment by ID",
100
+ schema: GetAttachmentParams
101
+ },
102
+ {
103
+ name: "send_message",
104
+ method: "messages.send",
105
+ description: "Send a message",
106
+ schema: SendMessageParams
107
+ },
108
+ {
109
+ name: "reply_to_message",
110
+ method: "messages.reply",
111
+ description: "Reply to a message",
112
+ schema: ReplyToMessageParams
113
+ }
114
+ ];
115
+
116
+ export {
117
+ ListItemsParams,
118
+ GetInboxParams,
119
+ CreateInboxParams,
120
+ ListThreadsParams,
121
+ GetThreadParams,
122
+ ListMessagesParams,
123
+ GetMessageParams,
124
+ GetAttachmentParams,
125
+ SendMessageParams,
126
+ ReplyToMessageParams,
127
+ tools
128
+ };
129
+ //# sourceMappingURL=chunk-QBOE34GE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas.ts","../src/tools.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const ListItemsParams = z.object({\n limit: z.number().optional().describe('The maximum number of items to return'),\n last_key: z.string().optional().describe('The last key to use for pagination'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('The username of the inbox to create'),\n domain: z.string().optional().describe('The domain of the inbox to create'),\n display_name: z.string().optional().describe('The display name of the inbox to create'),\n})\n\nexport const ListThreadsParams = ListItemsParams.extend({\n inbox_id: z.string().describe('The ID of the inbox to list threads for'),\n labels: z.array(z.string()).optional().describe('The labels to filter threads by'),\n})\n\nexport const GetThreadParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the thread for'),\n thread_id: z.string().describe('The ID of the thread to get'),\n})\n\nexport const ListMessagesParams = ListItemsParams.extend({\n inbox_id: z.string().describe('The ID of the inbox to list messages for'),\n labels: z.array(z.string()).optional().describe('The labels to filter messages by'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the message for'),\n message_id: z.string().describe('The ID of the message to get'),\n})\n\nexport const GetAttachmentParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the attachment for'),\n message_id: z.string().describe('The ID of the message to get the attachment for'),\n attachment_id: z.string().describe('The ID of the attachment to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to send the message from'),\n to: z.array(z.string()).describe('The list of recipients'),\n cc: z.array(z.string()).optional().describe('The list of CC recipients'),\n bcc: z.array(z.string()).optional().describe('The list of BCC recipients'),\n subject: z.string().optional().describe('The subject of the message'),\n text: z.string().optional().describe('The plain text body of the message'),\n html: z.string().optional().describe('The HTML body of the message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('The inbox ID of the inbox to reply to the message from'),\n message_id: z.string().describe('The message ID of the message you wish to reply to'),\n text: z.string().optional().describe('The plain text body of the reply'),\n html: z.string().optional().describe('The HTML body of the reply'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n GetAttachmentParams,\n SendMessageParams,\n ReplyToMessageParams,\n} from './schemas'\n\nexport type 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 all inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get an inbox by ID',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create a new inbox',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'threads.list',\n description: 'List all threads',\n schema: ListThreadsParams,\n },\n {\n name: 'get_thread',\n method: 'threads.get',\n description: 'Get a thread by ID',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'messages.list',\n description: 'List all messages',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'messages.get',\n description: 'Get a message by ID',\n schema: GetMessageParams,\n },\n {\n name: 'get_attachment',\n method: 'attachments.get',\n description: 'Get an attachment by ID',\n schema: GetAttachmentParams,\n },\n {\n name: 'send_message',\n method: 'messages.send',\n description: 'Send a message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'messages.reply',\n description: 'Reply to a message',\n schema: ReplyToMessageParams,\n },\n]\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,kBAAkB,EAAE,OAAO;AAAA,EACpC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,uCAAuC;AAAA,EAC7E,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oCAAoC;AACjF,CAAC;AAEM,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACnC,UAAU,EAAE,OAAO,EAAE,SAAS,4BAA4B;AAC9D,CAAC;AAEM,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACtC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,qCAAqC;AAAA,EAC9E,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mCAAmC;AAAA,EAC1E,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,yCAAyC;AAC1F,CAAC;AAEM,IAAM,oBAAoB,gBAAgB,OAAO;AAAA,EACpD,UAAU,EAAE,OAAO,EAAE,SAAS,yCAAyC;AAAA,EACvE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,iCAAiC;AACrF,CAAC;AAEM,IAAM,kBAAkB,EAAE,OAAO;AAAA,EACpC,UAAU,EAAE,OAAO,EA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AAE,SAAS,oDAAoD;AAAA,EACpF,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,4BAA4B;AACrE,CAAC;;;ACpCM,IAAM,QAAgB;AAAA,EACzB;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AACJ;","names":[]}
@@ -0,0 +1,143 @@
1
+ import { z } from 'zod';
2
+ export { T as Tool, t as tools } from './tools-DFoMkoW0.mjs';
3
+
4
+ declare const ListItemsParams: z.ZodObject<{
5
+ limit: z.ZodOptional<z.ZodNumber>;
6
+ last_key: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ limit?: number | undefined;
9
+ last_key?: string | undefined;
10
+ }, {
11
+ limit?: number | undefined;
12
+ last_key?: string | undefined;
13
+ }>;
14
+ declare const GetInboxParams: z.ZodObject<{
15
+ inbox_id: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ inbox_id: string;
18
+ }, {
19
+ inbox_id: string;
20
+ }>;
21
+ declare const CreateInboxParams: z.ZodObject<{
22
+ username: z.ZodOptional<z.ZodString>;
23
+ domain: z.ZodOptional<z.ZodString>;
24
+ display_name: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ username?: string | undefined;
27
+ domain?: string | undefined;
28
+ display_name?: string | undefined;
29
+ }, {
30
+ username?: string | undefined;
31
+ domain?: string | undefined;
32
+ display_name?: string | undefined;
33
+ }>;
34
+ declare const ListThreadsParams: z.ZodObject<z.objectUtil.extendShape<{
35
+ limit: z.ZodOptional<z.ZodNumber>;
36
+ last_key: z.ZodOptional<z.ZodString>;
37
+ }, {
38
+ inbox_id: z.ZodString;
39
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ }>, "strip", z.ZodTypeAny, {
41
+ inbox_id: string;
42
+ limit?: number | undefined;
43
+ last_key?: string | undefined;
44
+ labels?: string[] | undefined;
45
+ }, {
46
+ inbox_id: string;
47
+ limit?: number | undefined;
48
+ last_key?: string | undefined;
49
+ labels?: string[] | undefined;
50
+ }>;
51
+ declare const GetThreadParams: z.ZodObject<{
52
+ inbox_id: z.ZodString;
53
+ thread_id: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ inbox_id: string;
56
+ thread_id: string;
57
+ }, {
58
+ inbox_id: string;
59
+ thread_id: string;
60
+ }>;
61
+ declare const ListMessagesParams: z.ZodObject<z.objectUtil.extendShape<{
62
+ limit: z.ZodOptional<z.ZodNumber>;
63
+ last_key: z.ZodOptional<z.ZodString>;
64
+ }, {
65
+ inbox_id: z.ZodString;
66
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
67
+ }>, "strip", z.ZodTypeAny, {
68
+ inbox_id: string;
69
+ limit?: number | undefined;
70
+ last_key?: string | undefined;
71
+ labels?: string[] | undefined;
72
+ }, {
73
+ inbox_id: string;
74
+ limit?: number | undefined;
75
+ last_key?: string | undefined;
76
+ labels?: string[] | undefined;
77
+ }>;
78
+ declare const GetMessageParams: z.ZodObject<{
79
+ inbox_id: z.ZodString;
80
+ message_id: z.ZodString;
81
+ }, "strip", z.ZodTypeAny, {
82
+ inbox_id: string;
83
+ message_id: string;
84
+ }, {
85
+ inbox_id: string;
86
+ message_id: string;
87
+ }>;
88
+ declare const GetAttachmentParams: z.ZodObject<{
89
+ inbox_id: z.ZodString;
90
+ message_id: z.ZodString;
91
+ attachment_id: z.ZodString;
92
+ }, "strip", z.ZodTypeAny, {
93
+ inbox_id: string;
94
+ message_id: string;
95
+ attachment_id: string;
96
+ }, {
97
+ inbox_id: string;
98
+ message_id: string;
99
+ attachment_id: string;
100
+ }>;
101
+ declare const SendMessageParams: z.ZodObject<{
102
+ inbox_id: z.ZodString;
103
+ to: z.ZodArray<z.ZodString, "many">;
104
+ cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
105
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
+ subject: z.ZodOptional<z.ZodString>;
107
+ text: z.ZodOptional<z.ZodString>;
108
+ html: z.ZodOptional<z.ZodString>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ inbox_id: string;
111
+ to: string[];
112
+ cc?: string[] | undefined;
113
+ bcc?: string[] | undefined;
114
+ subject?: string | undefined;
115
+ text?: string | undefined;
116
+ html?: string | undefined;
117
+ }, {
118
+ inbox_id: string;
119
+ to: string[];
120
+ cc?: string[] | undefined;
121
+ bcc?: string[] | undefined;
122
+ subject?: string | undefined;
123
+ text?: string | undefined;
124
+ html?: string | undefined;
125
+ }>;
126
+ declare const ReplyToMessageParams: z.ZodObject<{
127
+ inbox_id: z.ZodString;
128
+ message_id: z.ZodString;
129
+ text: z.ZodOptional<z.ZodString>;
130
+ html: z.ZodOptional<z.ZodString>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ inbox_id: string;
133
+ message_id: string;
134
+ text?: string | undefined;
135
+ html?: string | undefined;
136
+ }, {
137
+ inbox_id: string;
138
+ message_id: string;
139
+ text?: string | undefined;
140
+ html?: string | undefined;
141
+ }>;
142
+
143
+ export { CreateInboxParams, GetAttachmentParams, GetInboxParams, GetMessageParams, GetThreadParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendMessageParams };
@@ -0,0 +1,143 @@
1
+ import { z } from 'zod';
2
+ export { T as Tool, t as tools } from './tools-DFoMkoW0.js';
3
+
4
+ declare const ListItemsParams: z.ZodObject<{
5
+ limit: z.ZodOptional<z.ZodNumber>;
6
+ last_key: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ limit?: number | undefined;
9
+ last_key?: string | undefined;
10
+ }, {
11
+ limit?: number | undefined;
12
+ last_key?: string | undefined;
13
+ }>;
14
+ declare const GetInboxParams: z.ZodObject<{
15
+ inbox_id: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ inbox_id: string;
18
+ }, {
19
+ inbox_id: string;
20
+ }>;
21
+ declare const CreateInboxParams: z.ZodObject<{
22
+ username: z.ZodOptional<z.ZodString>;
23
+ domain: z.ZodOptional<z.ZodString>;
24
+ display_name: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ username?: string | undefined;
27
+ domain?: string | undefined;
28
+ display_name?: string | undefined;
29
+ }, {
30
+ username?: string | undefined;
31
+ domain?: string | undefined;
32
+ display_name?: string | undefined;
33
+ }>;
34
+ declare const ListThreadsParams: z.ZodObject<z.objectUtil.extendShape<{
35
+ limit: z.ZodOptional<z.ZodNumber>;
36
+ last_key: z.ZodOptional<z.ZodString>;
37
+ }, {
38
+ inbox_id: z.ZodString;
39
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ }>, "strip", z.ZodTypeAny, {
41
+ inbox_id: string;
42
+ limit?: number | undefined;
43
+ last_key?: string | undefined;
44
+ labels?: string[] | undefined;
45
+ }, {
46
+ inbox_id: string;
47
+ limit?: number | undefined;
48
+ last_key?: string | undefined;
49
+ labels?: string[] | undefined;
50
+ }>;
51
+ declare const GetThreadParams: z.ZodObject<{
52
+ inbox_id: z.ZodString;
53
+ thread_id: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ inbox_id: string;
56
+ thread_id: string;
57
+ }, {
58
+ inbox_id: string;
59
+ thread_id: string;
60
+ }>;
61
+ declare const ListMessagesParams: z.ZodObject<z.objectUtil.extendShape<{
62
+ limit: z.ZodOptional<z.ZodNumber>;
63
+ last_key: z.ZodOptional<z.ZodString>;
64
+ }, {
65
+ inbox_id: z.ZodString;
66
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
67
+ }>, "strip", z.ZodTypeAny, {
68
+ inbox_id: string;
69
+ limit?: number | undefined;
70
+ last_key?: string | undefined;
71
+ labels?: string[] | undefined;
72
+ }, {
73
+ inbox_id: string;
74
+ limit?: number | undefined;
75
+ last_key?: string | undefined;
76
+ labels?: string[] | undefined;
77
+ }>;
78
+ declare const GetMessageParams: z.ZodObject<{
79
+ inbox_id: z.ZodString;
80
+ message_id: z.ZodString;
81
+ }, "strip", z.ZodTypeAny, {
82
+ inbox_id: string;
83
+ message_id: string;
84
+ }, {
85
+ inbox_id: string;
86
+ message_id: string;
87
+ }>;
88
+ declare const GetAttachmentParams: z.ZodObject<{
89
+ inbox_id: z.ZodString;
90
+ message_id: z.ZodString;
91
+ attachment_id: z.ZodString;
92
+ }, "strip", z.ZodTypeAny, {
93
+ inbox_id: string;
94
+ message_id: string;
95
+ attachment_id: string;
96
+ }, {
97
+ inbox_id: string;
98
+ message_id: string;
99
+ attachment_id: string;
100
+ }>;
101
+ declare const SendMessageParams: z.ZodObject<{
102
+ inbox_id: z.ZodString;
103
+ to: z.ZodArray<z.ZodString, "many">;
104
+ cc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
105
+ bcc: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
+ subject: z.ZodOptional<z.ZodString>;
107
+ text: z.ZodOptional<z.ZodString>;
108
+ html: z.ZodOptional<z.ZodString>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ inbox_id: string;
111
+ to: string[];
112
+ cc?: string[] | undefined;
113
+ bcc?: string[] | undefined;
114
+ subject?: string | undefined;
115
+ text?: string | undefined;
116
+ html?: string | undefined;
117
+ }, {
118
+ inbox_id: string;
119
+ to: string[];
120
+ cc?: string[] | undefined;
121
+ bcc?: string[] | undefined;
122
+ subject?: string | undefined;
123
+ text?: string | undefined;
124
+ html?: string | undefined;
125
+ }>;
126
+ declare const ReplyToMessageParams: z.ZodObject<{
127
+ inbox_id: z.ZodString;
128
+ message_id: z.ZodString;
129
+ text: z.ZodOptional<z.ZodString>;
130
+ html: z.ZodOptional<z.ZodString>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ inbox_id: string;
133
+ message_id: string;
134
+ text?: string | undefined;
135
+ html?: string | undefined;
136
+ }, {
137
+ inbox_id: string;
138
+ message_id: string;
139
+ text?: string | undefined;
140
+ html?: string | undefined;
141
+ }>;
142
+
143
+ export { CreateInboxParams, GetAttachmentParams, GetInboxParams, GetMessageParams, GetThreadParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendMessageParams };
package/dist/index.js ADDED
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ CreateInboxParams: () => CreateInboxParams,
24
+ GetAttachmentParams: () => GetAttachmentParams,
25
+ GetInboxParams: () => GetInboxParams,
26
+ GetMessageParams: () => GetMessageParams,
27
+ GetThreadParams: () => GetThreadParams,
28
+ ListItemsParams: () => ListItemsParams,
29
+ ListMessagesParams: () => ListMessagesParams,
30
+ ListThreadsParams: () => ListThreadsParams,
31
+ ReplyToMessageParams: () => ReplyToMessageParams,
32
+ SendMessageParams: () => SendMessageParams,
33
+ tools: () => tools
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/schemas.ts
38
+ var import_zod = require("zod");
39
+ var ListItemsParams = import_zod.z.object({
40
+ limit: import_zod.z.number().optional().describe("The maximum number of items to return"),
41
+ last_key: import_zod.z.string().optional().describe("The last key to use for pagination")
42
+ });
43
+ var GetInboxParams = import_zod.z.object({
44
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to get")
45
+ });
46
+ var CreateInboxParams = import_zod.z.object({
47
+ username: import_zod.z.string().optional().describe("The username of the inbox to create"),
48
+ domain: import_zod.z.string().optional().describe("The domain of the inbox to create"),
49
+ display_name: import_zod.z.string().optional().describe("The display name of the inbox to create")
50
+ });
51
+ var ListThreadsParams = ListItemsParams.extend({
52
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to list threads for"),
53
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("The labels to filter threads by")
54
+ });
55
+ var GetThreadParams = import_zod.z.object({
56
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to get the thread for"),
57
+ thread_id: import_zod.z.string().describe("The ID of the thread to get")
58
+ });
59
+ var ListMessagesParams = ListItemsParams.extend({
60
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to list messages for"),
61
+ labels: import_zod.z.array(import_zod.z.string()).optional().describe("The labels to filter messages by")
62
+ });
63
+ var GetMessageParams = import_zod.z.object({
64
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to get the message for"),
65
+ message_id: import_zod.z.string().describe("The ID of the message to get")
66
+ });
67
+ var GetAttachmentParams = import_zod.z.object({
68
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to get the attachment for"),
69
+ message_id: import_zod.z.string().describe("The ID of the message to get the attachment for"),
70
+ attachment_id: import_zod.z.string().describe("The ID of the attachment to get")
71
+ });
72
+ var SendMessageParams = import_zod.z.object({
73
+ inbox_id: import_zod.z.string().describe("The ID of the inbox to send the message from"),
74
+ to: import_zod.z.array(import_zod.z.string()).describe("The list of recipients"),
75
+ cc: import_zod.z.array(import_zod.z.string()).optional().describe("The list of CC recipients"),
76
+ bcc: import_zod.z.array(import_zod.z.string()).optional().describe("The list of BCC recipients"),
77
+ subject: import_zod.z.string().optional().describe("The subject of the message"),
78
+ text: import_zod.z.string().optional().describe("The plain text body of the message"),
79
+ html: import_zod.z.string().optional().describe("The HTML body of the message")
80
+ });
81
+ var ReplyToMessageParams = import_zod.z.object({
82
+ inbox_id: import_zod.z.string().describe("The inbox ID of the inbox to reply to the message from"),
83
+ message_id: import_zod.z.string().describe("The message ID of the message you wish to reply to"),
84
+ text: import_zod.z.string().optional().describe("The plain text body of the reply"),
85
+ html: import_zod.z.string().optional().describe("The HTML body of the reply")
86
+ });
87
+
88
+ // src/tools.ts
89
+ var tools = [
90
+ {
91
+ name: "list_inboxes",
92
+ method: "inboxes.list",
93
+ description: "List all inboxes",
94
+ schema: ListItemsParams
95
+ },
96
+ {
97
+ name: "get_inbox",
98
+ method: "inboxes.get",
99
+ description: "Get an inbox by ID",
100
+ schema: GetInboxParams
101
+ },
102
+ {
103
+ name: "create_inbox",
104
+ method: "inboxes.create",
105
+ description: "Create a new inbox",
106
+ schema: CreateInboxParams
107
+ },
108
+ {
109
+ name: "list_threads",
110
+ method: "threads.list",
111
+ description: "List all threads",
112
+ schema: ListThreadsParams
113
+ },
114
+ {
115
+ name: "get_thread",
116
+ method: "threads.get",
117
+ description: "Get a thread by ID",
118
+ schema: GetThreadParams
119
+ },
120
+ {
121
+ name: "list_messages",
122
+ method: "messages.list",
123
+ description: "List all messages",
124
+ schema: ListMessagesParams
125
+ },
126
+ {
127
+ name: "get_message",
128
+ method: "messages.get",
129
+ description: "Get a message by ID",
130
+ schema: GetMessageParams
131
+ },
132
+ {
133
+ name: "get_attachment",
134
+ method: "attachments.get",
135
+ description: "Get an attachment by ID",
136
+ schema: GetAttachmentParams
137
+ },
138
+ {
139
+ name: "send_message",
140
+ method: "messages.send",
141
+ description: "Send a message",
142
+ schema: SendMessageParams
143
+ },
144
+ {
145
+ name: "reply_to_message",
146
+ method: "messages.reply",
147
+ description: "Reply to a message",
148
+ schema: ReplyToMessageParams
149
+ }
150
+ ];
151
+ // Annotate the CommonJS export names for ESM import in node:
152
+ 0 && (module.exports = {
153
+ CreateInboxParams,
154
+ GetAttachmentParams,
155
+ GetInboxParams,
156
+ GetMessageParams,
157
+ GetThreadParams,
158
+ ListItemsParams,
159
+ ListMessagesParams,
160
+ ListThreadsParams,
161
+ ReplyToMessageParams,
162
+ SendMessageParams,
163
+ tools
164
+ });
165
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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('The maximum number of items to return'),\n last_key: z.string().optional().describe('The last key to use for pagination'),\n})\n\nexport const GetInboxParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get'),\n})\n\nexport const CreateInboxParams = z.object({\n username: z.string().optional().describe('The username of the inbox to create'),\n domain: z.string().optional().describe('The domain of the inbox to create'),\n display_name: z.string().optional().describe('The display name of the inbox to create'),\n})\n\nexport const ListThreadsParams = ListItemsParams.extend({\n inbox_id: z.string().describe('The ID of the inbox to list threads for'),\n labels: z.array(z.string()).optional().describe('The labels to filter threads by'),\n})\n\nexport const GetThreadParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the thread for'),\n thread_id: z.string().describe('The ID of the thread to get'),\n})\n\nexport const ListMessagesParams = ListItemsParams.extend({\n inbox_id: z.string().describe('The ID of the inbox to list messages for'),\n labels: z.array(z.string()).optional().describe('The labels to filter messages by'),\n})\n\nexport const GetMessageParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the message for'),\n message_id: z.string().describe('The ID of the message to get'),\n})\n\nexport const GetAttachmentParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to get the attachment for'),\n message_id: z.string().describe('The ID of the message to get the attachment for'),\n attachment_id: z.string().describe('The ID of the attachment to get'),\n})\n\nexport const SendMessageParams = z.object({\n inbox_id: z.string().describe('The ID of the inbox to send the message from'),\n to: z.array(z.string()).describe('The list of recipients'),\n cc: z.array(z.string()).optional().describe('The list of CC recipients'),\n bcc: z.array(z.string()).optional().describe('The list of BCC recipients'),\n subject: z.string().optional().describe('The subject of the message'),\n text: z.string().optional().describe('The plain text body of the message'),\n html: z.string().optional().describe('The HTML body of the message'),\n})\n\nexport const ReplyToMessageParams = z.object({\n inbox_id: z.string().describe('The inbox ID of the inbox to reply to the message from'),\n message_id: z.string().describe('The message ID of the message you wish to reply to'),\n text: z.string().optional().describe('The plain text body of the reply'),\n html: z.string().optional().describe('The HTML body of the reply'),\n})\n","import { AnyZodObject } from 'zod'\n\nimport {\n ListItemsParams,\n GetInboxParams,\n CreateInboxParams,\n ListThreadsParams,\n GetThreadParams,\n ListMessagesParams,\n GetMessageParams,\n GetAttachmentParams,\n SendMessageParams,\n ReplyToMessageParams,\n} from './schemas'\n\nexport type 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 all inboxes',\n schema: ListItemsParams,\n },\n {\n name: 'get_inbox',\n method: 'inboxes.get',\n description: 'Get an inbox by ID',\n schema: GetInboxParams,\n },\n {\n name: 'create_inbox',\n method: 'inboxes.create',\n description: 'Create a new inbox',\n schema: CreateInboxParams,\n },\n {\n name: 'list_threads',\n method: 'threads.list',\n description: 'List all threads',\n schema: ListThreadsParams,\n },\n {\n name: 'get_thread',\n method: 'threads.get',\n description: 'Get a thread by ID',\n schema: GetThreadParams,\n },\n {\n name: 'list_messages',\n method: 'messages.list',\n description: 'List all messages',\n schema: ListMessagesParams,\n },\n {\n name: 'get_message',\n method: 'messages.get',\n description: 'Get a message by ID',\n schema: GetMessageParams,\n },\n {\n name: 'get_attachment',\n method: 'attachments.get',\n description: 'Get an attachment by ID',\n schema: GetAttachmentParams,\n },\n {\n name: 'send_message',\n method: 'messages.send',\n description: 'Send a message',\n schema: SendMessageParams,\n },\n {\n name: 'reply_to_message',\n method: 'messages.reply',\n description: 'Reply to a message',\n schema: ReplyToMessageParams,\n },\n]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;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,uCAAuC;AAAA,EAC7E,UAAU,aAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oCAAoC;AACjF,CAAC;AAEM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACnC,UAAU,aAAE,OAAO,EAAE,SAAS,4BAA4B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AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;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 ADDED
@@ -0,0 +1,27 @@
1
+ import {
2
+ CreateInboxParams,
3
+ GetAttachmentParams,
4
+ GetInboxParams,
5
+ GetMessageParams,
6
+ GetThreadParams,
7
+ ListItemsParams,
8
+ ListMessagesParams,
9
+ ListThreadsParams,
10
+ ReplyToMessageParams,
11
+ SendMessageParams,
12
+ tools
13
+ } from "./chunk-QBOE34GE.mjs";
14
+ export {
15
+ CreateInboxParams,
16
+ GetAttachmentParams,
17
+ GetInboxParams,
18
+ GetMessageParams,
19
+ GetThreadParams,
20
+ ListItemsParams,
21
+ ListMessagesParams,
22
+ ListThreadsParams,
23
+ ReplyToMessageParams,
24
+ SendMessageParams,
25
+ tools
26
+ };
27
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,6 +1,7 @@
1
1
  import { StructuredTool } from '@langchain/core/tools';
2
2
  import { AgentMailClient } from 'agentmail';
3
- import { L as ListToolkit, T as Tool } from './toolkit-oWNeOd1D.mjs';
3
+ import { L as ListToolkit } from './toolkit-DtDXApKD.mjs';
4
+ import { T as Tool } from './tools-DFoMkoW0.mjs';
4
5
  import 'zod';
5
6
 
6
7
  declare class AgentMailToolkit extends ListToolkit<StructuredTool> {
@@ -1,6 +1,7 @@
1
1
  import { StructuredTool } from '@langchain/core/tools';
2
2
  import { AgentMailClient } from 'agentmail';
3
- import { L as ListToolkit, T as Tool } from './toolkit-oWNeOd1D.js';
3
+ import { L as ListToolkit } from './toolkit-Dc7siZcx.js';
4
+ import { T as Tool } from './tools-DFoMkoW0.js';
4
5
  import 'zod';
5
6
 
6
7
  declare class AgentMailToolkit extends ListToolkit<StructuredTool> {
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  ListToolkit
3
- } from "./chunk-UCWHGUXO.mjs";
4
- import "./chunk-GZAAHMW6.mjs";
3
+ } from "./chunk-H3V5ORVZ.mjs";
4
+ import "./chunk-3TR24M4E.mjs";
5
+ import "./chunk-QBOE34GE.mjs";
5
6
 
6
7
  // src/langchain.ts
7
8
  import { tool as langchainTool } from "@langchain/core/tools";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { type StructuredTool, tool as langchainTool } from '@langchain/core/tools'\nimport { AgentMailClient } from 'agentmail'\n\nimport { ListToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends ListToolkit<StructuredTool> {\n constructor(client?: AgentMailClient) {\n super(client)\n }\n\n protected buildTool(tool: Tool): StructuredTool {\n return langchainTool((args) => this.callMethodAndStringify(tool.method, args), {\n name: tool.name,\n description: tool.description,\n schema: tool.schema,\n })\n }\n}\n"],"mappings":";;;;;;AAAA,SAA8B,QAAQ,qBAAqB;AAMpD,IAAM,mBAAN,cAA+B,YAA4B;AAAA,EAC9D,YAAY,QAA0B;AAClC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,UAAU,MAA4B;AAC5C,WAAO,cAAc,CAAC,SAAS,KAAK,uBAAuB,KAAK,QAAQ,IAAI,GAAG;AAAA,MAC3E,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/langchain.ts"],"sourcesContent":["import { type StructuredTool, tool as langchainTool } from '@langchain/core/tools'\nimport { AgentMailClient } from 'agentmail'\n\nimport { ListToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\nexport class AgentMailToolkit extends ListToolkit<StructuredTool> {\n constructor(client?: AgentMailClient) {\n super(client)\n }\n\n protected buildTool(tool: Tool): StructuredTool {\n return langchainTool((args) => this.callMethodAndStringify(tool.method, args), {\n name: tool.name,\n description: tool.description,\n schema: tool.schema,\n })\n }\n}\n"],"mappings":";;;;;;;AAAA,SAA8B,QAAQ,qBAAqB;AAMpD,IAAM,mBAAN,cAA+B,YAA4B;AAAA,EAC9D,YAAY,QAA0B;AAClC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,UAAU,MAA4B;AAC5C,WAAO,cAAc,CAAC,SAAS,KAAK,uBAAuB,KAAK,QAAQ,IAAI,GAAG;AAAA,MAC3E,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,QAAQ,KAAK;AAAA,IACjB,CAAC;AAAA,EACL;AACJ;","names":[]}
package/dist/mcp.mjs CHANGED
@@ -1,7 +1,9 @@
1
1
  import {
2
- Wrapper,
2
+ Wrapper
3
+ } from "./chunk-3TR24M4E.mjs";
4
+ import {
3
5
  tools
4
- } from "./chunk-GZAAHMW6.mjs";
6
+ } from "./chunk-QBOE34GE.mjs";
5
7
 
6
8
  // src/mcp.ts
7
9
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/mcp.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { AgentMailClient } from 'agentmail'\n\nimport { Wrapper } from './wrapper'\nimport { tools } from './tools'\n\nexport class AgentMailMcpServer extends McpServer {\n private wrapper: Wrapper\n\n constructor(client?: AgentMailClient) {\n super({\n name: 'AgentMail',\n version: '0.1.0',\n })\n\n this.wrapper = new Wrapper(client)\n\n for (const tool of tools) {\n this.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: await this.wrapper.callMethodAndStringify(tool.method, args),\n },\n ],\n }))\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAS,iBAAiB;AAMnB,IAAM,qBAAN,cAAiC,UAAU;AAAA,EACtC;AAAA,EAER,YAAY,QAA0B;AAClC,UAAM;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA,IACb,CAAC;AAED,SAAK,UAAU,IAAI,QAAQ,MAAM;AAEjC,eAAW,QAAQ,OAAO;AACtB,WAAK,KAAK,KAAK,MAAM,KAAK,aAAa,KAAK,OAAO,OAAO,OAAO,UAAmB;AAAA,QAChF,SAAS;AAAA,UACL;AAAA,YACI,MAAM;AAAA,YACN,MAAM,MAAM,KAAK,QAAQ,uBAAuB,KAAK,QAAQ,IAAI;AAAA,UACrE;AAAA,QACJ;AAAA,MACJ,EAAE;AAAA,IACN;AAAA,EACJ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { AgentMailClient } from 'agentmail'\n\nimport { Wrapper } from './wrapper'\nimport { tools } from './tools'\n\nexport class AgentMailMcpServer extends McpServer {\n private wrapper: Wrapper\n\n constructor(client?: AgentMailClient) {\n super({\n name: 'AgentMail',\n version: '0.1.0',\n })\n\n this.wrapper = new Wrapper(client)\n\n for (const tool of tools) {\n this.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: await this.wrapper.callMethodAndStringify(tool.method, args),\n },\n ],\n }))\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,iBAAiB;AAMnB,IAAM,qBAAN,cAAiC,UAAU;AAAA,EACtC;AAAA,EAER,YAAY,QAA0B;AAClC,UAAM;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA,IACb,CAAC;AAED,SAAK,UAAU,IAAI,QAAQ,MAAM;AAEjC,eAAW,QAAQ,OAAO;AACtB,WAAK,KAAK,KAAK,MAAM,KAAK,aAAa,KAAK,OAAO,OAAO,OAAO,UAAmB;AAAA,QAChF,SAAS;AAAA,UACL;AAAA,YACI,MAAM;AAAA,YACN,MAAM,MAAM,KAAK,QAAQ,uBAAuB,KAAK,QAAQ,IAAI;AAAA,UACrE;AAAA,QACJ;AAAA,MACJ,EAAE;AAAA,IACN;AAAA,EACJ;AACJ;","names":[]}
@@ -0,0 +1,24 @@
1
+ import { AgentMailClient } from 'agentmail';
2
+ import { T as Tool } from './tools-DFoMkoW0.js';
3
+
4
+ declare class Wrapper {
5
+ private readonly client?;
6
+ constructor(client?: AgentMailClient | undefined);
7
+ callMethod(method: string, args: unknown): Promise<any>;
8
+ callMethodAndStringify(method: string, args: unknown): Promise<string>;
9
+ }
10
+
11
+ declare abstract class ListToolkit<T> extends Wrapper {
12
+ protected readonly tools: T[];
13
+ constructor(client?: AgentMailClient);
14
+ protected abstract buildTool(tool: Tool): T;
15
+ getTools(): T[];
16
+ }
17
+ declare abstract class MapToolkit<T> extends Wrapper {
18
+ protected readonly tools: Record<string, T>;
19
+ constructor(client?: AgentMailClient);
20
+ protected abstract buildTool(tool: Tool): T;
21
+ getTools(): Record<string, T>;
22
+ }
23
+
24
+ export { ListToolkit as L, MapToolkit as M };
@@ -0,0 +1,24 @@
1
+ import { AgentMailClient } from 'agentmail';
2
+ import { T as Tool } from './tools-DFoMkoW0.mjs';
3
+
4
+ declare class Wrapper {
5
+ private readonly client?;
6
+ constructor(client?: AgentMailClient | undefined);
7
+ callMethod(method: string, args: unknown): Promise<any>;
8
+ callMethodAndStringify(method: string, args: unknown): Promise<string>;
9
+ }
10
+
11
+ declare abstract class ListToolkit<T> extends Wrapper {
12
+ protected readonly tools: T[];
13
+ constructor(client?: AgentMailClient);
14
+ protected abstract buildTool(tool: Tool): T;
15
+ getTools(): T[];
16
+ }
17
+ declare abstract class MapToolkit<T> extends Wrapper {
18
+ protected readonly tools: Record<string, T>;
19
+ constructor(client?: AgentMailClient);
20
+ protected abstract buildTool(tool: Tool): T;
21
+ getTools(): Record<string, T>;
22
+ }
23
+
24
+ export { ListToolkit as L, MapToolkit as M };
@@ -0,0 +1,11 @@
1
+ import { AnyZodObject } from 'zod';
2
+
3
+ type Tool = {
4
+ name: string;
5
+ method: string;
6
+ description: string;
7
+ schema: AnyZodObject;
8
+ };
9
+ declare const tools: Tool[];
10
+
11
+ export { type Tool as T, tools as t };
@@ -0,0 +1,11 @@
1
+ import { AnyZodObject } from 'zod';
2
+
3
+ type Tool = {
4
+ name: string;
5
+ method: string;
6
+ description: string;
7
+ schema: AnyZodObject;
8
+ };
9
+ declare const tools: Tool[];
10
+
11
+ export { type Tool as T, tools as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail-toolkit",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "AgentMail Toolkit",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -23,6 +23,11 @@
23
23
  "dist"
24
24
  ],
25
25
  "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.mjs",
29
+ "require": "./dist/index.js"
30
+ },
26
31
  "./ai-sdk": {
27
32
  "types": "./dist/ai-sdk.d.ts",
28
33
  "import": "./dist/ai-sdk.mjs",