integrate-sdk 0.9.8-dev.0 → 0.9.10-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 +96 -14
- package/dist/adapters/index.js +96 -14
- package/dist/adapters/nextjs.js +96 -14
- package/dist/adapters/node.js +96 -14
- package/dist/adapters/svelte-kit.js +96 -14
- package/dist/adapters/tanstack-start.js +96 -14
- package/dist/ai/anthropic.d.ts.map +1 -1
- package/dist/ai/anthropic.js +39 -8
- package/dist/ai/google.d.ts.map +1 -1
- package/dist/ai/google.js +39 -8
- package/dist/ai/index.js +75 -11
- package/dist/ai/openai.d.ts.map +1 -1
- package/dist/ai/openai.js +39 -8
- package/dist/ai/vercel-ai.d.ts.map +1 -1
- package/dist/ai/vercel-ai.js +39 -8
- package/dist/code-mode/index.js +33 -7
- package/dist/code-mode/tool-builder.d.ts +25 -1
- package/dist/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/code-mode/tool-builder.js +37 -7
- package/dist/index.js +96 -14
- package/dist/oauth.js +96 -14
- package/dist/server.js +96 -14
- 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/tool-builder.d.ts +25 -1
- package/dist/src/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +2 -2
- package/dist/src/server.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/adapters/node.js
CHANGED
|
@@ -8780,16 +8780,46 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
8780
8780
|
var init_executor = () => {};
|
|
8781
8781
|
|
|
8782
8782
|
// ../code-mode/tool-builder.ts
|
|
8783
|
+
var exports_tool_builder = {};
|
|
8784
|
+
__export(exports_tool_builder, {
|
|
8785
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
8786
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
8787
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
8788
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
8789
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
8790
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
8791
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
8792
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
8793
|
+
});
|
|
8783
8794
|
function resolveCodeModeClientConfig(client) {
|
|
8784
8795
|
const oauthConfig = client.__oauthConfig;
|
|
8785
8796
|
return oauthConfig?.codeMode ?? {};
|
|
8786
8797
|
}
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8801
|
+
async function diagnoseCodeMode(client) {
|
|
8802
|
+
if (!await isSandboxAvailable()) {
|
|
8803
|
+
return { available: false, reason: "sandbox-missing" };
|
|
8804
|
+
}
|
|
8790
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8791
|
-
const publicUrl = serverConfig
|
|
8792
|
-
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8807
|
+
if (!publicUrl) {
|
|
8808
|
+
return { available: false, reason: "no-public-url" };
|
|
8809
|
+
}
|
|
8810
|
+
return { available: true };
|
|
8811
|
+
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8818
|
+
function warnCodeModeFallback(reason) {
|
|
8819
|
+
if (warnedCodeModeReasons.has(reason))
|
|
8820
|
+
return;
|
|
8821
|
+
warnedCodeModeReasons.add(reason);
|
|
8822
|
+
console.warn(CODE_MODE_UNAVAILABLE_MESSAGES[reason]);
|
|
8793
8823
|
}
|
|
8794
8824
|
function buildCodeModeTool(client, options) {
|
|
8795
8825
|
const { tools, providerTokens, context, integrationIds } = options;
|
|
@@ -8802,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8802
8832
|
${generated.source}
|
|
8803
8833
|
\`\`\``;
|
|
8804
8834
|
const execute = async ({ code }) => {
|
|
8805
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8806
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8807
8839
|
if (!publicUrl) {
|
|
8808
8840
|
return {
|
|
@@ -8811,7 +8843,7 @@ ${generated.source}
|
|
|
8811
8843
|
stdout: "",
|
|
8812
8844
|
stderr: "",
|
|
8813
8845
|
durationMs: 0,
|
|
8814
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
8846
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). " + "The sandbox uses it to call back into /api/integrate/mcp."
|
|
8815
8847
|
};
|
|
8816
8848
|
}
|
|
8817
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8845,7 +8877,7 @@ ${generated.source}
|
|
|
8845
8877
|
execute
|
|
8846
8878
|
};
|
|
8847
8879
|
}
|
|
8848
|
-
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS;
|
|
8880
|
+
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS, CODE_MODE_UNAVAILABLE_MESSAGES, warnedCodeModeReasons;
|
|
8849
8881
|
var init_tool_builder = __esm(() => {
|
|
8850
8882
|
init_type_generator();
|
|
8851
8883
|
init_executor();
|
|
@@ -8870,6 +8902,11 @@ var init_tool_builder = __esm(() => {
|
|
|
8870
8902
|
"API surface:"
|
|
8871
8903
|
].join(`
|
|
8872
8904
|
`);
|
|
8905
|
+
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8906
|
+
"sandbox-missing": "[integrate-sdk] Code Mode unavailable (reason: sandbox-missing) — falling back to tool mode. " + "Install `@vercel/sandbox` (e.g. `bun add @vercel/sandbox`) to enable Code Mode.",
|
|
8907
|
+
"no-public-url": "[integrate-sdk] Code Mode unavailable (reason: no-public-url) — falling back to tool mode. " + "Set `codeMode.publicUrl` on your server config or the `INTEGRATE_URL` env var."
|
|
8908
|
+
};
|
|
8909
|
+
warnedCodeModeReasons = new Set;
|
|
8873
8910
|
});
|
|
8874
8911
|
|
|
8875
8912
|
// ../ai/vercel-ai.ts
|
|
@@ -8896,7 +8933,18 @@ async function getVercelAITools(client, options) {
|
|
|
8896
8933
|
await ensureClientConnected(client);
|
|
8897
8934
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
8898
8935
|
const vercelTools = {};
|
|
8899
|
-
|
|
8936
|
+
let effectiveMode;
|
|
8937
|
+
if (options?.mode !== undefined) {
|
|
8938
|
+
effectiveMode = options.mode;
|
|
8939
|
+
} else {
|
|
8940
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
8941
|
+
if (diagnosis.available) {
|
|
8942
|
+
effectiveMode = "code";
|
|
8943
|
+
} else {
|
|
8944
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
8945
|
+
effectiveMode = "tools";
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8900
8948
|
if (effectiveMode === "code") {
|
|
8901
8949
|
const codeTool = buildCodeModeTool(client, {
|
|
8902
8950
|
tools: mcpTools,
|
|
@@ -10355,7 +10403,18 @@ async function getOpenAITools(client, options) {
|
|
|
10355
10403
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10356
10404
|
await ensureClientConnected(client);
|
|
10357
10405
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10358
|
-
|
|
10406
|
+
let effectiveMode;
|
|
10407
|
+
if (options?.mode !== undefined) {
|
|
10408
|
+
effectiveMode = options.mode;
|
|
10409
|
+
} else {
|
|
10410
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10411
|
+
if (diagnosis.available) {
|
|
10412
|
+
effectiveMode = "code";
|
|
10413
|
+
} else {
|
|
10414
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10415
|
+
effectiveMode = "tools";
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10359
10418
|
const openaiTools = effectiveMode === "code" ? (() => {
|
|
10360
10419
|
const codeTool = buildCodeModeTool(client, {
|
|
10361
10420
|
tools: mcpTools,
|
|
@@ -10535,7 +10594,18 @@ async function getAnthropicTools(client, options) {
|
|
|
10535
10594
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10536
10595
|
await ensureClientConnected(client);
|
|
10537
10596
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10538
|
-
|
|
10597
|
+
let effectiveMode;
|
|
10598
|
+
if (options?.mode !== undefined) {
|
|
10599
|
+
effectiveMode = options.mode;
|
|
10600
|
+
} else {
|
|
10601
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10602
|
+
if (diagnosis.available) {
|
|
10603
|
+
effectiveMode = "code";
|
|
10604
|
+
} else {
|
|
10605
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10606
|
+
effectiveMode = "tools";
|
|
10607
|
+
}
|
|
10608
|
+
}
|
|
10539
10609
|
const anthropicTools = effectiveMode === "code" ? (() => {
|
|
10540
10610
|
const codeTool = buildCodeModeTool(client, {
|
|
10541
10611
|
tools: mcpTools,
|
|
@@ -10724,7 +10794,18 @@ async function getGoogleTools(client, options) {
|
|
|
10724
10794
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10725
10795
|
await ensureClientConnected(client);
|
|
10726
10796
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10727
|
-
|
|
10797
|
+
let effectiveMode;
|
|
10798
|
+
if (options?.mode !== undefined) {
|
|
10799
|
+
effectiveMode = options.mode;
|
|
10800
|
+
} else {
|
|
10801
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10802
|
+
if (diagnosis.available) {
|
|
10803
|
+
effectiveMode = "code";
|
|
10804
|
+
} else {
|
|
10805
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10806
|
+
effectiveMode = "tools";
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10728
10809
|
let googleTools;
|
|
10729
10810
|
if (effectiveMode === "code") {
|
|
10730
10811
|
const TypeEnum = await getGoogleType();
|
|
@@ -11318,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11318
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11319
11400
|
}
|
|
11320
11401
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
11402
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
11321
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11322
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11323
11405
|
if (!publicUrl) {
|
|
11324
11406
|
return Response.json({
|
|
11325
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
11407
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). Set it to the public origin where /api/integrate/mcp is reachable."
|
|
11326
11408
|
}, { status: 500 });
|
|
11327
11409
|
}
|
|
11328
11410
|
let contextOverride = body.context;
|
|
@@ -8780,16 +8780,46 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
8780
8780
|
var init_executor = () => {};
|
|
8781
8781
|
|
|
8782
8782
|
// ../code-mode/tool-builder.ts
|
|
8783
|
+
var exports_tool_builder = {};
|
|
8784
|
+
__export(exports_tool_builder, {
|
|
8785
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
8786
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
8787
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
8788
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
8789
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
8790
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
8791
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
8792
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
8793
|
+
});
|
|
8783
8794
|
function resolveCodeModeClientConfig(client) {
|
|
8784
8795
|
const oauthConfig = client.__oauthConfig;
|
|
8785
8796
|
return oauthConfig?.codeMode ?? {};
|
|
8786
8797
|
}
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8801
|
+
async function diagnoseCodeMode(client) {
|
|
8802
|
+
if (!await isSandboxAvailable()) {
|
|
8803
|
+
return { available: false, reason: "sandbox-missing" };
|
|
8804
|
+
}
|
|
8790
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8791
|
-
const publicUrl = serverConfig
|
|
8792
|
-
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8807
|
+
if (!publicUrl) {
|
|
8808
|
+
return { available: false, reason: "no-public-url" };
|
|
8809
|
+
}
|
|
8810
|
+
return { available: true };
|
|
8811
|
+
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8818
|
+
function warnCodeModeFallback(reason) {
|
|
8819
|
+
if (warnedCodeModeReasons.has(reason))
|
|
8820
|
+
return;
|
|
8821
|
+
warnedCodeModeReasons.add(reason);
|
|
8822
|
+
console.warn(CODE_MODE_UNAVAILABLE_MESSAGES[reason]);
|
|
8793
8823
|
}
|
|
8794
8824
|
function buildCodeModeTool(client, options) {
|
|
8795
8825
|
const { tools, providerTokens, context, integrationIds } = options;
|
|
@@ -8802,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8802
8832
|
${generated.source}
|
|
8803
8833
|
\`\`\``;
|
|
8804
8834
|
const execute = async ({ code }) => {
|
|
8805
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8806
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8807
8839
|
if (!publicUrl) {
|
|
8808
8840
|
return {
|
|
@@ -8811,7 +8843,7 @@ ${generated.source}
|
|
|
8811
8843
|
stdout: "",
|
|
8812
8844
|
stderr: "",
|
|
8813
8845
|
durationMs: 0,
|
|
8814
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
8846
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). " + "The sandbox uses it to call back into /api/integrate/mcp."
|
|
8815
8847
|
};
|
|
8816
8848
|
}
|
|
8817
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8845,7 +8877,7 @@ ${generated.source}
|
|
|
8845
8877
|
execute
|
|
8846
8878
|
};
|
|
8847
8879
|
}
|
|
8848
|
-
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS;
|
|
8880
|
+
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS, CODE_MODE_UNAVAILABLE_MESSAGES, warnedCodeModeReasons;
|
|
8849
8881
|
var init_tool_builder = __esm(() => {
|
|
8850
8882
|
init_type_generator();
|
|
8851
8883
|
init_executor();
|
|
@@ -8870,6 +8902,11 @@ var init_tool_builder = __esm(() => {
|
|
|
8870
8902
|
"API surface:"
|
|
8871
8903
|
].join(`
|
|
8872
8904
|
`);
|
|
8905
|
+
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8906
|
+
"sandbox-missing": "[integrate-sdk] Code Mode unavailable (reason: sandbox-missing) — falling back to tool mode. " + "Install `@vercel/sandbox` (e.g. `bun add @vercel/sandbox`) to enable Code Mode.",
|
|
8907
|
+
"no-public-url": "[integrate-sdk] Code Mode unavailable (reason: no-public-url) — falling back to tool mode. " + "Set `codeMode.publicUrl` on your server config or the `INTEGRATE_URL` env var."
|
|
8908
|
+
};
|
|
8909
|
+
warnedCodeModeReasons = new Set;
|
|
8873
8910
|
});
|
|
8874
8911
|
|
|
8875
8912
|
// ../ai/vercel-ai.ts
|
|
@@ -8896,7 +8933,18 @@ async function getVercelAITools(client, options) {
|
|
|
8896
8933
|
await ensureClientConnected(client);
|
|
8897
8934
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
8898
8935
|
const vercelTools = {};
|
|
8899
|
-
|
|
8936
|
+
let effectiveMode;
|
|
8937
|
+
if (options?.mode !== undefined) {
|
|
8938
|
+
effectiveMode = options.mode;
|
|
8939
|
+
} else {
|
|
8940
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
8941
|
+
if (diagnosis.available) {
|
|
8942
|
+
effectiveMode = "code";
|
|
8943
|
+
} else {
|
|
8944
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
8945
|
+
effectiveMode = "tools";
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8900
8948
|
if (effectiveMode === "code") {
|
|
8901
8949
|
const codeTool = buildCodeModeTool(client, {
|
|
8902
8950
|
tools: mcpTools,
|
|
@@ -10355,7 +10403,18 @@ async function getOpenAITools(client, options) {
|
|
|
10355
10403
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10356
10404
|
await ensureClientConnected(client);
|
|
10357
10405
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10358
|
-
|
|
10406
|
+
let effectiveMode;
|
|
10407
|
+
if (options?.mode !== undefined) {
|
|
10408
|
+
effectiveMode = options.mode;
|
|
10409
|
+
} else {
|
|
10410
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10411
|
+
if (diagnosis.available) {
|
|
10412
|
+
effectiveMode = "code";
|
|
10413
|
+
} else {
|
|
10414
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10415
|
+
effectiveMode = "tools";
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10359
10418
|
const openaiTools = effectiveMode === "code" ? (() => {
|
|
10360
10419
|
const codeTool = buildCodeModeTool(client, {
|
|
10361
10420
|
tools: mcpTools,
|
|
@@ -10535,7 +10594,18 @@ async function getAnthropicTools(client, options) {
|
|
|
10535
10594
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10536
10595
|
await ensureClientConnected(client);
|
|
10537
10596
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10538
|
-
|
|
10597
|
+
let effectiveMode;
|
|
10598
|
+
if (options?.mode !== undefined) {
|
|
10599
|
+
effectiveMode = options.mode;
|
|
10600
|
+
} else {
|
|
10601
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10602
|
+
if (diagnosis.available) {
|
|
10603
|
+
effectiveMode = "code";
|
|
10604
|
+
} else {
|
|
10605
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10606
|
+
effectiveMode = "tools";
|
|
10607
|
+
}
|
|
10608
|
+
}
|
|
10539
10609
|
const anthropicTools = effectiveMode === "code" ? (() => {
|
|
10540
10610
|
const codeTool = buildCodeModeTool(client, {
|
|
10541
10611
|
tools: mcpTools,
|
|
@@ -10724,7 +10794,18 @@ async function getGoogleTools(client, options) {
|
|
|
10724
10794
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10725
10795
|
await ensureClientConnected(client);
|
|
10726
10796
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10727
|
-
|
|
10797
|
+
let effectiveMode;
|
|
10798
|
+
if (options?.mode !== undefined) {
|
|
10799
|
+
effectiveMode = options.mode;
|
|
10800
|
+
} else {
|
|
10801
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10802
|
+
if (diagnosis.available) {
|
|
10803
|
+
effectiveMode = "code";
|
|
10804
|
+
} else {
|
|
10805
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10806
|
+
effectiveMode = "tools";
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10728
10809
|
let googleTools;
|
|
10729
10810
|
if (effectiveMode === "code") {
|
|
10730
10811
|
const TypeEnum = await getGoogleType();
|
|
@@ -11318,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11318
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11319
11400
|
}
|
|
11320
11401
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
11402
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
11321
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11322
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11323
11405
|
if (!publicUrl) {
|
|
11324
11406
|
return Response.json({
|
|
11325
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
11407
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). Set it to the public origin where /api/integrate/mcp is reachable."
|
|
11326
11408
|
}, { status: 500 });
|
|
11327
11409
|
}
|
|
11328
11410
|
let contextOverride = body.context;
|
|
@@ -8780,16 +8780,46 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
8780
8780
|
var init_executor = () => {};
|
|
8781
8781
|
|
|
8782
8782
|
// ../code-mode/tool-builder.ts
|
|
8783
|
+
var exports_tool_builder = {};
|
|
8784
|
+
__export(exports_tool_builder, {
|
|
8785
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
8786
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
8787
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
8788
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
8789
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
8790
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
8791
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
8792
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
8793
|
+
});
|
|
8783
8794
|
function resolveCodeModeClientConfig(client) {
|
|
8784
8795
|
const oauthConfig = client.__oauthConfig;
|
|
8785
8796
|
return oauthConfig?.codeMode ?? {};
|
|
8786
8797
|
}
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8801
|
+
async function diagnoseCodeMode(client) {
|
|
8802
|
+
if (!await isSandboxAvailable()) {
|
|
8803
|
+
return { available: false, reason: "sandbox-missing" };
|
|
8804
|
+
}
|
|
8790
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8791
|
-
const publicUrl = serverConfig
|
|
8792
|
-
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8807
|
+
if (!publicUrl) {
|
|
8808
|
+
return { available: false, reason: "no-public-url" };
|
|
8809
|
+
}
|
|
8810
|
+
return { available: true };
|
|
8811
|
+
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8818
|
+
function warnCodeModeFallback(reason) {
|
|
8819
|
+
if (warnedCodeModeReasons.has(reason))
|
|
8820
|
+
return;
|
|
8821
|
+
warnedCodeModeReasons.add(reason);
|
|
8822
|
+
console.warn(CODE_MODE_UNAVAILABLE_MESSAGES[reason]);
|
|
8793
8823
|
}
|
|
8794
8824
|
function buildCodeModeTool(client, options) {
|
|
8795
8825
|
const { tools, providerTokens, context, integrationIds } = options;
|
|
@@ -8802,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8802
8832
|
${generated.source}
|
|
8803
8833
|
\`\`\``;
|
|
8804
8834
|
const execute = async ({ code }) => {
|
|
8805
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8806
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8807
8839
|
if (!publicUrl) {
|
|
8808
8840
|
return {
|
|
@@ -8811,7 +8843,7 @@ ${generated.source}
|
|
|
8811
8843
|
stdout: "",
|
|
8812
8844
|
stderr: "",
|
|
8813
8845
|
durationMs: 0,
|
|
8814
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
8846
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). " + "The sandbox uses it to call back into /api/integrate/mcp."
|
|
8815
8847
|
};
|
|
8816
8848
|
}
|
|
8817
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8845,7 +8877,7 @@ ${generated.source}
|
|
|
8845
8877
|
execute
|
|
8846
8878
|
};
|
|
8847
8879
|
}
|
|
8848
|
-
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS;
|
|
8880
|
+
var CODE_MODE_TOOL_NAME = "execute_code", DEFAULT_INSTRUCTIONS, CODE_MODE_UNAVAILABLE_MESSAGES, warnedCodeModeReasons;
|
|
8849
8881
|
var init_tool_builder = __esm(() => {
|
|
8850
8882
|
init_type_generator();
|
|
8851
8883
|
init_executor();
|
|
@@ -8870,6 +8902,11 @@ var init_tool_builder = __esm(() => {
|
|
|
8870
8902
|
"API surface:"
|
|
8871
8903
|
].join(`
|
|
8872
8904
|
`);
|
|
8905
|
+
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8906
|
+
"sandbox-missing": "[integrate-sdk] Code Mode unavailable (reason: sandbox-missing) — falling back to tool mode. " + "Install `@vercel/sandbox` (e.g. `bun add @vercel/sandbox`) to enable Code Mode.",
|
|
8907
|
+
"no-public-url": "[integrate-sdk] Code Mode unavailable (reason: no-public-url) — falling back to tool mode. " + "Set `codeMode.publicUrl` on your server config or the `INTEGRATE_URL` env var."
|
|
8908
|
+
};
|
|
8909
|
+
warnedCodeModeReasons = new Set;
|
|
8873
8910
|
});
|
|
8874
8911
|
|
|
8875
8912
|
// ../ai/vercel-ai.ts
|
|
@@ -8896,7 +8933,18 @@ async function getVercelAITools(client, options) {
|
|
|
8896
8933
|
await ensureClientConnected(client);
|
|
8897
8934
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
8898
8935
|
const vercelTools = {};
|
|
8899
|
-
|
|
8936
|
+
let effectiveMode;
|
|
8937
|
+
if (options?.mode !== undefined) {
|
|
8938
|
+
effectiveMode = options.mode;
|
|
8939
|
+
} else {
|
|
8940
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
8941
|
+
if (diagnosis.available) {
|
|
8942
|
+
effectiveMode = "code";
|
|
8943
|
+
} else {
|
|
8944
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
8945
|
+
effectiveMode = "tools";
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8900
8948
|
if (effectiveMode === "code") {
|
|
8901
8949
|
const codeTool = buildCodeModeTool(client, {
|
|
8902
8950
|
tools: mcpTools,
|
|
@@ -10355,7 +10403,18 @@ async function getOpenAITools(client, options) {
|
|
|
10355
10403
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10356
10404
|
await ensureClientConnected(client);
|
|
10357
10405
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10358
|
-
|
|
10406
|
+
let effectiveMode;
|
|
10407
|
+
if (options?.mode !== undefined) {
|
|
10408
|
+
effectiveMode = options.mode;
|
|
10409
|
+
} else {
|
|
10410
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10411
|
+
if (diagnosis.available) {
|
|
10412
|
+
effectiveMode = "code";
|
|
10413
|
+
} else {
|
|
10414
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10415
|
+
effectiveMode = "tools";
|
|
10416
|
+
}
|
|
10417
|
+
}
|
|
10359
10418
|
const openaiTools = effectiveMode === "code" ? (() => {
|
|
10360
10419
|
const codeTool = buildCodeModeTool(client, {
|
|
10361
10420
|
tools: mcpTools,
|
|
@@ -10535,7 +10594,18 @@ async function getAnthropicTools(client, options) {
|
|
|
10535
10594
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10536
10595
|
await ensureClientConnected(client);
|
|
10537
10596
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10538
|
-
|
|
10597
|
+
let effectiveMode;
|
|
10598
|
+
if (options?.mode !== undefined) {
|
|
10599
|
+
effectiveMode = options.mode;
|
|
10600
|
+
} else {
|
|
10601
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10602
|
+
if (diagnosis.available) {
|
|
10603
|
+
effectiveMode = "code";
|
|
10604
|
+
} else {
|
|
10605
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10606
|
+
effectiveMode = "tools";
|
|
10607
|
+
}
|
|
10608
|
+
}
|
|
10539
10609
|
const anthropicTools = effectiveMode === "code" ? (() => {
|
|
10540
10610
|
const codeTool = buildCodeModeTool(client, {
|
|
10541
10611
|
tools: mcpTools,
|
|
@@ -10724,7 +10794,18 @@ async function getGoogleTools(client, options) {
|
|
|
10724
10794
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
10725
10795
|
await ensureClientConnected(client);
|
|
10726
10796
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
10727
|
-
|
|
10797
|
+
let effectiveMode;
|
|
10798
|
+
if (options?.mode !== undefined) {
|
|
10799
|
+
effectiveMode = options.mode;
|
|
10800
|
+
} else {
|
|
10801
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
10802
|
+
if (diagnosis.available) {
|
|
10803
|
+
effectiveMode = "code";
|
|
10804
|
+
} else {
|
|
10805
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
10806
|
+
effectiveMode = "tools";
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10728
10809
|
let googleTools;
|
|
10729
10810
|
if (effectiveMode === "code") {
|
|
10730
10811
|
const TypeEnum = await getGoogleType();
|
|
@@ -11318,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11318
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11319
11400
|
}
|
|
11320
11401
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
11402
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
11321
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11322
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11323
11405
|
if (!publicUrl) {
|
|
11324
11406
|
return Response.json({
|
|
11325
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
11407
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). Set it to the public origin where /api/integrate/mcp is reachable."
|
|
11326
11408
|
}, { status: 500 });
|
|
11327
11409
|
}
|
|
11328
11410
|
let contextOverride = body.context;
|
|
@@ -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;AASjH,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;AA4ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,aAAa,EAAE,CAAC,CA2E1B;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"}
|
package/dist/ai/anthropic.js
CHANGED
|
@@ -4893,12 +4893,30 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4899
|
+
async function diagnoseCodeMode(client) {
|
|
4900
|
+
if (!await isSandboxAvailable()) {
|
|
4901
|
+
return { available: false, reason: "sandbox-missing" };
|
|
4902
|
+
}
|
|
4899
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4900
|
-
const publicUrl = serverConfig
|
|
4901
|
-
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4905
|
+
if (!publicUrl) {
|
|
4906
|
+
return { available: false, reason: "no-public-url" };
|
|
4907
|
+
}
|
|
4908
|
+
return { available: true };
|
|
4909
|
+
}
|
|
4910
|
+
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4911
|
+
"sandbox-missing": "[integrate-sdk] Code Mode unavailable (reason: sandbox-missing) — falling back to tool mode. " + "Install `@vercel/sandbox` (e.g. `bun add @vercel/sandbox`) to enable Code Mode.",
|
|
4912
|
+
"no-public-url": "[integrate-sdk] Code Mode unavailable (reason: no-public-url) — falling back to tool mode. " + "Set `codeMode.publicUrl` on your server config or the `INTEGRATE_URL` env var."
|
|
4913
|
+
};
|
|
4914
|
+
var warnedCodeModeReasons = new Set;
|
|
4915
|
+
function warnCodeModeFallback(reason) {
|
|
4916
|
+
if (warnedCodeModeReasons.has(reason))
|
|
4917
|
+
return;
|
|
4918
|
+
warnedCodeModeReasons.add(reason);
|
|
4919
|
+
console.warn(CODE_MODE_UNAVAILABLE_MESSAGES[reason]);
|
|
4902
4920
|
}
|
|
4903
4921
|
function buildCodeModeTool(client, options) {
|
|
4904
4922
|
const { tools, providerTokens, context, integrationIds } = options;
|
|
@@ -4911,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4911
4929
|
${generated.source}
|
|
4912
4930
|
\`\`\``;
|
|
4913
4931
|
const execute = async ({ code }) => {
|
|
4914
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4915
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4916
4936
|
if (!publicUrl) {
|
|
4917
4937
|
return {
|
|
@@ -4920,7 +4940,7 @@ ${generated.source}
|
|
|
4920
4940
|
stdout: "",
|
|
4921
4941
|
stderr: "",
|
|
4922
4942
|
durationMs: 0,
|
|
4923
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
4943
|
+
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the INTEGRATE_URL env var). " + "The sandbox uses it to call back into /api/integrate/mcp."
|
|
4924
4944
|
};
|
|
4925
4945
|
}
|
|
4926
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -5025,7 +5045,18 @@ async function getAnthropicTools(client, options) {
|
|
|
5025
5045
|
const finalOptions = providerTokens ? { ...options, providerTokens } : options;
|
|
5026
5046
|
await ensureClientConnected(client);
|
|
5027
5047
|
const mcpTools = await client.getEnabledToolsAsync();
|
|
5028
|
-
|
|
5048
|
+
let effectiveMode;
|
|
5049
|
+
if (options?.mode !== undefined) {
|
|
5050
|
+
effectiveMode = options.mode;
|
|
5051
|
+
} else {
|
|
5052
|
+
const diagnosis = await diagnoseCodeMode(client);
|
|
5053
|
+
if (diagnosis.available) {
|
|
5054
|
+
effectiveMode = "code";
|
|
5055
|
+
} else {
|
|
5056
|
+
warnCodeModeFallback(diagnosis.reason);
|
|
5057
|
+
effectiveMode = "tools";
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5029
5060
|
const anthropicTools = effectiveMode === "code" ? (() => {
|
|
5030
5061
|
const codeTool = buildCodeModeTool(client, {
|
|
5031
5062
|
tools: mcpTools,
|
package/dist/ai/google.d.ts.map
CHANGED
|
@@ -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;AAYjH,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,CA4DnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,UAAU,EAAE,CAAC,CAwFvB"}
|