integrate-sdk 0.9.27-dev.2 → 0.9.28-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/index.js CHANGED
@@ -800,6 +800,182 @@ var MCPMethod;
800
800
  MCPMethod2["PROMPTS_GET"] = "prompts/get";
801
801
  })(MCPMethod ||= {});
802
802
 
803
+ // src/integrations/library-metadata.ts
804
+ var INTEGRATION_CATEGORY_ORDER = [
805
+ "Productivity",
806
+ "Business",
807
+ "Communication",
808
+ "Engineering",
809
+ "Storage",
810
+ "Other"
811
+ ];
812
+ var INTEGRATION_LIBRARY_METADATA = {
813
+ airtable: {
814
+ description: "Manage Airtable bases, tables, and records",
815
+ category: "Business"
816
+ },
817
+ calcom: {
818
+ description: "Manage Cal.com bookings and schedules",
819
+ category: "Productivity"
820
+ },
821
+ cursor: {
822
+ description: "Manage Cursor Cloud Agents and background tasks",
823
+ category: "Engineering"
824
+ },
825
+ figma: {
826
+ description: "Access Figma files, comments, and components",
827
+ category: "Engineering"
828
+ },
829
+ github: {
830
+ description: "Manage GitHub repos, issues, and pull requests",
831
+ category: "Engineering"
832
+ },
833
+ gmail: {
834
+ description: "Send, read, and search Gmail messages",
835
+ category: "Communication"
836
+ },
837
+ gcal: {
838
+ description: "Manage Google Calendar events and schedules",
839
+ category: "Productivity"
840
+ },
841
+ hubspot: {
842
+ description: "Manage HubSpot contacts, deals, and tickets",
843
+ category: "Business"
844
+ },
845
+ intercom: {
846
+ description: "Manage Intercom contacts and conversations",
847
+ category: "Business"
848
+ },
849
+ linear: {
850
+ description: "Manage Linear issues, projects, and cycles",
851
+ category: "Engineering"
852
+ },
853
+ notion: {
854
+ description: "Manage Notion pages and databases",
855
+ category: "Productivity"
856
+ },
857
+ onedrive: {
858
+ description: "Manage OneDrive files, folders, and sharing",
859
+ category: "Storage"
860
+ },
861
+ outlook: {
862
+ description: "Manage Outlook mail, calendars, and contacts",
863
+ category: "Communication"
864
+ },
865
+ polar: {
866
+ description: "Manage Polar products, orders, and subscriptions",
867
+ category: "Business"
868
+ },
869
+ ramp: {
870
+ description: "Manage Ramp corporate cards, bills, and spend",
871
+ category: "Business"
872
+ },
873
+ slack: {
874
+ description: "Send and manage Slack messages and channels",
875
+ category: "Communication"
876
+ },
877
+ stripe: {
878
+ description: "Manage Stripe customers, payments, and subscriptions",
879
+ category: "Business"
880
+ },
881
+ todoist: {
882
+ description: "Manage Todoist tasks, projects, and labels",
883
+ category: "Productivity"
884
+ },
885
+ gslides: {
886
+ description: "Create and update Google Slides presentations",
887
+ category: "Productivity"
888
+ },
889
+ gsheets: {
890
+ description: "Read and update Google Sheets spreadsheets",
891
+ category: "Productivity"
892
+ },
893
+ gdocs: {
894
+ description: "Create and edit Google Docs documents",
895
+ category: "Productivity"
896
+ },
897
+ gdrive: {
898
+ description: "Manage Google Drive files, folders, and sharing",
899
+ category: "Storage"
900
+ },
901
+ vercel: {
902
+ description: "Manage Vercel projects, deployments, and domains",
903
+ category: "Engineering"
904
+ },
905
+ whatsapp: {
906
+ description: "Send WhatsApp messages and templates",
907
+ category: "Communication"
908
+ },
909
+ youtube: {
910
+ description: "Search and access YouTube videos and channels",
911
+ category: "Communication"
912
+ },
913
+ powerpoint: {
914
+ description: "Manage PowerPoint presentations and sharing",
915
+ category: "Productivity"
916
+ },
917
+ excel: {
918
+ description: "Manage Excel workbooks, worksheets, and tables",
919
+ category: "Productivity"
920
+ },
921
+ word: {
922
+ description: "Manage Word documents and sharing",
923
+ category: "Productivity"
924
+ },
925
+ dropbox: {
926
+ description: "Manage Dropbox files, folders, and sharing",
927
+ category: "Storage"
928
+ },
929
+ granola: {
930
+ description: "List and read Granola meeting notes and folders",
931
+ category: "Productivity"
932
+ },
933
+ mercury: {
934
+ description: "Manage Mercury bank accounts, cards, and transactions",
935
+ category: "Business"
936
+ },
937
+ zendesk: {
938
+ description: "Manage Zendesk tickets, users, and help center content",
939
+ category: "Business"
940
+ }
941
+ };
942
+ function integrationLibraryPresentationFields(integration) {
943
+ const id = typeof integration["id"] === "string" ? integration["id"] : String(integration["id"] ?? "");
944
+ const fromCatalog = id ? INTEGRATION_LIBRARY_METADATA[id] : undefined;
945
+ const explicitDescription = integration["description"];
946
+ const explicitCategory = integration["category"];
947
+ const description = typeof explicitDescription === "string" && explicitDescription.trim().length > 0 ? explicitDescription.trim() : fromCatalog?.description;
948
+ const category = typeof explicitCategory === "string" && explicitCategory.trim().length > 0 ? explicitCategory.trim() : fromCatalog?.category;
949
+ const out = {};
950
+ if (description)
951
+ out.description = description;
952
+ if (category)
953
+ out.category = category;
954
+ return out;
955
+ }
956
+
957
+ // src/integrations/integration-summary.ts
958
+ function toConfiguredIntegrationSummary(integration) {
959
+ const row = integration;
960
+ const pres = integrationLibraryPresentationFields(row);
961
+ return {
962
+ id: integration.id,
963
+ name: row.name || integration.id,
964
+ logoUrl: row.logoUrl,
965
+ tools: integration.tools,
966
+ hasOAuth: !!integration.oauth,
967
+ scopes: integration.oauth?.scopes,
968
+ provider: integration.oauth?.provider,
969
+ ...pres
970
+ };
971
+ }
972
+ function toConfiguredIntegrationWithToolMetadata(integration, toolMetadata) {
973
+ return {
974
+ ...toConfiguredIntegrationSummary(integration),
975
+ toolMetadata
976
+ };
977
+ }
978
+
803
979
  // src/client.ts
804
980
  init_errors();
805
981
 
@@ -2238,31 +2414,14 @@ class MCPClientBase {
2238
2414
  const serverConfig = this.__oauthConfig;
2239
2415
  const localIntegrations = serverConfig?.integrations || this.__configuredIntegrations;
2240
2416
  const formatLocalIntegrations = (integrations) => ({
2241
- integrations: integrations.map((integration) => ({
2242
- id: integration.id,
2243
- name: integration.name || integration.id,
2244
- logoUrl: integration.logoUrl,
2245
- tools: integration.tools,
2246
- hasOAuth: !!integration.oauth,
2247
- scopes: integration.oauth?.scopes,
2248
- provider: integration.oauth?.provider
2249
- }))
2417
+ integrations: integrations.map((integration) => toConfiguredIntegrationSummary(integration))
2250
2418
  });
2251
2419
  if (hasApiKey || !this.__useServerConfig) {
2252
2420
  if (options?.includeToolMetadata && hasApiKey) {
2253
2421
  await this.ensureConnected();
2254
2422
  const integrationsWithMetadata = localIntegrations.map((integration) => {
2255
2423
  const toolMetadata = integration.tools.map((toolName) => this.availableTools.get(toolName)).filter((tool) => !!tool);
2256
- return {
2257
- id: integration.id,
2258
- name: integration.name || integration.id,
2259
- logoUrl: integration.logoUrl,
2260
- tools: integration.tools,
2261
- hasOAuth: !!integration.oauth,
2262
- scopes: integration.oauth?.scopes,
2263
- provider: integration.oauth?.provider,
2264
- toolMetadata
2265
- };
2424
+ return toConfiguredIntegrationWithToolMetadata(integration, toolMetadata);
2266
2425
  });
2267
2426
  return { integrations: integrationsWithMetadata };
2268
2427
  }
@@ -2288,28 +2447,10 @@ class MCPClientBase {
2288
2447
  }
2289
2448
  }
2290
2449
  }
2291
- return {
2292
- id: integration.id,
2293
- name: integration.name || integration.id,
2294
- logoUrl: integration.logoUrl,
2295
- tools: integration.tools,
2296
- hasOAuth: !!integration.oauth,
2297
- scopes: integration.oauth?.scopes,
2298
- provider: integration.oauth?.provider,
2299
- toolMetadata
2300
- };
2450
+ return toConfiguredIntegrationWithToolMetadata(integration, toolMetadata);
2301
2451
  } catch (error) {
2302
2452
  logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
2303
- return {
2304
- id: integration.id,
2305
- name: integration.name || integration.id,
2306
- logoUrl: integration.logoUrl,
2307
- tools: integration.tools,
2308
- hasOAuth: !!integration.oauth,
2309
- scopes: integration.oauth?.scopes,
2310
- provider: integration.oauth?.provider,
2311
- toolMetadata: []
2312
- };
2453
+ return toConfiguredIntegrationWithToolMetadata(integration, []);
2313
2454
  }
2314
2455
  }, 3);
2315
2456
  return { integrations: integrationsWithMetadata };
@@ -2329,6 +2470,12 @@ class MCPClientBase {
2329
2470
  return formatLocalIntegrations(localIntegrations);
2330
2471
  }
2331
2472
  const result = await response.json();
2473
+ if (result.integrations && Array.isArray(result.integrations)) {
2474
+ result.integrations = result.integrations.map((row) => ({
2475
+ ...row,
2476
+ ...integrationLibraryPresentationFields(row)
2477
+ }));
2478
+ }
2332
2479
  if (options?.includeToolMetadata && result.integrations) {
2333
2480
  const { parallelWithLimit: parallelWithLimit2 } = await Promise.resolve().then(() => exports_concurrency);
2334
2481
  const integrationsWithMetadata = await parallelWithLimit2(result.integrations, async (integration) => {
@@ -2353,12 +2500,14 @@ class MCPClientBase {
2353
2500
  }
2354
2501
  return {
2355
2502
  ...integration,
2503
+ ...integrationLibraryPresentationFields(integration),
2356
2504
  toolMetadata
2357
2505
  };
2358
2506
  } catch (error) {
2359
2507
  logger5.error(`Failed to fetch tool metadata for ${integration.id}:`, error);
2360
2508
  return {
2361
2509
  ...integration,
2510
+ ...integrationLibraryPresentationFields(integration),
2362
2511
  toolMetadata: []
2363
2512
  };
2364
2513
  }
@@ -3103,14 +3252,8 @@ class OAuthHandler {
3103
3252
  const integrations = this.config.integrations || [];
3104
3253
  return {
3105
3254
  integrations: integrations.map((integration) => ({
3106
- id: integration.id,
3107
- name: integration.name || integration.id,
3108
- logoUrl: integration.logoUrl,
3109
- tools: integration.tools,
3110
- hasOAuth: !!integration.oauth,
3111
- scopes: integration.oauth?.scopes,
3112
- optionalScopes: integration.oauth?.optionalScopes,
3113
- provider: integration.oauth?.provider
3255
+ ...toConfiguredIntegrationSummary(integration),
3256
+ optionalScopes: integration.oauth?.optionalScopes
3114
3257
  }))
3115
3258
  };
3116
3259
  }
@@ -5690,6 +5833,7 @@ export {
5690
5833
  MCPClientBase,
5691
5834
  MAX_TRIGGER_STEPS,
5692
5835
  IntegrateSDKError,
5836
+ INTEGRATION_CATEGORY_ORDER,
5693
5837
  HttpSessionTransport,
5694
5838
  ConnectionError,
5695
5839
  AuthorizationError,
package/dist/oauth.js CHANGED
@@ -27,6 +27,180 @@ var __export = (target, all) => {
27
27
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
28
28
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
29
29
 
30
+ // src/integrations/library-metadata.ts
31
+ function integrationLibraryPresentationFields(integration) {
32
+ const id = typeof integration["id"] === "string" ? integration["id"] : String(integration["id"] ?? "");
33
+ const fromCatalog = id ? INTEGRATION_LIBRARY_METADATA[id] : undefined;
34
+ const explicitDescription = integration["description"];
35
+ const explicitCategory = integration["category"];
36
+ const description = typeof explicitDescription === "string" && explicitDescription.trim().length > 0 ? explicitDescription.trim() : fromCatalog?.description;
37
+ const category = typeof explicitCategory === "string" && explicitCategory.trim().length > 0 ? explicitCategory.trim() : fromCatalog?.category;
38
+ const out = {};
39
+ if (description)
40
+ out.description = description;
41
+ if (category)
42
+ out.category = category;
43
+ return out;
44
+ }
45
+ var INTEGRATION_LIBRARY_METADATA;
46
+ var init_library_metadata = __esm(() => {
47
+ INTEGRATION_LIBRARY_METADATA = {
48
+ airtable: {
49
+ description: "Manage Airtable bases, tables, and records",
50
+ category: "Business"
51
+ },
52
+ calcom: {
53
+ description: "Manage Cal.com bookings and schedules",
54
+ category: "Productivity"
55
+ },
56
+ cursor: {
57
+ description: "Manage Cursor Cloud Agents and background tasks",
58
+ category: "Engineering"
59
+ },
60
+ figma: {
61
+ description: "Access Figma files, comments, and components",
62
+ category: "Engineering"
63
+ },
64
+ github: {
65
+ description: "Manage GitHub repos, issues, and pull requests",
66
+ category: "Engineering"
67
+ },
68
+ gmail: {
69
+ description: "Send, read, and search Gmail messages",
70
+ category: "Communication"
71
+ },
72
+ gcal: {
73
+ description: "Manage Google Calendar events and schedules",
74
+ category: "Productivity"
75
+ },
76
+ hubspot: {
77
+ description: "Manage HubSpot contacts, deals, and tickets",
78
+ category: "Business"
79
+ },
80
+ intercom: {
81
+ description: "Manage Intercom contacts and conversations",
82
+ category: "Business"
83
+ },
84
+ linear: {
85
+ description: "Manage Linear issues, projects, and cycles",
86
+ category: "Engineering"
87
+ },
88
+ notion: {
89
+ description: "Manage Notion pages and databases",
90
+ category: "Productivity"
91
+ },
92
+ onedrive: {
93
+ description: "Manage OneDrive files, folders, and sharing",
94
+ category: "Storage"
95
+ },
96
+ outlook: {
97
+ description: "Manage Outlook mail, calendars, and contacts",
98
+ category: "Communication"
99
+ },
100
+ polar: {
101
+ description: "Manage Polar products, orders, and subscriptions",
102
+ category: "Business"
103
+ },
104
+ ramp: {
105
+ description: "Manage Ramp corporate cards, bills, and spend",
106
+ category: "Business"
107
+ },
108
+ slack: {
109
+ description: "Send and manage Slack messages and channels",
110
+ category: "Communication"
111
+ },
112
+ stripe: {
113
+ description: "Manage Stripe customers, payments, and subscriptions",
114
+ category: "Business"
115
+ },
116
+ todoist: {
117
+ description: "Manage Todoist tasks, projects, and labels",
118
+ category: "Productivity"
119
+ },
120
+ gslides: {
121
+ description: "Create and update Google Slides presentations",
122
+ category: "Productivity"
123
+ },
124
+ gsheets: {
125
+ description: "Read and update Google Sheets spreadsheets",
126
+ category: "Productivity"
127
+ },
128
+ gdocs: {
129
+ description: "Create and edit Google Docs documents",
130
+ category: "Productivity"
131
+ },
132
+ gdrive: {
133
+ description: "Manage Google Drive files, folders, and sharing",
134
+ category: "Storage"
135
+ },
136
+ vercel: {
137
+ description: "Manage Vercel projects, deployments, and domains",
138
+ category: "Engineering"
139
+ },
140
+ whatsapp: {
141
+ description: "Send WhatsApp messages and templates",
142
+ category: "Communication"
143
+ },
144
+ youtube: {
145
+ description: "Search and access YouTube videos and channels",
146
+ category: "Communication"
147
+ },
148
+ powerpoint: {
149
+ description: "Manage PowerPoint presentations and sharing",
150
+ category: "Productivity"
151
+ },
152
+ excel: {
153
+ description: "Manage Excel workbooks, worksheets, and tables",
154
+ category: "Productivity"
155
+ },
156
+ word: {
157
+ description: "Manage Word documents and sharing",
158
+ category: "Productivity"
159
+ },
160
+ dropbox: {
161
+ description: "Manage Dropbox files, folders, and sharing",
162
+ category: "Storage"
163
+ },
164
+ granola: {
165
+ description: "List and read Granola meeting notes and folders",
166
+ category: "Productivity"
167
+ },
168
+ mercury: {
169
+ description: "Manage Mercury bank accounts, cards, and transactions",
170
+ category: "Business"
171
+ },
172
+ zendesk: {
173
+ description: "Manage Zendesk tickets, users, and help center content",
174
+ category: "Business"
175
+ }
176
+ };
177
+ });
178
+
179
+ // src/integrations/integration-summary.ts
180
+ function toConfiguredIntegrationSummary(integration) {
181
+ const row = integration;
182
+ const pres = integrationLibraryPresentationFields(row);
183
+ return {
184
+ id: integration.id,
185
+ name: row.name || integration.id,
186
+ logoUrl: row.logoUrl,
187
+ tools: integration.tools,
188
+ hasOAuth: !!integration.oauth,
189
+ scopes: integration.oauth?.scopes,
190
+ provider: integration.oauth?.provider,
191
+ ...pres
192
+ };
193
+ }
194
+ function toConfiguredIntegrationWithToolMetadata(integration, toolMetadata) {
195
+ return {
196
+ ...toConfiguredIntegrationSummary(integration),
197
+ toolMetadata
198
+ };
199
+ }
200
+ var init_integration_summary = __esm(() => {
201
+ init_library_metadata();
202
+ });
203
+
30
204
  // src/utils/logger.ts
31
205
  function shouldLog(level, context) {
32
206
  return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
@@ -472,14 +646,8 @@ class OAuthHandler {
472
646
  const integrations = this.config.integrations || [];
473
647
  return {
474
648
  integrations: integrations.map((integration) => ({
475
- id: integration.id,
476
- name: integration.name || integration.id,
477
- logoUrl: integration.logoUrl,
478
- tools: integration.tools,
479
- hasOAuth: !!integration.oauth,
480
- scopes: integration.oauth?.scopes,
481
- optionalScopes: integration.oauth?.optionalScopes,
482
- provider: integration.oauth?.provider
649
+ ...toConfiguredIntegrationSummary(integration),
650
+ optionalScopes: integration.oauth?.optionalScopes
483
651
  }))
484
652
  };
485
653
  }
@@ -866,6 +1034,7 @@ class OAuthHandler {
866
1034
  }
867
1035
  var SERVER_LOG_CONTEXT = "server", logger2, MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
868
1036
  var init_base_handler = __esm(() => {
1037
+ init_integration_summary();
869
1038
  init_email_fetcher();
870
1039
  init_logger();
871
1040
  logger2 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT);