integrate-sdk 0.8.53-dev.0 → 0.8.54-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.
@@ -11,39 +11,43 @@ var __export = (target, all) => {
11
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
12
 
13
13
  // ../utils/logger.ts
14
- function shouldLog(level) {
15
- return logLevelHierarchy[level] <= logLevelHierarchy[globalLogLevel];
14
+ function shouldLog(level, context) {
15
+ return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
16
16
  }
17
- function setLogLevel(level) {
18
- globalLogLevel = level;
17
+ function setLogLevel(level, context = "client") {
18
+ contextLogLevels[context] = level;
19
19
  }
20
- function createLogger(namespace) {
20
+ function createLogger(namespace, context = "client") {
21
21
  const prefix = `[${namespace}]`;
22
22
  return {
23
23
  debug: (...args) => {
24
- if (shouldLog("debug")) {
24
+ if (shouldLog("debug", context)) {
25
25
  console.log(prefix, ...args);
26
26
  }
27
27
  },
28
28
  info: (...args) => {
29
- if (shouldLog("info")) {
29
+ if (shouldLog("info", context)) {
30
30
  console.log(prefix, ...args);
31
31
  }
32
32
  },
33
33
  warn: (...args) => {
34
- if (shouldLog("warn")) {
34
+ if (shouldLog("warn", context)) {
35
35
  console.warn(prefix, ...args);
36
36
  }
37
37
  },
38
38
  error: (...args) => {
39
- if (shouldLog("error")) {
39
+ if (shouldLog("error", context)) {
40
40
  console.error(prefix, ...args);
41
41
  }
42
42
  }
43
43
  };
44
44
  }
45
- var globalLogLevel = "error", logLevelHierarchy;
45
+ var contextLogLevels, logLevelHierarchy;
46
46
  var init_logger = __esm(() => {
47
+ contextLogLevels = {
48
+ client: "error",
49
+ server: "error"
50
+ };
47
51
  logLevelHierarchy = {
48
52
  none: 0,
49
53
  error: 1,
@@ -2445,14 +2449,14 @@ class MCPClientBase {
2445
2449
  return success;
2446
2450
  }
2447
2451
  }
2448
- var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2452
+ var CLIENT_LOG_CONTEXT = "client", MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2449
2453
  var init_client = __esm(() => {
2450
2454
  init_http_session();
2451
2455
  init_messages();
2452
2456
  init_errors();
2453
2457
  init_logger();
2454
2458
  init_manager();
2455
- logger5 = createLogger("MCPClient");
2459
+ logger5 = createLogger("MCPClient", CLIENT_LOG_CONTEXT);
2456
2460
  clientCache = new Map;
2457
2461
  cleanupClients = new Set;
2458
2462
  });
@@ -9881,7 +9885,7 @@ function getDefaultRedirectUri() {
9881
9885
  return "http://localhost:3000/api/integrate/oauth/callback";
9882
9886
  }
9883
9887
  function createMCPServer(config) {
9884
- setLogLevel(config.debug ? "debug" : "error");
9888
+ setLogLevel(config.debug ? "debug" : "error", SERVER_LOG_CONTEXT);
9885
9889
  if (typeof window !== "undefined") {
9886
9890
  throw new Error("createMCPServer() should only be called on the server-side. " + "Use createMCPClient() for client-side code.");
9887
9891
  }
@@ -10650,7 +10654,7 @@ function toSvelteKitHandler(clientOrHandlerOrOptions, _redirectOptions) {
10650
10654
  }
10651
10655
  };
10652
10656
  }
10653
- var logger29, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10657
+ var SERVER_LOG_CONTEXT = "server", logger29, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10654
10658
  if (!globalServerConfig) {
10655
10659
  return Response.json({ error: "OAuth not configured. Call createMCPServer() in your server initialization file first." }, { status: 500 });
10656
10660
  }
@@ -10698,7 +10702,7 @@ var init_server = __esm(() => {
10698
10702
  init_anthropic();
10699
10703
  init_google();
10700
10704
  init_ai();
10701
- logger29 = createLogger("MCPServer");
10705
+ logger29 = createLogger("MCPServer", SERVER_LOG_CONTEXT);
10702
10706
  codeVerifierStorage = new Map;
10703
10707
  });
10704
10708
 
@@ -11261,10 +11265,10 @@ class OAuthHandler {
11261
11265
  return jsonRpcResponse.result;
11262
11266
  }
11263
11267
  }
11264
- var logger30, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11268
+ var SERVER_LOG_CONTEXT2 = "server", logger30, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11265
11269
  var init_base_handler = __esm(() => {
11266
11270
  init_logger();
11267
- logger30 = createLogger("OAuthHandler");
11271
+ logger30 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT2);
11268
11272
  });
11269
11273
 
11270
11274
  // nextjs.ts
@@ -11469,11 +11473,11 @@ function createNextOAuthHandler(config) {
11469
11473
  };
11470
11474
  return handlers;
11471
11475
  }
11472
- var logger31;
11476
+ var SERVER_LOG_CONTEXT3 = "server", logger31;
11473
11477
  var init_nextjs = __esm(() => {
11474
11478
  init_base_handler();
11475
11479
  init_logger();
11476
- logger31 = createLogger("NextJSOAuth");
11480
+ logger31 = createLogger("NextJSOAuth", SERVER_LOG_CONTEXT3);
11477
11481
  });
11478
11482
 
11479
11483
  // solid-start.ts
@@ -11,39 +11,43 @@ var __export = (target, all) => {
11
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
12
 
13
13
  // ../utils/logger.ts
14
- function shouldLog(level) {
15
- return logLevelHierarchy[level] <= logLevelHierarchy[globalLogLevel];
14
+ function shouldLog(level, context) {
15
+ return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
16
16
  }
17
- function setLogLevel(level) {
18
- globalLogLevel = level;
17
+ function setLogLevel(level, context = "client") {
18
+ contextLogLevels[context] = level;
19
19
  }
20
- function createLogger(namespace) {
20
+ function createLogger(namespace, context = "client") {
21
21
  const prefix = `[${namespace}]`;
22
22
  return {
23
23
  debug: (...args) => {
24
- if (shouldLog("debug")) {
24
+ if (shouldLog("debug", context)) {
25
25
  console.log(prefix, ...args);
26
26
  }
27
27
  },
28
28
  info: (...args) => {
29
- if (shouldLog("info")) {
29
+ if (shouldLog("info", context)) {
30
30
  console.log(prefix, ...args);
31
31
  }
32
32
  },
33
33
  warn: (...args) => {
34
- if (shouldLog("warn")) {
34
+ if (shouldLog("warn", context)) {
35
35
  console.warn(prefix, ...args);
36
36
  }
37
37
  },
38
38
  error: (...args) => {
39
- if (shouldLog("error")) {
39
+ if (shouldLog("error", context)) {
40
40
  console.error(prefix, ...args);
41
41
  }
42
42
  }
43
43
  };
44
44
  }
45
- var globalLogLevel = "error", logLevelHierarchy;
45
+ var contextLogLevels, logLevelHierarchy;
46
46
  var init_logger = __esm(() => {
47
+ contextLogLevels = {
48
+ client: "error",
49
+ server: "error"
50
+ };
47
51
  logLevelHierarchy = {
48
52
  none: 0,
49
53
  error: 1,
@@ -2445,14 +2449,14 @@ class MCPClientBase {
2445
2449
  return success;
2446
2450
  }
2447
2451
  }
2448
- var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2452
+ var CLIENT_LOG_CONTEXT = "client", MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2449
2453
  var init_client = __esm(() => {
2450
2454
  init_http_session();
2451
2455
  init_messages();
2452
2456
  init_errors();
2453
2457
  init_logger();
2454
2458
  init_manager();
2455
- logger5 = createLogger("MCPClient");
2459
+ logger5 = createLogger("MCPClient", CLIENT_LOG_CONTEXT);
2456
2460
  clientCache = new Map;
2457
2461
  cleanupClients = new Set;
2458
2462
  });
@@ -9881,7 +9885,7 @@ function getDefaultRedirectUri() {
9881
9885
  return "http://localhost:3000/api/integrate/oauth/callback";
9882
9886
  }
9883
9887
  function createMCPServer(config) {
9884
- setLogLevel(config.debug ? "debug" : "error");
9888
+ setLogLevel(config.debug ? "debug" : "error", SERVER_LOG_CONTEXT);
9885
9889
  if (typeof window !== "undefined") {
9886
9890
  throw new Error("createMCPServer() should only be called on the server-side. " + "Use createMCPClient() for client-side code.");
9887
9891
  }
@@ -10650,7 +10654,7 @@ function toSvelteKitHandler(clientOrHandlerOrOptions, _redirectOptions) {
10650
10654
  }
10651
10655
  };
10652
10656
  }
10653
- var logger29, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10657
+ var SERVER_LOG_CONTEXT = "server", logger29, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10654
10658
  if (!globalServerConfig) {
10655
10659
  return Response.json({ error: "OAuth not configured. Call createMCPServer() in your server initialization file first." }, { status: 500 });
10656
10660
  }
@@ -10698,7 +10702,7 @@ var init_server = __esm(() => {
10698
10702
  init_anthropic();
10699
10703
  init_google();
10700
10704
  init_ai();
10701
- logger29 = createLogger("MCPServer");
10705
+ logger29 = createLogger("MCPServer", SERVER_LOG_CONTEXT);
10702
10706
  codeVerifierStorage = new Map;
10703
10707
  });
10704
10708
 
@@ -11261,10 +11265,10 @@ class OAuthHandler {
11261
11265
  return jsonRpcResponse.result;
11262
11266
  }
11263
11267
  }
11264
- var logger30, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11268
+ var SERVER_LOG_CONTEXT2 = "server", logger30, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11265
11269
  var init_base_handler = __esm(() => {
11266
11270
  init_logger();
11267
- logger30 = createLogger("OAuthHandler");
11271
+ logger30 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT2);
11268
11272
  });
11269
11273
 
11270
11274
  // nextjs.ts
@@ -11469,11 +11473,11 @@ function createNextOAuthHandler(config) {
11469
11473
  };
11470
11474
  return handlers;
11471
11475
  }
11472
- var logger31;
11476
+ var SERVER_LOG_CONTEXT3 = "server", logger31;
11473
11477
  var init_nextjs = __esm(() => {
11474
11478
  init_base_handler();
11475
11479
  init_logger();
11476
- logger31 = createLogger("NextJSOAuth");
11480
+ logger31 = createLogger("NextJSOAuth", SERVER_LOG_CONTEXT3);
11477
11481
  });
11478
11482
 
11479
11483
  // svelte-kit.ts
package/dist/index.js CHANGED
@@ -20,39 +20,43 @@ function parseMessage(message) {
20
20
  }
21
21
 
22
22
  // src/utils/logger.ts
23
- function shouldLog(level) {
24
- return logLevelHierarchy[level] <= logLevelHierarchy[globalLogLevel];
23
+ function shouldLog(level, context) {
24
+ return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
25
25
  }
26
- function setLogLevel(level) {
27
- globalLogLevel = level;
26
+ function setLogLevel(level, context = "client") {
27
+ contextLogLevels[context] = level;
28
28
  }
29
- function createLogger(namespace) {
29
+ function createLogger(namespace, context = "client") {
30
30
  const prefix = `[${namespace}]`;
31
31
  return {
32
32
  debug: (...args) => {
33
- if (shouldLog("debug")) {
33
+ if (shouldLog("debug", context)) {
34
34
  console.log(prefix, ...args);
35
35
  }
36
36
  },
37
37
  info: (...args) => {
38
- if (shouldLog("info")) {
38
+ if (shouldLog("info", context)) {
39
39
  console.log(prefix, ...args);
40
40
  }
41
41
  },
42
42
  warn: (...args) => {
43
- if (shouldLog("warn")) {
43
+ if (shouldLog("warn", context)) {
44
44
  console.warn(prefix, ...args);
45
45
  }
46
46
  },
47
47
  error: (...args) => {
48
- if (shouldLog("error")) {
48
+ if (shouldLog("error", context)) {
49
49
  console.error(prefix, ...args);
50
50
  }
51
51
  }
52
52
  };
53
53
  }
54
- var globalLogLevel = "error", logLevelHierarchy;
54
+ var contextLogLevels, logLevelHierarchy;
55
55
  var init_logger = __esm(() => {
56
+ contextLogLevels = {
57
+ client: "error",
58
+ server: "error"
59
+ };
56
60
  logLevelHierarchy = {
57
61
  none: 0,
58
62
  error: 1,
@@ -2518,7 +2522,7 @@ function generateCacheKey(config) {
2518
2522
  return parts.join("|");
2519
2523
  }
2520
2524
  function createMCPClient(config) {
2521
- setLogLevel(config.debug ? "debug" : "error");
2525
+ setLogLevel(config.debug ? "debug" : "error", CLIENT_LOG_CONTEXT);
2522
2526
  const useSingleton = config.singleton ?? true;
2523
2527
  const connectionMode = config.connectionMode ?? "lazy";
2524
2528
  const autoCleanup = config.autoCleanup ?? true;
@@ -2623,14 +2627,14 @@ async function clearClientCache() {
2623
2627
  }
2624
2628
  }));
2625
2629
  }
2626
- var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients, cleanupHandlersRegistered = false;
2630
+ var CLIENT_LOG_CONTEXT = "client", MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients, cleanupHandlersRegistered = false;
2627
2631
  var init_client = __esm(() => {
2628
2632
  init_http_session();
2629
2633
  init_messages();
2630
2634
  init_errors();
2631
2635
  init_logger();
2632
2636
  init_manager();
2633
- logger5 = createLogger("MCPClient");
2637
+ logger5 = createLogger("MCPClient", CLIENT_LOG_CONTEXT);
2634
2638
  clientCache = new Map;
2635
2639
  cleanupClients = new Set;
2636
2640
  });
@@ -2837,11 +2841,11 @@ function createNextOAuthHandler(config) {
2837
2841
  };
2838
2842
  return handlers;
2839
2843
  }
2840
- var logger6;
2844
+ var SERVER_LOG_CONTEXT = "server", logger6;
2841
2845
  var init_nextjs = __esm(() => {
2842
2846
  init_base_handler();
2843
2847
  init_logger();
2844
- logger6 = createLogger("NextJSOAuth");
2848
+ logger6 = createLogger("NextJSOAuth", SERVER_LOG_CONTEXT);
2845
2849
  });
2846
2850
 
2847
2851
  // src/utils/env.ts
@@ -10256,7 +10260,7 @@ function getDefaultRedirectUri() {
10256
10260
  return "http://localhost:3000/api/integrate/oauth/callback";
10257
10261
  }
10258
10262
  function createMCPServer(config) {
10259
- setLogLevel(config.debug ? "debug" : "error");
10263
+ setLogLevel(config.debug ? "debug" : "error", SERVER_LOG_CONTEXT2);
10260
10264
  if (typeof window !== "undefined") {
10261
10265
  throw new Error("createMCPServer() should only be called on the server-side. " + "Use createMCPClient() for client-side code.");
10262
10266
  }
@@ -11025,7 +11029,7 @@ function toSvelteKitHandler(clientOrHandlerOrOptions, _redirectOptions) {
11025
11029
  }
11026
11030
  };
11027
11031
  }
11028
- var logger30, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
11032
+ var SERVER_LOG_CONTEXT2 = "server", logger30, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
11029
11033
  if (!globalServerConfig) {
11030
11034
  return Response.json({ error: "OAuth not configured. Call createMCPServer() in your server initialization file first." }, { status: 500 });
11031
11035
  }
@@ -11073,7 +11077,7 @@ var init_server = __esm(() => {
11073
11077
  init_anthropic();
11074
11078
  init_google();
11075
11079
  init_ai();
11076
- logger30 = createLogger("MCPServer");
11080
+ logger30 = createLogger("MCPServer", SERVER_LOG_CONTEXT2);
11077
11081
  codeVerifierStorage = new Map;
11078
11082
  });
11079
11083
 
@@ -11636,10 +11640,10 @@ class OAuthHandler {
11636
11640
  return jsonRpcResponse.result;
11637
11641
  }
11638
11642
  }
11639
- var logger31, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11643
+ var SERVER_LOG_CONTEXT3 = "server", logger31, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11640
11644
  var init_base_handler = __esm(() => {
11641
11645
  init_logger();
11642
- logger31 = createLogger("OAuthHandler");
11646
+ logger31 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT3);
11643
11647
  });
11644
11648
 
11645
11649
  // src/index.ts
@@ -11651,7 +11655,8 @@ init_nextjs();
11651
11655
 
11652
11656
  // src/adapters/nextjs-oauth-redirect.ts
11653
11657
  init_logger();
11654
- var logger32 = createLogger("OAuthRedirect");
11658
+ var SERVER_LOG_CONTEXT4 = "server";
11659
+ var logger32 = createLogger("OAuthRedirect", SERVER_LOG_CONTEXT4);
11655
11660
  function createOAuthRedirectHandler(config) {
11656
11661
  const defaultRedirectUrl = config?.redirectUrl || "/";
11657
11662
  const errorRedirectUrl = config?.errorRedirectUrl || "/auth-error";
package/dist/oauth.js CHANGED
@@ -11,39 +11,43 @@ var __export = (target, all) => {
11
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
12
 
13
13
  // src/utils/logger.ts
14
- function shouldLog(level) {
15
- return logLevelHierarchy[level] <= logLevelHierarchy[globalLogLevel];
14
+ function shouldLog(level, context) {
15
+ return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
16
16
  }
17
- function setLogLevel(level) {
18
- globalLogLevel = level;
17
+ function setLogLevel(level, context = "client") {
18
+ contextLogLevels[context] = level;
19
19
  }
20
- function createLogger(namespace) {
20
+ function createLogger(namespace, context = "client") {
21
21
  const prefix = `[${namespace}]`;
22
22
  return {
23
23
  debug: (...args) => {
24
- if (shouldLog("debug")) {
24
+ if (shouldLog("debug", context)) {
25
25
  console.log(prefix, ...args);
26
26
  }
27
27
  },
28
28
  info: (...args) => {
29
- if (shouldLog("info")) {
29
+ if (shouldLog("info", context)) {
30
30
  console.log(prefix, ...args);
31
31
  }
32
32
  },
33
33
  warn: (...args) => {
34
- if (shouldLog("warn")) {
34
+ if (shouldLog("warn", context)) {
35
35
  console.warn(prefix, ...args);
36
36
  }
37
37
  },
38
38
  error: (...args) => {
39
- if (shouldLog("error")) {
39
+ if (shouldLog("error", context)) {
40
40
  console.error(prefix, ...args);
41
41
  }
42
42
  }
43
43
  };
44
44
  }
45
- var globalLogLevel = "error", logLevelHierarchy;
45
+ var contextLogLevels, logLevelHierarchy;
46
46
  var init_logger = __esm(() => {
47
+ contextLogLevels = {
48
+ client: "error",
49
+ server: "error"
50
+ };
47
51
  logLevelHierarchy = {
48
52
  none: 0,
49
53
  error: 1,
@@ -2445,14 +2449,14 @@ class MCPClientBase {
2445
2449
  return success;
2446
2450
  }
2447
2451
  }
2448
- var MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2452
+ var CLIENT_LOG_CONTEXT = "client", MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp", logger5, clientCache, cleanupClients;
2449
2453
  var init_client = __esm(() => {
2450
2454
  init_http_session();
2451
2455
  init_messages();
2452
2456
  init_errors();
2453
2457
  init_logger();
2454
2458
  init_manager();
2455
- logger5 = createLogger("MCPClient");
2459
+ logger5 = createLogger("MCPClient", CLIENT_LOG_CONTEXT);
2456
2460
  clientCache = new Map;
2457
2461
  cleanupClients = new Set;
2458
2462
  });
@@ -2659,11 +2663,11 @@ function createNextOAuthHandler(config) {
2659
2663
  };
2660
2664
  return handlers;
2661
2665
  }
2662
- var logger6;
2666
+ var SERVER_LOG_CONTEXT = "server", logger6;
2663
2667
  var init_nextjs = __esm(() => {
2664
2668
  init_base_handler();
2665
2669
  init_logger();
2666
- logger6 = createLogger("NextJSOAuth");
2670
+ logger6 = createLogger("NextJSOAuth", SERVER_LOG_CONTEXT);
2667
2671
  });
2668
2672
 
2669
2673
  // src/utils/env.ts
@@ -10090,7 +10094,7 @@ function getDefaultRedirectUri() {
10090
10094
  return "http://localhost:3000/api/integrate/oauth/callback";
10091
10095
  }
10092
10096
  function createMCPServer(config) {
10093
- setLogLevel(config.debug ? "debug" : "error");
10097
+ setLogLevel(config.debug ? "debug" : "error", SERVER_LOG_CONTEXT2);
10094
10098
  if (typeof window !== "undefined") {
10095
10099
  throw new Error("createMCPServer() should only be called on the server-side. " + "Use createMCPClient() for client-side code.");
10096
10100
  }
@@ -10859,7 +10863,7 @@ function toSvelteKitHandler(clientOrHandlerOrOptions, _redirectOptions) {
10859
10863
  }
10860
10864
  };
10861
10865
  }
10862
- var logger30, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10866
+ var SERVER_LOG_CONTEXT2 = "server", logger30, globalServerConfig = null, codeVerifierStorage, POST = async (req, context) => {
10863
10867
  if (!globalServerConfig) {
10864
10868
  return Response.json({ error: "OAuth not configured. Call createMCPServer() in your server initialization file first." }, { status: 500 });
10865
10869
  }
@@ -10907,7 +10911,7 @@ var init_server = __esm(() => {
10907
10911
  init_anthropic();
10908
10912
  init_google();
10909
10913
  init_ai();
10910
- logger30 = createLogger("MCPServer");
10914
+ logger30 = createLogger("MCPServer", SERVER_LOG_CONTEXT2);
10911
10915
  codeVerifierStorage = new Map;
10912
10916
  });
10913
10917
 
@@ -11470,16 +11474,17 @@ class OAuthHandler {
11470
11474
  return jsonRpcResponse.result;
11471
11475
  }
11472
11476
  }
11473
- var logger31, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11477
+ var SERVER_LOG_CONTEXT3 = "server", logger31, MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
11474
11478
  var init_base_handler = __esm(() => {
11475
11479
  init_logger();
11476
- logger31 = createLogger("OAuthHandler");
11480
+ logger31 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT3);
11477
11481
  });
11478
11482
 
11479
11483
  // src/adapters/auto-routes.ts
11480
11484
  init_base_handler();
11481
11485
  init_logger();
11482
- var logger32 = createLogger("AutoRoutes");
11486
+ var SERVER_LOG_CONTEXT4 = "server";
11487
+ var logger32 = createLogger("AutoRoutes", SERVER_LOG_CONTEXT4);
11483
11488
  var globalOAuthConfig = null;
11484
11489
  async function POST2(req, context) {
11485
11490
  if (!globalOAuthConfig) {
package/dist/react.js CHANGED
@@ -11,39 +11,43 @@ var __export = (target, all) => {
11
11
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
12
12
 
13
13
  // src/utils/logger.ts
14
- function shouldLog(level) {
15
- return logLevelHierarchy[level] <= logLevelHierarchy[globalLogLevel];
14
+ function shouldLog(level, context) {
15
+ return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
16
16
  }
17
- function setLogLevel(level) {
18
- globalLogLevel = level;
17
+ function setLogLevel(level, context = "client") {
18
+ contextLogLevels[context] = level;
19
19
  }
20
- function createLogger(namespace) {
20
+ function createLogger(namespace, context = "client") {
21
21
  const prefix = `[${namespace}]`;
22
22
  return {
23
23
  debug: (...args) => {
24
- if (shouldLog("debug")) {
24
+ if (shouldLog("debug", context)) {
25
25
  console.log(prefix, ...args);
26
26
  }
27
27
  },
28
28
  info: (...args) => {
29
- if (shouldLog("info")) {
29
+ if (shouldLog("info", context)) {
30
30
  console.log(prefix, ...args);
31
31
  }
32
32
  },
33
33
  warn: (...args) => {
34
- if (shouldLog("warn")) {
34
+ if (shouldLog("warn", context)) {
35
35
  console.warn(prefix, ...args);
36
36
  }
37
37
  },
38
38
  error: (...args) => {
39
- if (shouldLog("error")) {
39
+ if (shouldLog("error", context)) {
40
40
  console.error(prefix, ...args);
41
41
  }
42
42
  }
43
43
  };
44
44
  }
45
- var globalLogLevel = "error", logLevelHierarchy;
45
+ var contextLogLevels, logLevelHierarchy;
46
46
  var init_logger = __esm(() => {
47
+ contextLogLevels = {
48
+ client: "error",
49
+ server: "error"
50
+ };
47
51
  logLevelHierarchy = {
48
52
  none: 0,
49
53
  error: 1,