integrate-sdk 0.7.53 → 0.7.56
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/anthropic.d.ts +16 -117
- package/dist/ai/anthropic.d.ts.map +1 -1
- package/dist/ai/anthropic.js +11 -17
- package/dist/ai/google.d.ts +0 -63
- package/dist/ai/google.d.ts.map +1 -1
- package/dist/ai/google.js +11 -25
- package/dist/ai/index.d.ts +5 -71
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +33 -241
- package/dist/ai/openai.d.ts +0 -92
- package/dist/ai/openai.d.ts.map +1 -1
- package/dist/ai/openai.js +7 -17
- package/dist/ai/vercel-ai.d.ts +0 -66
- package/dist/ai/vercel-ai.d.ts.map +1 -1
- package/dist/ai/vercel-ai.js +7 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +676 -787
- package/dist/src/ai/anthropic.d.ts +16 -117
- package/dist/src/ai/anthropic.d.ts.map +1 -1
- package/dist/src/ai/google.d.ts +0 -63
- package/dist/src/ai/google.d.ts.map +1 -1
- package/dist/src/ai/index.d.ts +5 -71
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/openai.d.ts +0 -92
- package/dist/src/ai/openai.d.ts.map +1 -1
- package/dist/src/ai/vercel-ai.d.ts +0 -66
- package/dist/src/ai/vercel-ai.d.ts.map +1 -1
- package/dist/src/server.d.ts +5 -0
- package/dist/src/server.d.ts.map +1 -1
- package/package.json +4 -36
- package/server.ts +18 -41
- package/dist/ai/cloudflare.d.ts +0 -158
- package/dist/ai/cloudflare.d.ts.map +0 -1
- package/dist/ai/cloudflare.js +0 -4249
- package/dist/ai/langchain.d.ts +0 -139
- package/dist/ai/langchain.d.ts.map +0 -1
- package/dist/ai/langchain.js +0 -4237
- package/dist/ai/llamaindex.d.ts +0 -125
- package/dist/ai/llamaindex.d.ts.map +0 -1
- package/dist/ai/llamaindex.js +0 -4236
- package/dist/ai/mastra.d.ts +0 -138
- package/dist/ai/mastra.d.ts.map +0 -1
- package/dist/ai/mastra.js +0 -4240
- package/dist/src/ai/cloudflare.d.ts +0 -158
- package/dist/src/ai/cloudflare.d.ts.map +0 -1
- package/dist/src/ai/langchain.d.ts +0 -139
- package/dist/src/ai/langchain.d.ts.map +0 -1
- package/dist/src/ai/llamaindex.d.ts +0 -125
- package/dist/src/ai/llamaindex.d.ts.map +0 -1
- package/dist/src/ai/mastra.d.ts +0 -138
- package/dist/src/ai/mastra.d.ts.map +0 -1
- package/dist/src/integrations/vercel-ai.d.ts +0 -127
- package/dist/src/integrations/vercel-ai.d.ts.map +0 -1
- package/dist/src/plugins/generic.d.ts +0 -99
- package/dist/src/plugins/generic.d.ts.map +0 -1
- package/dist/src/plugins/github-client.d.ts +0 -320
- package/dist/src/plugins/github-client.d.ts.map +0 -1
- package/dist/src/plugins/github.d.ts +0 -89
- package/dist/src/plugins/github.d.ts.map +0 -1
- package/dist/src/plugins/gmail-client.d.ts +0 -106
- package/dist/src/plugins/gmail-client.d.ts.map +0 -1
- package/dist/src/plugins/gmail.d.ts +0 -87
- package/dist/src/plugins/gmail.d.ts.map +0 -1
- package/dist/src/plugins/server-client.d.ts +0 -18
- package/dist/src/plugins/server-client.d.ts.map +0 -1
- package/dist/src/plugins/types.d.ts +0 -70
- package/dist/src/plugins/types.d.ts.map +0 -1
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Helper functions to convert MCP tools to Anthropic Claude API format
|
|
5
5
|
*/
|
|
6
6
|
import type { MCPClient } from "../client.js";
|
|
7
|
-
import type { MCPTool } from "../protocol/messages.js";
|
|
8
7
|
import { type AIToolsOptions } from "./utils.js";
|
|
9
8
|
import type Anthropic from "@anthropic-ai/sdk";
|
|
10
9
|
/**
|
|
@@ -43,100 +42,6 @@ export interface AnthropicToolResultBlock {
|
|
|
43
42
|
tool_use_id: string;
|
|
44
43
|
content: string;
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Convert a single MCP tool to Anthropic Claude API format
|
|
48
|
-
*
|
|
49
|
-
* @param mcpTool - The MCP tool definition
|
|
50
|
-
* @param client - The MCP client instance (used for executing the tool)
|
|
51
|
-
* @param options - Optional configuration including provider tokens
|
|
52
|
-
* @returns Anthropic compatible tool definition
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* const anthropicTool = convertMCPToolToAnthropic(mcpTool, client);
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export declare function convertMCPToolToAnthropic(mcpTool: MCPTool, _client: MCPClient<any>, _options?: AnthropicToolsOptions): AnthropicTool;
|
|
60
|
-
/**
|
|
61
|
-
* Convert all enabled MCP tools to Anthropic Claude API format
|
|
62
|
-
*
|
|
63
|
-
* @param client - The MCP client instance (must be connected)
|
|
64
|
-
* @param options - Optional configuration including provider tokens
|
|
65
|
-
* @returns Array of Anthropic compatible tool definitions
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* // Client-side usage
|
|
70
|
-
* const tools = convertMCPToolsToAnthropic(mcpClient);
|
|
71
|
-
*
|
|
72
|
-
* // Server-side with provider tokens
|
|
73
|
-
* const tools = convertMCPToolsToAnthropic(serverClient, {
|
|
74
|
-
* providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
|
|
75
|
-
* });
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare function convertMCPToolsToAnthropic(client: MCPClient<any>, options?: AnthropicToolsOptions): AnthropicTool[];
|
|
79
|
-
/**
|
|
80
|
-
* Execute a tool call from Anthropic's response
|
|
81
|
-
*
|
|
82
|
-
* @param client - The MCP client instance
|
|
83
|
-
* @param toolUse - The tool use block from Anthropic response
|
|
84
|
-
* @param options - Optional configuration including provider tokens
|
|
85
|
-
* @returns Tool execution result as JSON string
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const result = await executeAnthropicToolCall(client, {
|
|
90
|
-
* type: 'tool_use',
|
|
91
|
-
* id: 'toolu_123',
|
|
92
|
-
* name: 'github_create_issue',
|
|
93
|
-
* input: { owner: 'user', repo: 'repo', title: 'Bug' }
|
|
94
|
-
* }, { providerTokens });
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
export declare function executeAnthropicToolCall(client: MCPClient<any>, toolUse: AnthropicToolUseBlock, options?: AnthropicToolsOptions): Promise<string>;
|
|
98
|
-
/**
|
|
99
|
-
* Handle all tool calls from Anthropic's message response
|
|
100
|
-
* Executes all tool use blocks and returns tool result blocks
|
|
101
|
-
*
|
|
102
|
-
* @param client - The MCP client instance
|
|
103
|
-
* @param messageContent - Array of content blocks from Anthropic message
|
|
104
|
-
* @param options - Optional configuration including provider tokens
|
|
105
|
-
* @returns Array of tool result blocks ready to send back to Claude
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```typescript
|
|
109
|
-
* const response = await anthropic.messages.create({
|
|
110
|
-
* model: 'claude-3-5-sonnet-20241022',
|
|
111
|
-
* max_tokens: 1024,
|
|
112
|
-
* tools,
|
|
113
|
-
* messages: [{ role: 'user', content: 'Create a GitHub issue' }]
|
|
114
|
-
* });
|
|
115
|
-
*
|
|
116
|
-
* // Handle tool calls
|
|
117
|
-
* const toolResults = await handleAnthropicToolCalls(
|
|
118
|
-
* client,
|
|
119
|
-
* response.content,
|
|
120
|
-
* { providerTokens }
|
|
121
|
-
* );
|
|
122
|
-
*
|
|
123
|
-
* // Continue conversation with tool results
|
|
124
|
-
* const finalResponse = await anthropic.messages.create({
|
|
125
|
-
* model: 'claude-3-5-sonnet-20241022',
|
|
126
|
-
* max_tokens: 1024,
|
|
127
|
-
* tools,
|
|
128
|
-
* messages: [
|
|
129
|
-
* { role: 'user', content: 'Create a GitHub issue' },
|
|
130
|
-
* { role: 'assistant', content: response.content },
|
|
131
|
-
* { role: 'user', content: toolResults }
|
|
132
|
-
* ]
|
|
133
|
-
* });
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
export declare function handleAnthropicToolCalls(client: MCPClient<any>, messageContent: Array<{
|
|
137
|
-
type: string;
|
|
138
|
-
[key: string]: any;
|
|
139
|
-
}>, options?: AnthropicToolsOptions): Promise<AnthropicToolResultBlock[]>;
|
|
140
45
|
/**
|
|
141
46
|
* Get tools in a format compatible with Anthropic Claude API
|
|
142
47
|
*
|
|
@@ -193,7 +98,7 @@ export declare function getAnthropicTools(client: MCPClient<any>, options?: Anth
|
|
|
193
98
|
* @param client - The MCP client instance
|
|
194
99
|
* @param message - The complete Message object from Anthropic
|
|
195
100
|
* @param options - Optional configuration including provider tokens
|
|
196
|
-
* @returns
|
|
101
|
+
* @returns Tool execution results as MessageParam[] if tools were called, otherwise returns the original message
|
|
197
102
|
*
|
|
198
103
|
* @example
|
|
199
104
|
* ```typescript
|
|
@@ -206,7 +111,6 @@ export declare function getAnthropicTools(client: MCPClient<any>, options?: Anth
|
|
|
206
111
|
* export async function POST(req: Request) {
|
|
207
112
|
* const { messages } = await req.json();
|
|
208
113
|
*
|
|
209
|
-
* // Initial request with tools
|
|
210
114
|
* const message = await anthropic.messages.create({
|
|
211
115
|
* model: 'claude-3-5-sonnet-20241022',
|
|
212
116
|
* max_tokens: 1024,
|
|
@@ -214,26 +118,9 @@ export declare function getAnthropicTools(client: MCPClient<any>, options?: Anth
|
|
|
214
118
|
* messages,
|
|
215
119
|
* });
|
|
216
120
|
*
|
|
217
|
-
*
|
|
218
|
-
* if (message.stop_reason === 'tool_use') {
|
|
219
|
-
* const toolMessages = await handleAnthropicMessage(serverClient, message);
|
|
220
|
-
*
|
|
221
|
-
* // Continue conversation with tool results
|
|
222
|
-
* const finalMessage = await anthropic.messages.create({
|
|
223
|
-
* model: 'claude-3-5-sonnet-20241022',
|
|
224
|
-
* max_tokens: 1024,
|
|
225
|
-
* tools: await getAnthropicTools(serverClient),
|
|
226
|
-
* messages: [
|
|
227
|
-
* ...messages,
|
|
228
|
-
* { role: 'assistant', content: message.content },
|
|
229
|
-
* ...toolMessages,
|
|
230
|
-
* ],
|
|
231
|
-
* });
|
|
232
|
-
*
|
|
233
|
-
* return Response.json(finalMessage);
|
|
234
|
-
* }
|
|
121
|
+
* const result = await handleAnthropicMessage(serverClient, message);
|
|
235
122
|
*
|
|
236
|
-
* return Response.json(
|
|
123
|
+
* return Response.json(result);
|
|
237
124
|
* }
|
|
238
125
|
* ```
|
|
239
126
|
*
|
|
@@ -245,5 +132,17 @@ export declare function getAnthropicTools(client: MCPClient<any>, options?: Anth
|
|
|
245
132
|
* });
|
|
246
133
|
* ```
|
|
247
134
|
*/
|
|
248
|
-
export declare function handleAnthropicMessage(client: MCPClient<any>, message:
|
|
135
|
+
export declare function handleAnthropicMessage(client: MCPClient<any>, message: {
|
|
136
|
+
role: string;
|
|
137
|
+
content: Array<{
|
|
138
|
+
type: string;
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}>;
|
|
141
|
+
} & Record<string, any>, options?: AnthropicToolsOptions): Promise<Anthropic.Messages.MessageParam[] | ({
|
|
142
|
+
role: string;
|
|
143
|
+
content: Array<{
|
|
144
|
+
type: string;
|
|
145
|
+
[key: string]: any;
|
|
146
|
+
}>;
|
|
147
|
+
} & Record<string, any>)>;
|
|
249
148
|
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/ai/anthropic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/ai/anthropic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,C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AAI,EAAE,MAAM,CAAC;QAAA,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACpG,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAA,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAkC5I"}
|
package/dist/src/ai/google.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Helper functions to convert MCP tools to Google GenAI format
|
|
5
5
|
*/
|
|
6
6
|
import type { MCPClient } from "../client.js";
|
|
7
|
-
import type { MCPTool } from "../protocol/messages.js";
|
|
8
7
|
import { type AIToolsOptions } from "./utils.js";
|
|
9
8
|
import type { Schema, FunctionDeclaration, FunctionCall, Type } from "@google/genai";
|
|
10
9
|
export type GoogleTool = FunctionDeclaration;
|
|
@@ -15,68 +14,6 @@ export type { Schema, Type };
|
|
|
15
14
|
*/
|
|
16
15
|
export interface GoogleToolsOptions extends AIToolsOptions {
|
|
17
16
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Convert a single MCP tool to Google GenAI format
|
|
20
|
-
*
|
|
21
|
-
* @param mcpTool - The MCP tool definition
|
|
22
|
-
* @param client - The MCP client instance (used for executing the tool)
|
|
23
|
-
* @param options - Optional configuration including provider tokens
|
|
24
|
-
* @returns Google GenAI compatible tool definition
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const googleTool = await convertMCPToolToGoogle(mcpTool, client);
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function convertMCPToolToGoogle(mcpTool: MCPTool, _client: MCPClient<any>, _options?: GoogleToolsOptions): Promise<GoogleTool>;
|
|
32
|
-
/**
|
|
33
|
-
* Convert all enabled MCP tools to Google GenAI format
|
|
34
|
-
*
|
|
35
|
-
* @param client - The MCP client instance (must be connected)
|
|
36
|
-
* @param options - Optional configuration including provider tokens
|
|
37
|
-
* @returns Array of Google GenAI compatible tool definitions
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* // Client-side usage
|
|
42
|
-
* const tools = await convertMCPToolsToGoogle(mcpClient);
|
|
43
|
-
*
|
|
44
|
-
* // Server-side with provider tokens
|
|
45
|
-
* const tools = await convertMCPToolsToGoogle(serverClient, {
|
|
46
|
-
* providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export declare function convertMCPToolsToGoogle(client: MCPClient<any>, options?: GoogleToolsOptions): Promise<GoogleTool[]>;
|
|
51
|
-
/**
|
|
52
|
-
* Execute a function call from Google GenAI
|
|
53
|
-
*
|
|
54
|
-
* Automatically extracts provider tokens from the request if not provided.
|
|
55
|
-
*
|
|
56
|
-
* @param client - The MCP client instance
|
|
57
|
-
* @param functionCall - The function call from Google GenAI response
|
|
58
|
-
* @param options - Optional configuration including provider tokens
|
|
59
|
-
* @returns Tool execution result as JSON string
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* // Tokens are automatically extracted
|
|
64
|
-
* const result = await executeGoogleFunctionCall(client, {
|
|
65
|
-
* name: 'github_create_issue',
|
|
66
|
-
* args: { owner: 'user', repo: 'repo', title: 'Bug' }
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* // Or explicitly pass provider tokens
|
|
73
|
-
* const result = await executeGoogleFunctionCall(client, {
|
|
74
|
-
* name: 'github_create_issue',
|
|
75
|
-
* args: { owner: 'user', repo: 'repo', title: 'Bug' }
|
|
76
|
-
* }, { providerTokens });
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
export declare function executeGoogleFunctionCall(client: MCPClient<any>, functionCall: GoogleFunctionCall, options?: GoogleToolsOptions): Promise<string>;
|
|
80
17
|
/**
|
|
81
18
|
* Execute multiple function calls from Google GenAI response
|
|
82
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../src/ai/google.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../src/ai/google.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjH,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,IAAI,EACL,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC7C,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC9C,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAuB7B;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;CAAI;AAsG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,aAAa,EAAE,kBAAkB,EAAE,GAAG,SAAS,GAAG,IAAI,EACtD,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,EAAE,CAAC,CAqCnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,CAkBvB"}
|
package/dist/src/ai/index.d.ts
CHANGED
|
@@ -3,75 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unified interface for all AI provider integrations
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export * from "./google.js";
|
|
12
|
-
export * from "./cloudflare.js";
|
|
13
|
-
export * from "./langchain.js";
|
|
14
|
-
export * from "./llamaindex.js";
|
|
15
|
-
export * from "./mastra.js";
|
|
16
|
-
export * from "./utils.js";
|
|
17
|
-
/**
|
|
18
|
-
* Supported AI provider names
|
|
19
|
-
*/
|
|
20
|
-
export type AIProviderName = "vercel-ai" | "openai" | "anthropic" | "google" | "cloudflare" | "langchain" | "llamaindex" | "mastra";
|
|
21
|
-
/**
|
|
22
|
-
* Generic function to get AI tools for any supported provider
|
|
23
|
-
*
|
|
24
|
-
* This provides a unified interface for getting tools from any AI provider.
|
|
25
|
-
* Use this when you want to dynamically switch between providers or support multiple providers.
|
|
26
|
-
*
|
|
27
|
-
* @param client - The MCP client instance
|
|
28
|
-
* @param provider - The AI provider name
|
|
29
|
-
* @param options - Optional configuration including provider tokens for server-side usage
|
|
30
|
-
* @returns Tools in the format expected by the specified provider
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* // Dynamic provider selection
|
|
35
|
-
* import { createMCPClient, githubIntegration } from 'integrate-sdk';
|
|
36
|
-
* import { getAITools } from 'integrate-sdk/integrations';
|
|
37
|
-
*
|
|
38
|
-
* const client = createMCPClient({
|
|
39
|
-
* integrations: [githubIntegration({ clientId: '...' })],
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* // Choose provider at runtime
|
|
43
|
-
* const provider = process.env.AI_PROVIDER || 'openai';
|
|
44
|
-
* const tools = await getAITools(client, provider as any);
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* // Server-side with provider tokens
|
|
50
|
-
* import { createMCPServer, githubIntegration } from 'integrate-sdk/server';
|
|
51
|
-
* import { getAITools } from 'integrate-sdk/integrations';
|
|
52
|
-
*
|
|
53
|
-
* const { client: serverClient } = createMCPServer({
|
|
54
|
-
* integrations: [githubIntegration({
|
|
55
|
-
* clientId: '...',
|
|
56
|
-
* clientSecret: '...'
|
|
57
|
-
* })],
|
|
58
|
-
* });
|
|
59
|
-
*
|
|
60
|
-
* export async function POST(req: Request) {
|
|
61
|
-
* const providerTokens = JSON.parse(req.headers.get('x-integrate-tokens') || '{}');
|
|
62
|
-
*
|
|
63
|
-
* // Support multiple providers
|
|
64
|
-
* const tools = await getAITools(serverClient, 'anthropic', { providerTokens });
|
|
65
|
-
* // ... use with Anthropic SDK
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare function getAITools(client: MCPClient<any>, provider: "vercel-ai", options?: AIToolsOptions): Promise<Record<string, any>>;
|
|
70
|
-
export declare function getAITools(client: MCPClient<any>, provider: "openai", options?: AIToolsOptions): Promise<Array<any>>;
|
|
71
|
-
export declare function getAITools(client: MCPClient<any>, provider: "anthropic", options?: AIToolsOptions): Promise<Array<any>>;
|
|
72
|
-
export declare function getAITools(client: MCPClient<any>, provider: "google", options?: AIToolsOptions): Promise<Array<any>>;
|
|
73
|
-
export declare function getAITools(client: MCPClient<any>, provider: "cloudflare", options?: AIToolsOptions): Promise<Record<string, any>>;
|
|
74
|
-
export declare function getAITools(client: MCPClient<any>, provider: "langchain", options?: AIToolsOptions): Promise<Array<any>>;
|
|
75
|
-
export declare function getAITools(client: MCPClient<any>, provider: "llamaindex", options?: AIToolsOptions): Promise<Array<any>>;
|
|
76
|
-
export declare function getAITools(client: MCPClient<any>, provider: "mastra", options?: AIToolsOptions): Promise<Record<string, any>>;
|
|
6
|
+
export { getVercelAITools, type VercelAITool, type VercelAIToolsOptions } from "./vercel-ai.js";
|
|
7
|
+
export { getOpenAITools, handleOpenAIResponse, type OpenAITool, type OpenAIToolsOptions } from "./openai.js";
|
|
8
|
+
export { getAnthropicTools, handleAnthropicMessage, type AnthropicTool, type AnthropicToolsOptions, type AnthropicToolUseBlock, type AnthropicToolResultBlock } from "./anthropic.js";
|
|
9
|
+
export { getGoogleTools, executeGoogleFunctionCalls, type GoogleTool, type GoogleFunctionCall, type GoogleToolsOptions } from "./google.js";
|
|
10
|
+
export type { AIToolsOptions } from "./utils.js";
|
|
77
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/src/ai/openai.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Helper functions to convert MCP tools to OpenAI Responses API format
|
|
5
5
|
*/
|
|
6
6
|
import type { MCPClient } from "../client.js";
|
|
7
|
-
import type { MCPTool } from "../protocol/messages.js";
|
|
8
7
|
import { type AIToolsOptions } from "./utils.js";
|
|
9
8
|
import type { OpenAI } from "openai";
|
|
10
9
|
/**
|
|
@@ -30,61 +29,6 @@ export interface OpenAIToolsOptions extends AIToolsOptions {
|
|
|
30
29
|
*/
|
|
31
30
|
strict?: boolean;
|
|
32
31
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Convert a single MCP tool to OpenAI Responses API format
|
|
35
|
-
*
|
|
36
|
-
* @param mcpTool - The MCP tool definition
|
|
37
|
-
* @param client - The MCP client instance (used for executing the tool)
|
|
38
|
-
* @param options - Optional configuration including provider tokens and strict mode
|
|
39
|
-
* @returns OpenAI compatible tool definition
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const openaiTool = convertMCPToolToOpenAI(mcpTool, client, { strict: true });
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function convertMCPToolToOpenAI(mcpTool: MCPTool, _client: MCPClient<any>, options?: OpenAIToolsOptions): OpenAITool;
|
|
47
|
-
/**
|
|
48
|
-
* Convert all enabled MCP tools to OpenAI Responses API format
|
|
49
|
-
*
|
|
50
|
-
* @param client - The MCP client instance (must be connected)
|
|
51
|
-
* @param options - Optional configuration including provider tokens and strict mode
|
|
52
|
-
* @returns Array of OpenAI compatible tool definitions
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* // Client-side usage
|
|
57
|
-
* const tools = convertMCPToolsToOpenAI(mcpClient);
|
|
58
|
-
*
|
|
59
|
-
* // Server-side with provider tokens
|
|
60
|
-
* const tools = convertMCPToolsToOpenAI(serverClient, {
|
|
61
|
-
* providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
|
|
62
|
-
* });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export declare function convertMCPToolsToOpenAI(client: MCPClient<any>, options?: OpenAIToolsOptions): OpenAITool[];
|
|
66
|
-
/**
|
|
67
|
-
* Execute a tool call from OpenAI's response
|
|
68
|
-
*
|
|
69
|
-
* @param client - The MCP client instance
|
|
70
|
-
* @param toolCall - The tool call from OpenAI response
|
|
71
|
-
* @param options - Optional configuration including provider tokens
|
|
72
|
-
* @returns Tool execution result as JSON string
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```typescript
|
|
76
|
-
* const result = await executeOpenAIToolCall(client, {
|
|
77
|
-
* id: 'call_123',
|
|
78
|
-
* name: 'github_create_issue',
|
|
79
|
-
* arguments: '{"owner":"user","repo":"repo","title":"Bug"}'
|
|
80
|
-
* }, { providerTokens });
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
export declare function executeOpenAIToolCall(client: MCPClient<any>, toolCall: {
|
|
84
|
-
id: string;
|
|
85
|
-
name: string;
|
|
86
|
-
arguments: string;
|
|
87
|
-
}, options?: OpenAIToolsOptions): Promise<string>;
|
|
88
32
|
/**
|
|
89
33
|
* Get tools in a format compatible with OpenAI Responses API
|
|
90
34
|
*
|
|
@@ -125,42 +69,6 @@ export declare function executeOpenAIToolCall(client: MCPClient<any>, toolCall:
|
|
|
125
69
|
* ```
|
|
126
70
|
*/
|
|
127
71
|
export declare function getOpenAITools(client: MCPClient<any>, options?: OpenAIToolsOptions): Promise<OpenAITool[]>;
|
|
128
|
-
/**
|
|
129
|
-
* Handle multiple tool calls from OpenAI's response output
|
|
130
|
-
*
|
|
131
|
-
* This function processes all function_call items from the response output,
|
|
132
|
-
* executes each tool call, and returns formatted results for the next request.
|
|
133
|
-
*
|
|
134
|
-
* @param client - The MCP client instance
|
|
135
|
-
* @param toolCalls - Array of output items from OpenAI response (filters for function_call type)
|
|
136
|
-
* @param options - Optional configuration including provider tokens
|
|
137
|
-
* @returns Array of function call outputs to send back to OpenAI
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* // Handle tool calls from a response
|
|
142
|
-
* const response = await openai.responses.create({
|
|
143
|
-
* model: 'gpt-4o-2024-11-20',
|
|
144
|
-
* input: 'Create a GitHub issue',
|
|
145
|
-
* tools: await getOpenAITools(serverClient),
|
|
146
|
-
* });
|
|
147
|
-
*
|
|
148
|
-
* // Execute the tool calls and get outputs
|
|
149
|
-
* const toolOutputs = await handleOpenAIToolCalls(
|
|
150
|
-
* serverClient,
|
|
151
|
-
* response.output,
|
|
152
|
-
* { providerTokens }
|
|
153
|
-
* );
|
|
154
|
-
*
|
|
155
|
-
* // Continue the conversation with tool results
|
|
156
|
-
* const nextResponse = await openai.responses.create({
|
|
157
|
-
* model: 'gpt-4o-2024-11-20',
|
|
158
|
-
* input: toolOutputs,
|
|
159
|
-
* tools: await getOpenAITools(serverClient),
|
|
160
|
-
* });
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
export declare function handleOpenAIToolCalls(client: MCPClient<any>, toolCalls: OpenAI.Responses.ResponseOutputItem[], options?: OpenAIToolsOptions): Promise<OpenAI.Responses.ResponseInputItem.FunctionCallOutput[]>;
|
|
164
72
|
/**
|
|
165
73
|
* Handle an entire OpenAI Response object
|
|
166
74
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/ai/openai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/ai/openai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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E,CAAC,CAAA;CAAE,CAAC,CAyB3H"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import type { MCPClient } from "../client.js";
|
|
8
|
-
import type { MCPTool } from "../protocol/messages.js";
|
|
9
8
|
import type { MCPContext } from "../config/types.js";
|
|
10
9
|
import { type AIToolsOptions } from "./utils.js";
|
|
11
10
|
/**
|
|
@@ -24,71 +23,6 @@ export interface VercelAIToolsOptions extends AIToolsOptions {
|
|
|
24
23
|
/** User context for multi-tenant token storage */
|
|
25
24
|
context?: MCPContext;
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Convert a single MCP tool to Vercel AI SDK format
|
|
29
|
-
*
|
|
30
|
-
* @param mcpTool - The MCP tool definition
|
|
31
|
-
* @param client - The MCP client instance (used for executing the tool)
|
|
32
|
-
* @param options - Optional configuration including provider tokens and context
|
|
33
|
-
* @returns Vercel AI SDK compatible tool definition
|
|
34
|
-
*/
|
|
35
|
-
export declare function convertMCPToolToVercelAI(mcpTool: MCPTool, client: MCPClient<any>, options?: VercelAIToolsOptions): VercelAITool;
|
|
36
|
-
/**
|
|
37
|
-
* Convert all enabled MCP tools to Vercel AI SDK v5 format
|
|
38
|
-
*
|
|
39
|
-
* @param client - The MCP client instance (must be connected)
|
|
40
|
-
* @param options - Optional configuration including provider tokens for server-side usage
|
|
41
|
-
* @returns Object mapping tool names to Vercel AI SDK v5 tool definitions (compatible with CoreTool from 'ai' package v5)
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* // Client-side usage
|
|
46
|
-
* import { createMCPClient, githubIntegration } from 'integrate-sdk';
|
|
47
|
-
* import { convertMCPToolsToVercelAI } from 'integrate-sdk/vercel-ai';
|
|
48
|
-
* import { generateText } from 'ai';
|
|
49
|
-
*
|
|
50
|
-
* const mcpClient = createMCPClient({
|
|
51
|
-
* integrations: [githubIntegration({ clientId: '...', clientSecret: '...' })],
|
|
52
|
-
* });
|
|
53
|
-
*
|
|
54
|
-
* await mcpClient.connect();
|
|
55
|
-
*
|
|
56
|
-
* const tools = convertMCPToolsToVercelAI(mcpClient);
|
|
57
|
-
*
|
|
58
|
-
* const result = await generateText({
|
|
59
|
-
* model: openai('gpt-5'),
|
|
60
|
-
* prompt: 'Create a GitHub issue in my repo',
|
|
61
|
-
* tools,
|
|
62
|
-
* });
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* // Server-side usage with token passing
|
|
68
|
-
* import { createMCPServer, githubIntegration } from 'integrate-sdk/server';
|
|
69
|
-
* import { convertMCPToolsToVercelAI } from 'integrate-sdk/vercel-ai';
|
|
70
|
-
*
|
|
71
|
-
* const { client: serverClient } = createMCPServer({
|
|
72
|
-
* integrations: [githubIntegration({ clientId: '...', clientSecret: '...' })],
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* // In your API route handler
|
|
76
|
-
* export async function POST(req: Request) {
|
|
77
|
-
* const providerTokens = JSON.parse(req.headers.get('x-integrate-tokens') || '{}');
|
|
78
|
-
*
|
|
79
|
-
* const tools = convertMCPToolsToVercelAI(serverClient, { providerTokens });
|
|
80
|
-
*
|
|
81
|
-
* const result = await generateText({
|
|
82
|
-
* model: openai('gpt-4'),
|
|
83
|
-
* prompt: 'Create a GitHub issue',
|
|
84
|
-
* tools,
|
|
85
|
-
* });
|
|
86
|
-
*
|
|
87
|
-
* return Response.json(result);
|
|
88
|
-
* }
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
export declare function convertMCPToolsToVercelAI(client: MCPClient<any>, options?: VercelAIToolsOptions): Record<string, any>;
|
|
92
26
|
/**
|
|
93
27
|
* Get tools in a format compatible with Vercel AI SDK v5's tools parameter
|
|
94
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel-ai.d.ts","sourceRoot":"","sources":["../../../src/ai/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"vercel-ai.d.ts","sourceRoot":"","sources":["../../../src/ai/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,kDAAkD;IAClD,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,oBAAoB,gCAyB/B"}
|
package/dist/src/server.d.ts
CHANGED
|
@@ -160,6 +160,11 @@ export declare const GET: (req: any, context: {
|
|
|
160
160
|
action: string;
|
|
161
161
|
}>;
|
|
162
162
|
}) => Promise<any>;
|
|
163
|
+
export { getVercelAITools } from './ai/vercel-ai.js';
|
|
164
|
+
export { getOpenAITools, handleOpenAIResponse } from './ai/openai.js';
|
|
165
|
+
export { getAnthropicTools, handleAnthropicMessage } from './ai/anthropic.js';
|
|
166
|
+
export { getGoogleTools, executeGoogleFunctionCalls } from './ai/google.js';
|
|
167
|
+
export * from './ai/index.js';
|
|
163
168
|
/**
|
|
164
169
|
* Create catch-all route handlers for Next.js
|
|
165
170
|
*
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,aAAa,SAAS,SAAS,cAAc,EAAE,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG;IACxG,uEAAuE;IACvE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtH,qDAAqD;IACrD,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;QAAE,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7G,oDAAoD;IACpD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;QAAE,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO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