integrate-sdk 0.7.43 → 0.7.44

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.
@@ -1,99 +0,0 @@
1
- /**
2
- * OpenAI Agents Integration
3
- *
4
- * Helper functions to convert MCP tools to @openai/agents 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
- * OpenAI Agents tool definition
12
- * Compatible with @openai/agents package
13
- */
14
- export interface OpenAIAgentsTool {
15
- name: string;
16
- description: string;
17
- parameters: z.ZodType<any>;
18
- execute: (args: any) => Promise<any>;
19
- }
20
- /**
21
- * Options for converting MCP tools to OpenAI Agents format
22
- */
23
- export interface OpenAIAgentsToolsOptions extends AIToolsOptions {
24
- }
25
- /**
26
- * Convert a single MCP tool to OpenAI Agents format
27
- *
28
- * @param mcpTool - The MCP tool definition
29
- * @param client - The MCP client instance (used for executing the tool)
30
- * @param options - Optional configuration including provider tokens
31
- * @returns OpenAI Agents compatible tool definition
32
- *
33
- * @example
34
- * ```typescript
35
- * const agentTool = convertMCPToolToOpenAIAgents(mcpTool, client);
36
- * ```
37
- */
38
- export declare function convertMCPToolToOpenAIAgents(mcpTool: MCPTool, client: MCPClient<any>, options?: OpenAIAgentsToolsOptions): OpenAIAgentsTool;
39
- /**
40
- * Convert all enabled MCP tools to OpenAI Agents format
41
- *
42
- * @param client - The MCP client instance (must be connected)
43
- * @param options - Optional configuration including provider tokens
44
- * @returns Array of OpenAI Agents compatible tool definitions
45
- *
46
- * @example
47
- * ```typescript
48
- * // Client-side usage
49
- * const tools = convertMCPToolsToOpenAIAgents(mcpClient);
50
- *
51
- * // Server-side with provider tokens
52
- * const tools = convertMCPToolsToOpenAIAgents(serverClient, {
53
- * providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
54
- * });
55
- * ```
56
- */
57
- export declare function convertMCPToolsToOpenAIAgents(client: MCPClient<any>, options?: OpenAIAgentsToolsOptions): OpenAIAgentsTool[];
58
- /**
59
- * Get tools in a format compatible with @openai/agents
60
- *
61
- * Automatically connects the client if not already connected.
62
- *
63
- * **Auto-extraction**: Provider tokens are automatically extracted from request headers
64
- * or environment variables if not provided in options.
65
- *
66
- * @param client - The MCP client instance
67
- * @param options - Optional configuration including provider tokens for server-side usage
68
- * @returns Array of tools ready to use with @openai/agents
69
- *
70
- * @example
71
- * ```typescript
72
- * // Auto-extraction (recommended)
73
- * import { serverClient } from '@/lib/integrate-server';
74
- * import { getOpenAIAgentsTools } from 'integrate-sdk';
75
- * import { Agent } from '@openai/agents';
76
- *
77
- * export async function POST(req: Request) {
78
- * const tools = await getOpenAIAgentsTools(serverClient); // Tokens auto-extracted
79
- *
80
- * const agent = new Agent({
81
- * model: 'gpt-4o',
82
- * tools,
83
- * });
84
- *
85
- * const result = await agent.run('Create a GitHub issue');
86
- * return Response.json({ result });
87
- * }
88
- * ```
89
- *
90
- * @example
91
- * ```typescript
92
- * // Manual override
93
- * const tools = await getOpenAIAgentsTools(serverClient, {
94
- * providerTokens: { github: 'ghp_...', gmail: 'ya29...' }
95
- * });
96
- * ```
97
- */
98
- export declare function getOpenAIAgentsTools(client: MCPClient<any>, options?: OpenAIAgentsToolsOptions): Promise<OpenAIAgentsTool[]>;
99
- //# sourceMappingURL=openai-agents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openai-agents.d.ts","sourceRoot":"","sources":["../../../src/ai/openai-agents.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,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,cAAc;CAAI;AAEpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,wBAAwB,GACjC,gBAAgB,CASlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,wBAAwB,GACjC,gBAAgB,EAAE,CAGpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAe7B"}