agentmail-toolkit 0.1.20 → 0.1.22
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 +3 -4
- package/dist/ai-sdk.d.ts +3 -4
- package/dist/ai-sdk.js +53 -59
- package/dist/ai-sdk.js.map +1 -1
- package/dist/ai-sdk.mjs +2 -6
- package/dist/ai-sdk.mjs.map +1 -1
- package/dist/chunk-CIU3KR25.mjs +117 -0
- package/dist/chunk-CIU3KR25.mjs.map +1 -0
- package/dist/chunk-GWFZG2RN.mjs +117 -0
- package/dist/chunk-GWFZG2RN.mjs.map +1 -0
- package/dist/chunk-UODX72KA.mjs +40 -0
- package/dist/chunk-UODX72KA.mjs.map +1 -0
- package/dist/chunk-W2LJOBDV.mjs +71 -0
- package/dist/chunk-W2LJOBDV.mjs.map +1 -0
- package/dist/index.d.mts +17 -30
- package/dist/index.d.ts +17 -30
- package/dist/index.js +40 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -3
- package/dist/langchain.d.mts +3 -4
- package/dist/langchain.d.ts +3 -4
- package/dist/langchain.js +58 -61
- package/dist/langchain.js.map +1 -1
- package/dist/langchain.mjs +2 -6
- package/dist/langchain.mjs.map +1 -1
- package/dist/mcp.d.mts +14 -6
- package/dist/mcp.d.ts +14 -6
- package/dist/mcp.js +77 -69
- package/dist/mcp.js.map +1 -1
- package/dist/mcp.mjs +14 -20
- package/dist/mcp.mjs.map +1 -1
- package/dist/toolkit-3F468CU6.d.ts +26 -0
- package/dist/toolkit-BLAprE02.d.mts +26 -0
- package/dist/tools-Dzp_FZN_.d.mts +11 -0
- package/dist/tools-Dzp_FZN_.d.ts +11 -0
- package/package.json +15 -15
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tools
|
|
3
|
+
} from "./chunk-CIU3KR25.mjs";
|
|
4
|
+
|
|
5
|
+
// src/wrapper.ts
|
|
6
|
+
import { AgentMailClient } from "agentmail";
|
|
7
|
+
var Wrapper = class {
|
|
8
|
+
constructor(client = new AgentMailClient()) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
async call(method, args) {
|
|
12
|
+
const parts = method.split(".");
|
|
13
|
+
const methodKey = parts.pop();
|
|
14
|
+
if (!methodKey) throw new Error("Method name empty");
|
|
15
|
+
let parent = this.client;
|
|
16
|
+
for (const part of parts) parent = parent[part];
|
|
17
|
+
const { inboxId, ...options } = args;
|
|
18
|
+
if (inboxId) return await parent[methodKey].call(parent, inboxId, options);
|
|
19
|
+
else return await parent[methodKey].call(parent, options);
|
|
20
|
+
}
|
|
21
|
+
async safeCall(method, args) {
|
|
22
|
+
try {
|
|
23
|
+
return { isError: false, result: await this.call(method, args) };
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (error instanceof Error) return { isError: true, result: error.message };
|
|
26
|
+
else return { isError: true, result: "Unknown error" };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/toolkit.ts
|
|
32
|
+
var BaseToolkit = class extends Wrapper {
|
|
33
|
+
tools = {};
|
|
34
|
+
constructor(client) {
|
|
35
|
+
super(client);
|
|
36
|
+
this.tools = tools.reduce(
|
|
37
|
+
(acc, tool) => {
|
|
38
|
+
acc[tool.name] = this.buildTool(tool);
|
|
39
|
+
return acc;
|
|
40
|
+
},
|
|
41
|
+
{}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var ListToolkit = class extends BaseToolkit {
|
|
46
|
+
getTools(names) {
|
|
47
|
+
if (!names) return Object.values(this.tools);
|
|
48
|
+
return names.reduce((acc, name) => {
|
|
49
|
+
if (name in this.tools) acc.push(this.tools[name]);
|
|
50
|
+
return acc;
|
|
51
|
+
}, []);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var MapToolkit = class extends BaseToolkit {
|
|
55
|
+
getTools(names) {
|
|
56
|
+
if (!names) return this.tools;
|
|
57
|
+
return names.reduce(
|
|
58
|
+
(acc, name) => {
|
|
59
|
+
if (name in this.tools) acc[name] = this.tools[name];
|
|
60
|
+
return acc;
|
|
61
|
+
},
|
|
62
|
+
{}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
ListToolkit,
|
|
69
|
+
MapToolkit
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=chunk-W2LJOBDV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/wrapper.ts","../src/toolkit.ts"],"sourcesContent":["import { AgentMailClient } from 'agentmail'\n\nexport class Wrapper {\n constructor(private readonly client = new AgentMailClient()) {}\n\n public async call(method: string, args: any) {\n const parts = method.split('.')\n const methodKey = parts.pop()\n\n if (!methodKey) throw new Error('Method name empty')\n\n let parent: any = this.client\n for (const part of parts) parent = parent[part]\n\n const { inboxId, ...options } = args\n\n if (inboxId) return await parent[methodKey].call(parent, inboxId, options)\n else return await parent[methodKey].call(parent, options)\n }\n\n public async safeCall(method: string, args: any) {\n try {\n return { isError: false, result: await this.call(method, args) }\n } catch (error) {\n if (error instanceof Error) return { isError: true, result: error.message }\n else return { isError: true, result: 'Unknown error' }\n }\n }\n}\n","import { AgentMailClient } from 'agentmail'\n\nimport { Wrapper } from './wrapper'\nimport { type Tool, tools } from './tools'\n\nexport abstract class BaseToolkit<T> extends Wrapper {\n protected readonly tools: Record<string, T> = {}\n\n constructor(client?: AgentMailClient) {\n super(client)\n\n this.tools = tools.reduce(\n (acc, tool) => {\n acc[tool.name] = this.buildTool(tool)\n return acc\n },\n {} as Record<string, T>\n )\n }\n\n protected abstract buildTool(tool: Tool): T\n}\n\nexport abstract class ListToolkit<T> extends BaseToolkit<T> {\n public getTools(names?: string[]) {\n if (!names) return Object.values(this.tools)\n\n return names.reduce((acc, name) => {\n if (name in this.tools) acc.push(this.tools[name])\n return acc\n }, [] as T[])\n }\n}\n\nexport abstract class MapToolkit<T> extends BaseToolkit<T> {\n public getTools(names?: string[]) {\n if (!names) return this.tools\n\n return names.reduce(\n (acc, name) => {\n if (name in this.tools) acc[name] = this.tools[name]\n return acc\n },\n {} as Record<string, T>\n )\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAEzB,IAAM,UAAN,MAAc;AAAA,EACjB,YAA6B,SAAS,IAAI,gBAAgB,GAAG;AAAhC;AAAA,EAAiC;AAAA,EAE9D,MAAa,KAAK,QAAgB,MAAW;AACzC,UAAM,QAAQ,OAAO,MAAM,GAAG;AAC9B,UAAM,YAAY,MAAM,IAAI;AAE5B,QAAI,CAAC,UAAW,OAAM,IAAI,MAAM,mBAAmB;AAEnD,QAAI,SAAc,KAAK;AACvB,eAAW,QAAQ,MAAO,UAAS,OAAO,IAAI;AAE9C,UAAM,EAAE,SAAS,GAAG,QAAQ,IAAI;AAEhC,QAAI,QAAS,QAAO,MAAM,OAAO,SAAS,EAAE,KAAK,QAAQ,SAAS,OAAO;AAAA,QACpE,QAAO,MAAM,OAAO,SAAS,EAAE,KAAK,QAAQ,OAAO;AAAA,EAC5D;AAAA,EAEA,MAAa,SAAS,QAAgB,MAAW;AAC7C,QAAI;AACA,aAAO,EAAE,SAAS,OAAO,QAAQ,MAAM,KAAK,KAAK,QAAQ,IAAI,EAAE;AAAA,IACnE,SAAS,OAAO;AACZ,UAAI,iBAAiB,MAAO,QAAO,EAAE,SAAS,MAAM,QAAQ,MAAM,QAAQ;AAAA,UACrE,QAAO,EAAE,SAAS,MAAM,QAAQ,gBAAgB;AAAA,IACzD;AAAA,EACJ;AACJ;;;ACvBO,IAAe,cAAf,cAAsC,QAAQ;AAAA,EAC9B,QAA2B,CAAC;AAAA,EAE/C,YAAY,QAA0B;AAClC,UAAM,MAAM;AAEZ,SAAK,QAAQ,MAAM;AAAA,MACf,CAAC,KAAK,SAAS;AACX,YAAI,KAAK,IAAI,IAAI,KAAK,UAAU,IAAI;AACpC,eAAO;AAAA,MACX;AAAA,MACA,CAAC;AAAA,IACL;AAAA,EACJ;AAGJ;AAEO,IAAe,cAAf,cAAsC,YAAe;AAAA,EACjD,SAAS,OAAkB;AAC9B,QAAI,CAAC,MAAO,QAAO,OAAO,OAAO,KAAK,KAAK;AAE3C,WAAO,MAAM,OAAO,CAAC,KAAK,SAAS;AAC/B,UAAI,QAAQ,KAAK,MAAO,KAAI,KAAK,KAAK,MAAM,IAAI,CAAC;AACjD,aAAO;AAAA,IACX,GAAG,CAAC,CAAQ;AAAA,EAChB;AACJ;AAEO,IAAe,aAAf,cAAqC,YAAe;AAAA,EAChD,SAAS,OAAkB;AAC9B,QAAI,CAAC,MAAO,QAAO,KAAK;AAExB,WAAO,MAAM;AAAA,MACT,CAAC,KAAK,SAAS;AACX,YAAI,QAAQ,KAAK,MAAO,KAAI,IAAI,IAAI,KAAK,MAAM,IAAI;AACnD,eAAO;AAAA,MACX;AAAA,MACA,CAAC;AAAA,IACL;AAAA,EACJ;AACJ;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export { T as Tool, t as tools } from './tools-
|
|
2
|
+
export { T as Tool, t as tools } from './tools-Dzp_FZN_.mjs';
|
|
3
3
|
|
|
4
4
|
declare const ListItemsParams: z.ZodObject<{
|
|
5
5
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
|
|
6
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
limit?: number | undefined;
|
|
9
|
-
|
|
9
|
+
page_token?: string | undefined;
|
|
10
10
|
}, {
|
|
11
11
|
limit?: number | undefined;
|
|
12
|
-
|
|
12
|
+
page_token?: string | undefined;
|
|
13
13
|
}>;
|
|
14
14
|
declare const GetInboxParams: z.ZodObject<{
|
|
15
15
|
inbox_id: z.ZodString;
|
|
@@ -31,21 +31,21 @@ declare const CreateInboxParams: z.ZodObject<{
|
|
|
31
31
|
domain?: string | undefined;
|
|
32
32
|
display_name?: string | undefined;
|
|
33
33
|
}>;
|
|
34
|
-
declare const ListThreadsParams: z.ZodObject<
|
|
34
|
+
declare const ListThreadsParams: z.ZodObject<{
|
|
35
35
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
|
|
37
|
-
}
|
|
36
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
37
|
+
} & {
|
|
38
38
|
inbox_id: z.ZodString;
|
|
39
39
|
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
-
}
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
41
|
inbox_id: string;
|
|
42
42
|
limit?: number | undefined;
|
|
43
|
-
|
|
43
|
+
page_token?: string | undefined;
|
|
44
44
|
labels?: string[] | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
inbox_id: string;
|
|
47
47
|
limit?: number | undefined;
|
|
48
|
-
|
|
48
|
+
page_token?: string | undefined;
|
|
49
49
|
labels?: string[] | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
declare const GetThreadParams: z.ZodObject<{
|
|
@@ -58,21 +58,21 @@ declare const GetThreadParams: z.ZodObject<{
|
|
|
58
58
|
inbox_id: string;
|
|
59
59
|
thread_id: string;
|
|
60
60
|
}>;
|
|
61
|
-
declare const ListMessagesParams: z.ZodObject<
|
|
61
|
+
declare const ListMessagesParams: z.ZodObject<{
|
|
62
62
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
63
|
-
|
|
64
|
-
}
|
|
63
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
64
|
+
} & {
|
|
65
65
|
inbox_id: z.ZodString;
|
|
66
66
|
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
-
}
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
68
|
inbox_id: string;
|
|
69
69
|
limit?: number | undefined;
|
|
70
|
-
|
|
70
|
+
page_token?: string | undefined;
|
|
71
71
|
labels?: string[] | undefined;
|
|
72
72
|
}, {
|
|
73
73
|
inbox_id: string;
|
|
74
74
|
limit?: number | undefined;
|
|
75
|
-
|
|
75
|
+
page_token?: string | undefined;
|
|
76
76
|
labels?: string[] | undefined;
|
|
77
77
|
}>;
|
|
78
78
|
declare const GetMessageParams: z.ZodObject<{
|
|
@@ -85,19 +85,6 @@ declare const GetMessageParams: z.ZodObject<{
|
|
|
85
85
|
inbox_id: string;
|
|
86
86
|
message_id: string;
|
|
87
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
88
|
declare const SendMessageParams: z.ZodObject<{
|
|
102
89
|
inbox_id: z.ZodString;
|
|
103
90
|
to: z.ZodArray<z.ZodString, "many">;
|
|
@@ -140,4 +127,4 @@ declare const ReplyToMessageParams: z.ZodObject<{
|
|
|
140
127
|
html?: string | undefined;
|
|
141
128
|
}>;
|
|
142
129
|
|
|
143
|
-
export { CreateInboxParams,
|
|
130
|
+
export { CreateInboxParams, GetInboxParams, GetMessageParams, GetThreadParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendMessageParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export { T as Tool, t as tools } from './tools-
|
|
2
|
+
export { T as Tool, t as tools } from './tools-Dzp_FZN_.js';
|
|
3
3
|
|
|
4
4
|
declare const ListItemsParams: z.ZodObject<{
|
|
5
5
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
|
|
6
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
limit?: number | undefined;
|
|
9
|
-
|
|
9
|
+
page_token?: string | undefined;
|
|
10
10
|
}, {
|
|
11
11
|
limit?: number | undefined;
|
|
12
|
-
|
|
12
|
+
page_token?: string | undefined;
|
|
13
13
|
}>;
|
|
14
14
|
declare const GetInboxParams: z.ZodObject<{
|
|
15
15
|
inbox_id: z.ZodString;
|
|
@@ -31,21 +31,21 @@ declare const CreateInboxParams: z.ZodObject<{
|
|
|
31
31
|
domain?: string | undefined;
|
|
32
32
|
display_name?: string | undefined;
|
|
33
33
|
}>;
|
|
34
|
-
declare const ListThreadsParams: z.ZodObject<
|
|
34
|
+
declare const ListThreadsParams: z.ZodObject<{
|
|
35
35
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
|
|
37
|
-
}
|
|
36
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
37
|
+
} & {
|
|
38
38
|
inbox_id: z.ZodString;
|
|
39
39
|
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
-
}
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
41
|
inbox_id: string;
|
|
42
42
|
limit?: number | undefined;
|
|
43
|
-
|
|
43
|
+
page_token?: string | undefined;
|
|
44
44
|
labels?: string[] | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
inbox_id: string;
|
|
47
47
|
limit?: number | undefined;
|
|
48
|
-
|
|
48
|
+
page_token?: string | undefined;
|
|
49
49
|
labels?: string[] | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
declare const GetThreadParams: z.ZodObject<{
|
|
@@ -58,21 +58,21 @@ declare const GetThreadParams: z.ZodObject<{
|
|
|
58
58
|
inbox_id: string;
|
|
59
59
|
thread_id: string;
|
|
60
60
|
}>;
|
|
61
|
-
declare const ListMessagesParams: z.ZodObject<
|
|
61
|
+
declare const ListMessagesParams: z.ZodObject<{
|
|
62
62
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
63
|
-
|
|
64
|
-
}
|
|
63
|
+
page_token: z.ZodOptional<z.ZodString>;
|
|
64
|
+
} & {
|
|
65
65
|
inbox_id: z.ZodString;
|
|
66
66
|
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
-
}
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
68
|
inbox_id: string;
|
|
69
69
|
limit?: number | undefined;
|
|
70
|
-
|
|
70
|
+
page_token?: string | undefined;
|
|
71
71
|
labels?: string[] | undefined;
|
|
72
72
|
}, {
|
|
73
73
|
inbox_id: string;
|
|
74
74
|
limit?: number | undefined;
|
|
75
|
-
|
|
75
|
+
page_token?: string | undefined;
|
|
76
76
|
labels?: string[] | undefined;
|
|
77
77
|
}>;
|
|
78
78
|
declare const GetMessageParams: z.ZodObject<{
|
|
@@ -85,19 +85,6 @@ declare const GetMessageParams: z.ZodObject<{
|
|
|
85
85
|
inbox_id: string;
|
|
86
86
|
message_id: string;
|
|
87
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
88
|
declare const SendMessageParams: z.ZodObject<{
|
|
102
89
|
inbox_id: z.ZodString;
|
|
103
90
|
to: z.ZodArray<z.ZodString, "many">;
|
|
@@ -140,4 +127,4 @@ declare const ReplyToMessageParams: z.ZodObject<{
|
|
|
140
127
|
html?: string | undefined;
|
|
141
128
|
}>;
|
|
142
129
|
|
|
143
|
-
export { CreateInboxParams,
|
|
130
|
+
export { CreateInboxParams, GetInboxParams, GetMessageParams, GetThreadParams, ListItemsParams, ListMessagesParams, ListThreadsParams, ReplyToMessageParams, SendMessageParams };
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CreateInboxParams: () => CreateInboxParams,
|
|
24
|
-
GetAttachmentParams: () => GetAttachmentParams,
|
|
25
24
|
GetInboxParams: () => GetInboxParams,
|
|
26
25
|
GetMessageParams: () => GetMessageParams,
|
|
27
26
|
GetThreadParams: () => GetThreadParams,
|
|
@@ -37,52 +36,47 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
36
|
// src/schemas.ts
|
|
38
37
|
var import_zod = require("zod");
|
|
39
38
|
var ListItemsParams = import_zod.z.object({
|
|
40
|
-
limit: import_zod.z.number().optional().describe("
|
|
41
|
-
|
|
39
|
+
limit: import_zod.z.number().optional().describe("Max number of items to return"),
|
|
40
|
+
page_token: import_zod.z.string().optional().describe("Page token for pagination")
|
|
42
41
|
});
|
|
43
42
|
var GetInboxParams = import_zod.z.object({
|
|
44
|
-
inbox_id: import_zod.z.string().describe("
|
|
43
|
+
inbox_id: import_zod.z.string().describe("ID of inbox to get")
|
|
45
44
|
});
|
|
46
45
|
var CreateInboxParams = import_zod.z.object({
|
|
47
|
-
username: import_zod.z.string().optional().describe("
|
|
48
|
-
domain: import_zod.z.string().optional().describe("
|
|
49
|
-
display_name: import_zod.z.string().optional().describe("
|
|
46
|
+
username: import_zod.z.string().optional().describe("Username of inbox to create"),
|
|
47
|
+
domain: import_zod.z.string().optional().describe("Domain of inbox to create"),
|
|
48
|
+
display_name: import_zod.z.string().optional().describe("Display name of inbox to create")
|
|
50
49
|
});
|
|
51
50
|
var ListThreadsParams = ListItemsParams.extend({
|
|
52
|
-
inbox_id: import_zod.z.string().describe("
|
|
53
|
-
labels: import_zod.z.array(import_zod.z.string()).optional().describe("
|
|
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")
|
|
54
53
|
});
|
|
55
54
|
var GetThreadParams = import_zod.z.object({
|
|
56
|
-
inbox_id: import_zod.z.string().describe("
|
|
57
|
-
thread_id: import_zod.z.string().describe("
|
|
55
|
+
inbox_id: import_zod.z.string().describe("ID of inbox to get thread from"),
|
|
56
|
+
thread_id: import_zod.z.string().describe("ID of thread to get")
|
|
58
57
|
});
|
|
59
58
|
var ListMessagesParams = ListItemsParams.extend({
|
|
60
|
-
inbox_id: import_zod.z.string().describe("
|
|
61
|
-
labels: import_zod.z.array(import_zod.z.string()).optional().describe("
|
|
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")
|
|
62
61
|
});
|
|
63
62
|
var GetMessageParams = import_zod.z.object({
|
|
64
|
-
inbox_id: import_zod.z.string().describe("
|
|
65
|
-
message_id: import_zod.z.string().describe("
|
|
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")
|
|
63
|
+
inbox_id: import_zod.z.string().describe("ID of inbox to get message from"),
|
|
64
|
+
message_id: import_zod.z.string().describe("ID of message to get")
|
|
71
65
|
});
|
|
72
66
|
var SendMessageParams = import_zod.z.object({
|
|
73
|
-
inbox_id: import_zod.z.string().describe("
|
|
74
|
-
to: import_zod.z.array(import_zod.z.string()).describe("
|
|
75
|
-
cc: import_zod.z.array(import_zod.z.string()).optional().describe("
|
|
76
|
-
bcc: import_zod.z.array(import_zod.z.string()).optional().describe("
|
|
77
|
-
subject: import_zod.z.string().optional().describe("
|
|
78
|
-
text: import_zod.z.string().optional().describe("
|
|
79
|
-
html: import_zod.z.string().optional().describe("
|
|
67
|
+
inbox_id: import_zod.z.string().describe("ID of inbox to send message from"),
|
|
68
|
+
to: import_zod.z.array(import_zod.z.string()).describe("Recipients of message"),
|
|
69
|
+
cc: import_zod.z.array(import_zod.z.string()).optional().describe("CC recipients of message"),
|
|
70
|
+
bcc: import_zod.z.array(import_zod.z.string()).optional().describe("BCC recipients of message"),
|
|
71
|
+
subject: import_zod.z.string().optional().describe("Subject of message"),
|
|
72
|
+
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
74
|
});
|
|
81
75
|
var ReplyToMessageParams = import_zod.z.object({
|
|
82
|
-
inbox_id: import_zod.z.string().describe("
|
|
83
|
-
message_id: import_zod.z.string().describe("
|
|
84
|
-
text: import_zod.z.string().optional().describe("
|
|
85
|
-
html: import_zod.z.string().optional().describe("
|
|
76
|
+
inbox_id: import_zod.z.string().describe("ID of inbox to reply to message from"),
|
|
77
|
+
message_id: import_zod.z.string().describe("ID of message to reply to"),
|
|
78
|
+
text: import_zod.z.string().optional().describe("Plain text body of reply"),
|
|
79
|
+
html: import_zod.z.string().optional().describe("HTML body of reply")
|
|
86
80
|
});
|
|
87
81
|
|
|
88
82
|
// src/tools.ts
|
|
@@ -90,68 +84,61 @@ var tools = [
|
|
|
90
84
|
{
|
|
91
85
|
name: "list_inboxes",
|
|
92
86
|
method: "inboxes.list",
|
|
93
|
-
description: "List
|
|
87
|
+
description: "List inboxes",
|
|
94
88
|
schema: ListItemsParams
|
|
95
89
|
},
|
|
96
90
|
{
|
|
97
91
|
name: "get_inbox",
|
|
98
92
|
method: "inboxes.get",
|
|
99
|
-
description: "Get
|
|
93
|
+
description: "Get inbox",
|
|
100
94
|
schema: GetInboxParams
|
|
101
95
|
},
|
|
102
96
|
{
|
|
103
97
|
name: "create_inbox",
|
|
104
98
|
method: "inboxes.create",
|
|
105
|
-
description: "Create
|
|
99
|
+
description: "Create inbox. Use default username, domain, and display name unless otherwise specified.",
|
|
106
100
|
schema: CreateInboxParams
|
|
107
101
|
},
|
|
108
102
|
{
|
|
109
103
|
name: "list_threads",
|
|
110
|
-
method: "threads.list",
|
|
111
|
-
description: "List
|
|
104
|
+
method: "inboxes.threads.list",
|
|
105
|
+
description: "List threads in inbox",
|
|
112
106
|
schema: ListThreadsParams
|
|
113
107
|
},
|
|
114
108
|
{
|
|
115
109
|
name: "get_thread",
|
|
116
|
-
method: "threads.get",
|
|
117
|
-
description: "Get
|
|
110
|
+
method: "inboxes.threads.get",
|
|
111
|
+
description: "Get thread",
|
|
118
112
|
schema: GetThreadParams
|
|
119
113
|
},
|
|
120
114
|
{
|
|
121
115
|
name: "list_messages",
|
|
122
|
-
method: "messages.list",
|
|
123
|
-
description: "List
|
|
116
|
+
method: "inboxes.messages.list",
|
|
117
|
+
description: "List messages in inbox",
|
|
124
118
|
schema: ListMessagesParams
|
|
125
119
|
},
|
|
126
120
|
{
|
|
127
121
|
name: "get_message",
|
|
128
|
-
method: "messages.get",
|
|
129
|
-
description: "Get
|
|
122
|
+
method: "inboxes.messages.get",
|
|
123
|
+
description: "Get message",
|
|
130
124
|
schema: GetMessageParams
|
|
131
125
|
},
|
|
132
|
-
{
|
|
133
|
-
name: "get_attachment",
|
|
134
|
-
method: "attachments.get",
|
|
135
|
-
description: "Get an attachment by ID",
|
|
136
|
-
schema: GetAttachmentParams
|
|
137
|
-
},
|
|
138
126
|
{
|
|
139
127
|
name: "send_message",
|
|
140
|
-
method: "messages.send",
|
|
141
|
-
description: "Send
|
|
128
|
+
method: "inboxes.messages.send",
|
|
129
|
+
description: "Send message",
|
|
142
130
|
schema: SendMessageParams
|
|
143
131
|
},
|
|
144
132
|
{
|
|
145
133
|
name: "reply_to_message",
|
|
146
|
-
method: "messages.reply",
|
|
147
|
-
description: "Reply to
|
|
134
|
+
method: "inboxes.messages.reply",
|
|
135
|
+
description: "Reply to message",
|
|
148
136
|
schema: ReplyToMessageParams
|
|
149
137
|
}
|
|
150
138
|
];
|
|
151
139
|
// Annotate the CommonJS export names for ESM import in node:
|
|
152
140
|
0 && (module.exports = {
|
|
153
141
|
CreateInboxParams,
|
|
154
|
-
GetAttachmentParams,
|
|
155
142
|
GetInboxParams,
|
|
156
143
|
GetMessageParams,
|
|
157
144
|
GetThreadParams,
|
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('
|
|
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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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":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CreateInboxParams,
|
|
3
|
-
GetAttachmentParams,
|
|
4
3
|
GetInboxParams,
|
|
5
4
|
GetMessageParams,
|
|
6
5
|
GetThreadParams,
|
|
@@ -10,10 +9,9 @@ import {
|
|
|
10
9
|
ReplyToMessageParams,
|
|
11
10
|
SendMessageParams,
|
|
12
11
|
tools
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CIU3KR25.mjs";
|
|
14
13
|
export {
|
|
15
14
|
CreateInboxParams,
|
|
16
|
-
GetAttachmentParams,
|
|
17
15
|
GetInboxParams,
|
|
18
16
|
GetMessageParams,
|
|
19
17
|
GetThreadParams,
|
package/dist/langchain.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { L as ListToolkit } from './toolkit-BLAprE02.mjs';
|
|
3
|
+
import { T as Tool } from './tools-Dzp_FZN_.mjs';
|
|
4
|
+
import 'agentmail';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
declare class AgentMailToolkit extends ListToolkit<StructuredTool> {
|
|
8
|
-
constructor(client?: AgentMailClient);
|
|
9
8
|
protected buildTool(tool: Tool): StructuredTool;
|
|
10
9
|
}
|
|
11
10
|
|
package/dist/langchain.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { L as ListToolkit } from './toolkit-3F468CU6.js';
|
|
3
|
+
import { T as Tool } from './tools-Dzp_FZN_.js';
|
|
4
|
+
import 'agentmail';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
declare class AgentMailToolkit extends ListToolkit<StructuredTool> {
|
|
8
|
-
constructor(client?: AgentMailClient);
|
|
9
8
|
protected buildTool(tool: Tool): StructuredTool;
|
|
10
9
|
}
|
|
11
10
|
|