integrate-sdk 0.9.9-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 +29 -6
- package/dist/adapters/index.js +29 -6
- package/dist/adapters/nextjs.js +29 -6
- package/dist/adapters/node.js +29 -6
- package/dist/adapters/svelte-kit.js +29 -6
- package/dist/adapters/tanstack-start.js +29 -6
- package/dist/ai/anthropic.js +9 -4
- package/dist/ai/google.js +9 -4
- package/dist/ai/index.js +9 -4
- package/dist/ai/openai.js +9 -4
- package/dist/ai/vercel-ai.js +9 -4
- package/dist/code-mode/index.js +9 -4
- package/dist/code-mode/tool-builder.d.ts +9 -1
- package/dist/code-mode/tool-builder.d.ts.map +1 -1
- package/dist/code-mode/tool-builder.js +10 -4
- package/dist/index.js +29 -6
- package/dist/oauth.js +29 -6
- package/dist/server.js +29 -6
- package/dist/src/code-mode/tool-builder.d.ts +9 -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
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
package/dist/adapters/index.js
CHANGED
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
package/dist/adapters/nextjs.js
CHANGED
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
package/dist/adapters/node.js
CHANGED
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
|
@@ -8780,21 +8780,41 @@ 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
|
}
|
|
8798
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
8799
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
8800
|
+
}
|
|
8787
8801
|
async function diagnoseCodeMode(client) {
|
|
8788
8802
|
if (!await isSandboxAvailable()) {
|
|
8789
8803
|
return { available: false, reason: "sandbox-missing" };
|
|
8790
8804
|
}
|
|
8791
8805
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
8792
|
-
const publicUrl = serverConfig
|
|
8806
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
8793
8807
|
if (!publicUrl) {
|
|
8794
8808
|
return { available: false, reason: "no-public-url" };
|
|
8795
8809
|
}
|
|
8796
8810
|
return { available: true };
|
|
8797
8811
|
}
|
|
8812
|
+
async function canUseCodeMode(client) {
|
|
8813
|
+
return (await diagnoseCodeMode(client)).available;
|
|
8814
|
+
}
|
|
8815
|
+
function __resetCodeModeFallbackWarnings() {
|
|
8816
|
+
warnedCodeModeReasons.clear();
|
|
8817
|
+
}
|
|
8798
8818
|
function warnCodeModeFallback(reason) {
|
|
8799
8819
|
if (warnedCodeModeReasons.has(reason))
|
|
8800
8820
|
return;
|
|
@@ -8812,7 +8832,9 @@ function buildCodeModeTool(client, options) {
|
|
|
8812
8832
|
${generated.source}
|
|
8813
8833
|
\`\`\``;
|
|
8814
8834
|
const execute = async ({ code }) => {
|
|
8815
|
-
const publicUrl =
|
|
8835
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
8836
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
8837
|
+
});
|
|
8816
8838
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
8817
8839
|
if (!publicUrl) {
|
|
8818
8840
|
return {
|
|
@@ -8821,7 +8843,7 @@ ${generated.source}
|
|
|
8821
8843
|
stdout: "",
|
|
8822
8844
|
stderr: "",
|
|
8823
8845
|
durationMs: 0,
|
|
8824
|
-
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."
|
|
8825
8847
|
};
|
|
8826
8848
|
}
|
|
8827
8849
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -8882,7 +8904,7 @@ var init_tool_builder = __esm(() => {
|
|
|
8882
8904
|
`);
|
|
8883
8905
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
8884
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.",
|
|
8885
|
-
"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 `
|
|
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."
|
|
8886
8908
|
};
|
|
8887
8909
|
warnedCodeModeReasons = new Set;
|
|
8888
8910
|
});
|
|
@@ -11377,11 +11399,12 @@ function createMCPServer(config) {
|
|
|
11377
11399
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11378
11400
|
}
|
|
11379
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));
|
|
11380
11403
|
const codeModeConfig = config.codeMode ?? {};
|
|
11381
|
-
const publicUrl = codeModeConfig
|
|
11404
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11382
11405
|
if (!publicUrl) {
|
|
11383
11406
|
return Response.json({
|
|
11384
|
-
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."
|
|
11385
11408
|
}, { status: 500 });
|
|
11386
11409
|
}
|
|
11387
11410
|
let contextOverride = body.context;
|
package/dist/ai/anthropic.js
CHANGED
|
@@ -4893,12 +4893,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4896
4899
|
async function diagnoseCodeMode(client) {
|
|
4897
4900
|
if (!await isSandboxAvailable()) {
|
|
4898
4901
|
return { available: false, reason: "sandbox-missing" };
|
|
4899
4902
|
}
|
|
4900
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4901
|
-
const publicUrl = serverConfig
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4902
4905
|
if (!publicUrl) {
|
|
4903
4906
|
return { available: false, reason: "no-public-url" };
|
|
4904
4907
|
}
|
|
@@ -4906,7 +4909,7 @@ async function diagnoseCodeMode(client) {
|
|
|
4906
4909
|
}
|
|
4907
4910
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4908
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.",
|
|
4909
|
-
"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 `
|
|
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."
|
|
4910
4913
|
};
|
|
4911
4914
|
var warnedCodeModeReasons = new Set;
|
|
4912
4915
|
function warnCodeModeFallback(reason) {
|
|
@@ -4926,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4926
4929
|
${generated.source}
|
|
4927
4930
|
\`\`\``;
|
|
4928
4931
|
const execute = async ({ code }) => {
|
|
4929
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4930
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4931
4936
|
if (!publicUrl) {
|
|
4932
4937
|
return {
|
|
@@ -4935,7 +4940,7 @@ ${generated.source}
|
|
|
4935
4940
|
stdout: "",
|
|
4936
4941
|
stderr: "",
|
|
4937
4942
|
durationMs: 0,
|
|
4938
|
-
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."
|
|
4939
4944
|
};
|
|
4940
4945
|
}
|
|
4941
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
package/dist/ai/google.js
CHANGED
|
@@ -4893,12 +4893,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4896
4899
|
async function diagnoseCodeMode(client) {
|
|
4897
4900
|
if (!await isSandboxAvailable()) {
|
|
4898
4901
|
return { available: false, reason: "sandbox-missing" };
|
|
4899
4902
|
}
|
|
4900
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4901
|
-
const publicUrl = serverConfig
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4902
4905
|
if (!publicUrl) {
|
|
4903
4906
|
return { available: false, reason: "no-public-url" };
|
|
4904
4907
|
}
|
|
@@ -4906,7 +4909,7 @@ async function diagnoseCodeMode(client) {
|
|
|
4906
4909
|
}
|
|
4907
4910
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4908
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.",
|
|
4909
|
-
"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 `
|
|
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."
|
|
4910
4913
|
};
|
|
4911
4914
|
var warnedCodeModeReasons = new Set;
|
|
4912
4915
|
function warnCodeModeFallback(reason) {
|
|
@@ -4926,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4926
4929
|
${generated.source}
|
|
4927
4930
|
\`\`\``;
|
|
4928
4931
|
const execute = async ({ code }) => {
|
|
4929
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4930
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4931
4936
|
if (!publicUrl) {
|
|
4932
4937
|
return {
|
|
@@ -4935,7 +4940,7 @@ ${generated.source}
|
|
|
4935
4940
|
stdout: "",
|
|
4936
4941
|
stderr: "",
|
|
4937
4942
|
durationMs: 0,
|
|
4938
|
-
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."
|
|
4939
4944
|
};
|
|
4940
4945
|
}
|
|
4941
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
package/dist/ai/index.js
CHANGED
|
@@ -4893,12 +4893,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4896
4899
|
async function diagnoseCodeMode(client) {
|
|
4897
4900
|
if (!await isSandboxAvailable()) {
|
|
4898
4901
|
return { available: false, reason: "sandbox-missing" };
|
|
4899
4902
|
}
|
|
4900
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4901
|
-
const publicUrl = serverConfig
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4902
4905
|
if (!publicUrl) {
|
|
4903
4906
|
return { available: false, reason: "no-public-url" };
|
|
4904
4907
|
}
|
|
@@ -4906,7 +4909,7 @@ async function diagnoseCodeMode(client) {
|
|
|
4906
4909
|
}
|
|
4907
4910
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4908
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.",
|
|
4909
|
-
"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 `
|
|
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."
|
|
4910
4913
|
};
|
|
4911
4914
|
var warnedCodeModeReasons = new Set;
|
|
4912
4915
|
function warnCodeModeFallback(reason) {
|
|
@@ -4926,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4926
4929
|
${generated.source}
|
|
4927
4930
|
\`\`\``;
|
|
4928
4931
|
const execute = async ({ code }) => {
|
|
4929
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4930
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4931
4936
|
if (!publicUrl) {
|
|
4932
4937
|
return {
|
|
@@ -4935,7 +4940,7 @@ ${generated.source}
|
|
|
4935
4940
|
stdout: "",
|
|
4936
4941
|
stderr: "",
|
|
4937
4942
|
durationMs: 0,
|
|
4938
|
-
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."
|
|
4939
4944
|
};
|
|
4940
4945
|
}
|
|
4941
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
package/dist/ai/openai.js
CHANGED
|
@@ -4893,12 +4893,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4896
4899
|
async function diagnoseCodeMode(client) {
|
|
4897
4900
|
if (!await isSandboxAvailable()) {
|
|
4898
4901
|
return { available: false, reason: "sandbox-missing" };
|
|
4899
4902
|
}
|
|
4900
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4901
|
-
const publicUrl = serverConfig
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4902
4905
|
if (!publicUrl) {
|
|
4903
4906
|
return { available: false, reason: "no-public-url" };
|
|
4904
4907
|
}
|
|
@@ -4906,7 +4909,7 @@ async function diagnoseCodeMode(client) {
|
|
|
4906
4909
|
}
|
|
4907
4910
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4908
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.",
|
|
4909
|
-
"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 `
|
|
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."
|
|
4910
4913
|
};
|
|
4911
4914
|
var warnedCodeModeReasons = new Set;
|
|
4912
4915
|
function warnCodeModeFallback(reason) {
|
|
@@ -4926,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4926
4929
|
${generated.source}
|
|
4927
4930
|
\`\`\``;
|
|
4928
4931
|
const execute = async ({ code }) => {
|
|
4929
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4930
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4931
4936
|
if (!publicUrl) {
|
|
4932
4937
|
return {
|
|
@@ -4935,7 +4940,7 @@ ${generated.source}
|
|
|
4935
4940
|
stdout: "",
|
|
4936
4941
|
stderr: "",
|
|
4937
4942
|
durationMs: 0,
|
|
4938
|
-
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."
|
|
4939
4944
|
};
|
|
4940
4945
|
}
|
|
4941
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
package/dist/ai/vercel-ai.js
CHANGED
|
@@ -4893,12 +4893,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
4893
4893
|
const oauthConfig = client.__oauthConfig;
|
|
4894
4894
|
return oauthConfig?.codeMode ?? {};
|
|
4895
4895
|
}
|
|
4896
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
4897
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
4898
|
+
}
|
|
4896
4899
|
async function diagnoseCodeMode(client) {
|
|
4897
4900
|
if (!await isSandboxAvailable()) {
|
|
4898
4901
|
return { available: false, reason: "sandbox-missing" };
|
|
4899
4902
|
}
|
|
4900
4903
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
4901
|
-
const publicUrl = serverConfig
|
|
4904
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
4902
4905
|
if (!publicUrl) {
|
|
4903
4906
|
return { available: false, reason: "no-public-url" };
|
|
4904
4907
|
}
|
|
@@ -4906,7 +4909,7 @@ async function diagnoseCodeMode(client) {
|
|
|
4906
4909
|
}
|
|
4907
4910
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
4908
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.",
|
|
4909
|
-
"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 `
|
|
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."
|
|
4910
4913
|
};
|
|
4911
4914
|
var warnedCodeModeReasons = new Set;
|
|
4912
4915
|
function warnCodeModeFallback(reason) {
|
|
@@ -4926,7 +4929,9 @@ function buildCodeModeTool(client, options) {
|
|
|
4926
4929
|
${generated.source}
|
|
4927
4930
|
\`\`\``;
|
|
4928
4931
|
const execute = async ({ code }) => {
|
|
4929
|
-
const publicUrl =
|
|
4932
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
4933
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
4934
|
+
});
|
|
4930
4935
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
4931
4936
|
if (!publicUrl) {
|
|
4932
4937
|
return {
|
|
@@ -4935,7 +4940,7 @@ ${generated.source}
|
|
|
4935
4940
|
stdout: "",
|
|
4936
4941
|
stderr: "",
|
|
4937
4942
|
durationMs: 0,
|
|
4938
|
-
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."
|
|
4939
4944
|
};
|
|
4940
4945
|
}
|
|
4941
4946
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
package/dist/code-mode/index.js
CHANGED
|
@@ -498,12 +498,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
498
498
|
const oauthConfig = client.__oauthConfig;
|
|
499
499
|
return oauthConfig?.codeMode ?? {};
|
|
500
500
|
}
|
|
501
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
502
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
503
|
+
}
|
|
501
504
|
async function diagnoseCodeMode(client) {
|
|
502
505
|
if (!await isSandboxAvailable()) {
|
|
503
506
|
return { available: false, reason: "sandbox-missing" };
|
|
504
507
|
}
|
|
505
508
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
506
|
-
const publicUrl = serverConfig
|
|
509
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
507
510
|
if (!publicUrl) {
|
|
508
511
|
return { available: false, reason: "no-public-url" };
|
|
509
512
|
}
|
|
@@ -514,7 +517,7 @@ async function canUseCodeMode(client) {
|
|
|
514
517
|
}
|
|
515
518
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
516
519
|
"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.",
|
|
517
|
-
"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 `
|
|
520
|
+
"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."
|
|
518
521
|
};
|
|
519
522
|
var warnedCodeModeReasons = new Set;
|
|
520
523
|
function __resetCodeModeFallbackWarnings() {
|
|
@@ -537,7 +540,9 @@ function buildCodeModeTool(client, options) {
|
|
|
537
540
|
${generated.source}
|
|
538
541
|
\`\`\``;
|
|
539
542
|
const execute = async ({ code }) => {
|
|
540
|
-
const publicUrl =
|
|
543
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
544
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
545
|
+
});
|
|
541
546
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
542
547
|
if (!publicUrl) {
|
|
543
548
|
return {
|
|
@@ -546,7 +551,7 @@ ${generated.source}
|
|
|
546
551
|
stdout: "",
|
|
547
552
|
stderr: "",
|
|
548
553
|
durationMs: 0,
|
|
549
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
554
|
+
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."
|
|
550
555
|
};
|
|
551
556
|
}
|
|
552
557
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -27,7 +27,7 @@ export interface CodeModeToolOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Sandbox + callback overrides. Everything is optional — defaults come
|
|
29
29
|
* from the server client's `__oauthConfig.codeMode` block (set by
|
|
30
|
-
* `createMCPServer`) or from `
|
|
30
|
+
* `createMCPServer`) or from `INTEGRATE_URL`.
|
|
31
31
|
*/
|
|
32
32
|
sandbox?: {
|
|
33
33
|
publicUrl?: string;
|
|
@@ -81,6 +81,14 @@ export type CodeModeDiagnosis = {
|
|
|
81
81
|
available: false;
|
|
82
82
|
reason: CodeModeUnavailableReason;
|
|
83
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the public URL the sandbox should call back into. Precedence:
|
|
86
|
+
* 1. Explicit `codeMode.publicUrl` on the server config
|
|
87
|
+
* 2. `INTEGRATE_URL` env var (same variable used for OAuth redirect auto-detect)
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveCodeModePublicUrl(serverConfig?: {
|
|
90
|
+
publicUrl?: string;
|
|
91
|
+
}): string | undefined;
|
|
84
92
|
export declare function diagnoseCodeMode(client: MCPClient<any>): Promise<CodeModeDiagnosis>;
|
|
85
93
|
export declare function canUseCodeMode(client: MCPClient<any>): Promise<boolean>;
|
|
86
94
|
/** @internal — used by unit tests to reset the warn-once throttle. */
|
|
@@ -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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AG,OAAO,CAAC,iBAAiB,CAAC,CAUzF;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7E;AAaD,sEAAsE;AACtE,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAI5E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,EAAE,mBAAmB,GAC3B,sBAAsB,CA8DxB"}
|
|
@@ -498,12 +498,15 @@ function resolveCodeModeClientConfig(client) {
|
|
|
498
498
|
const oauthConfig = client.__oauthConfig;
|
|
499
499
|
return oauthConfig?.codeMode ?? {};
|
|
500
500
|
}
|
|
501
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
502
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
503
|
+
}
|
|
501
504
|
async function diagnoseCodeMode(client) {
|
|
502
505
|
if (!await isSandboxAvailable()) {
|
|
503
506
|
return { available: false, reason: "sandbox-missing" };
|
|
504
507
|
}
|
|
505
508
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
506
|
-
const publicUrl = serverConfig
|
|
509
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
507
510
|
if (!publicUrl) {
|
|
508
511
|
return { available: false, reason: "no-public-url" };
|
|
509
512
|
}
|
|
@@ -514,7 +517,7 @@ async function canUseCodeMode(client) {
|
|
|
514
517
|
}
|
|
515
518
|
var CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
516
519
|
"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.",
|
|
517
|
-
"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 `
|
|
520
|
+
"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."
|
|
518
521
|
};
|
|
519
522
|
var warnedCodeModeReasons = new Set;
|
|
520
523
|
function __resetCodeModeFallbackWarnings() {
|
|
@@ -537,7 +540,9 @@ function buildCodeModeTool(client, options) {
|
|
|
537
540
|
${generated.source}
|
|
538
541
|
\`\`\``;
|
|
539
542
|
const execute = async ({ code }) => {
|
|
540
|
-
const publicUrl =
|
|
543
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
544
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
545
|
+
});
|
|
541
546
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
542
547
|
if (!publicUrl) {
|
|
543
548
|
return {
|
|
@@ -546,7 +551,7 @@ ${generated.source}
|
|
|
546
551
|
stdout: "",
|
|
547
552
|
stderr: "",
|
|
548
553
|
durationMs: 0,
|
|
549
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
554
|
+
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."
|
|
550
555
|
};
|
|
551
556
|
}
|
|
552
557
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -582,6 +587,7 @@ ${generated.source}
|
|
|
582
587
|
}
|
|
583
588
|
export {
|
|
584
589
|
warnCodeModeFallback,
|
|
590
|
+
resolveCodeModePublicUrl,
|
|
585
591
|
resolveCodeModeClientConfig,
|
|
586
592
|
diagnoseCodeMode,
|
|
587
593
|
canUseCodeMode,
|
package/dist/index.js
CHANGED
|
@@ -9182,21 +9182,41 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
9182
9182
|
var init_executor = () => {};
|
|
9183
9183
|
|
|
9184
9184
|
// src/code-mode/tool-builder.ts
|
|
9185
|
+
var exports_tool_builder = {};
|
|
9186
|
+
__export(exports_tool_builder, {
|
|
9187
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
9188
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
9189
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
9190
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
9191
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
9192
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
9193
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
9194
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
9195
|
+
});
|
|
9185
9196
|
function resolveCodeModeClientConfig(client) {
|
|
9186
9197
|
const oauthConfig = client.__oauthConfig;
|
|
9187
9198
|
return oauthConfig?.codeMode ?? {};
|
|
9188
9199
|
}
|
|
9200
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
9201
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
9202
|
+
}
|
|
9189
9203
|
async function diagnoseCodeMode(client) {
|
|
9190
9204
|
if (!await isSandboxAvailable()) {
|
|
9191
9205
|
return { available: false, reason: "sandbox-missing" };
|
|
9192
9206
|
}
|
|
9193
9207
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
9194
|
-
const publicUrl = serverConfig
|
|
9208
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
9195
9209
|
if (!publicUrl) {
|
|
9196
9210
|
return { available: false, reason: "no-public-url" };
|
|
9197
9211
|
}
|
|
9198
9212
|
return { available: true };
|
|
9199
9213
|
}
|
|
9214
|
+
async function canUseCodeMode(client) {
|
|
9215
|
+
return (await diagnoseCodeMode(client)).available;
|
|
9216
|
+
}
|
|
9217
|
+
function __resetCodeModeFallbackWarnings() {
|
|
9218
|
+
warnedCodeModeReasons.clear();
|
|
9219
|
+
}
|
|
9200
9220
|
function warnCodeModeFallback(reason) {
|
|
9201
9221
|
if (warnedCodeModeReasons.has(reason))
|
|
9202
9222
|
return;
|
|
@@ -9214,7 +9234,9 @@ function buildCodeModeTool(client, options) {
|
|
|
9214
9234
|
${generated.source}
|
|
9215
9235
|
\`\`\``;
|
|
9216
9236
|
const execute = async ({ code }) => {
|
|
9217
|
-
const publicUrl =
|
|
9237
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
9238
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
9239
|
+
});
|
|
9218
9240
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
9219
9241
|
if (!publicUrl) {
|
|
9220
9242
|
return {
|
|
@@ -9223,7 +9245,7 @@ ${generated.source}
|
|
|
9223
9245
|
stdout: "",
|
|
9224
9246
|
stderr: "",
|
|
9225
9247
|
durationMs: 0,
|
|
9226
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
9248
|
+
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."
|
|
9227
9249
|
};
|
|
9228
9250
|
}
|
|
9229
9251
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -9284,7 +9306,7 @@ var init_tool_builder = __esm(() => {
|
|
|
9284
9306
|
`);
|
|
9285
9307
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
9286
9308
|
"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.",
|
|
9287
|
-
"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 `
|
|
9309
|
+
"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."
|
|
9288
9310
|
};
|
|
9289
9311
|
warnedCodeModeReasons = new Set;
|
|
9290
9312
|
});
|
|
@@ -11779,11 +11801,12 @@ function createMCPServer(config) {
|
|
|
11779
11801
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11780
11802
|
}
|
|
11781
11803
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
11804
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
11782
11805
|
const codeModeConfig = config.codeMode ?? {};
|
|
11783
|
-
const publicUrl = codeModeConfig
|
|
11806
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11784
11807
|
if (!publicUrl) {
|
|
11785
11808
|
return Response.json({
|
|
11786
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
11809
|
+
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."
|
|
11787
11810
|
}, { status: 500 });
|
|
11788
11811
|
}
|
|
11789
11812
|
let contextOverride = body.context;
|
package/dist/oauth.js
CHANGED
|
@@ -9016,21 +9016,41 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
9016
9016
|
var init_executor = () => {};
|
|
9017
9017
|
|
|
9018
9018
|
// src/code-mode/tool-builder.ts
|
|
9019
|
+
var exports_tool_builder = {};
|
|
9020
|
+
__export(exports_tool_builder, {
|
|
9021
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
9022
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
9023
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
9024
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
9025
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
9026
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
9027
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
9028
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
9029
|
+
});
|
|
9019
9030
|
function resolveCodeModeClientConfig(client) {
|
|
9020
9031
|
const oauthConfig = client.__oauthConfig;
|
|
9021
9032
|
return oauthConfig?.codeMode ?? {};
|
|
9022
9033
|
}
|
|
9034
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
9035
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
9036
|
+
}
|
|
9023
9037
|
async function diagnoseCodeMode(client) {
|
|
9024
9038
|
if (!await isSandboxAvailable()) {
|
|
9025
9039
|
return { available: false, reason: "sandbox-missing" };
|
|
9026
9040
|
}
|
|
9027
9041
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
9028
|
-
const publicUrl = serverConfig
|
|
9042
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
9029
9043
|
if (!publicUrl) {
|
|
9030
9044
|
return { available: false, reason: "no-public-url" };
|
|
9031
9045
|
}
|
|
9032
9046
|
return { available: true };
|
|
9033
9047
|
}
|
|
9048
|
+
async function canUseCodeMode(client) {
|
|
9049
|
+
return (await diagnoseCodeMode(client)).available;
|
|
9050
|
+
}
|
|
9051
|
+
function __resetCodeModeFallbackWarnings() {
|
|
9052
|
+
warnedCodeModeReasons.clear();
|
|
9053
|
+
}
|
|
9034
9054
|
function warnCodeModeFallback(reason) {
|
|
9035
9055
|
if (warnedCodeModeReasons.has(reason))
|
|
9036
9056
|
return;
|
|
@@ -9048,7 +9068,9 @@ function buildCodeModeTool(client, options) {
|
|
|
9048
9068
|
${generated.source}
|
|
9049
9069
|
\`\`\``;
|
|
9050
9070
|
const execute = async ({ code }) => {
|
|
9051
|
-
const publicUrl =
|
|
9071
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
9072
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
9073
|
+
});
|
|
9052
9074
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
9053
9075
|
if (!publicUrl) {
|
|
9054
9076
|
return {
|
|
@@ -9057,7 +9079,7 @@ ${generated.source}
|
|
|
9057
9079
|
stdout: "",
|
|
9058
9080
|
stderr: "",
|
|
9059
9081
|
durationMs: 0,
|
|
9060
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
9082
|
+
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."
|
|
9061
9083
|
};
|
|
9062
9084
|
}
|
|
9063
9085
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -9118,7 +9140,7 @@ var init_tool_builder = __esm(() => {
|
|
|
9118
9140
|
`);
|
|
9119
9141
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
9120
9142
|
"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.",
|
|
9121
|
-
"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 `
|
|
9143
|
+
"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."
|
|
9122
9144
|
};
|
|
9123
9145
|
warnedCodeModeReasons = new Set;
|
|
9124
9146
|
});
|
|
@@ -11613,11 +11635,12 @@ function createMCPServer(config) {
|
|
|
11613
11635
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
11614
11636
|
}
|
|
11615
11637
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
11638
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
11616
11639
|
const codeModeConfig = config.codeMode ?? {};
|
|
11617
|
-
const publicUrl = codeModeConfig
|
|
11640
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
11618
11641
|
if (!publicUrl) {
|
|
11619
11642
|
return Response.json({
|
|
11620
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
11643
|
+
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."
|
|
11621
11644
|
}, { status: 500 });
|
|
11622
11645
|
}
|
|
11623
11646
|
let contextOverride = body.context;
|
package/dist/server.js
CHANGED
|
@@ -9696,21 +9696,41 @@ var sandboxFactoryOverride = null, _sandboxAvailableCache = null, _sandboxForced
|
|
|
9696
9696
|
var init_executor = () => {};
|
|
9697
9697
|
|
|
9698
9698
|
// src/code-mode/tool-builder.ts
|
|
9699
|
+
var exports_tool_builder = {};
|
|
9700
|
+
__export(exports_tool_builder, {
|
|
9701
|
+
warnCodeModeFallback: () => warnCodeModeFallback,
|
|
9702
|
+
resolveCodeModePublicUrl: () => resolveCodeModePublicUrl,
|
|
9703
|
+
resolveCodeModeClientConfig: () => resolveCodeModeClientConfig,
|
|
9704
|
+
diagnoseCodeMode: () => diagnoseCodeMode,
|
|
9705
|
+
canUseCodeMode: () => canUseCodeMode,
|
|
9706
|
+
buildCodeModeTool: () => buildCodeModeTool,
|
|
9707
|
+
__resetCodeModeFallbackWarnings: () => __resetCodeModeFallbackWarnings,
|
|
9708
|
+
CODE_MODE_TOOL_NAME: () => CODE_MODE_TOOL_NAME
|
|
9709
|
+
});
|
|
9699
9710
|
function resolveCodeModeClientConfig(client) {
|
|
9700
9711
|
const oauthConfig = client.__oauthConfig;
|
|
9701
9712
|
return oauthConfig?.codeMode ?? {};
|
|
9702
9713
|
}
|
|
9714
|
+
function resolveCodeModePublicUrl(serverConfig = {}) {
|
|
9715
|
+
return serverConfig.publicUrl ?? getEnv("INTEGRATE_URL");
|
|
9716
|
+
}
|
|
9703
9717
|
async function diagnoseCodeMode(client) {
|
|
9704
9718
|
if (!await isSandboxAvailable()) {
|
|
9705
9719
|
return { available: false, reason: "sandbox-missing" };
|
|
9706
9720
|
}
|
|
9707
9721
|
const serverConfig = resolveCodeModeClientConfig(client);
|
|
9708
|
-
const publicUrl = serverConfig
|
|
9722
|
+
const publicUrl = resolveCodeModePublicUrl(serverConfig);
|
|
9709
9723
|
if (!publicUrl) {
|
|
9710
9724
|
return { available: false, reason: "no-public-url" };
|
|
9711
9725
|
}
|
|
9712
9726
|
return { available: true };
|
|
9713
9727
|
}
|
|
9728
|
+
async function canUseCodeMode(client) {
|
|
9729
|
+
return (await diagnoseCodeMode(client)).available;
|
|
9730
|
+
}
|
|
9731
|
+
function __resetCodeModeFallbackWarnings() {
|
|
9732
|
+
warnedCodeModeReasons.clear();
|
|
9733
|
+
}
|
|
9714
9734
|
function warnCodeModeFallback(reason) {
|
|
9715
9735
|
if (warnedCodeModeReasons.has(reason))
|
|
9716
9736
|
return;
|
|
@@ -9728,7 +9748,9 @@ function buildCodeModeTool(client, options) {
|
|
|
9728
9748
|
${generated.source}
|
|
9729
9749
|
\`\`\``;
|
|
9730
9750
|
const execute = async ({ code }) => {
|
|
9731
|
-
const publicUrl =
|
|
9751
|
+
const publicUrl = resolveCodeModePublicUrl({
|
|
9752
|
+
publicUrl: sandboxOverrides.publicUrl ?? serverCodeModeConfig.publicUrl
|
|
9753
|
+
});
|
|
9732
9754
|
const apiKey = client.__oauthConfig?.apiKey;
|
|
9733
9755
|
if (!publicUrl) {
|
|
9734
9756
|
return {
|
|
@@ -9737,7 +9759,7 @@ ${generated.source}
|
|
|
9737
9759
|
stdout: "",
|
|
9738
9760
|
stderr: "",
|
|
9739
9761
|
durationMs: 0,
|
|
9740
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
9762
|
+
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."
|
|
9741
9763
|
};
|
|
9742
9764
|
}
|
|
9743
9765
|
const mcpUrl = publicUrl.replace(/\/$/, "") + "/api/integrate/mcp";
|
|
@@ -9798,7 +9820,7 @@ var init_tool_builder = __esm(() => {
|
|
|
9798
9820
|
`);
|
|
9799
9821
|
CODE_MODE_UNAVAILABLE_MESSAGES = {
|
|
9800
9822
|
"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.",
|
|
9801
|
-
"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 `
|
|
9823
|
+
"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."
|
|
9802
9824
|
};
|
|
9803
9825
|
warnedCodeModeReasons = new Set;
|
|
9804
9826
|
});
|
|
@@ -12293,11 +12315,12 @@ function createMCPServer(config) {
|
|
|
12293
12315
|
return Response.json({ error: "`code` is required and must be a non-empty string." }, { status: 400 });
|
|
12294
12316
|
}
|
|
12295
12317
|
const { executeSandboxCode: executeSandboxCode2 } = await Promise.resolve().then(() => (init_executor(), exports_executor));
|
|
12318
|
+
const { resolveCodeModePublicUrl: resolveCodeModePublicUrl2 } = await Promise.resolve().then(() => (init_tool_builder(), exports_tool_builder));
|
|
12296
12319
|
const codeModeConfig = config.codeMode ?? {};
|
|
12297
|
-
const publicUrl = codeModeConfig
|
|
12320
|
+
const publicUrl = resolveCodeModePublicUrl2(codeModeConfig);
|
|
12298
12321
|
if (!publicUrl) {
|
|
12299
12322
|
return Response.json({
|
|
12300
|
-
error: "Code Mode requires `codeMode.publicUrl` in createMCPServer config (or the
|
|
12323
|
+
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."
|
|
12301
12324
|
}, { status: 500 });
|
|
12302
12325
|
}
|
|
12303
12326
|
let contextOverride = body.context;
|
|
@@ -27,7 +27,7 @@ export interface CodeModeToolOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Sandbox + callback overrides. Everything is optional — defaults come
|
|
29
29
|
* from the server client's `__oauthConfig.codeMode` block (set by
|
|
30
|
-
* `createMCPServer`) or from `
|
|
30
|
+
* `createMCPServer`) or from `INTEGRATE_URL`.
|
|
31
31
|
*/
|
|
32
32
|
sandbox?: {
|
|
33
33
|
publicUrl?: string;
|
|
@@ -81,6 +81,14 @@ export type CodeModeDiagnosis = {
|
|
|
81
81
|
available: false;
|
|
82
82
|
reason: CodeModeUnavailableReason;
|
|
83
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the public URL the sandbox should call back into. Precedence:
|
|
86
|
+
* 1. Explicit `codeMode.publicUrl` on the server config
|
|
87
|
+
* 2. `INTEGRATE_URL` env var (same variable used for OAuth redirect auto-detect)
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveCodeModePublicUrl(serverConfig?: {
|
|
90
|
+
publicUrl?: string;
|
|
91
|
+
}): string | undefined;
|
|
84
92
|
export declare function diagnoseCodeMode(client: MCPClient<any>): Promise<CodeModeDiagnosis>;
|
|
85
93
|
export declare function canUseCodeMode(client: MCPClient<any>): Promise<boolean>;
|
|
86
94
|
/** @internal — used by unit tests to reset the warn-once throttle. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-builder.d.ts","sourceRoot":"","sources":["../../../src/code-mode/tool-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;A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BAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAUzF;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7E;AAaD,sEAAsE;AACtE,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAI5E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,OAAO,EAAE,mBAAmB,GAC3B,sBAAsB,CA8DxB"}
|
|
@@ -309,7 +309,7 @@ export interface MCPServerConfig<TIntegrations extends readonly MCPIntegration[]
|
|
|
309
309
|
* createMCPServer({
|
|
310
310
|
* integrations: [...],
|
|
311
311
|
* codeMode: {
|
|
312
|
-
* publicUrl: process.env.
|
|
312
|
+
* publicUrl: process.env.INTEGRATE_URL, // required when code mode is used
|
|
313
313
|
* timeoutMs: 90_000,
|
|
314
314
|
* },
|
|
315
315
|
* });
|
|
@@ -321,7 +321,7 @@ export interface MCPServerConfig<TIntegrations extends readonly MCPIntegration[]
|
|
|
321
321
|
* Vercel Sandbox. Must include the scheme and no trailing `/api/integrate` suffix,
|
|
322
322
|
* e.g. `https://myapp.vercel.app`.
|
|
323
323
|
*
|
|
324
|
-
* Falls back to `process.env.
|
|
324
|
+
* Falls back to `process.env.INTEGRATE_URL` if unset. If neither is provided,
|
|
325
325
|
* Code Mode requests fail fast with a descriptive error.
|
|
326
326
|
*/
|
|
327
327
|
publicUrl?: string;
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAA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