integrate-sdk 0.9.25 → 0.9.26-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/adapters/index.js +28 -10
  2. package/dist/adapters/solid-start.js +28 -10
  3. package/dist/adapters/svelte-kit.js +28 -10
  4. package/dist/ai/anthropic.js +11 -1
  5. package/dist/ai/google.js +11 -1
  6. package/dist/ai/index.js +11 -1
  7. package/dist/ai/openai.js +11 -1
  8. package/dist/ai/vercel-ai.js +11 -1
  9. package/dist/code-mode/executor.js +5 -1
  10. package/dist/code-mode/index.js +11 -1
  11. package/dist/code-mode/runtime-stub.d.ts +1 -1
  12. package/dist/code-mode/runtime-stub.d.ts.map +1 -1
  13. package/dist/code-mode/runtime-stub.js +5 -1
  14. package/dist/code-mode/tool-builder.d.ts.map +1 -1
  15. package/dist/code-mode/tool-builder.js +11 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +197 -10
  19. package/dist/server.js +292 -64
  20. package/dist/src/code-mode/runtime-stub.d.ts +1 -1
  21. package/dist/src/code-mode/runtime-stub.d.ts.map +1 -1
  22. package/dist/src/code-mode/tool-builder.d.ts.map +1 -1
  23. package/dist/src/integrations/excel-client.d.ts +284 -0
  24. package/dist/src/integrations/excel-client.d.ts.map +1 -0
  25. package/dist/src/integrations/excel.d.ts +22 -0
  26. package/dist/src/integrations/excel.d.ts.map +1 -0
  27. package/dist/src/integrations/gdrive-client.d.ts +264 -0
  28. package/dist/src/integrations/gdrive-client.d.ts.map +1 -0
  29. package/dist/src/integrations/gdrive.d.ts +22 -0
  30. package/dist/src/integrations/gdrive.d.ts.map +1 -0
  31. package/dist/src/integrations/onedrive-client.d.ts +47 -250
  32. package/dist/src/integrations/onedrive-client.d.ts.map +1 -1
  33. package/dist/src/integrations/onedrive.d.ts +1 -1
  34. package/dist/src/integrations/onedrive.d.ts.map +1 -1
  35. package/dist/src/integrations/powerpoint-client.d.ts +99 -0
  36. package/dist/src/integrations/powerpoint-client.d.ts.map +1 -0
  37. package/dist/src/integrations/powerpoint.d.ts +22 -0
  38. package/dist/src/integrations/powerpoint.d.ts.map +1 -0
  39. package/dist/src/integrations/whatsapp-client.d.ts +406 -211
  40. package/dist/src/integrations/whatsapp-client.d.ts.map +1 -1
  41. package/dist/src/integrations/whatsapp.d.ts +1 -1
  42. package/dist/src/integrations/whatsapp.d.ts.map +1 -1
  43. package/dist/src/integrations/word-client.d.ts +99 -0
  44. package/dist/src/integrations/word-client.d.ts.map +1 -0
  45. package/dist/src/integrations/word.d.ts +22 -0
  46. package/dist/src/integrations/word.d.ts.map +1 -0
  47. package/dist/src/integrations/youtube-client.d.ts +292 -283
  48. package/dist/src/integrations/youtube-client.d.ts.map +1 -1
  49. package/dist/src/integrations/youtube.d.ts +2 -2
  50. package/dist/src/integrations/youtube.d.ts.map +1 -1
  51. package/dist/src/server.d.ts +4 -0
  52. package/dist/src/server.d.ts.map +1 -1
  53. package/index.ts +8 -0
  54. package/package.json +1 -1
@@ -1183,6 +1183,12 @@ var init_tool_builder = __esm(() => {
1183
1183
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
1184
1184
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
1185
1185
  "",
1186
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
1187
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
1188
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
1189
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
1190
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
1191
+ "",
1186
1192
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
1187
1193
  "",
1188
1194
  "Available methods:"
@@ -3693,33 +3699,45 @@ var logger22 = createLogger("Ramp");
3693
3699
  // ../integrations/onedrive.ts
3694
3700
  init_logger();
3695
3701
  var logger23 = createLogger("OneDrive");
3702
+ // ../integrations/word.ts
3703
+ init_logger();
3704
+ var logger24 = createLogger("Word");
3705
+ // ../integrations/excel.ts
3706
+ init_logger();
3707
+ var logger25 = createLogger("Excel");
3708
+ // ../integrations/powerpoint.ts
3709
+ init_logger();
3710
+ var logger26 = createLogger("PowerPoint");
3696
3711
  // ../integrations/gdocs.ts
3697
3712
  init_logger();
3698
- var logger24 = createLogger("Google Docs");
3713
+ var logger27 = createLogger("Google Docs");
3714
+ // ../integrations/gdrive.ts
3715
+ init_logger();
3716
+ var logger28 = createLogger("Google Drive");
3699
3717
  // ../integrations/gsheets.ts
3700
3718
  init_logger();
3701
- var logger25 = createLogger("Google Sheets");
3719
+ var logger29 = createLogger("Google Sheets");
3702
3720
  // ../integrations/gslides.ts
3703
3721
  init_logger();
3704
- var logger26 = createLogger("Google Slides");
3722
+ var logger30 = createLogger("Google Slides");
3705
3723
  // ../integrations/polar.ts
3706
3724
  init_logger();
3707
- var logger27 = createLogger("Polar");
3725
+ var logger31 = createLogger("Polar");
3708
3726
  // ../integrations/figma.ts
3709
3727
  init_logger();
3710
- var logger28 = createLogger("Figma");
3728
+ var logger32 = createLogger("Figma");
3711
3729
  // ../integrations/intercom.ts
3712
3730
  init_logger();
3713
- var logger29 = createLogger("Intercom");
3731
+ var logger33 = createLogger("Intercom");
3714
3732
  // ../integrations/hubspot.ts
3715
3733
  init_logger();
3716
- var logger30 = createLogger("HubSpot");
3734
+ var logger34 = createLogger("HubSpot");
3717
3735
  // ../integrations/youtube.ts
3718
3736
  init_logger();
3719
- var logger31 = createLogger("YouTube");
3737
+ var logger35 = createLogger("YouTube");
3720
3738
  // ../integrations/cursor.ts
3721
3739
  init_logger();
3722
- var logger32 = createLogger("Cursor");
3740
+ var logger36 = createLogger("Cursor");
3723
3741
  // ../ai/trigger-tools.ts
3724
3742
  init_utils();
3725
3743
 
@@ -3738,7 +3756,7 @@ init_tool_builder();
3738
3756
  init_tool_builder();
3739
3757
  // ../server.ts
3740
3758
  var SERVER_LOG_CONTEXT3 = "server";
3741
- var logger33 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3759
+ var logger37 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3742
3760
  var codeVerifierStorage = new Map;
3743
3761
  var unauthenticatedCodeModeWarnings = new Set;
3744
3762
  function toSolidStartHandler(clientOrHandlerOrOptions, _redirectOptions) {
@@ -1183,6 +1183,12 @@ var init_tool_builder = __esm(() => {
1183
1183
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
1184
1184
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
1185
1185
  "",
1186
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
1187
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
1188
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
1189
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
1190
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
1191
+ "",
1186
1192
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
1187
1193
  "",
1188
1194
  "Available methods:"
@@ -3693,33 +3699,45 @@ var logger22 = createLogger("Ramp");
3693
3699
  // ../integrations/onedrive.ts
3694
3700
  init_logger();
3695
3701
  var logger23 = createLogger("OneDrive");
3702
+ // ../integrations/word.ts
3703
+ init_logger();
3704
+ var logger24 = createLogger("Word");
3705
+ // ../integrations/excel.ts
3706
+ init_logger();
3707
+ var logger25 = createLogger("Excel");
3708
+ // ../integrations/powerpoint.ts
3709
+ init_logger();
3710
+ var logger26 = createLogger("PowerPoint");
3696
3711
  // ../integrations/gdocs.ts
3697
3712
  init_logger();
3698
- var logger24 = createLogger("Google Docs");
3713
+ var logger27 = createLogger("Google Docs");
3714
+ // ../integrations/gdrive.ts
3715
+ init_logger();
3716
+ var logger28 = createLogger("Google Drive");
3699
3717
  // ../integrations/gsheets.ts
3700
3718
  init_logger();
3701
- var logger25 = createLogger("Google Sheets");
3719
+ var logger29 = createLogger("Google Sheets");
3702
3720
  // ../integrations/gslides.ts
3703
3721
  init_logger();
3704
- var logger26 = createLogger("Google Slides");
3722
+ var logger30 = createLogger("Google Slides");
3705
3723
  // ../integrations/polar.ts
3706
3724
  init_logger();
3707
- var logger27 = createLogger("Polar");
3725
+ var logger31 = createLogger("Polar");
3708
3726
  // ../integrations/figma.ts
3709
3727
  init_logger();
3710
- var logger28 = createLogger("Figma");
3728
+ var logger32 = createLogger("Figma");
3711
3729
  // ../integrations/intercom.ts
3712
3730
  init_logger();
3713
- var logger29 = createLogger("Intercom");
3731
+ var logger33 = createLogger("Intercom");
3714
3732
  // ../integrations/hubspot.ts
3715
3733
  init_logger();
3716
- var logger30 = createLogger("HubSpot");
3734
+ var logger34 = createLogger("HubSpot");
3717
3735
  // ../integrations/youtube.ts
3718
3736
  init_logger();
3719
- var logger31 = createLogger("YouTube");
3737
+ var logger35 = createLogger("YouTube");
3720
3738
  // ../integrations/cursor.ts
3721
3739
  init_logger();
3722
- var logger32 = createLogger("Cursor");
3740
+ var logger36 = createLogger("Cursor");
3723
3741
  // ../ai/trigger-tools.ts
3724
3742
  init_utils();
3725
3743
 
@@ -3738,7 +3756,7 @@ init_tool_builder();
3738
3756
  init_tool_builder();
3739
3757
  // ../server.ts
3740
3758
  var SERVER_LOG_CONTEXT3 = "server";
3741
- var logger33 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3759
+ var logger37 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3742
3760
  var codeVerifierStorage = new Map;
3743
3761
  var unauthenticatedCodeModeWarnings = new Set;
3744
3762
  function toSolidStartHandler(clientOrHandlerOrOptions, _redirectOptions) {
@@ -1183,6 +1183,12 @@ var init_tool_builder = __esm(() => {
1183
1183
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
1184
1184
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
1185
1185
  "",
1186
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
1187
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
1188
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
1189
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
1190
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
1191
+ "",
1186
1192
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
1187
1193
  "",
1188
1194
  "Available methods:"
@@ -3693,33 +3699,45 @@ var logger22 = createLogger("Ramp");
3693
3699
  // ../integrations/onedrive.ts
3694
3700
  init_logger();
3695
3701
  var logger23 = createLogger("OneDrive");
3702
+ // ../integrations/word.ts
3703
+ init_logger();
3704
+ var logger24 = createLogger("Word");
3705
+ // ../integrations/excel.ts
3706
+ init_logger();
3707
+ var logger25 = createLogger("Excel");
3708
+ // ../integrations/powerpoint.ts
3709
+ init_logger();
3710
+ var logger26 = createLogger("PowerPoint");
3696
3711
  // ../integrations/gdocs.ts
3697
3712
  init_logger();
3698
- var logger24 = createLogger("Google Docs");
3713
+ var logger27 = createLogger("Google Docs");
3714
+ // ../integrations/gdrive.ts
3715
+ init_logger();
3716
+ var logger28 = createLogger("Google Drive");
3699
3717
  // ../integrations/gsheets.ts
3700
3718
  init_logger();
3701
- var logger25 = createLogger("Google Sheets");
3719
+ var logger29 = createLogger("Google Sheets");
3702
3720
  // ../integrations/gslides.ts
3703
3721
  init_logger();
3704
- var logger26 = createLogger("Google Slides");
3722
+ var logger30 = createLogger("Google Slides");
3705
3723
  // ../integrations/polar.ts
3706
3724
  init_logger();
3707
- var logger27 = createLogger("Polar");
3725
+ var logger31 = createLogger("Polar");
3708
3726
  // ../integrations/figma.ts
3709
3727
  init_logger();
3710
- var logger28 = createLogger("Figma");
3728
+ var logger32 = createLogger("Figma");
3711
3729
  // ../integrations/intercom.ts
3712
3730
  init_logger();
3713
- var logger29 = createLogger("Intercom");
3731
+ var logger33 = createLogger("Intercom");
3714
3732
  // ../integrations/hubspot.ts
3715
3733
  init_logger();
3716
- var logger30 = createLogger("HubSpot");
3734
+ var logger34 = createLogger("HubSpot");
3717
3735
  // ../integrations/youtube.ts
3718
3736
  init_logger();
3719
- var logger31 = createLogger("YouTube");
3737
+ var logger35 = createLogger("YouTube");
3720
3738
  // ../integrations/cursor.ts
3721
3739
  init_logger();
3722
- var logger32 = createLogger("Cursor");
3740
+ var logger36 = createLogger("Cursor");
3723
3741
  // ../ai/trigger-tools.ts
3724
3742
  init_utils();
3725
3743
 
@@ -3738,7 +3756,7 @@ init_tool_builder();
3738
3756
  init_tool_builder();
3739
3757
  // ../server.ts
3740
3758
  var SERVER_LOG_CONTEXT3 = "server";
3741
- var logger33 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3759
+ var logger37 = createLogger("MCPServer", SERVER_LOG_CONTEXT3);
3742
3760
  var codeVerifierStorage = new Map;
3743
3761
  var unauthenticatedCodeModeWarnings = new Set;
3744
3762
  function toSolidStartHandler(clientOrHandlerOrOptions, _redirectOptions) {
@@ -4729,7 +4729,11 @@ function createIntegrationProxy(integrationId) {
4729
4729
  return new Proxy({}, {
4730
4730
  get(_target, methodName) {
4731
4731
  if (typeof methodName !== 'string') return undefined;
4732
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
4732
+ return (args) => {
4733
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
4734
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
4735
+ return callTool(toolName, args);
4736
+ };
4733
4737
  },
4734
4738
  });
4735
4739
  }
@@ -4941,6 +4945,12 @@ var DEFAULT_INSTRUCTIONS = [
4941
4945
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
4942
4946
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
4943
4947
  "",
4948
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
4949
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
4950
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
4951
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
4952
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
4953
+ "",
4944
4954
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
4945
4955
  "",
4946
4956
  "Available methods:"
package/dist/ai/google.js CHANGED
@@ -4729,7 +4729,11 @@ function createIntegrationProxy(integrationId) {
4729
4729
  return new Proxy({}, {
4730
4730
  get(_target, methodName) {
4731
4731
  if (typeof methodName !== 'string') return undefined;
4732
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
4732
+ return (args) => {
4733
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
4734
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
4735
+ return callTool(toolName, args);
4736
+ };
4733
4737
  },
4734
4738
  });
4735
4739
  }
@@ -4941,6 +4945,12 @@ var DEFAULT_INSTRUCTIONS = [
4941
4945
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
4942
4946
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
4943
4947
  "",
4948
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
4949
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
4950
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
4951
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
4952
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
4953
+ "",
4944
4954
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
4945
4955
  "",
4946
4956
  "Available methods:"
package/dist/ai/index.js CHANGED
@@ -4729,7 +4729,11 @@ function createIntegrationProxy(integrationId) {
4729
4729
  return new Proxy({}, {
4730
4730
  get(_target, methodName) {
4731
4731
  if (typeof methodName !== 'string') return undefined;
4732
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
4732
+ return (args) => {
4733
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
4734
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
4735
+ return callTool(toolName, args);
4736
+ };
4733
4737
  },
4734
4738
  });
4735
4739
  }
@@ -4941,6 +4945,12 @@ var DEFAULT_INSTRUCTIONS = [
4941
4945
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
4942
4946
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
4943
4947
  "",
4948
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
4949
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
4950
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
4951
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
4952
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
4953
+ "",
4944
4954
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
4945
4955
  "",
4946
4956
  "Available methods:"
package/dist/ai/openai.js CHANGED
@@ -4729,7 +4729,11 @@ function createIntegrationProxy(integrationId) {
4729
4729
  return new Proxy({}, {
4730
4730
  get(_target, methodName) {
4731
4731
  if (typeof methodName !== 'string') return undefined;
4732
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
4732
+ return (args) => {
4733
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
4734
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
4735
+ return callTool(toolName, args);
4736
+ };
4733
4737
  },
4734
4738
  });
4735
4739
  }
@@ -4941,6 +4945,12 @@ var DEFAULT_INSTRUCTIONS = [
4941
4945
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
4942
4946
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
4943
4947
  "",
4948
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
4949
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
4950
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
4951
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
4952
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
4953
+ "",
4944
4954
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
4945
4955
  "",
4946
4956
  "Available methods:"
@@ -4729,7 +4729,11 @@ function createIntegrationProxy(integrationId) {
4729
4729
  return new Proxy({}, {
4730
4730
  get(_target, methodName) {
4731
4731
  if (typeof methodName !== 'string') return undefined;
4732
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
4732
+ return (args) => {
4733
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
4734
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
4735
+ return callTool(toolName, args);
4736
+ };
4733
4737
  },
4734
4738
  });
4735
4739
  }
@@ -4941,6 +4945,12 @@ var DEFAULT_INSTRUCTIONS = [
4941
4945
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
4942
4946
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
4943
4947
  "",
4948
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
4949
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
4950
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
4951
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
4952
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
4953
+ "",
4944
4954
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
4945
4955
  "",
4946
4956
  "Available methods:"
@@ -82,7 +82,11 @@ function createIntegrationProxy(integrationId) {
82
82
  return new Proxy({}, {
83
83
  get(_target, methodName) {
84
84
  if (typeof methodName !== 'string') return undefined;
85
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
85
+ return (args) => {
86
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
87
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
88
+ return callTool(toolName, args);
89
+ };
86
90
  },
87
91
  });
88
92
  }
@@ -327,7 +327,11 @@ function createIntegrationProxy(integrationId) {
327
327
  return new Proxy({}, {
328
328
  get(_target, methodName) {
329
329
  if (typeof methodName !== 'string') return undefined;
330
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
330
+ return (args) => {
331
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
332
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
333
+ return callTool(toolName, args);
334
+ };
331
335
  },
332
336
  });
333
337
  }
@@ -603,6 +607,12 @@ var DEFAULT_INSTRUCTIONS = [
603
607
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
604
608
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
605
609
  "",
610
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
611
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
612
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
613
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
614
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
615
+ "",
606
616
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
607
617
  "",
608
618
  "Available methods:"
@@ -12,5 +12,5 @@
12
12
  * dependencies. It is NOT imported by the host SDK — it only ships as a
13
13
  * literal payload to the sandbox.
14
14
  */
15
- export declare const RUNTIME_STUB_SOURCE = "// runtime.mjs \u2014 generated by integrate-sdk code mode\nconst MCP_URL = process.env.INTEGRATE_MCP_URL;\nconst SESSION_TOKEN = process.env.INTEGRATE_SESSION_TOKEN;\nconst API_KEY = process.env.INTEGRATE_API_KEY || '';\nconst PROVIDER_TOKENS = process.env.INTEGRATE_PROVIDER_TOKENS || '';\nconst INTEGRATIONS_HEADER = process.env.INTEGRATE_INTEGRATIONS || '';\nconst CONTEXT_JSON = process.env.INTEGRATE_CONTEXT || '';\n\nif (!MCP_URL) {\n throw new Error('INTEGRATE_MCP_URL is not set \u2014 the sandbox cannot reach the MCP route.');\n}\n\nfunction camelToSnake(str) {\n return str.replace(/[A-Z]/g, (letter) => '_' + letter.toLowerCase());\n}\n\nasync function callTool(toolName, args) {\n const headers = {\n 'Content-Type': 'application/json',\n 'x-integrate-code-mode': '1',\n };\n if (SESSION_TOKEN) headers['Authorization'] = 'Bearer ' + SESSION_TOKEN;\n if (API_KEY) headers['x-integrate-api-key'] = API_KEY;\n if (PROVIDER_TOKENS) headers['x-integrate-tokens'] = PROVIDER_TOKENS;\n if (INTEGRATIONS_HEADER) headers['x-integrations'] = INTEGRATIONS_HEADER;\n if (CONTEXT_JSON) headers['x-integrate-context'] = CONTEXT_JSON;\n\n const res = await fetch(MCP_URL, {\n method: 'POST',\n headers,\n body: JSON.stringify({ name: toolName, arguments: args || {} }),\n });\n\n const text = await res.text();\n\n let payload;\n try {\n payload = text ? JSON.parse(text) : null;\n } catch {\n payload = { content: [{ type: 'text', text }] };\n }\n\n if (!res.ok) {\n let message = (payload && (payload.error || payload.message)) || 'Tool call failed: HTTP ' + res.status;\n if ((res.status === 401 || res.status === 403) && typeof text === 'string' && text.indexOf('Authorization header') !== -1) {\n message =\n 'Code Mode callback was rejected by the MCP server (HTTP ' + res.status + '). ' +\n 'The SDK route could not synthesize an Authorization header. Check the host-side ' +\n 'createMCPServer config (apiKey, getProviderToken) or pass providerTokens to the ' +\n 'AI helper. Original upstream message: ' + text;\n }\n const err = new Error(message);\n err.status = res.status;\n err.toolName = toolName;\n throw err;\n }\n\n return payload;\n}\n\nfunction createIntegrationProxy(integrationId) {\n return new Proxy({}, {\n get(_target, methodName) {\n if (typeof methodName !== 'string') return undefined;\n return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);\n },\n });\n}\n\nexport const client = new Proxy({}, {\n get(_target, integrationId) {\n if (typeof integrationId !== 'string') return undefined;\n return createIntegrationProxy(integrationId);\n },\n});\n\nexport { callTool };\n";
15
+ export declare const RUNTIME_STUB_SOURCE = "// runtime.mjs \u2014 generated by integrate-sdk code mode\nconst MCP_URL = process.env.INTEGRATE_MCP_URL;\nconst SESSION_TOKEN = process.env.INTEGRATE_SESSION_TOKEN;\nconst API_KEY = process.env.INTEGRATE_API_KEY || '';\nconst PROVIDER_TOKENS = process.env.INTEGRATE_PROVIDER_TOKENS || '';\nconst INTEGRATIONS_HEADER = process.env.INTEGRATE_INTEGRATIONS || '';\nconst CONTEXT_JSON = process.env.INTEGRATE_CONTEXT || '';\n\nif (!MCP_URL) {\n throw new Error('INTEGRATE_MCP_URL is not set \u2014 the sandbox cannot reach the MCP route.');\n}\n\nfunction camelToSnake(str) {\n return str.replace(/[A-Z]/g, (letter) => '_' + letter.toLowerCase());\n}\n\nasync function callTool(toolName, args) {\n const headers = {\n 'Content-Type': 'application/json',\n 'x-integrate-code-mode': '1',\n };\n if (SESSION_TOKEN) headers['Authorization'] = 'Bearer ' + SESSION_TOKEN;\n if (API_KEY) headers['x-integrate-api-key'] = API_KEY;\n if (PROVIDER_TOKENS) headers['x-integrate-tokens'] = PROVIDER_TOKENS;\n if (INTEGRATIONS_HEADER) headers['x-integrations'] = INTEGRATIONS_HEADER;\n if (CONTEXT_JSON) headers['x-integrate-context'] = CONTEXT_JSON;\n\n const res = await fetch(MCP_URL, {\n method: 'POST',\n headers,\n body: JSON.stringify({ name: toolName, arguments: args || {} }),\n });\n\n const text = await res.text();\n\n let payload;\n try {\n payload = text ? JSON.parse(text) : null;\n } catch {\n payload = { content: [{ type: 'text', text }] };\n }\n\n if (!res.ok) {\n let message = (payload && (payload.error || payload.message)) || 'Tool call failed: HTTP ' + res.status;\n if ((res.status === 401 || res.status === 403) && typeof text === 'string' && text.indexOf('Authorization header') !== -1) {\n message =\n 'Code Mode callback was rejected by the MCP server (HTTP ' + res.status + '). ' +\n 'The SDK route could not synthesize an Authorization header. Check the host-side ' +\n 'createMCPServer config (apiKey, getProviderToken) or pass providerTokens to the ' +\n 'AI helper. Original upstream message: ' + text;\n }\n const err = new Error(message);\n err.status = res.status;\n err.toolName = toolName;\n throw err;\n }\n\n return payload;\n}\n\nfunction createIntegrationProxy(integrationId) {\n return new Proxy({}, {\n get(_target, methodName) {\n if (typeof methodName !== 'string') return undefined;\n return (args) => {\n const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');\n const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);\n return callTool(toolName, args);\n };\n },\n });\n}\n\nexport const client = new Proxy({}, {\n get(_target, integrationId) {\n if (typeof integrationId !== 'string') return undefined;\n return createIntegrationProxy(integrationId);\n },\n});\n\nexport { callTool };\n";
16
16
  //# sourceMappingURL=runtime-stub.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-stub.d.ts","sourceRoot":"","sources":["../../../src/code-mode/runtime-stub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,mBAAmB,gsFA6E/B,CAAC"}
1
+ {"version":3,"file":"runtime-stub.d.ts","sourceRoot":"","sources":["../../../src/code-mode/runtime-stub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,mBAAmB,o4FAiF/B,CAAC"}
@@ -82,7 +82,11 @@ function createIntegrationProxy(integrationId) {
82
82
  return new Proxy({}, {
83
83
  get(_target, methodName) {
84
84
  if (typeof methodName !== 'string') return undefined;
85
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
85
+ return (args) => {
86
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
87
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
88
+ return callTool(toolName, args);
89
+ };
86
90
  },
87
91
  });
88
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tool-builder.d.ts","sourceRoot":"","sources":["../../../src/code-mode/tool-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,iCAAiC;IACjC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;O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AAgB,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,aAAa,CAuIf"}
@@ -327,7 +327,11 @@ function createIntegrationProxy(integrationId) {
327
327
  return new Proxy({}, {
328
328
  get(_target, methodName) {
329
329
  if (typeof methodName !== 'string') return undefined;
330
- return (args) => callTool(integrationId + '_' + camelToSnake(methodName), args);
330
+ return (args) => {
331
+ const alreadyFull = methodName.startsWith(integrationId + '_') || methodName.startsWith('___');
332
+ const toolName = alreadyFull ? methodName : integrationId + '_' + camelToSnake(methodName);
333
+ return callTool(toolName, args);
334
+ };
331
335
  },
332
336
  });
333
337
  }
@@ -603,6 +607,12 @@ var DEFAULT_INSTRUCTIONS = [
603
607
  "Each method returns `ToolResult { content: [{ type, text? }], isError? }` — parse `result.content[0].text` as JSON.",
604
608
  "Only `client`, `callTool`, `fetch`, `console`, `JSON` are available (no npm imports).",
605
609
  "",
610
+ "IMPORTANT — method naming rules (violations cause -32602 'tool not found'):",
611
+ " • Always use camelCase method names: `client.github.getFileContents(args)` ✓",
612
+ " • NEVER use the full tool ID as the method key: `client.github['github_get_file_contents']` ✗ (produces double prefix)",
613
+ " • NEVER use snake_case method names: `client.github['get_file_contents']` ✗",
614
+ " • If you use `callTool` directly, pass the exact tool name as listed (e.g. `callTool('github_get_file_contents', args)`) — do NOT add the integration prefix again.",
615
+ "",
606
616
  "Call `get_integration_types` with an integration name to get full parameter types before writing code.",
607
617
  "",
608
618
  "Available methods:"
package/dist/index.d.ts CHANGED
@@ -63,5 +63,5 @@ export * from './src/index.js';
63
63
  * });
64
64
  * ```
65
65
  */
66
- export declare const client: import("./index.js").MCPClient<(import("./index.js").MCPIntegration<"github"> | import("./index.js").MCPIntegration<"gmail"> | import("./index.js").MCPIntegration<"notion"> | import("./index.js").MCPIntegration<"slack"> | import("./index.js").MCPIntegration<"linear"> | import("./index.js").MCPIntegration<"vercel"> | import("./index.js").MCPIntegration<"zendesk"> | import("./index.js").MCPIntegration<"stripe"> | import("./index.js").MCPIntegration<"gcal"> | import("./index.js").MCPIntegration<"outlook"> | import("./index.js").MCPIntegration<"airtable"> | import("./index.js").MCPIntegration<"todoist"> | import("./index.js").MCPIntegration<"whatsapp"> | import("./index.js").MCPIntegration<"calcom"> | import("./index.js").MCPIntegration<"ramp"> | import("./index.js").MCPIntegration<"onedrive"> | import("./index.js").MCPIntegration<"gdocs"> | import("./index.js").MCPIntegration<"gsheets"> | import("./index.js").MCPIntegration<"gslides"> | import("./index.js").MCPIntegration<"polar"> | import("./index.js").MCPIntegration<"figma"> | import("./index.js").MCPIntegration<"intercom"> | import("./index.js").MCPIntegration<"hubspot"> | import("./index.js").MCPIntegration<"youtube"> | import("./index.js").MCPIntegration<"cursor">)[]>;
66
+ export declare const client: import("./index.js").MCPClient<(import("./index.js").MCPIntegration<"github"> | import("./index.js").MCPIntegration<"gmail"> | import("./index.js").MCPIntegration<"notion"> | import("./index.js").MCPIntegration<"slack"> | import("./index.js").MCPIntegration<"linear"> | import("./index.js").MCPIntegration<"vercel"> | import("./index.js").MCPIntegration<"zendesk"> | import("./index.js").MCPIntegration<"stripe"> | import("./index.js").MCPIntegration<"gcal"> | import("./index.js").MCPIntegration<"outlook"> | import("./index.js").MCPIntegration<"airtable"> | import("./index.js").MCPIntegration<"todoist"> | import("./index.js").MCPIntegration<"whatsapp"> | import("./index.js").MCPIntegration<"calcom"> | import("./index.js").MCPIntegration<"ramp"> | import("./index.js").MCPIntegration<"onedrive"> | import("./index.js").MCPIntegration<"gdocs"> | import("./index.js").MCPIntegration<"gsheets"> | import("./index.js").MCPIntegration<"gslides"> | import("./index.js").MCPIntegration<"polar"> | import("./index.js").MCPIntegration<"figma"> | import("./index.js").MCPIntegration<"intercom"> | import("./index.js").MCPIntegration<"hubspot"> | import("./index.js").MCPIntegration<"youtube"> | import("./index.js").MCPIntegration<"cursor"> | import("./index.js").MCPIntegration<"word"> | import("./index.js").MCPIntegration<"excel"> | import("./index.js").MCPIntegration<"powerpoint"> | import("./index.js").MCPIntegration<"gdrive">)[]>;
67
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,cAAc,gBAAgB,CAAC;AA8B/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,MAAM,ytCA+BjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,cAAc,gBAAgB,CAAC;AAkC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,MAAM,05CAmCjB,CAAC"}