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
package/dist/mcp.mjs
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
5
|
-
tools
|
|
6
|
-
} from "./chunk-QBOE34GE.mjs";
|
|
2
|
+
ListToolkit
|
|
3
|
+
} from "./chunk-W2LJOBDV.mjs";
|
|
4
|
+
import "./chunk-CIU3KR25.mjs";
|
|
7
5
|
|
|
8
6
|
// src/mcp.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.wrapper = new Wrapper(client);
|
|
18
|
-
for (const tool of tools) {
|
|
19
|
-
this.tool(tool.name, tool.description, tool.schema.shape, async (args) => {
|
|
20
|
-
const { isError, result } = await this.wrapper.safeCall(tool.method, args);
|
|
7
|
+
var AgentMailToolkit = class extends ListToolkit {
|
|
8
|
+
buildTool(tool) {
|
|
9
|
+
return {
|
|
10
|
+
name: tool.name,
|
|
11
|
+
description: tool.description,
|
|
12
|
+
paramsSchema: tool.schema.shape,
|
|
13
|
+
callback: async (args) => {
|
|
14
|
+
const { isError, result } = await this.safeCall(tool.method, args);
|
|
21
15
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError };
|
|
22
|
-
}
|
|
23
|
-
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
24
18
|
}
|
|
25
19
|
};
|
|
26
20
|
export {
|
|
27
|
-
|
|
21
|
+
AgentMailToolkit
|
|
28
22
|
};
|
|
29
23
|
//# sourceMappingURL=mcp.mjs.map
|
package/dist/mcp.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/mcp.ts"],"sourcesContent":["import { type ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { type ZodRawShape } from 'zod'\n\nimport { ListToolkit } from './toolkit'\nimport { type Tool } from './tools'\n\ninterface McpTool {\n name: string\n description: string\n paramsSchema: ZodRawShape\n callback: ToolCallback<ZodRawShape>\n}\n\nexport class AgentMailToolkit extends ListToolkit<McpTool> {\n protected buildTool(tool: Tool): McpTool {\n return {\n name: tool.name,\n description: tool.description,\n paramsSchema: tool.schema.shape,\n callback: async (args) => {\n const { isError, result } = await this.safeCall(tool.method, args)\n return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], isError }\n },\n }\n }\n}\n"],"mappings":";;;;;;AAaO,IAAM,mBAAN,cAA+B,YAAqB;AAAA,EAC7C,UAAU,MAAqB;AACrC,WAAO;AAAA,MACH,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,cAAc,KAAK,OAAO;AAAA,MAC1B,UAAU,OAAO,SAAS;AACtB,cAAM,EAAE,SAAS,OAAO,IAAI,MAAM,KAAK,SAAS,KAAK,QAAQ,IAAI;AACjE,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,CAAC,GAAG,QAAQ;AAAA,MAClG;AAAA,IACJ;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AgentMailClient } from 'agentmail';
|
|
2
|
+
import { T as Tool } from './tools-Dzp_FZN_.js';
|
|
3
|
+
|
|
4
|
+
declare class Wrapper {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client?: AgentMailClient);
|
|
7
|
+
call(method: string, args: any): Promise<any>;
|
|
8
|
+
safeCall(method: string, args: any): Promise<{
|
|
9
|
+
isError: boolean;
|
|
10
|
+
result: any;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare abstract class BaseToolkit<T> extends Wrapper {
|
|
15
|
+
protected readonly tools: Record<string, T>;
|
|
16
|
+
constructor(client?: AgentMailClient);
|
|
17
|
+
protected abstract buildTool(tool: Tool): T;
|
|
18
|
+
}
|
|
19
|
+
declare abstract class ListToolkit<T> extends BaseToolkit<T> {
|
|
20
|
+
getTools(names?: string[]): T[];
|
|
21
|
+
}
|
|
22
|
+
declare abstract class MapToolkit<T> extends BaseToolkit<T> {
|
|
23
|
+
getTools(names?: string[]): Record<string, T>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { ListToolkit as L, MapToolkit as M };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AgentMailClient } from 'agentmail';
|
|
2
|
+
import { T as Tool } from './tools-Dzp_FZN_.mjs';
|
|
3
|
+
|
|
4
|
+
declare class Wrapper {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client?: AgentMailClient);
|
|
7
|
+
call(method: string, args: any): Promise<any>;
|
|
8
|
+
safeCall(method: string, args: any): Promise<{
|
|
9
|
+
isError: boolean;
|
|
10
|
+
result: any;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare abstract class BaseToolkit<T> extends Wrapper {
|
|
15
|
+
protected readonly tools: Record<string, T>;
|
|
16
|
+
constructor(client?: AgentMailClient);
|
|
17
|
+
protected abstract buildTool(tool: Tool): T;
|
|
18
|
+
}
|
|
19
|
+
declare abstract class ListToolkit<T> extends BaseToolkit<T> {
|
|
20
|
+
getTools(names?: string[]): T[];
|
|
21
|
+
}
|
|
22
|
+
declare abstract class MapToolkit<T> extends BaseToolkit<T> {
|
|
23
|
+
getTools(names?: string[]): Record<string, T>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { ListToolkit as L, MapToolkit as M };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmail-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "AgentMail Toolkit",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"AgentMail",
|
|
13
13
|
"Toolkit"
|
|
14
14
|
],
|
|
15
|
-
"author": "AgentMail <support@agentmail.
|
|
15
|
+
"author": "AgentMail <support@agentmail.cc>",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
@@ -45,24 +45,24 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@eslint/js": "^9.
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"eslint": "^9.
|
|
51
|
-
"eslint-config-prettier": "^10.1.
|
|
52
|
-
"globals": "^16.
|
|
48
|
+
"@eslint/js": "^9.28.0",
|
|
49
|
+
"@types/node": "^24.0.1",
|
|
50
|
+
"eslint": "^9.28.0",
|
|
51
|
+
"eslint-config-prettier": "^10.1.5",
|
|
52
|
+
"globals": "^16.2.0",
|
|
53
53
|
"prettier": "3.5.3",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
|
-
"tsup": "^8.
|
|
56
|
-
"typescript": "^5.8.
|
|
57
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"tsup": "^8.5.0",
|
|
56
|
+
"typescript": "^5.8.3",
|
|
57
|
+
"typescript-eslint": "^8.34.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"agentmail": "^0.0.
|
|
61
|
-
"zod": "^3.
|
|
60
|
+
"agentmail": "^0.0.34",
|
|
61
|
+
"zod": "^3.25.63"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@langchain/core": "^0.3.
|
|
65
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
66
|
-
"ai": "^4.
|
|
64
|
+
"@langchain/core": "^0.3.58",
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
66
|
+
"ai": "^4.3.16"
|
|
67
67
|
}
|
|
68
68
|
}
|