integrate-sdk 0.8.39 → 0.8.41-dev.0
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/adapters/auto-routes.js +1471 -60
- package/dist/adapters/index.js +1471 -60
- package/dist/adapters/nextjs.js +1471 -60
- package/dist/adapters/node.js +1471 -60
- package/dist/adapters/svelte-kit.js +1471 -60
- package/dist/adapters/tanstack-start.js +1471 -60
- package/dist/ai/anthropic.d.ts.map +1 -1
- package/dist/ai/anthropic.js +1240 -21
- package/dist/ai/google.d.ts.map +1 -1
- package/dist/ai/google.js +1292 -18
- package/dist/ai/index.js +1300 -60
- package/dist/ai/openai.d.ts.map +1 -1
- package/dist/ai/openai.js +1240 -21
- package/dist/index.js +1471 -60
- package/dist/oauth.js +1471 -60
- package/dist/server.js +1471 -60
- package/dist/src/ai/anthropic.d.ts.map +1 -1
- package/dist/src/ai/google.d.ts.map +1 -1
- package/dist/src/ai/openai.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/adapters/base-handler.js +0 -561
- 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
package/dist/ai/mastra.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mastra AI SDK Integration
|
|
3
|
-
*
|
|
4
|
-
* Helper functions to convert MCP tools to Mastra AI SDK format
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import type { MCPClient } from "../client.js";
|
|
8
|
-
import type { MCPTool } from "../protocol/messages.js";
|
|
9
|
-
import { type AIToolsOptions } from "./utils.js";
|
|
10
|
-
/**
|
|
11
|
-
* Mastra tool definition
|
|
12
|
-
* Compatible with @mastra/core
|
|
13
|
-
*/
|
|
14
|
-
export interface MastraTool {
|
|
15
|
-
id: string;
|
|
16
|
-
description: string;
|
|
17
|
-
inputSchema?: z.ZodType<any>;
|
|
18
|
-
outputSchema?: z.ZodType<any>;
|
|
19
|
-
execute: (params: {
|
|
20
|
-
context: Record<string, unknown>;
|
|
21
|
-
}) => Promise<any>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Options for converting MCP tools to Mastra format
|
|
25
|
-
*/
|
|
26
|
-
export interface MastraToolsOptions extends AIToolsOptions {
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Convert a single MCP tool to Mastra AI SDK format
|
|
30
|
-
*
|
|
31
|
-
* @param mcpTool - The MCP tool definition
|
|
32
|
-
* @param client - The MCP client instance (used for executing the tool)
|
|
33
|
-
* @param options - Optional configuration including provider tokens
|
|
34
|
-
* @returns Mastra compatible tool definition
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* const mastraTool = convertMCPToolToMastra(mcpTool, client);
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function convertMCPToolToMastra(mcpTool: MCPTool, client: MCPClient<any>, options?: MastraToolsOptions): MastraTool;
|
|
42
|
-
/**
|
|
43
|
-
* Convert all enabled MCP tools to Mastra AI SDK format
|
|
44
|
-
* Returns a dictionary keyed by tool ID
|
|
45
|
-
*
|
|
46
|
-
* @param client - The MCP client instance (must be connected)
|
|
47
|
-
* @param options - Optional configuration including provider tokens
|
|
48
|
-
* @returns Dictionary of Mastra compatible tool definitions
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* // Client-side usage
|
|
53
|
-
* const tools = convertMCPToolsToMastra(mcpClient);
|
|
54
|
-
*
|
|
55
|
-
* // Server-side with provider tokens
|
|
56
|
-
* const tools = convertMCPToolsToMastra(serverClient, {
|
|
57
|
-
* providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
|
|
58
|
-
* });
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare function convertMCPToolsToMastra(client: MCPClient<any>, options?: MastraToolsOptions): Record<string, MastraTool>;
|
|
62
|
-
/**
|
|
63
|
-
* Get tools in a format compatible with Mastra AI SDK
|
|
64
|
-
*
|
|
65
|
-
* Automatically connects the client if not already connected.
|
|
66
|
-
* Returns tool configurations that can be used with Mastra's tool system.
|
|
67
|
-
*
|
|
68
|
-
* @param client - The MCP client instance
|
|
69
|
-
* @param options - Optional configuration including provider tokens for server-side usage
|
|
70
|
-
* @returns Dictionary of tools ready to use with Mastra AI SDK
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* // Client-side usage
|
|
75
|
-
* import { createMCPClient, githubIntegration } from 'integrate-sdk';
|
|
76
|
-
* import { getMastraTools } from 'integrate-sdk/ai/mastra';
|
|
77
|
-
* import { createTool, Agent } from '@mastra/core';
|
|
78
|
-
*
|
|
79
|
-
* const client = createMCPClient({
|
|
80
|
-
* integrations: [githubIntegration({ clientId: '...' })],
|
|
81
|
-
* });
|
|
82
|
-
*
|
|
83
|
-
* const toolConfigs = await getMastraTools(client);
|
|
84
|
-
*
|
|
85
|
-
* // Create Mastra tools
|
|
86
|
-
* const tools = Object.fromEntries(
|
|
87
|
-
* Object.entries(toolConfigs).map(([id, config]) => [
|
|
88
|
-
* id,
|
|
89
|
-
* createTool(config)
|
|
90
|
-
* ])
|
|
91
|
-
* );
|
|
92
|
-
*
|
|
93
|
-
* const agent = new Agent({
|
|
94
|
-
* tools,
|
|
95
|
-
* model: { provider: 'openai', name: 'gpt-4' }
|
|
96
|
-
* });
|
|
97
|
-
*
|
|
98
|
-
* const result = await agent.generate('Create a GitHub issue');
|
|
99
|
-
* ```
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```typescript
|
|
103
|
-
* // Server-side usage with tokens from client
|
|
104
|
-
* import { createMCPServer, githubIntegration } from 'integrate-sdk/server';
|
|
105
|
-
* import { getMastraTools } from 'integrate-sdk/ai/mastra';
|
|
106
|
-
*
|
|
107
|
-
* const { client: serverClient } = createMCPServer({
|
|
108
|
-
* integrations: [githubIntegration({
|
|
109
|
-
* clientId: '...',
|
|
110
|
-
* clientSecret: '...'
|
|
111
|
-
* })],
|
|
112
|
-
* });
|
|
113
|
-
*
|
|
114
|
-
* // In your API route
|
|
115
|
-
* export async function POST(req: Request) {
|
|
116
|
-
* const providerTokens = JSON.parse(req.headers.get('x-integrate-tokens') || '{}');
|
|
117
|
-
* const toolConfigs = await getMastraTools(serverClient, { providerTokens });
|
|
118
|
-
*
|
|
119
|
-
* // Create Mastra tools
|
|
120
|
-
* const tools = Object.fromEntries(
|
|
121
|
-
* Object.entries(toolConfigs).map(([id, config]) => [
|
|
122
|
-
* id,
|
|
123
|
-
* createTool(config)
|
|
124
|
-
* ])
|
|
125
|
-
* );
|
|
126
|
-
*
|
|
127
|
-
* const agent = new Agent({
|
|
128
|
-
* tools,
|
|
129
|
-
* model: { provider: 'openai', name: 'gpt-4' }
|
|
130
|
-
* });
|
|
131
|
-
*
|
|
132
|
-
* const result = await agent.generate('Create a GitHub issue');
|
|
133
|
-
* return Response.json(result);
|
|
134
|
-
* }
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
137
|
-
export declare function getMastraTools(client: MCPClient<any>, options?: MastraToolsOptions): Promise<Record<string, MastraTool>>;
|
|
138
|
-
//# sourceMappingURL=mastra.d.ts.map
|
package/dist/ai/mastra.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mastra.d.ts","sourceRoot":"","sources":["../../../src/ai/mastra.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,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