integrate-sdk 0.9.17-dev.0 → 0.9.19-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 +6 -16
- package/dist/adapters/solid-start.js +6 -16
- package/dist/adapters/svelte-kit.js +6 -16
- package/dist/ai/anthropic.d.ts.map +1 -1
- package/dist/ai/anthropic.js +102 -27
- package/dist/ai/google.d.ts.map +1 -1
- package/dist/ai/google.js +107 -27
- package/dist/ai/index.js +139 -32
- package/dist/ai/openai.d.ts.map +1 -1
- package/dist/ai/openai.js +100 -27
- package/dist/ai/vercel-ai.d.ts.map +1 -1
- package/dist/ai/vercel-ai.js +97 -26
- package/dist/code-mode/index.d.ts +1 -1
- package/dist/code-mode/index.d.ts.map +1 -1
- package/dist/code-mode/index.js +90 -25
- package/dist/code-mode/tool-builder.d.ts +32 -4
- package/dist/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/code-mode/tool-builder.js +90 -25
- package/dist/code-mode/type-generator.d.ts +4 -0
- package/dist/code-mode/type-generator.d.ts.map +1 -1
- package/dist/code-mode/type-generator.js +33 -3
- package/dist/server.js +141 -33
- 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/dist/src/ai/vercel-ai.d.ts.map +1 -1
- package/dist/src/code-mode/index.d.ts +1 -1
- package/dist/src/code-mode/index.d.ts.map +1 -1
- package/dist/src/code-mode/tool-builder.d.ts +32 -4
- package/dist/src/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/src/code-mode/type-generator.d.ts +4 -0
- package/dist/src/code-mode/type-generator.d.ts.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -182,6 +182,8 @@ function generateCodeModeTypes(tools) {
|
|
|
182
182
|
const methodMap = {};
|
|
183
183
|
const integrationCounts = {};
|
|
184
184
|
const sections = [];
|
|
185
|
+
const compactLines = [];
|
|
186
|
+
const perIntegration = {};
|
|
185
187
|
const integrationIds = Object.keys(byIntegration).sort();
|
|
186
188
|
sections.push("/**");
|
|
187
189
|
sections.push(" * Integrate SDK — available APIs inside `execute_code`.");
|
|
@@ -194,18 +196,35 @@ function generateCodeModeTypes(tools) {
|
|
|
194
196
|
const integrationTools = byIntegration[integrationId].slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
195
197
|
integrationCounts[integrationId] = integrationTools.length;
|
|
196
198
|
const interfaceName = pascalCase(integrationId) + "Client";
|
|
199
|
+
const fullSections = [];
|
|
200
|
+
fullSections.push(`export interface ${interfaceName} {`);
|
|
197
201
|
sections.push(`export interface ${interfaceName} {`);
|
|
202
|
+
const compactMethods = [];
|
|
198
203
|
for (const tool of integrationTools) {
|
|
199
204
|
const methodName = toolNameToMethod(tool.name);
|
|
200
205
|
methodMap[`${integrationId}.${methodName}`] = tool.name;
|
|
201
|
-
|
|
206
|
+
const fullDesc = formatDescription(tool.description, " ");
|
|
207
|
+
fullSections.push(fullDesc);
|
|
208
|
+
sections.push(fullDesc);
|
|
202
209
|
const argType = argsType(tool.inputSchema);
|
|
203
210
|
const argIsOptional = !methodHasRequiredArgs(tool.inputSchema);
|
|
204
211
|
const paramName = argIsOptional ? "args?" : "args";
|
|
205
|
-
|
|
212
|
+
const fullLine = ` ${safeIdent(methodName)}(${paramName}: ${argType}): Promise<ToolResult>;`;
|
|
213
|
+
fullSections.push(fullLine);
|
|
214
|
+
sections.push(fullLine);
|
|
215
|
+
const compactArgs = compactArgsSignature(tool.inputSchema);
|
|
216
|
+
const compactParam = argIsOptional ? `args?: ${compactArgs}` : `args: ${compactArgs}`;
|
|
217
|
+
compactMethods.push(` ${safeIdent(methodName)}(${compactParam}): Promise<ToolResult>`);
|
|
206
218
|
}
|
|
207
219
|
sections.push("}");
|
|
208
220
|
sections.push("");
|
|
221
|
+
fullSections.push("}");
|
|
222
|
+
perIntegration[integrationId] = fullSections.join(`
|
|
223
|
+
`);
|
|
224
|
+
compactLines.push(`client.${integrationId}:`);
|
|
225
|
+
for (const m of compactMethods) {
|
|
226
|
+
compactLines.push(m);
|
|
227
|
+
}
|
|
209
228
|
}
|
|
210
229
|
sections.push("export interface ToolResult {");
|
|
211
230
|
sections.push(" content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; [key: string]: unknown }>;");
|
|
@@ -223,11 +242,22 @@ function generateCodeModeTypes(tools) {
|
|
|
223
242
|
sections.push("export declare const client: Client;");
|
|
224
243
|
return {
|
|
225
244
|
source: sections.filter((line, idx, arr) => !(line === "" && arr[idx - 1] === "")).join(`
|
|
245
|
+
`),
|
|
246
|
+
compact: compactLines.join(`
|
|
226
247
|
`),
|
|
227
248
|
methodMap,
|
|
228
|
-
integrationCounts
|
|
249
|
+
integrationCounts,
|
|
250
|
+
perIntegration
|
|
229
251
|
};
|
|
230
252
|
}
|
|
253
|
+
function compactArgsSignature(schema) {
|
|
254
|
+
if (!schema || !schema.properties || Object.keys(schema.properties).length === 0) {
|
|
255
|
+
return "{}";
|
|
256
|
+
}
|
|
257
|
+
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
258
|
+
const params = Object.keys(schema.properties).map((key) => `${safeIdent(key)}${required.has(key) ? "" : "?"}`);
|
|
259
|
+
return `{ ${params.join(", ")} }`;
|
|
260
|
+
}
|
|
231
261
|
function pascalCase(id) {
|
|
232
262
|
return id.split(/[^A-Za-z0-9]/).filter(Boolean).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("") || "Unknown";
|
|
233
263
|
}
|
|
@@ -512,25 +542,16 @@ function getEnv(key) {
|
|
|
512
542
|
|
|
513
543
|
// tool-builder.ts
|
|
514
544
|
var CODE_MODE_TOOL_NAME = "execute_code";
|
|
545
|
+
var TYPES_TOOL_NAME = "get_integration_types";
|
|
515
546
|
var DEFAULT_INSTRUCTIONS = [
|
|
516
|
-
"
|
|
517
|
-
"
|
|
518
|
-
"
|
|
519
|
-
"
|
|
520
|
-
"that is the whole point of this tool.",
|
|
547
|
+
"Write an async JS/TS snippet that runs in an isolated sandbox using `client.<integration>.<method>(args)`.",
|
|
548
|
+
"Chain multiple operations in one snippet. Use `await`, `return <value>` for JSON output, `console.log()` for debug.",
|
|
549
|
+
"Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
|
|
550
|
+
"Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
|
|
521
551
|
"",
|
|
522
|
-
"
|
|
523
|
-
"- The snippet is the body of an `async` function. Use `await` freely.",
|
|
524
|
-
"- Use `return <value>` at the end to hand a structured result back to the caller;",
|
|
525
|
-
" the caller receives it as JSON.",
|
|
526
|
-
"- Use `console.log(...)` for intermediate observations you want to read later.",
|
|
527
|
-
"- Throw / let errors propagate; the runtime will surface them with a non-zero exit.",
|
|
528
|
-
"- Each method call returns an object of shape `ToolResult` (see types below).",
|
|
529
|
-
" The payload usually lives in `result.content[0].text` as JSON — parse it if needed.",
|
|
530
|
-
"- You cannot import npm packages. Only the pre-imported `client` and standard",
|
|
531
|
-
" globals (`fetch`, `console`, `JSON`, ...) are available.",
|
|
552
|
+
"Call `get_integration_types` with an integration name to get full parameter types before writing code.",
|
|
532
553
|
"",
|
|
533
|
-
"
|
|
554
|
+
"Available methods:"
|
|
534
555
|
].join(`
|
|
535
556
|
`);
|
|
536
557
|
function resolveCodeModeClientConfig(client) {
|
|
@@ -578,10 +599,7 @@ function buildCodeModeTool(client, options) {
|
|
|
578
599
|
const serverCodeModeConfig = resolveCodeModeClientConfig(client);
|
|
579
600
|
const sandboxOverrides = options.sandbox ?? {};
|
|
580
601
|
const description = `${DEFAULT_INSTRUCTIONS}
|
|
581
|
-
|
|
582
|
-
\`\`\`typescript
|
|
583
|
-
${generated.source}
|
|
584
|
-
\`\`\``;
|
|
602
|
+
${generated.compact}`;
|
|
585
603
|
const execute = async ({ code }) => {
|
|
586
604
|
const publicUrl = resolveCodeModePublicUrl({
|
|
587
605
|
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
@@ -598,11 +616,33 @@ ${generated.source}
|
|
|
598
616
|
};
|
|
599
617
|
}
|
|
600
618
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
619
|
+
let resolvedTokens = providerTokens;
|
|
620
|
+
if (!resolvedTokens || Object.keys(resolvedTokens).length === 0) {
|
|
621
|
+
const oauthManager = client.oauthManager;
|
|
622
|
+
if (oauthManager) {
|
|
623
|
+
resolvedTokens = {};
|
|
624
|
+
const clientIntegrations = client.integrations || [];
|
|
625
|
+
for (const integration of clientIntegrations) {
|
|
626
|
+
if (integration.oauth) {
|
|
627
|
+
const provider = integration.oauth.provider;
|
|
628
|
+
try {
|
|
629
|
+
const tokenData = await oauthManager.getProviderToken(provider, undefined, context);
|
|
630
|
+
if (tokenData?.accessToken) {
|
|
631
|
+
resolvedTokens[provider] = tokenData.accessToken;
|
|
632
|
+
}
|
|
633
|
+
} catch {}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
if (Object.keys(resolvedTokens).length === 0) {
|
|
637
|
+
resolvedTokens = undefined;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
601
641
|
return executeSandboxCode({
|
|
602
642
|
code,
|
|
603
643
|
mcpUrl,
|
|
604
644
|
apiKey,
|
|
605
|
-
providerTokens,
|
|
645
|
+
providerTokens: resolvedTokens,
|
|
606
646
|
context,
|
|
607
647
|
integrationsHeader: integrationIds && integrationIds.length > 0 ? integrationIds.join(",") : undefined,
|
|
608
648
|
runtime: sandboxOverrides.runtime ?? serverCodeModeConfig.runtime,
|
|
@@ -611,7 +651,8 @@ ${generated.source}
|
|
|
611
651
|
networkPolicy: sandboxOverrides.networkPolicy ?? serverCodeModeConfig.networkPolicy
|
|
612
652
|
});
|
|
613
653
|
};
|
|
614
|
-
|
|
654
|
+
const availableIntegrations = Object.keys(generated.perIntegration);
|
|
655
|
+
const codeTool = {
|
|
615
656
|
name: CODE_MODE_TOOL_NAME,
|
|
616
657
|
description,
|
|
617
658
|
parameters: {
|
|
@@ -627,6 +668,29 @@ ${generated.source}
|
|
|
627
668
|
},
|
|
628
669
|
execute
|
|
629
670
|
};
|
|
671
|
+
const typesTool = {
|
|
672
|
+
name: TYPES_TOOL_NAME,
|
|
673
|
+
description: "Get full TypeScript type definitions (method signatures, parameter types, JSDoc) for a specific integration. " + `Available integrations: ${availableIntegrations.join(", ")}.`,
|
|
674
|
+
parameters: {
|
|
675
|
+
type: "object",
|
|
676
|
+
properties: {
|
|
677
|
+
integration: {
|
|
678
|
+
type: "string",
|
|
679
|
+
description: `Integration name to get types for (${availableIntegrations.join(", ")}).`
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
required: ["integration"],
|
|
683
|
+
additionalProperties: false
|
|
684
|
+
},
|
|
685
|
+
execute: ({ integration }) => {
|
|
686
|
+
const types = generated.perIntegration[integration];
|
|
687
|
+
if (!types) {
|
|
688
|
+
return { error: `Unknown integration "${integration}".`, available: availableIntegrations };
|
|
689
|
+
}
|
|
690
|
+
return { types };
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
return { codeTool, typesTool };
|
|
630
694
|
}
|
|
631
695
|
export {
|
|
632
696
|
warnCodeModeFallback,
|
|
@@ -636,5 +700,6 @@ export {
|
|
|
636
700
|
canUseCodeMode,
|
|
637
701
|
buildCodeModeTool,
|
|
638
702
|
__resetCodeModeFallbackWarnings,
|
|
703
|
+
TYPES_TOOL_NAME,
|
|
639
704
|
CODE_MODE_TOOL_NAME
|
|
640
705
|
};
|
|
@@ -10,10 +10,14 @@ import type { MCPTool } from "../protocol/messages.js";
|
|
|
10
10
|
export interface GeneratedTypes {
|
|
11
11
|
/** The full TypeScript source to embed in the LLM prompt. */
|
|
12
12
|
source: string;
|
|
13
|
+
/** Compact method listing (no JSDoc, param names only) for the tool description. */
|
|
14
|
+
compact: string;
|
|
13
15
|
/** Map from dotted method path (e.g. `github.createIssue`) to MCP tool name. */
|
|
14
16
|
methodMap: Record<string, string>;
|
|
15
17
|
/** Per-integration tool counts, useful for logging. */
|
|
16
18
|
integrationCounts: Record<string, number>;
|
|
19
|
+
/** Per-integration full type source for on-demand lookup. */
|
|
20
|
+
perIntegration: Record<string, string>;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Build the TypeScript API surface from a set of enabled MCP tools.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-generator.d.ts","sourceRoot":"","sources":["../../../src/code-mode/type-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,yBAAyB,CAAC;AAGxE,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"type-generator.d.ts","sourceRoot":"","sources":["../../../src/code-mode/type-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,yBAAyB,CAAC;AAGxE,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,6DAA6D;IAC7D,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAgHD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,cAAc,CA8FtE"}
|
|
@@ -182,6 +182,8 @@ function generateCodeModeTypes(tools) {
|
|
|
182
182
|
const methodMap = {};
|
|
183
183
|
const integrationCounts = {};
|
|
184
184
|
const sections = [];
|
|
185
|
+
const compactLines = [];
|
|
186
|
+
const perIntegration = {};
|
|
185
187
|
const integrationIds = Object.keys(byIntegration).sort();
|
|
186
188
|
sections.push("/**");
|
|
187
189
|
sections.push(" * Integrate SDK — available APIs inside `execute_code`.");
|
|
@@ -194,18 +196,35 @@ function generateCodeModeTypes(tools) {
|
|
|
194
196
|
const integrationTools = byIntegration[integrationId].slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
195
197
|
integrationCounts[integrationId] = integrationTools.length;
|
|
196
198
|
const interfaceName = pascalCase(integrationId) + "Client";
|
|
199
|
+
const fullSections = [];
|
|
200
|
+
fullSections.push(`export interface ${interfaceName} {`);
|
|
197
201
|
sections.push(`export interface ${interfaceName} {`);
|
|
202
|
+
const compactMethods = [];
|
|
198
203
|
for (const tool of integrationTools) {
|
|
199
204
|
const methodName = toolNameToMethod(tool.name);
|
|
200
205
|
methodMap[`${integrationId}.${methodName}`] = tool.name;
|
|
201
|
-
|
|
206
|
+
const fullDesc = formatDescription(tool.description, " ");
|
|
207
|
+
fullSections.push(fullDesc);
|
|
208
|
+
sections.push(fullDesc);
|
|
202
209
|
const argType = argsType(tool.inputSchema);
|
|
203
210
|
const argIsOptional = !methodHasRequiredArgs(tool.inputSchema);
|
|
204
211
|
const paramName = argIsOptional ? "args?" : "args";
|
|
205
|
-
|
|
212
|
+
const fullLine = ` ${safeIdent(methodName)}(${paramName}: ${argType}): Promise<ToolResult>;`;
|
|
213
|
+
fullSections.push(fullLine);
|
|
214
|
+
sections.push(fullLine);
|
|
215
|
+
const compactArgs = compactArgsSignature(tool.inputSchema);
|
|
216
|
+
const compactParam = argIsOptional ? `args?: ${compactArgs}` : `args: ${compactArgs}`;
|
|
217
|
+
compactMethods.push(` ${safeIdent(methodName)}(${compactParam}): Promise<ToolResult>`);
|
|
206
218
|
}
|
|
207
219
|
sections.push("}");
|
|
208
220
|
sections.push("");
|
|
221
|
+
fullSections.push("}");
|
|
222
|
+
perIntegration[integrationId] = fullSections.join(`
|
|
223
|
+
`);
|
|
224
|
+
compactLines.push(`client.${integrationId}:`);
|
|
225
|
+
for (const m of compactMethods) {
|
|
226
|
+
compactLines.push(m);
|
|
227
|
+
}
|
|
209
228
|
}
|
|
210
229
|
sections.push("export interface ToolResult {");
|
|
211
230
|
sections.push(" content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; [key: string]: unknown }>;");
|
|
@@ -223,11 +242,22 @@ function generateCodeModeTypes(tools) {
|
|
|
223
242
|
sections.push("export declare const client: Client;");
|
|
224
243
|
return {
|
|
225
244
|
source: sections.filter((line, idx, arr) => !(line === "" && arr[idx - 1] === "")).join(`
|
|
245
|
+
`),
|
|
246
|
+
compact: compactLines.join(`
|
|
226
247
|
`),
|
|
227
248
|
methodMap,
|
|
228
|
-
integrationCounts
|
|
249
|
+
integrationCounts,
|
|
250
|
+
perIntegration
|
|
229
251
|
};
|
|
230
252
|
}
|
|
253
|
+
function compactArgsSignature(schema) {
|
|
254
|
+
if (!schema || !schema.properties || Object.keys(schema.properties).length === 0) {
|
|
255
|
+
return "{}";
|
|
256
|
+
}
|
|
257
|
+
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
258
|
+
const params = Object.keys(schema.properties).map((key) => `${safeIdent(key)}${required.has(key) ? "" : "?"}`);
|
|
259
|
+
return `{ ${params.join(", ")} }`;
|
|
260
|
+
}
|
|
231
261
|
function pascalCase(id) {
|
|
232
262
|
return id.split(/[^A-Za-z0-9]/).filter(Boolean).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("") || "Unknown";
|
|
233
263
|
}
|
package/dist/server.js
CHANGED
|
@@ -1337,6 +1337,8 @@ function generateCodeModeTypes(tools) {
|
|
|
1337
1337
|
const methodMap = {};
|
|
1338
1338
|
const integrationCounts = {};
|
|
1339
1339
|
const sections = [];
|
|
1340
|
+
const compactLines = [];
|
|
1341
|
+
const perIntegration = {};
|
|
1340
1342
|
const integrationIds = Object.keys(byIntegration).sort();
|
|
1341
1343
|
sections.push("/**");
|
|
1342
1344
|
sections.push(" * Integrate SDK — available APIs inside `execute_code`.");
|
|
@@ -1349,18 +1351,35 @@ function generateCodeModeTypes(tools) {
|
|
|
1349
1351
|
const integrationTools = byIntegration[integrationId].slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
1350
1352
|
integrationCounts[integrationId] = integrationTools.length;
|
|
1351
1353
|
const interfaceName = pascalCase(integrationId) + "Client";
|
|
1354
|
+
const fullSections = [];
|
|
1355
|
+
fullSections.push(`export interface ${interfaceName} {`);
|
|
1352
1356
|
sections.push(`export interface ${interfaceName} {`);
|
|
1357
|
+
const compactMethods = [];
|
|
1353
1358
|
for (const tool of integrationTools) {
|
|
1354
1359
|
const methodName = toolNameToMethod(tool.name);
|
|
1355
1360
|
methodMap[`${integrationId}.${methodName}`] = tool.name;
|
|
1356
|
-
|
|
1361
|
+
const fullDesc = formatDescription(tool.description, " ");
|
|
1362
|
+
fullSections.push(fullDesc);
|
|
1363
|
+
sections.push(fullDesc);
|
|
1357
1364
|
const argType = argsType(tool.inputSchema);
|
|
1358
1365
|
const argIsOptional = !methodHasRequiredArgs(tool.inputSchema);
|
|
1359
1366
|
const paramName = argIsOptional ? "args?" : "args";
|
|
1360
|
-
|
|
1367
|
+
const fullLine = ` ${safeIdent(methodName)}(${paramName}: ${argType}): Promise<ToolResult>;`;
|
|
1368
|
+
fullSections.push(fullLine);
|
|
1369
|
+
sections.push(fullLine);
|
|
1370
|
+
const compactArgs = compactArgsSignature(tool.inputSchema);
|
|
1371
|
+
const compactParam = argIsOptional ? `args?: ${compactArgs}` : `args: ${compactArgs}`;
|
|
1372
|
+
compactMethods.push(` ${safeIdent(methodName)}(${compactParam}): Promise<ToolResult>`);
|
|
1361
1373
|
}
|
|
1362
1374
|
sections.push("}");
|
|
1363
1375
|
sections.push("");
|
|
1376
|
+
fullSections.push("}");
|
|
1377
|
+
perIntegration[integrationId] = fullSections.join(`
|
|
1378
|
+
`);
|
|
1379
|
+
compactLines.push(`client.${integrationId}:`);
|
|
1380
|
+
for (const m of compactMethods) {
|
|
1381
|
+
compactLines.push(m);
|
|
1382
|
+
}
|
|
1364
1383
|
}
|
|
1365
1384
|
sections.push("export interface ToolResult {");
|
|
1366
1385
|
sections.push(" content: Array<{ type: 'text' | 'image' | 'resource'; text?: string; data?: string; mimeType?: string; [key: string]: unknown }>;");
|
|
@@ -1378,11 +1397,22 @@ function generateCodeModeTypes(tools) {
|
|
|
1378
1397
|
sections.push("export declare const client: Client;");
|
|
1379
1398
|
return {
|
|
1380
1399
|
source: sections.filter((line, idx, arr) => !(line === "" && arr[idx - 1] === "")).join(`
|
|
1400
|
+
`),
|
|
1401
|
+
compact: compactLines.join(`
|
|
1381
1402
|
`),
|
|
1382
1403
|
methodMap,
|
|
1383
|
-
integrationCounts
|
|
1404
|
+
integrationCounts,
|
|
1405
|
+
perIntegration
|
|
1384
1406
|
};
|
|
1385
1407
|
}
|
|
1408
|
+
function compactArgsSignature(schema) {
|
|
1409
|
+
if (!schema || !schema.properties || Object.keys(schema.properties).length === 0) {
|
|
1410
|
+
return "{}";
|
|
1411
|
+
}
|
|
1412
|
+
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
1413
|
+
const params = Object.keys(schema.properties).map((key) => `${safeIdent(key)}${required.has(key) ? "" : "?"}`);
|
|
1414
|
+
return `{ ${params.join(", ")} }`;
|
|
1415
|
+
}
|
|
1386
1416
|
function pascalCase(id) {
|
|
1387
1417
|
return id.split(/[^A-Za-z0-9]/).filter(Boolean).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("") || "Unknown";
|
|
1388
1418
|
}
|
|
@@ -1710,6 +1740,7 @@ __export(exports_tool_builder, {
|
|
|
1710
1740
|
canUseCodeMode: () => canUseCodeMode,
|
|
1711
1741
|
buildCodeModeTool: () => buildCodeModeTool,
|
|
1712
1742
|
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
1743
|
+
TYPES_TOOL_NAME: () => TYPES_TOOL_NAME,
|
|
1713
1744
|
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
1714
1745
|
});
|
|
1715
1746
|
function resolveCodeModeClientConfig(client) {
|
|
@@ -1756,10 +1787,7 @@ function buildCodeModeTool(client, options) {
|
|
|
1756
1787
|
const serverCodeModeConfig = resolveCodeModeClientConfig(client);
|
|
1757
1788
|
const sandboxOverrides = options.sandbox ?? {};
|
|
1758
1789
|
const description = `${DEFAULT_INSTRUCTIONS}
|
|
1759
|
-
|
|
1760
|
-
\`\`\`typescript
|
|
1761
|
-
${generated.source}
|
|
1762
|
-
\`\`\``;
|
|
1790
|
+
${generated.compact}`;
|
|
1763
1791
|
const execute = async ({ code }) => {
|
|
1764
1792
|
const publicUrl = resolveCodeModePublicUrl({
|
|
1765
1793
|
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
@@ -1776,11 +1804,33 @@ ${generated.source}
|
|
|
1776
1804
|
};
|
|
1777
1805
|
}
|
|
1778
1806
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
1807
|
+
let resolvedTokens = providerTokens;
|
|
1808
|
+
if (!resolvedTokens || Object.keys(resolvedTokens).length === 0) {
|
|
1809
|
+
const oauthManager = client.oauthManager;
|
|
1810
|
+
if (oauthManager) {
|
|
1811
|
+
resolvedTokens = {};
|
|
1812
|
+
const clientIntegrations = client.integrations || [];
|
|
1813
|
+
for (const integration of clientIntegrations) {
|
|
1814
|
+
if (integration.oauth) {
|
|
1815
|
+
const provider = integration.oauth.provider;
|
|
1816
|
+
try {
|
|
1817
|
+
const tokenData = await oauthManager.getProviderToken(provider, undefined, context);
|
|
1818
|
+
if (tokenData?.accessToken) {
|
|
1819
|
+
resolvedTokens[provider] = tokenData.accessToken;
|
|
1820
|
+
}
|
|
1821
|
+
} catch {}
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
if (Object.keys(resolvedTokens).length === 0) {
|
|
1825
|
+
resolvedTokens = undefined;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1779
1829
|
return executeSandboxCode({
|
|
1780
1830
|
code,
|
|
1781
1831
|
mcpUrl,
|
|
1782
1832
|
apiKey,
|
|
1783
|
-
providerTokens,
|
|
1833
|
+
providerTokens: resolvedTokens,
|
|
1784
1834
|
context,
|
|
1785
1835
|
integrationsHeader: integrationIds && integrationIds.length > 0 ? integrationIds.join(",") : undefined,
|
|
1786
1836
|
runtime: sandboxOverrides.runtime ?? serverCodeModeConfig.runtime,
|
|
@@ -1789,7 +1839,8 @@ ${generated.source}
|
|
|
1789
1839
|
networkPolicy: sandboxOverrides.networkPolicy ?? serverCodeModeConfig.networkPolicy
|
|
1790
1840
|
});
|
|
1791
1841
|
};
|
|
1792
|
-
|
|
1842
|
+
const availableIntegrations = Object.keys(generated.perIntegration);
|
|
1843
|
+
const codeTool = {
|
|
1793
1844
|
name: CODE_MODE_TOOL_NAME,
|
|
1794
1845
|
description,
|
|
1795
1846
|
parameters: {
|
|
@@ -1805,30 +1856,43 @@ ${generated.source}
|
|
|
1805
1856
|
},
|
|
1806
1857
|
execute
|
|
1807
1858
|
};
|
|
1859
|
+
const typesTool = {
|
|
1860
|
+
name: TYPES_TOOL_NAME,
|
|
1861
|
+
description: "Get full TypeScript type definitions (method signatures, parameter types, JSDoc) for a specific integration. " + `Available integrations: ${availableIntegrations.join(", ")}.`,
|
|
1862
|
+
parameters: {
|
|
1863
|
+
type: "object",
|
|
1864
|
+
properties: {
|
|
1865
|
+
integration: {
|
|
1866
|
+
type: "string",
|
|
1867
|
+
description: `Integration name to get types for (${availableIntegrations.join(", ")}).`
|
|
1868
|
+
}
|
|
1869
|
+
},
|
|
1870
|
+
required: ["integration"],
|
|
1871
|
+
additionalProperties: false
|
|
1872
|
+
},
|
|
1873
|
+
execute: ({ integration }) => {
|
|
1874
|
+
const types2 = generated.perIntegration[integration];
|
|
1875
|
+
if (!types2) {
|
|
1876
|
+
return { error: `Unknown integration "${integration}".`, available: availableIntegrations };
|
|
1877
|
+
}
|
|
1878
|
+
return { types: types2 };
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
return { codeTool, typesTool };
|
|
1808
1882
|
}
|
|
1809
|
-
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS, warnedCodeModeReasons;
|
|
1883
|
+
var CODE_MODE_TOOL_NAME = "execute_code", TYPES_TOOL_NAME = "get_integration_types", DEFAULT_INSTRUCTIONS, warnedCodeModeReasons;
|
|
1810
1884
|
var init_tool_builder = __esm(() => {
|
|
1811
1885
|
init_type_generator();
|
|
1812
1886
|
init_executor();
|
|
1813
1887
|
DEFAULT_INSTRUCTIONS = [
|
|
1814
|
-
"
|
|
1815
|
-
"
|
|
1816
|
-
"
|
|
1817
|
-
"
|
|
1818
|
-
"that is the whole point of this tool.",
|
|
1888
|
+
"Write an async JS/TS snippet that runs in an isolated sandbox using `client.<integration>.<method>(args)`.",
|
|
1889
|
+
"Chain multiple operations in one snippet. Use `await`, `return <value>` for JSON output, `console.log()` for debug.",
|
|
1890
|
+
"Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
|
|
1891
|
+
"Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
|
|
1819
1892
|
"",
|
|
1820
|
-
"
|
|
1821
|
-
"- The snippet is the body of an `async` function. Use `await` freely.",
|
|
1822
|
-
"- Use `return <value>` at the end to hand a structured result back to the caller;",
|
|
1823
|
-
" the caller receives it as JSON.",
|
|
1824
|
-
"- Use `console.log(...)` for intermediate observations you want to read later.",
|
|
1825
|
-
"- Throw / let errors propagate; the runtime will surface them with a non-zero exit.",
|
|
1826
|
-
"- Each method call returns an object of shape `ToolResult` (see types below).",
|
|
1827
|
-
" The payload usually lives in `result.content[0].text` as JSON — parse it if needed.",
|
|
1828
|
-
"- You cannot import npm packages. Only the pre-imported `client` and standard",
|
|
1829
|
-
" globals (`fetch`, `console`, `JSON`, ...) are available.",
|
|
1893
|
+
"Call `get_integration_types` with an integration name to get full parameter types before writing code.",
|
|
1830
1894
|
"",
|
|
1831
|
-
"
|
|
1895
|
+
"Available methods:"
|
|
1832
1896
|
].join(`
|
|
1833
1897
|
`);
|
|
1834
1898
|
warnedCodeModeReasons = new Set;
|
|
@@ -10036,7 +10100,7 @@ async function getVercelAITools(client, options) {
|
|
|
10036
10100
|
}
|
|
10037
10101
|
}
|
|
10038
10102
|
if (effectiveMode === "code") {
|
|
10039
|
-
const codeTool = buildCodeModeTool(client, {
|
|
10103
|
+
const { codeTool, typesTool } = buildCodeModeTool(client, {
|
|
10040
10104
|
tools: mcpTools,
|
|
10041
10105
|
providerTokens,
|
|
10042
10106
|
context: options?.context,
|
|
@@ -10049,6 +10113,13 @@ async function getVercelAITools(client, options) {
|
|
|
10049
10113
|
}),
|
|
10050
10114
|
execute: async (args) => codeTool.execute(args)
|
|
10051
10115
|
};
|
|
10116
|
+
vercelTools[TYPES_TOOL_NAME] = {
|
|
10117
|
+
description: typesTool.description,
|
|
10118
|
+
inputSchema: exports_external.object({
|
|
10119
|
+
integration: exports_external.string().describe(typesTool.parameters.properties.integration.description)
|
|
10120
|
+
}),
|
|
10121
|
+
execute: async (args) => typesTool.execute(args)
|
|
10122
|
+
};
|
|
10052
10123
|
} else {
|
|
10053
10124
|
for (const mcpTool of mcpTools) {
|
|
10054
10125
|
vercelTools[mcpTool.name] = convertMCPToolToVercelAI(mcpTool, client, finalOptions);
|
|
@@ -11334,7 +11405,7 @@ async function getOpenAITools(client, options) {
|
|
|
11334
11405
|
}
|
|
11335
11406
|
}
|
|
11336
11407
|
const openaiTools = effectiveMode === "code" ? (() => {
|
|
11337
|
-
const codeTool = buildCodeModeTool(client, {
|
|
11408
|
+
const { codeTool, typesTool } = buildCodeModeTool(client, {
|
|
11338
11409
|
tools: mcpTools,
|
|
11339
11410
|
providerTokens,
|
|
11340
11411
|
context: options?.context,
|
|
@@ -11346,6 +11417,12 @@ async function getOpenAITools(client, options) {
|
|
|
11346
11417
|
description: codeTool.description,
|
|
11347
11418
|
parameters: codeTool.parameters,
|
|
11348
11419
|
strict: options?.strict ?? null
|
|
11420
|
+
}, {
|
|
11421
|
+
type: "function",
|
|
11422
|
+
name: TYPES_TOOL_NAME,
|
|
11423
|
+
description: typesTool.description,
|
|
11424
|
+
parameters: typesTool.parameters,
|
|
11425
|
+
strict: options?.strict ?? null
|
|
11349
11426
|
}];
|
|
11350
11427
|
})() : mcpTools.map((mcpTool) => convertMCPToolToOpenAI(mcpTool, client, finalOptions));
|
|
11351
11428
|
const triggerConfig = client.__triggerConfig;
|
|
@@ -11396,8 +11473,11 @@ async function handleOpenAIToolCalls(client, toolCalls, options) {
|
|
|
11396
11473
|
const args = JSON.parse(toolCall.arguments);
|
|
11397
11474
|
let result;
|
|
11398
11475
|
if (toolCall.name === CODE_MODE_TOOL_NAME) {
|
|
11399
|
-
const codeTool = await getCodeModeTool();
|
|
11476
|
+
const { codeTool } = await getCodeModeTool();
|
|
11400
11477
|
result = await codeTool.execute(args);
|
|
11478
|
+
} else if (toolCall.name === TYPES_TOOL_NAME) {
|
|
11479
|
+
const { typesTool } = await getCodeModeTool();
|
|
11480
|
+
result = typesTool.execute(args);
|
|
11401
11481
|
} else if (triggerTools && triggerTools[toolCall.name]) {
|
|
11402
11482
|
result = await triggerTools[toolCall.name].execute(args);
|
|
11403
11483
|
} else {
|
|
@@ -11471,8 +11551,11 @@ async function handleAnthropicToolCalls(client, messageContent, options) {
|
|
|
11471
11551
|
try {
|
|
11472
11552
|
let result;
|
|
11473
11553
|
if (toolUse.name === CODE_MODE_TOOL_NAME) {
|
|
11474
|
-
const codeTool = await getCodeModeTool();
|
|
11554
|
+
const { codeTool } = await getCodeModeTool();
|
|
11475
11555
|
result = await codeTool.execute(toolUse.input);
|
|
11556
|
+
} else if (toolUse.name === TYPES_TOOL_NAME) {
|
|
11557
|
+
const { typesTool } = await getCodeModeTool();
|
|
11558
|
+
result = typesTool.execute(toolUse.input);
|
|
11476
11559
|
} else if (triggerTools && triggerTools[toolUse.name]) {
|
|
11477
11560
|
result = await triggerTools[toolUse.name].execute(toolUse.input);
|
|
11478
11561
|
} else {
|
|
@@ -11519,7 +11602,7 @@ async function getAnthropicTools(client, options) {
|
|
|
11519
11602
|
}
|
|
11520
11603
|
}
|
|
11521
11604
|
const anthropicTools = effectiveMode === "code" ? (() => {
|
|
11522
|
-
const codeTool = buildCodeModeTool(client, {
|
|
11605
|
+
const { codeTool, typesTool } = buildCodeModeTool(client, {
|
|
11523
11606
|
tools: mcpTools,
|
|
11524
11607
|
providerTokens,
|
|
11525
11608
|
context: options?.context,
|
|
@@ -11533,6 +11616,14 @@ async function getAnthropicTools(client, options) {
|
|
|
11533
11616
|
properties: codeTool.parameters.properties,
|
|
11534
11617
|
required: [...codeTool.parameters.required]
|
|
11535
11618
|
}
|
|
11619
|
+
}, {
|
|
11620
|
+
name: TYPES_TOOL_NAME,
|
|
11621
|
+
description: typesTool.description,
|
|
11622
|
+
input_schema: {
|
|
11623
|
+
type: "object",
|
|
11624
|
+
properties: typesTool.parameters.properties,
|
|
11625
|
+
required: [...typesTool.parameters.required]
|
|
11626
|
+
}
|
|
11536
11627
|
}];
|
|
11537
11628
|
})() : mcpTools.map((mcpTool) => convertMCPToolToAnthropic(mcpTool, client, finalOptions));
|
|
11538
11629
|
const triggerConfig = client.__triggerConfig;
|
|
@@ -11679,8 +11770,11 @@ async function executeGoogleFunctionCalls(client, functionCalls, options) {
|
|
|
11679
11770
|
const args = call.args || {};
|
|
11680
11771
|
let result;
|
|
11681
11772
|
if (call.name === CODE_MODE_TOOL_NAME) {
|
|
11682
|
-
const codeTool = await getCodeModeTool();
|
|
11773
|
+
const { codeTool } = await getCodeModeTool();
|
|
11683
11774
|
result = await codeTool.execute(args);
|
|
11775
|
+
} else if (call.name === TYPES_TOOL_NAME) {
|
|
11776
|
+
const { typesTool } = await getCodeModeTool();
|
|
11777
|
+
result = typesTool.execute(args);
|
|
11684
11778
|
} else if (triggerTools && triggerTools[call.name]) {
|
|
11685
11779
|
result = await triggerTools[call.name].execute(args);
|
|
11686
11780
|
} else {
|
|
@@ -11715,7 +11809,7 @@ async function getGoogleTools(client, options) {
|
|
|
11715
11809
|
let googleTools;
|
|
11716
11810
|
if (effectiveMode === "code") {
|
|
11717
11811
|
const TypeEnum = await getGoogleType();
|
|
11718
|
-
const codeTool = buildCodeModeTool(client, {
|
|
11812
|
+
const { codeTool, typesTool } = buildCodeModeTool(client, {
|
|
11719
11813
|
tools: mcpTools,
|
|
11720
11814
|
providerTokens,
|
|
11721
11815
|
context: options?.context,
|
|
@@ -11734,6 +11828,19 @@ async function getGoogleTools(client, options) {
|
|
|
11734
11828
|
},
|
|
11735
11829
|
required: ["code"]
|
|
11736
11830
|
}
|
|
11831
|
+
}, {
|
|
11832
|
+
name: TYPES_TOOL_NAME,
|
|
11833
|
+
description: typesTool.description,
|
|
11834
|
+
parameters: {
|
|
11835
|
+
type: TypeEnum.OBJECT,
|
|
11836
|
+
properties: {
|
|
11837
|
+
integration: {
|
|
11838
|
+
type: TypeEnum.STRING,
|
|
11839
|
+
description: typesTool.parameters.properties.integration.description
|
|
11840
|
+
}
|
|
11841
|
+
},
|
|
11842
|
+
required: ["integration"]
|
|
11843
|
+
}
|
|
11737
11844
|
}];
|
|
11738
11845
|
} else {
|
|
11739
11846
|
googleTools = await Promise.all(mcpTools.map((mcpTool) => convertMCPToolToGoogle(mcpTool, client, finalOptions)));
|
|
@@ -12104,6 +12211,7 @@ function createMCPServer(config) {
|
|
|
12104
12211
|
const result = await executeSandboxCode2({
|
|
12105
12212
|
code: body.code,
|
|
12106
12213
|
mcpUrl: publicUrl.replace(/\/$/, "") + "/api/integrate/mcp",
|
|
12214
|
+
apiKey: config.apiKey,
|
|
12107
12215
|
providerTokens,
|
|
12108
12216
|
context: contextOverride,
|
|
12109
12217
|
integrationsHeader: integrationIds.join(","),
|
|
@@ -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;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,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,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,kDAAkD;IAClD,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AA+ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,aAAa,EAAE,CAAC,CAmF1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,EAAE;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,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"}
|
|
@@ -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;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,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,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAajH,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;IACxD,kDAAkD;IAClD,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAsGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CA+DnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,CAqGvB"}
|
|
@@ -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;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,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,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAkE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAiCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,CAiFvB;AA6GD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,QAAQ,EAAE;IAAE,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAA,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAA;CAAE,EAChE,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAA,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAyB3H"}
|
|
@@ -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;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,YAAY,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;AAUpB;;;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;IACrB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,oBAAoB,gCAyE/B"}
|