integrate-sdk 0.9.25 → 0.9.26-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/index.js +28 -10
- package/dist/adapters/solid-start.js +28 -10
- package/dist/adapters/svelte-kit.js +28 -10
- package/dist/ai/anthropic.js +11 -1
- package/dist/ai/google.js +11 -1
- package/dist/ai/index.js +11 -1
- package/dist/ai/openai.js +11 -1
- package/dist/ai/vercel-ai.js +11 -1
- package/dist/code-mode/executor.js +5 -1
- package/dist/code-mode/index.js +11 -1
- package/dist/code-mode/runtime-stub.d.ts +1 -1
- package/dist/code-mode/runtime-stub.d.ts.map +1 -1
- package/dist/code-mode/runtime-stub.js +5 -1
- package/dist/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/code-mode/tool-builder.js +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -10
- package/dist/server.js +292 -64
- package/dist/src/code-mode/runtime-stub.d.ts +1 -1
- package/dist/src/code-mode/runtime-stub.d.ts.map +1 -1
- package/dist/src/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/src/integrations/excel-client.d.ts +284 -0
- package/dist/src/integrations/excel-client.d.ts.map +1 -0
- package/dist/src/integrations/excel.d.ts +22 -0
- package/dist/src/integrations/excel.d.ts.map +1 -0
- package/dist/src/integrations/gdrive-client.d.ts +264 -0
- package/dist/src/integrations/gdrive-client.d.ts.map +1 -0
- package/dist/src/integrations/gdrive.d.ts +22 -0
- package/dist/src/integrations/gdrive.d.ts.map +1 -0
- package/dist/src/integrations/onedrive-client.d.ts +47 -250
- package/dist/src/integrations/onedrive-client.d.ts.map +1 -1
- package/dist/src/integrations/onedrive.d.ts +1 -1
- package/dist/src/integrations/onedrive.d.ts.map +1 -1
- package/dist/src/integrations/powerpoint-client.d.ts +99 -0
- package/dist/src/integrations/powerpoint-client.d.ts.map +1 -0
- package/dist/src/integrations/powerpoint.d.ts +22 -0
- package/dist/src/integrations/powerpoint.d.ts.map +1 -0
- package/dist/src/integrations/whatsapp-client.d.ts +406 -211
- package/dist/src/integrations/whatsapp-client.d.ts.map +1 -1
- package/dist/src/integrations/whatsapp.d.ts +1 -1
- package/dist/src/integrations/whatsapp.d.ts.map +1 -1
- package/dist/src/integrations/word-client.d.ts +99 -0
- package/dist/src/integrations/word-client.d.ts.map +1 -0
- package/dist/src/integrations/word.d.ts +22 -0
- package/dist/src/integrations/word.d.ts.map +1 -0
- package/dist/src/integrations/youtube-client.d.ts +292 -283
- package/dist/src/integrations/youtube-client.d.ts.map +1 -1
- package/dist/src/integrations/youtube.d.ts +2 -2
- package/dist/src/integrations/youtube.d.ts.map +1 -1
- package/dist/src/server.d.ts +4 -0
- package/dist/src/server.d.ts.map +1 -1
- package/index.ts +8 -0
- package/package.json +1 -1
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* dependencies. It is NOT imported by the host SDK — it only ships as a
|
|
13
13
|
* literal payload to the sandbox.
|
|
14
14
|
*/
|
|
15
|
-
export declare const RUNTIME_STUB_SOURCE = "// runtime.mjs \u2014 generated by integrate-sdk code mode\nconst MCP_URL = process.env.INTEGRATE_MCP_URL;\nconst SESSION_TOKEN = process.env.INTEGRATE_SESSION_TOKEN;\nconst API_KEY = process.env.INTEGRATE_API_KEY || '';\nconst PROVIDER_TOKENS = process.env.INTEGRATE_PROVIDER_TOKENS || '';\nconst INTEGRATIONS_HEADER = process.env.INTEGRATE_INTEGRATIONS || '';\nconst CONTEXT_JSON = process.env.INTEGRATE_CONTEXT || '';\n\nif (!MCP_URL) {\n throw new Error('INTEGRATE_MCP_URL is not set \u2014 the sandbox cannot reach the MCP route.');\n}\n\nfunction camelToSnake(str) {\n return str.replace(/[A-Z]/g, (letter) => '_' + letter.toLowerCase());\n}\n\nasync function callTool(toolName, args) {\n const headers = {\n 'Content-Type': 'application/json',\n 'x-integrate-code-mode': '1',\n };\n if (SESSION_TOKEN) headers['Authorization'] = 'Bearer ' + SESSION_TOKEN;\n if (API_KEY) headers['x-integrate-api-key'] = API_KEY;\n if (PROVIDER_TOKENS) headers['x-integrate-tokens'] = PROVIDER_TOKENS;\n if (INTEGRATIONS_HEADER) headers['x-integrations'] = INTEGRATIONS_HEADER;\n if (CONTEXT_JSON) headers['x-integrate-context'] = CONTEXT_JSON;\n\n const res = await fetch(MCP_URL, {\n method: 'POST',\n headers,\n body: JSON.stringify({ name: toolName, arguments: args || {} }),\n });\n\n const text = await res.text();\n\n let payload;\n try {\n payload = text ? JSON.parse(text) : null;\n } catch {\n payload = { content: [{ type: 'text', text }] };\n }\n\n if (!res.ok) {\n let message = (payload && (payload.error || payload.message)) || 'Tool call failed: HTTP ' + res.status;\n if ((res.status === 401 || res.status === 403) && typeof text === 'string' && text.indexOf('Authorization header') !== -1) {\n message =\n 'Code Mode callback was rejected by the MCP server (HTTP ' + res.status + '). ' +\n 'The SDK route could not synthesize an Authorization header. Check the host-side ' +\n 'createMCPServer config (apiKey, getProviderToken) or pass providerTokens to the ' +\n 'AI helper. Original upstream message: ' + text;\n }\n const err = new Error(message);\n err.status = res.status;\n err.toolName = toolName;\n throw err;\n }\n\n return payload;\n}\n\nfunction createIntegrationProxy(integrationId) {\n return new Proxy({}, {\n get(_target, methodName) {\n if (typeof methodName !== 'string') return undefined;\n return (args) =>
|
|
15
|
+
export declare const RUNTIME_STUB_SOURCE = "// runtime.mjs \u2014 generated by integrate-sdk code mode\nconst MCP_URL = process.env.INTEGRATE_MCP_URL;\nconst SESSION_TOKEN = process.env.INTEGRATE_SESSION_TOKEN;\nconst API_KEY = process.env.INTEGRATE_API_KEY || '';\nconst PROVIDER_TOKENS = process.env.INTEGRATE_PROVIDER_TOKENS || '';\nconst INTEGRATIONS_HEADER = process.env.INTEGRATE_INTEGRATIONS || '';\nconst CONTEXT_JSON = process.env.INTEGRATE_CONTEXT || '';\n\nif (!MCP_URL) {\n throw new Error('INTEGRATE_MCP_URL is not set \u2014 the sandbox cannot reach the MCP route.');\n}\n\nfunction camelToSnake(str) {\n return str.replace(/[A-Z]/g, (letter) => '_' + letter.toLowerCase());\n}\n\nasync function callTool(toolName, args) {\n const headers = {\n 'Content-Type': 'application/json',\n 'x-integrate-code-mode': '1',\n };\n if (SESSION_TOKEN) headers['Authorization'] = 'Bearer ' + SESSION_TOKEN;\n if (API_KEY) headers['x-integrate-api-key'] = API_KEY;\n if (PROVIDER_TOKENS) headers['x-integrate-tokens'] = PROVIDER_TOKENS;\n if (INTEGRATIONS_HEADER) headers['x-integrations'] = INTEGRATIONS_HEADER;\n if (CONTEXT_JSON) headers['x-integrate-context'] = CONTEXT_JSON;\n\n const res = await fetch(MCP_URL, {\n method: 'POST',\n headers,\n body: JSON.stringify({ name: toolName, arguments: args || {} }),\n });\n\n const text = await res.text();\n\n let payload;\n try {\n payload = text ? JSON.parse(text) : null;\n } catch {\n payload = { content: [{ type: 'text', text }] };\n }\n\n if (!res.ok) {\n let message = (payload && (payload.error || payload.message)) || 'Tool call failed: HTTP ' + res.status;\n if ((res.status === 401 || res.status === 403) && typeof text === 'string' && text.indexOf('Authorization header') !== -1) {\n message =\n 'Code Mode callback was rejected by the MCP server (HTTP ' + res.status + '). ' +\n 'The SDK route could not synthesize an Authorization header. Check the host-side ' +\n 'createMCPServer config (apiKey, getProviderToken) or pass providerTokens to the ' +\n 'AI helper. Original upstream message: ' + text;\n }\n const err = new Error(message);\n err.status = res.status;\n err.toolName = toolName;\n throw err;\n }\n\n return payload;\n}\n\nfunction createIntegrationProxy(integrationId) {\n return new Proxy({}, {\n get(_target, methodName) {\n if (typeof methodName !== 'string') return undefined;\n return (args) => {\n const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');\n const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);\n return callTool(toolName, args);\n };\n },\n });\n}\n\nexport const client = new Proxy({}, {\n get(_target, integrationId) {\n if (typeof integrationId !== 'string') return undefined;\n return createIntegrationProxy(integrationId);\n },\n});\n\nexport { callTool };\n";
|
|
16
16
|
//# sourceMappingURL=runtime-stub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-stub.d.ts","sourceRoot":"","sources":["../../../src/code-mode/runtime-stub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"runtime-stub.d.ts","sourceRoot":"","sources":["../../../src/code-mode/runtime-stub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,mBAAmB,o4FAiF/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-builder.d.ts","sourceRoot":"","sources":["../../../src/code-mode/tool-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,iCAAiC;IACjC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC9B,SAAS,CAAC,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|
+
/**
|
|
2
|
+
* Excel Integration Client Types
|
|
3
|
+
* Fully typed interface for Excel workbook methods
|
|
4
|
+
*/
|
|
5
|
+
import type { MCPToolCallResponse } from "../protocol/messages.js";
|
|
6
|
+
/**
|
|
7
|
+
* Excel Integration Client Interface
|
|
8
|
+
* Provides type-safe methods for managing Excel workbooks in OneDrive
|
|
9
|
+
*/
|
|
10
|
+
export interface ExcelIntegrationClient {
|
|
11
|
+
/**
|
|
12
|
+
* Search for Excel workbooks
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const workbooks = await client.excel.list({ query: "budget" });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
list(params?: {
|
|
20
|
+
/** Filter by name (default: searches .xlsx) */
|
|
21
|
+
query?: string;
|
|
22
|
+
/** Max results (default 25) */
|
|
23
|
+
top?: number;
|
|
24
|
+
}): Promise<MCPToolCallResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Get metadata for an Excel workbook
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const wb = await client.excel.get({ item_id: "ABC123" });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
get(params: {
|
|
34
|
+
/** Workbook item ID */
|
|
35
|
+
item_id: string;
|
|
36
|
+
}): Promise<MCPToolCallResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new empty .xlsx workbook in OneDrive
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const wb = await client.excel.create({ name: "Monthly Report" });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
create(params: {
|
|
46
|
+
/** File name (.xlsx appended automatically if missing) */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Parent folder item ID (defaults to root) */
|
|
49
|
+
parent_id?: string;
|
|
50
|
+
}): Promise<MCPToolCallResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete an Excel workbook permanently
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* await client.excel.delete({ item_id: "ABC123" });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
delete(params: {
|
|
60
|
+
/** Workbook item ID */
|
|
61
|
+
item_id: string;
|
|
62
|
+
}): Promise<MCPToolCallResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Create a sharing link for an Excel workbook
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const link = await client.excel.share({ item_id: "ABC123", type: "edit" });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
share(params: {
|
|
72
|
+
/** Workbook item ID */
|
|
73
|
+
item_id: string;
|
|
74
|
+
/** view, edit, or embed (default: view) */
|
|
75
|
+
type?: "view" | "edit" | "embed";
|
|
76
|
+
/** anonymous or organization (default: anonymous) */
|
|
77
|
+
scope?: "anonymous" | "organization";
|
|
78
|
+
}): Promise<MCPToolCallResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* List all worksheets in a workbook
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const sheets = await client.excel.listWorksheets({ item_id: "ABC123" });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
listWorksheets(params: {
|
|
88
|
+
/** Workbook item ID */
|
|
89
|
+
item_id: string;
|
|
90
|
+
}): Promise<MCPToolCallResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* Add a new worksheet to a workbook
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* await client.excel.addWorksheet({ item_id: "ABC123", name: "Summary" });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
addWorksheet(params: {
|
|
100
|
+
/** Workbook item ID */
|
|
101
|
+
item_id: string;
|
|
102
|
+
/** New worksheet name */
|
|
103
|
+
name: string;
|
|
104
|
+
}): Promise<MCPToolCallResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Delete a worksheet from a workbook
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* await client.excel.deleteWorksheet({ item_id: "ABC123", worksheet: "Sheet2" });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
deleteWorksheet(params: {
|
|
114
|
+
/** Workbook item ID */
|
|
115
|
+
item_id: string;
|
|
116
|
+
/** Worksheet name or ID */
|
|
117
|
+
worksheet: string;
|
|
118
|
+
}): Promise<MCPToolCallResponse>;
|
|
119
|
+
/**
|
|
120
|
+
* Get values, formulas, and formatting from a cell range
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const data = await client.excel.getRange({
|
|
125
|
+
* item_id: "ABC123",
|
|
126
|
+
* worksheet: "Sheet1",
|
|
127
|
+
* range: "A1:C10",
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
getRange(params: {
|
|
132
|
+
/** Workbook item ID */
|
|
133
|
+
item_id: string;
|
|
134
|
+
/** Worksheet name or ID */
|
|
135
|
+
worksheet: string;
|
|
136
|
+
/** A1 notation e.g. A1:C10 */
|
|
137
|
+
range: string;
|
|
138
|
+
}): Promise<MCPToolCallResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Update cell values in a range
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* await client.excel.updateRange({
|
|
145
|
+
* item_id: "ABC123",
|
|
146
|
+
* worksheet: "Sheet1",
|
|
147
|
+
* range: "A1:B2",
|
|
148
|
+
* values: JSON.stringify([["Name", "Age"], ["Alice", 30]]),
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
updateRange(params: {
|
|
153
|
+
/** Workbook item ID */
|
|
154
|
+
item_id: string;
|
|
155
|
+
/** Worksheet name or ID */
|
|
156
|
+
worksheet: string;
|
|
157
|
+
/** A1 notation e.g. A1:C3 */
|
|
158
|
+
range: string;
|
|
159
|
+
/** JSON 2D array — must match range dimensions */
|
|
160
|
+
values: string;
|
|
161
|
+
}): Promise<MCPToolCallResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Clear contents and/or formatting from a cell range
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* await client.excel.clearRange({
|
|
168
|
+
* item_id: "ABC123",
|
|
169
|
+
* worksheet: "Sheet1",
|
|
170
|
+
* range: "A1:Z100",
|
|
171
|
+
* });
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
clearRange(params: {
|
|
175
|
+
/** Workbook item ID */
|
|
176
|
+
item_id: string;
|
|
177
|
+
/** Worksheet name or ID */
|
|
178
|
+
worksheet: string;
|
|
179
|
+
/** A1 notation */
|
|
180
|
+
range: string;
|
|
181
|
+
/** All, Contents, Formats, or Hyperlinks (default: All) */
|
|
182
|
+
apply_to?: "All" | "Contents" | "Formats" | "Hyperlinks";
|
|
183
|
+
}): Promise<MCPToolCallResponse>;
|
|
184
|
+
/**
|
|
185
|
+
* Get the bounding range of all data in a worksheet
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* const used = await client.excel.getUsedRange({ item_id: "ABC123", worksheet: "Sheet1" });
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
getUsedRange(params: {
|
|
193
|
+
/** Workbook item ID */
|
|
194
|
+
item_id: string;
|
|
195
|
+
/** Worksheet name or ID */
|
|
196
|
+
worksheet: string;
|
|
197
|
+
}): Promise<MCPToolCallResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* List all tables in a worksheet
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const tables = await client.excel.listTables({ item_id: "ABC123", worksheet: "Sheet1" });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
listTables(params: {
|
|
207
|
+
/** Workbook item ID */
|
|
208
|
+
item_id: string;
|
|
209
|
+
/** Worksheet name or ID */
|
|
210
|
+
worksheet: string;
|
|
211
|
+
}): Promise<MCPToolCallResponse>;
|
|
212
|
+
/**
|
|
213
|
+
* Create a table from a cell range
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* await client.excel.createTable({
|
|
218
|
+
* item_id: "ABC123",
|
|
219
|
+
* worksheet: "Sheet1",
|
|
220
|
+
* range: "A1:D10",
|
|
221
|
+
* has_headers: true,
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
createTable(params: {
|
|
226
|
+
/** Workbook item ID */
|
|
227
|
+
item_id: string;
|
|
228
|
+
/** Worksheet name or ID */
|
|
229
|
+
worksheet: string;
|
|
230
|
+
/** Cell range for the table e.g. A1:D10 */
|
|
231
|
+
range: string;
|
|
232
|
+
/** Whether first row is a header row (default: true) */
|
|
233
|
+
has_headers?: boolean;
|
|
234
|
+
}): Promise<MCPToolCallResponse>;
|
|
235
|
+
/**
|
|
236
|
+
* Get rows from a table
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const rows = await client.excel.getTableRows({
|
|
241
|
+
* item_id: "ABC123",
|
|
242
|
+
* worksheet: "Sheet1",
|
|
243
|
+
* table: "Table1",
|
|
244
|
+
* top: 100,
|
|
245
|
+
* });
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
getTableRows(params: {
|
|
249
|
+
/** Workbook item ID */
|
|
250
|
+
item_id: string;
|
|
251
|
+
/** Worksheet name or ID */
|
|
252
|
+
worksheet: string;
|
|
253
|
+
/** Table name or ID */
|
|
254
|
+
table: string;
|
|
255
|
+
/** Max rows to return */
|
|
256
|
+
top?: number;
|
|
257
|
+
/** Rows to skip (for pagination) */
|
|
258
|
+
skip?: number;
|
|
259
|
+
}): Promise<MCPToolCallResponse>;
|
|
260
|
+
/**
|
|
261
|
+
* Append rows to a table
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```typescript
|
|
265
|
+
* await client.excel.addTableRows({
|
|
266
|
+
* item_id: "ABC123",
|
|
267
|
+
* worksheet: "Sheet1",
|
|
268
|
+
* table: "Table1",
|
|
269
|
+
* values: JSON.stringify([["Alice", 30], ["Bob", 25]]),
|
|
270
|
+
* });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
addTableRows(params: {
|
|
274
|
+
/** Workbook item ID */
|
|
275
|
+
item_id: string;
|
|
276
|
+
/** Worksheet name or ID */
|
|
277
|
+
worksheet: string;
|
|
278
|
+
/** Table name or ID */
|
|
279
|
+
table: string;
|
|
280
|
+
/** JSON 2D array of rows */
|
|
281
|
+
values: string;
|
|
282
|
+
}): Promise<MCPToolCallResponse>;
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=excel-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/excel-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE;QACZ,+CAA+C;QAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+BAA+B;QAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;OAOG;IACH,GAAG,CAAC,MAAM,EAAE;QACV,uBAAuB;QACvB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;OAOG;IACH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,MAAM,CAAC;QACd,wDAAwD;QACxD,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,MAAM,EAAE;QACnB,uBAAuB;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,2BAA2B;QAC3B,SAAS,EAAE,MAAM,CAAC;QAClB,uBAAuB;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,yBAAyB;QACzB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,oCAAoC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,MAAM,EAAE;QACnB,uBAAuB;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,2BAA2B;QAC3B,SAAS,EAAE,MAAM,CAAC;QAClB,uBAAuB;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,4BAA4B;QAC5B,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel Integration
|
|
3
|
+
* Enables Excel workbook tools with OAuth configuration
|
|
4
|
+
*/
|
|
5
|
+
import type { MCPIntegration } from "./types.js";
|
|
6
|
+
export interface ExcelIntegrationConfig {
|
|
7
|
+
/** Microsoft OAuth client ID (defaults to EXCEL_CLIENT_ID env var) */
|
|
8
|
+
clientId?: string;
|
|
9
|
+
/** Microsoft OAuth client secret (defaults to EXCEL_CLIENT_SECRET env var) */
|
|
10
|
+
clientSecret?: string;
|
|
11
|
+
/** Additional OAuth scopes */
|
|
12
|
+
scopes?: string[];
|
|
13
|
+
/** Optional OAuth scopes */
|
|
14
|
+
optionalScopes?: string[];
|
|
15
|
+
/** OAuth redirect URI */
|
|
16
|
+
redirectUri?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const EXCEL_TOOLS: readonly ["excel_list", "excel_get", "excel_create", "excel_delete", "excel_share", "excel_list_worksheets", "excel_add_worksheet", "excel_delete_worksheet", "excel_get_range", "excel_update_range", "excel_clear_range", "excel_get_used_range", "excel_list_tables", "excel_create_table", "excel_get_table_rows", "excel_add_table_rows"];
|
|
19
|
+
export declare function excelIntegration(config?: ExcelIntegrationConfig): MCPIntegration<"excel">;
|
|
20
|
+
export type ExcelTools = typeof EXCEL_TOOLS[number];
|
|
21
|
+
export type { ExcelIntegrationClient } from "./excel-client.js";
|
|
22
|
+
//# sourceMappingURL=excel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel.d.ts","sourceRoot":"","sources":["../../../src/integrations/excel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAM9D,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,gVAiBP,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,sBAA2B,GAAG,cAAc,CAAC,OAAO,CAAC,CA0B7F;AAED,MAAM,MAAM,UAAU,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Drive Integration Client Types
|
|
3
|
+
* Fully typed interface for Google Drive integration methods
|
|
4
|
+
*/
|
|
5
|
+
import type { MCPToolCallResponse } from "../protocol/messages.js";
|
|
6
|
+
export interface GDriveFile {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
parents?: string[];
|
|
12
|
+
webViewLink?: string;
|
|
13
|
+
modifiedTime?: string;
|
|
14
|
+
createdTime?: string;
|
|
15
|
+
owners?: Array<{
|
|
16
|
+
displayName: string;
|
|
17
|
+
emailAddress: string;
|
|
18
|
+
photoLink?: string;
|
|
19
|
+
}>;
|
|
20
|
+
shared?: boolean;
|
|
21
|
+
trashed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface GDrivePermission {
|
|
24
|
+
id: string;
|
|
25
|
+
type: "user" | "group" | "domain" | "anyone";
|
|
26
|
+
role: "owner" | "organizer" | "fileOrganizer" | "writer" | "commenter" | "reader";
|
|
27
|
+
emailAddress?: string;
|
|
28
|
+
domain?: string;
|
|
29
|
+
displayName?: string;
|
|
30
|
+
expirationTime?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface GDriveAbout {
|
|
33
|
+
user: {
|
|
34
|
+
displayName: string;
|
|
35
|
+
emailAddress: string;
|
|
36
|
+
photoLink?: string;
|
|
37
|
+
};
|
|
38
|
+
storageQuota: {
|
|
39
|
+
limit?: string;
|
|
40
|
+
usage: string;
|
|
41
|
+
usageInDrive: string;
|
|
42
|
+
usageInDriveTrash: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Google Drive Integration Client Interface
|
|
47
|
+
* Provides type-safe methods for all Google Drive operations
|
|
48
|
+
*/
|
|
49
|
+
export interface GDriveIntegrationClient {
|
|
50
|
+
/**
|
|
51
|
+
* List files and folders in Google Drive
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const result = await client.gdrive.listFiles({
|
|
56
|
+
* query: "name contains 'report'",
|
|
57
|
+
* order_by: "modifiedTime desc",
|
|
58
|
+
* page_size: 50,
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
listFiles(params?: {
|
|
63
|
+
/** Files to return (default 20, max 1000) */
|
|
64
|
+
page_size?: number;
|
|
65
|
+
/** Pagination token */
|
|
66
|
+
page_token?: string;
|
|
67
|
+
/** Drive query string e.g. "name contains 'report'" */
|
|
68
|
+
query?: string;
|
|
69
|
+
/** Only list files in this folder ID */
|
|
70
|
+
parent_id?: string;
|
|
71
|
+
/** Sort order e.g. "modifiedTime desc" */
|
|
72
|
+
order_by?: string;
|
|
73
|
+
}): Promise<MCPToolCallResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Get metadata for a file or folder
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const file = await client.gdrive.getFile({ file_id: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms" });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
getFile(params: {
|
|
83
|
+
/** File or folder ID */
|
|
84
|
+
file_id: string;
|
|
85
|
+
}): Promise<MCPToolCallResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Create a new folder
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const folder = await client.gdrive.createFolder({ name: "Reports 2024" });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
createFolder(params: {
|
|
95
|
+
/** Folder name */
|
|
96
|
+
name: string;
|
|
97
|
+
/** Parent folder ID (defaults to root) */
|
|
98
|
+
parent_id?: string;
|
|
99
|
+
}): Promise<MCPToolCallResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Rename a file or folder
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* await client.gdrive.renameFile({ file_id: "abc123", name: "Q4 Report" });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
renameFile(params: {
|
|
109
|
+
/** File or folder ID */
|
|
110
|
+
file_id: string;
|
|
111
|
+
/** New name */
|
|
112
|
+
name: string;
|
|
113
|
+
}): Promise<MCPToolCallResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* Move a file or folder to a different parent
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* await client.gdrive.moveFile({ file_id: "abc123", new_parent_id: "folderId" });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
moveFile(params: {
|
|
123
|
+
/** File or folder ID to move */
|
|
124
|
+
file_id: string;
|
|
125
|
+
/** Destination folder ID */
|
|
126
|
+
new_parent_id: string;
|
|
127
|
+
}): Promise<MCPToolCallResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Copy a file
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const copy = await client.gdrive.copyFile({ file_id: "abc123", name: "Budget Copy" });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
copyFile(params: {
|
|
137
|
+
/** File ID to copy */
|
|
138
|
+
file_id: string;
|
|
139
|
+
/** Name for the copy (defaults to "Copy of <original>") */
|
|
140
|
+
name?: string;
|
|
141
|
+
/** Destination folder ID */
|
|
142
|
+
parent_id?: string;
|
|
143
|
+
}): Promise<MCPToolCallResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* Permanently delete a file or folder (not recoverable)
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* await client.gdrive.deleteFile({ file_id: "abc123" });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
deleteFile(params: {
|
|
153
|
+
/** File or folder ID */
|
|
154
|
+
file_id: string;
|
|
155
|
+
}): Promise<MCPToolCallResponse>;
|
|
156
|
+
/**
|
|
157
|
+
* Move a file or folder to trash (recoverable)
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* await client.gdrive.trashFile({ file_id: "abc123" });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
trashFile(params: {
|
|
165
|
+
/** File or folder ID */
|
|
166
|
+
file_id: string;
|
|
167
|
+
}): Promise<MCPToolCallResponse>;
|
|
168
|
+
/**
|
|
169
|
+
* Create a new file with text content
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const file = await client.gdrive.uploadTextFile({
|
|
174
|
+
* name: "notes.txt",
|
|
175
|
+
* content: "Hello, world!",
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
uploadTextFile(params: {
|
|
180
|
+
/** File name */
|
|
181
|
+
name: string;
|
|
182
|
+
/** Text content */
|
|
183
|
+
content: string;
|
|
184
|
+
/** MIME type (default: text/plain) */
|
|
185
|
+
mime_type?: string;
|
|
186
|
+
/** Parent folder ID */
|
|
187
|
+
parent_id?: string;
|
|
188
|
+
}): Promise<MCPToolCallResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* Download file content as text. Google Workspace files are auto-exported.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const result = await client.gdrive.downloadFile({ file_id: "abc123" });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
downloadFile(params: {
|
|
198
|
+
/** File ID */
|
|
199
|
+
file_id: string;
|
|
200
|
+
}): Promise<MCPToolCallResponse>;
|
|
201
|
+
/**
|
|
202
|
+
* List sharing permissions on a file or folder
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* const perms = await client.gdrive.listPermissions({ file_id: "abc123" });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
listPermissions(params: {
|
|
210
|
+
/** File or folder ID */
|
|
211
|
+
file_id: string;
|
|
212
|
+
}): Promise<MCPToolCallResponse>;
|
|
213
|
+
/**
|
|
214
|
+
* Share a file or folder
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* await client.gdrive.shareFile({
|
|
219
|
+
* file_id: "abc123",
|
|
220
|
+
* role: "reader",
|
|
221
|
+
* type: "user",
|
|
222
|
+
* email: "colleague@example.com",
|
|
223
|
+
* });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
shareFile(params: {
|
|
227
|
+
/** File or folder ID */
|
|
228
|
+
file_id: string;
|
|
229
|
+
/** reader, commenter, writer, or owner */
|
|
230
|
+
role: "reader" | "commenter" | "writer" | "owner";
|
|
231
|
+
/** user, group, domain, or anyone */
|
|
232
|
+
type: "user" | "group" | "domain" | "anyone";
|
|
233
|
+
/** Required when type is user or group */
|
|
234
|
+
email?: string;
|
|
235
|
+
/** Required when type is domain */
|
|
236
|
+
domain?: string;
|
|
237
|
+
/** Send notification email (default: true) */
|
|
238
|
+
send_notification?: boolean;
|
|
239
|
+
}): Promise<MCPToolCallResponse>;
|
|
240
|
+
/**
|
|
241
|
+
* Remove a sharing permission
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* await client.gdrive.removePermission({ file_id: "abc123", permission_id: "perm456" });
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
removePermission(params: {
|
|
249
|
+
/** File or folder ID */
|
|
250
|
+
file_id: string;
|
|
251
|
+
/** Permission ID (from gdrive_list_permissions) */
|
|
252
|
+
permission_id: string;
|
|
253
|
+
}): Promise<MCPToolCallResponse>;
|
|
254
|
+
/**
|
|
255
|
+
* Get current user info and storage quota
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* const about = await client.gdrive.getAbout();
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
getAbout(params?: Record<string, never>): Promise<MCPToolCallResponse>;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=gdrive-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gdrive-client.d.ts","sourceRoot":"","sources":["../../../src/integrations/gdrive-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAA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AE,MAAM,CAAC;QAChB,0CAA0C;QAC1C,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;QAClD,qCAAqC;QACrC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;QAC7C,0CAA0C;QAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,8CAA8C;QAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;OAOG;IACH,gBAAgB,CAAC,MAAM,EAAE;QACvB,wBAAwB;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,mDAAmD;QACnD,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACxE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Drive Integration
|
|
3
|
+
* Enables Google Drive tools with OAuth configuration
|
|
4
|
+
*/
|
|
5
|
+
import type { MCPIntegration } from "./types.js";
|
|
6
|
+
export interface GDriveIntegrationConfig {
|
|
7
|
+
/** Google OAuth client ID (defaults to GDRIVE_CLIENT_ID env var) */
|
|
8
|
+
clientId?: string;
|
|
9
|
+
/** Google OAuth client secret (defaults to GDRIVE_CLIENT_SECRET env var) */
|
|
10
|
+
clientSecret?: string;
|
|
11
|
+
/** Additional OAuth scopes */
|
|
12
|
+
scopes?: string[];
|
|
13
|
+
/** Optional OAuth scopes (user may choose to grant or deny) */
|
|
14
|
+
optionalScopes?: string[];
|
|
15
|
+
/** OAuth redirect URI */
|
|
16
|
+
redirectUri?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const GDRIVE_TOOLS: readonly ["gdrive_list_files", "gdrive_get_file", "gdrive_create_folder", "gdrive_rename_file", "gdrive_move_file", "gdrive_copy_file", "gdrive_delete_file", "gdrive_trash_file", "gdrive_upload_text_file", "gdrive_download_file", "gdrive_list_permissions", "gdrive_share_file", "gdrive_remove_permission", "gdrive_get_about"];
|
|
19
|
+
export declare function gdriveIntegration(config?: GDriveIntegrationConfig): MCPIntegration<"gdrive">;
|
|
20
|
+
export type GDriveTools = typeof GDRIVE_TOOLS[number];
|
|
21
|
+
export type { GDriveIntegrationClient } from "./gdrive-client.js";
|
|
22
|
+
//# sourceMappingURL=gdrive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gdrive.d.ts","sourceRoot":"","sources":["../../../src/integrations/gdrive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,YAAY,CAAC;AAM9D,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,YAAY,uUAeR,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,uBAA4B,GAAG,cAAc,CAAC,QAAQ,CAAC,CA0BhG;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
|