integrate-sdk 0.9.28-dev.0 → 0.9.29-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 +54 -23
- package/dist/adapters/base-handler.d.ts +1 -0
- package/dist/adapters/base-handler.d.ts.map +1 -1
- package/dist/adapters/base-handler.js +54 -23
- package/dist/adapters/index.js +141 -56
- package/dist/adapters/nextjs.d.ts.map +1 -1
- package/dist/adapters/nextjs.js +55 -24
- package/dist/adapters/solid-start.js +141 -56
- package/dist/adapters/svelte-kit.js +141 -56
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +398 -108
- package/dist/oauth.js +53 -23
- package/dist/server.js +420 -130
- package/dist/src/adapters/base-handler.d.ts +1 -0
- package/dist/src/adapters/base-handler.d.ts.map +1 -1
- package/dist/src/adapters/nextjs.d.ts.map +1 -1
- package/dist/src/client.d.ts +7 -2
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/integrations/library-metadata.d.ts +1 -1
- package/dist/src/integrations/library-metadata.d.ts.map +1 -1
- package/dist/src/integrations/posthog-client.d.ts +222 -0
- package/dist/src/integrations/posthog-client.d.ts.map +1 -0
- package/dist/src/integrations/posthog.d.ts +30 -0
- package/dist/src/integrations/posthog.d.ts.map +1 -0
- package/dist/src/integrations/railway-client.d.ts +302 -0
- package/dist/src/integrations/railway-client.d.ts.map +1 -0
- package/dist/src/integrations/railway.d.ts +24 -0
- package/dist/src/integrations/railway.d.ts.map +1 -0
- package/dist/src/oauth/manager.d.ts.map +1 -1
- package/dist/src/oauth/types.d.ts +8 -0
- package/dist/src/oauth/types.d.ts.map +1 -1
- package/dist/src/server.d.ts +2 -0
- package/dist/src/server.d.ts.map +1 -1
- package/index.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -802,10 +802,12 @@ var MCPMethod;
|
|
|
802
802
|
|
|
803
803
|
// src/integrations/library-metadata.ts
|
|
804
804
|
var INTEGRATION_CATEGORY_ORDER = [
|
|
805
|
+
"Analytics",
|
|
805
806
|
"Productivity",
|
|
806
807
|
"Business",
|
|
807
808
|
"Communication",
|
|
808
809
|
"Engineering",
|
|
810
|
+
"Infrastructure",
|
|
809
811
|
"Storage",
|
|
810
812
|
"Other"
|
|
811
813
|
];
|
|
@@ -866,10 +868,18 @@ var INTEGRATION_LIBRARY_METADATA = {
|
|
|
866
868
|
description: "Manage Polar products, orders, and subscriptions",
|
|
867
869
|
category: "Business"
|
|
868
870
|
},
|
|
871
|
+
posthog: {
|
|
872
|
+
description: "Read PostHog organizations, projects, insights, and feature flags",
|
|
873
|
+
category: "Analytics"
|
|
874
|
+
},
|
|
869
875
|
ramp: {
|
|
870
876
|
description: "Manage Ramp corporate cards, bills, and spend",
|
|
871
877
|
category: "Business"
|
|
872
878
|
},
|
|
879
|
+
railway: {
|
|
880
|
+
description: "Manage Railway workspaces, projects, services, deployments, variables, domains, and volumes",
|
|
881
|
+
category: "Infrastructure"
|
|
882
|
+
},
|
|
873
883
|
slack: {
|
|
874
884
|
description: "Send and manage Slack messages and channels",
|
|
875
885
|
category: "Communication"
|
|
@@ -1605,6 +1615,7 @@ class OAuthManager {
|
|
|
1605
1615
|
}
|
|
1606
1616
|
const provider = tokenData.provider || pendingAuth.provider;
|
|
1607
1617
|
const tokenDataToStore = {
|
|
1618
|
+
sessionToken: tokenData.sessionToken,
|
|
1608
1619
|
accessToken: tokenData.accessToken,
|
|
1609
1620
|
refreshToken: tokenData.refreshToken,
|
|
1610
1621
|
tokenType: tokenData.tokenType,
|
|
@@ -1646,6 +1657,7 @@ class OAuthManager {
|
|
|
1646
1657
|
try {
|
|
1647
1658
|
const response = await this.exchangeCodeForToken(pendingAuth.provider, code, pendingAuth.codeVerifier, state);
|
|
1648
1659
|
const tokenData = {
|
|
1660
|
+
sessionToken: response.sessionToken,
|
|
1649
1661
|
accessToken: response.accessToken,
|
|
1650
1662
|
refreshToken: response.refreshToken,
|
|
1651
1663
|
tokenType: response.tokenType,
|
|
@@ -2219,6 +2231,7 @@ class MCPClientBase {
|
|
|
2219
2231
|
authState = new Map;
|
|
2220
2232
|
oauthManager;
|
|
2221
2233
|
eventEmitter = new SimpleEventEmitter;
|
|
2234
|
+
sessionToken;
|
|
2222
2235
|
apiRouteBase;
|
|
2223
2236
|
apiBaseUrl;
|
|
2224
2237
|
databaseDetected = false;
|
|
@@ -2263,6 +2276,7 @@ class MCPClientBase {
|
|
|
2263
2276
|
setProviderToken: config.setProviderToken,
|
|
2264
2277
|
removeProviderToken: config.removeProviderToken
|
|
2265
2278
|
});
|
|
2279
|
+
this.setSessionToken(config.sessionToken || this.loadSessionTokenFromStorage());
|
|
2266
2280
|
for (const integration of this.integrations) {
|
|
2267
2281
|
for (const toolName of integration.tools) {
|
|
2268
2282
|
this.enabledToolNames.add(toolName);
|
|
@@ -2285,6 +2299,9 @@ class MCPClientBase {
|
|
|
2285
2299
|
const provider = integration.oauth.provider;
|
|
2286
2300
|
try {
|
|
2287
2301
|
const tokenData = await this.oauthManager.getProviderToken(provider);
|
|
2302
|
+
if (tokenData?.sessionToken && !this.sessionToken) {
|
|
2303
|
+
this.setSessionToken(tokenData.sessionToken);
|
|
2304
|
+
}
|
|
2288
2305
|
const currentState = this.authState.get(provider);
|
|
2289
2306
|
if (currentState && !currentState.authenticated && !currentState.lastError) {
|
|
2290
2307
|
this.authState.set(provider, { authenticated: !!tokenData });
|
|
@@ -2309,6 +2326,9 @@ class MCPClientBase {
|
|
|
2309
2326
|
const provider = integration.oauth.provider;
|
|
2310
2327
|
const tokenData = this.oauthManager.getProviderTokenFromCache(provider);
|
|
2311
2328
|
if (tokenData) {
|
|
2329
|
+
if (tokenData.sessionToken && !this.sessionToken) {
|
|
2330
|
+
this.setSessionToken(tokenData.sessionToken);
|
|
2331
|
+
}
|
|
2312
2332
|
this.authState.set(provider, { authenticated: true });
|
|
2313
2333
|
}
|
|
2314
2334
|
}
|
|
@@ -2330,6 +2350,9 @@ class MCPClientBase {
|
|
|
2330
2350
|
if (integrationIds.includes("linear")) {
|
|
2331
2351
|
this.linear = this.createIntegrationProxy("linear");
|
|
2332
2352
|
}
|
|
2353
|
+
if (integrationIds.includes("railway")) {
|
|
2354
|
+
this.railway = this.createIntegrationProxy("railway");
|
|
2355
|
+
}
|
|
2333
2356
|
if (integrationIds.includes("vercel")) {
|
|
2334
2357
|
this.vercel = this.createIntegrationProxy("vercel");
|
|
2335
2358
|
}
|
|
@@ -2360,6 +2383,9 @@ class MCPClientBase {
|
|
|
2360
2383
|
if (integrationIds.includes("gslides")) {
|
|
2361
2384
|
this.gslides = this.createIntegrationProxy("gslides");
|
|
2362
2385
|
}
|
|
2386
|
+
if (integrationIds.includes("posthog")) {
|
|
2387
|
+
this.posthog = this.createIntegrationProxy("posthog");
|
|
2388
|
+
}
|
|
2363
2389
|
this.server = this.createServerProxy();
|
|
2364
2390
|
this.trigger = new TriggerClient({
|
|
2365
2391
|
apiRouteBase: this.apiRouteBase,
|
|
@@ -2650,17 +2676,15 @@ class MCPClientBase {
|
|
|
2650
2676
|
const headers = {
|
|
2651
2677
|
"Content-Type": "application/json"
|
|
2652
2678
|
};
|
|
2679
|
+
if (this.sessionToken) {
|
|
2680
|
+
headers["Authorization"] = `Bearer ${this.sessionToken}`;
|
|
2681
|
+
headers["X-Session-Token"] = this.sessionToken;
|
|
2682
|
+
}
|
|
2653
2683
|
const integrationsHeader = this.getIntegrationHeaderValue();
|
|
2654
2684
|
if (integrationsHeader) {
|
|
2655
2685
|
headers["X-Integrations"] = integrationsHeader;
|
|
2656
2686
|
}
|
|
2657
2687
|
Object.assign(headers, integrationHeaders);
|
|
2658
|
-
if (provider) {
|
|
2659
|
-
const tokenData = await this.oauthManager.getProviderToken(provider, undefined, options?.context);
|
|
2660
|
-
if (tokenData) {
|
|
2661
|
-
headers["Authorization"] = `Bearer ${tokenData.accessToken}`;
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
2688
|
const response = await fetch(url, {
|
|
2665
2689
|
method: "POST",
|
|
2666
2690
|
headers,
|
|
@@ -2859,7 +2883,35 @@ class MCPClientBase {
|
|
|
2859
2883
|
off(event, handler) {
|
|
2860
2884
|
this.eventEmitter.off(event, handler);
|
|
2861
2885
|
}
|
|
2886
|
+
loadSessionTokenFromStorage() {
|
|
2887
|
+
if (typeof window === "undefined" || !window.sessionStorage) {
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2890
|
+
try {
|
|
2891
|
+
return window.sessionStorage.getItem("integrate_session_token") || undefined;
|
|
2892
|
+
} catch {
|
|
2893
|
+
return;
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
setSessionToken(sessionToken) {
|
|
2897
|
+
this.sessionToken = sessionToken;
|
|
2898
|
+
if (sessionToken) {
|
|
2899
|
+
this.transport.setHeader("X-Session-Token", sessionToken);
|
|
2900
|
+
} else {
|
|
2901
|
+
this.transport.removeHeader("X-Session-Token");
|
|
2902
|
+
}
|
|
2903
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
2904
|
+
try {
|
|
2905
|
+
if (sessionToken) {
|
|
2906
|
+
window.sessionStorage.setItem("integrate_session_token", sessionToken);
|
|
2907
|
+
} else {
|
|
2908
|
+
window.sessionStorage.removeItem("integrate_session_token");
|
|
2909
|
+
}
|
|
2910
|
+
} catch {}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2862
2913
|
clearSessionToken() {
|
|
2914
|
+
this.setSessionToken(undefined);
|
|
2863
2915
|
this.oauthManager.clearAllProviderTokens();
|
|
2864
2916
|
for (const integration of this.integrations) {
|
|
2865
2917
|
if (integration.oauth) {
|
|
@@ -3001,6 +3053,7 @@ class MCPClientBase {
|
|
|
3001
3053
|
if (tokenData) {
|
|
3002
3054
|
this.eventEmitter.emit("auth:complete", {
|
|
3003
3055
|
provider,
|
|
3056
|
+
sessionToken: tokenData.sessionToken || this.sessionToken,
|
|
3004
3057
|
accessToken: tokenData.accessToken,
|
|
3005
3058
|
expiresAt: tokenData.expiresAt
|
|
3006
3059
|
});
|
|
@@ -3016,6 +3069,7 @@ class MCPClientBase {
|
|
|
3016
3069
|
if (tokenData) {
|
|
3017
3070
|
this.eventEmitter.emit("auth:complete", {
|
|
3018
3071
|
provider,
|
|
3072
|
+
sessionToken: tokenData.sessionToken || this.sessionToken,
|
|
3019
3073
|
accessToken: tokenData.accessToken,
|
|
3020
3074
|
expiresAt: tokenData.expiresAt
|
|
3021
3075
|
});
|
|
@@ -3029,9 +3083,13 @@ class MCPClientBase {
|
|
|
3029
3083
|
async handleOAuthCallback(params) {
|
|
3030
3084
|
try {
|
|
3031
3085
|
const result = params.tokenData ? await this.oauthManager.handleCallbackWithToken(params.code, params.state, params.tokenData) : await this.oauthManager.handleCallback(params.code, params.state);
|
|
3086
|
+
if (result.sessionToken) {
|
|
3087
|
+
this.setSessionToken(result.sessionToken);
|
|
3088
|
+
}
|
|
3032
3089
|
this.authState.set(result.provider, { authenticated: true });
|
|
3033
3090
|
this.eventEmitter.emit("auth:complete", {
|
|
3034
3091
|
provider: result.provider,
|
|
3092
|
+
sessionToken: result.sessionToken || this.sessionToken,
|
|
3035
3093
|
accessToken: result.accessToken,
|
|
3036
3094
|
expiresAt: result.expiresAt
|
|
3037
3095
|
});
|
|
@@ -3234,6 +3292,34 @@ async function clearClientCache() {
|
|
|
3234
3292
|
// src/adapters/base-handler.ts
|
|
3235
3293
|
var SERVER_LOG_CONTEXT = "server";
|
|
3236
3294
|
var logger6 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT);
|
|
3295
|
+
var OAUTH_CONFIG_FIELDS = new Set([
|
|
3296
|
+
"clientId",
|
|
3297
|
+
"clientSecret",
|
|
3298
|
+
"scopes",
|
|
3299
|
+
"optionalScopes",
|
|
3300
|
+
"redirectUri",
|
|
3301
|
+
"client_id",
|
|
3302
|
+
"client_secret",
|
|
3303
|
+
"scope",
|
|
3304
|
+
"optional_scope",
|
|
3305
|
+
"redirect_uri",
|
|
3306
|
+
"provider"
|
|
3307
|
+
]);
|
|
3308
|
+
function getForwardableProviderConfig(config) {
|
|
3309
|
+
if (!config) {
|
|
3310
|
+
return {};
|
|
3311
|
+
}
|
|
3312
|
+
return Object.fromEntries(Object.entries(config).filter(([key, value]) => value !== undefined && value !== null && !OAUTH_CONFIG_FIELDS.has(key)).map(([key, value]) => [key, String(value)]));
|
|
3313
|
+
}
|
|
3314
|
+
function getStoredProviderConfig(config) {
|
|
3315
|
+
const baseUrl = config?.baseUrl || config?.apiBaseUrl;
|
|
3316
|
+
if (!baseUrl) {
|
|
3317
|
+
return;
|
|
3318
|
+
}
|
|
3319
|
+
return {
|
|
3320
|
+
baseUrl: String(baseUrl)
|
|
3321
|
+
};
|
|
3322
|
+
}
|
|
3237
3323
|
var MCP_SERVER_URL2 = "https://mcp.integrate.dev/api/v1/mcp";
|
|
3238
3324
|
|
|
3239
3325
|
class OAuthHandler {
|
|
@@ -3306,25 +3392,9 @@ class OAuthHandler {
|
|
|
3306
3392
|
if (redirectUri) {
|
|
3307
3393
|
url.searchParams.set("redirect_uri", redirectUri);
|
|
3308
3394
|
}
|
|
3309
|
-
const
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
"scopes",
|
|
3313
|
-
"optionalScopes",
|
|
3314
|
-
"redirectUri",
|
|
3315
|
-
"client_id",
|
|
3316
|
-
"client_secret",
|
|
3317
|
-
"scope",
|
|
3318
|
-
"optional_scope",
|
|
3319
|
-
"redirect_uri",
|
|
3320
|
-
"provider"
|
|
3321
|
-
]);
|
|
3322
|
-
if (providerConfig.config) {
|
|
3323
|
-
for (const [key, value] of Object.entries(providerConfig.config)) {
|
|
3324
|
-
if (value !== undefined && value !== null && !OAUTH_FIELDS.has(key)) {
|
|
3325
|
-
url.searchParams.set(key, String(value));
|
|
3326
|
-
}
|
|
3327
|
-
}
|
|
3395
|
+
const extraConfig = getForwardableProviderConfig(providerConfig.config);
|
|
3396
|
+
for (const [key, value] of Object.entries(extraConfig)) {
|
|
3397
|
+
url.searchParams.set(key, value);
|
|
3328
3398
|
}
|
|
3329
3399
|
const response = await fetch(url.toString(), {
|
|
3330
3400
|
method: "GET",
|
|
@@ -3411,7 +3481,8 @@ class OAuthHandler {
|
|
|
3411
3481
|
state: callbackRequest.state,
|
|
3412
3482
|
client_id: providerConfig.clientId,
|
|
3413
3483
|
client_secret: providerConfig.clientSecret,
|
|
3414
|
-
redirect_uri: providerConfig.redirectUri
|
|
3484
|
+
redirect_uri: providerConfig.redirectUri,
|
|
3485
|
+
...getForwardableProviderConfig(providerConfig.config)
|
|
3415
3486
|
})
|
|
3416
3487
|
});
|
|
3417
3488
|
if (!response.ok) {
|
|
@@ -3423,12 +3494,14 @@ class OAuthHandler {
|
|
|
3423
3494
|
if (this.config.setProviderToken) {
|
|
3424
3495
|
try {
|
|
3425
3496
|
const tokenData = {
|
|
3497
|
+
sessionToken: result.sessionToken,
|
|
3426
3498
|
accessToken: result.accessToken,
|
|
3427
3499
|
refreshToken: result.refreshToken,
|
|
3428
3500
|
tokenType: result.tokenType,
|
|
3429
3501
|
expiresIn: result.expiresIn,
|
|
3430
3502
|
expiresAt: result.expiresAt,
|
|
3431
|
-
scopes: result.scopes ? result.scopes.flatMap((s) => s.split(" ").filter(Boolean)) : result.scopes
|
|
3503
|
+
scopes: result.scopes ? result.scopes.flatMap((s) => s.split(" ").filter(Boolean)) : result.scopes,
|
|
3504
|
+
providerConfig: getStoredProviderConfig(providerConfig.config)
|
|
3432
3505
|
};
|
|
3433
3506
|
const email = result.email || await fetchUserEmail(callbackRequest.provider, tokenData);
|
|
3434
3507
|
if (email) {
|
|
@@ -3545,6 +3618,12 @@ class OAuthHandler {
|
|
|
3545
3618
|
if (providerConfig.config?.subdomain) {
|
|
3546
3619
|
body.subdomain = providerConfig.config.subdomain;
|
|
3547
3620
|
}
|
|
3621
|
+
const extraConfig = getForwardableProviderConfig(providerConfig.config);
|
|
3622
|
+
for (const [key, value] of Object.entries(extraConfig)) {
|
|
3623
|
+
if (body[key] === undefined) {
|
|
3624
|
+
body[key] = value;
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3548
3627
|
const url = new URL("/oauth/refresh", this.serverUrl);
|
|
3549
3628
|
const response = await fetch(url.toString(), {
|
|
3550
3629
|
method: "POST",
|
|
@@ -3571,7 +3650,8 @@ class OAuthHandler {
|
|
|
3571
3650
|
tokenType: result.tokenType,
|
|
3572
3651
|
expiresIn: result.expiresIn,
|
|
3573
3652
|
expiresAt: result.expiresAt,
|
|
3574
|
-
scopes: result.scopes ? result.scopes.flatMap((s) => s.split(" ").filter(Boolean)) : result.scopes
|
|
3653
|
+
scopes: result.scopes ? result.scopes.flatMap((s) => s.split(" ").filter(Boolean)) : result.scopes,
|
|
3654
|
+
providerConfig: getStoredProviderConfig(providerConfig.config)
|
|
3575
3655
|
};
|
|
3576
3656
|
const email = result.email || await fetchUserEmail(refreshRequest.provider, tokenData);
|
|
3577
3657
|
if (email) {
|
|
@@ -3778,7 +3858,7 @@ function createNextOAuthHandler(config) {
|
|
|
3778
3858
|
const codeModeHeader = req.headers.get("x-integrate-code-mode");
|
|
3779
3859
|
const tokensHeader = req.headers.get("x-integrate-tokens");
|
|
3780
3860
|
const toolName = typeof body?.name === "string" ? body.name : "";
|
|
3781
|
-
if (codeModeHeader === "1" && tokensHeader && toolName) {
|
|
3861
|
+
if (codeModeHeader === "1" && !authHeader && tokensHeader && toolName) {
|
|
3782
3862
|
try {
|
|
3783
3863
|
const tokens = JSON.parse(tokensHeader);
|
|
3784
3864
|
let best = null;
|
|
@@ -4315,8 +4395,121 @@ function linearIntegration(config = {}) {
|
|
|
4315
4395
|
}
|
|
4316
4396
|
};
|
|
4317
4397
|
}
|
|
4398
|
+
// src/integrations/railway.ts
|
|
4399
|
+
var logger14 = createLogger("Railway");
|
|
4400
|
+
var RAILWAY_SCOPES = [
|
|
4401
|
+
"openid",
|
|
4402
|
+
"profile",
|
|
4403
|
+
"email",
|
|
4404
|
+
"workspace:admin",
|
|
4405
|
+
"project:member"
|
|
4406
|
+
];
|
|
4407
|
+
var RAILWAY_TOOLS = [
|
|
4408
|
+
"railway_get_current_user",
|
|
4409
|
+
"railway_get_workspace",
|
|
4410
|
+
"railway_list_regions",
|
|
4411
|
+
"railway_list_projects",
|
|
4412
|
+
"railway_get_project",
|
|
4413
|
+
"railway_create_project",
|
|
4414
|
+
"railway_update_project",
|
|
4415
|
+
"railway_delete_project",
|
|
4416
|
+
"railway_transfer_project",
|
|
4417
|
+
"railway_list_project_members",
|
|
4418
|
+
"railway_list_environments",
|
|
4419
|
+
"railway_get_environment",
|
|
4420
|
+
"railway_create_environment",
|
|
4421
|
+
"railway_rename_environment",
|
|
4422
|
+
"railway_delete_environment",
|
|
4423
|
+
"railway_get_environment_logs",
|
|
4424
|
+
"railway_get_environment_staged_changes",
|
|
4425
|
+
"railway_commit_environment_staged_changes",
|
|
4426
|
+
"railway_get_service",
|
|
4427
|
+
"railway_get_service_instance",
|
|
4428
|
+
"railway_create_service",
|
|
4429
|
+
"railway_update_service",
|
|
4430
|
+
"railway_update_service_instance",
|
|
4431
|
+
"railway_connect_service",
|
|
4432
|
+
"railway_disconnect_service",
|
|
4433
|
+
"railway_deploy_service",
|
|
4434
|
+
"railway_redeploy_service",
|
|
4435
|
+
"railway_get_service_limits",
|
|
4436
|
+
"railway_delete_service",
|
|
4437
|
+
"railway_list_deployments",
|
|
4438
|
+
"railway_get_deployment",
|
|
4439
|
+
"railway_get_latest_active_deployment",
|
|
4440
|
+
"railway_get_deployment_build_logs",
|
|
4441
|
+
"railway_get_deployment_runtime_logs",
|
|
4442
|
+
"railway_get_deployment_http_logs",
|
|
4443
|
+
"railway_redeploy_deployment",
|
|
4444
|
+
"railway_restart_deployment",
|
|
4445
|
+
"railway_rollback_deployment",
|
|
4446
|
+
"railway_stop_deployment",
|
|
4447
|
+
"railway_cancel_deployment",
|
|
4448
|
+
"railway_remove_deployment",
|
|
4449
|
+
"railway_get_variables",
|
|
4450
|
+
"railway_get_unrendered_variables",
|
|
4451
|
+
"railway_upsert_variable",
|
|
4452
|
+
"railway_upsert_variables",
|
|
4453
|
+
"railway_delete_variable",
|
|
4454
|
+
"railway_get_rendered_variables",
|
|
4455
|
+
"railway_list_domains",
|
|
4456
|
+
"railway_create_service_domain",
|
|
4457
|
+
"railway_delete_service_domain",
|
|
4458
|
+
"railway_check_custom_domain_availability",
|
|
4459
|
+
"railway_create_custom_domain",
|
|
4460
|
+
"railway_get_custom_domain_status",
|
|
4461
|
+
"railway_update_custom_domain",
|
|
4462
|
+
"railway_delete_custom_domain",
|
|
4463
|
+
"railway_list_project_volumes",
|
|
4464
|
+
"railway_get_volume_instance",
|
|
4465
|
+
"railway_create_volume",
|
|
4466
|
+
"railway_update_volume",
|
|
4467
|
+
"railway_update_volume_instance",
|
|
4468
|
+
"railway_delete_volume",
|
|
4469
|
+
"railway_list_volume_backups",
|
|
4470
|
+
"railway_create_volume_backup",
|
|
4471
|
+
"railway_restore_volume_backup",
|
|
4472
|
+
"railway_lock_volume_backup",
|
|
4473
|
+
"railway_delete_volume_backup",
|
|
4474
|
+
"railway_list_volume_backup_schedules",
|
|
4475
|
+
"railway_list_tcp_proxies"
|
|
4476
|
+
];
|
|
4477
|
+
function railwayIntegration(config = {}) {
|
|
4478
|
+
const oauth = {
|
|
4479
|
+
provider: "railway",
|
|
4480
|
+
clientId: config.clientId ?? getEnv("RAILWAY_CLIENT_ID"),
|
|
4481
|
+
clientSecret: config.clientSecret ?? getEnv("RAILWAY_CLIENT_SECRET"),
|
|
4482
|
+
scopes: config.scopes ?? [...RAILWAY_SCOPES],
|
|
4483
|
+
optionalScopes: config.optionalScopes,
|
|
4484
|
+
redirectUri: config.redirectUri,
|
|
4485
|
+
config: {
|
|
4486
|
+
authorization_endpoint: "https://backboard.railway.com/oauth/auth",
|
|
4487
|
+
token_endpoint: "https://backboard.railway.com/oauth/token",
|
|
4488
|
+
response_type: "code",
|
|
4489
|
+
grant_types_supported: ["authorization_code", "refresh_token"],
|
|
4490
|
+
code_challenge_method: "S256",
|
|
4491
|
+
apiBaseUrl: "https://backboard.railway.com/graphql/v2",
|
|
4492
|
+
...config
|
|
4493
|
+
}
|
|
4494
|
+
};
|
|
4495
|
+
return {
|
|
4496
|
+
id: "railway",
|
|
4497
|
+
name: "Railway",
|
|
4498
|
+
logoUrl: "https://wdvtnli2jn3texa6.public.blob.vercel-storage.com/railway.png",
|
|
4499
|
+
description: "Manage Railway workspaces, projects, services, deployments, variables, domains, and volumes",
|
|
4500
|
+
category: "Infrastructure",
|
|
4501
|
+
tools: [...RAILWAY_TOOLS],
|
|
4502
|
+
oauth,
|
|
4503
|
+
async onInit(_client) {
|
|
4504
|
+
logger14.debug("Railway integration initialized");
|
|
4505
|
+
},
|
|
4506
|
+
async onAfterConnect(_client) {
|
|
4507
|
+
logger14.debug("Railway integration connected");
|
|
4508
|
+
}
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4318
4511
|
// src/integrations/vercel.ts
|
|
4319
|
-
var
|
|
4512
|
+
var logger15 = createLogger("Vercel");
|
|
4320
4513
|
var VERCEL_TOOLS = [
|
|
4321
4514
|
"vercel_list_projects",
|
|
4322
4515
|
"vercel_get_project",
|
|
@@ -4359,15 +4552,15 @@ function vercelIntegration(config = {}) {
|
|
|
4359
4552
|
tools: [...VERCEL_TOOLS],
|
|
4360
4553
|
oauth,
|
|
4361
4554
|
async onInit(_client) {
|
|
4362
|
-
|
|
4555
|
+
logger15.debug("Vercel integration initialized");
|
|
4363
4556
|
},
|
|
4364
4557
|
async onAfterConnect(_client) {
|
|
4365
|
-
|
|
4558
|
+
logger15.debug("Vercel integration connected");
|
|
4366
4559
|
}
|
|
4367
4560
|
};
|
|
4368
4561
|
}
|
|
4369
4562
|
// src/integrations/zendesk.ts
|
|
4370
|
-
var
|
|
4563
|
+
var logger16 = createLogger("Zendesk");
|
|
4371
4564
|
var ZENDESK_TOOLS = [
|
|
4372
4565
|
"zendesk_list_tickets",
|
|
4373
4566
|
"zendesk_get_ticket",
|
|
@@ -4416,15 +4609,15 @@ function zendeskIntegration(config = {}) {
|
|
|
4416
4609
|
tools: [...ZENDESK_TOOLS],
|
|
4417
4610
|
oauth,
|
|
4418
4611
|
async onInit(_client) {
|
|
4419
|
-
|
|
4612
|
+
logger16.debug("Zendesk integration initialized");
|
|
4420
4613
|
},
|
|
4421
4614
|
async onAfterConnect(_client) {
|
|
4422
|
-
|
|
4615
|
+
logger16.debug("Zendesk integration connected");
|
|
4423
4616
|
}
|
|
4424
4617
|
};
|
|
4425
4618
|
}
|
|
4426
4619
|
// src/integrations/stripe.ts
|
|
4427
|
-
var
|
|
4620
|
+
var logger17 = createLogger("Stripe");
|
|
4428
4621
|
var STRIPE_TOOLS = [
|
|
4429
4622
|
"stripe_list_customers",
|
|
4430
4623
|
"stripe_get_customer",
|
|
@@ -4480,15 +4673,15 @@ function stripeIntegration(config = {}) {
|
|
|
4480
4673
|
tools: [...STRIPE_TOOLS],
|
|
4481
4674
|
oauth,
|
|
4482
4675
|
async onInit(_client) {
|
|
4483
|
-
|
|
4676
|
+
logger17.debug("Stripe integration initialized");
|
|
4484
4677
|
},
|
|
4485
4678
|
async onAfterConnect(_client) {
|
|
4486
|
-
|
|
4679
|
+
logger17.debug("Stripe integration connected");
|
|
4487
4680
|
}
|
|
4488
4681
|
};
|
|
4489
4682
|
}
|
|
4490
4683
|
// src/integrations/gcal.ts
|
|
4491
|
-
var
|
|
4684
|
+
var logger18 = createLogger("Google Calendar");
|
|
4492
4685
|
var GCAL_TOOLS = [
|
|
4493
4686
|
"gcal_list_calendars",
|
|
4494
4687
|
"gcal_get_calendar",
|
|
@@ -4521,15 +4714,15 @@ function gcalIntegration(config = {}) {
|
|
|
4521
4714
|
tools: [...GCAL_TOOLS],
|
|
4522
4715
|
oauth,
|
|
4523
4716
|
async onInit(_client) {
|
|
4524
|
-
|
|
4717
|
+
logger18.debug("Google Calendar integration initialized");
|
|
4525
4718
|
},
|
|
4526
4719
|
async onAfterConnect(_client) {
|
|
4527
|
-
|
|
4720
|
+
logger18.debug("Google Calendar integration connected");
|
|
4528
4721
|
}
|
|
4529
4722
|
};
|
|
4530
4723
|
}
|
|
4531
4724
|
// src/integrations/outlook.ts
|
|
4532
|
-
var
|
|
4725
|
+
var logger19 = createLogger("Outlook");
|
|
4533
4726
|
var OUTLOOK_TOOLS = [
|
|
4534
4727
|
"outlook_list_messages",
|
|
4535
4728
|
"outlook_get_message",
|
|
@@ -4576,15 +4769,15 @@ function outlookIntegration(config = {}) {
|
|
|
4576
4769
|
tools: [...OUTLOOK_TOOLS],
|
|
4577
4770
|
oauth,
|
|
4578
4771
|
async onInit(_client) {
|
|
4579
|
-
|
|
4772
|
+
logger19.debug("Outlook integration initialized");
|
|
4580
4773
|
},
|
|
4581
4774
|
async onAfterConnect(_client) {
|
|
4582
|
-
|
|
4775
|
+
logger19.debug("Outlook integration connected");
|
|
4583
4776
|
}
|
|
4584
4777
|
};
|
|
4585
4778
|
}
|
|
4586
4779
|
// src/integrations/airtable.ts
|
|
4587
|
-
var
|
|
4780
|
+
var logger20 = createLogger("Airtable");
|
|
4588
4781
|
var AIRTABLE_TOOLS = [
|
|
4589
4782
|
"airtable_list_bases",
|
|
4590
4783
|
"airtable_get_base",
|
|
@@ -4630,15 +4823,15 @@ function airtableIntegration(config = {}) {
|
|
|
4630
4823
|
tools: [...AIRTABLE_TOOLS],
|
|
4631
4824
|
oauth,
|
|
4632
4825
|
async onInit(_client) {
|
|
4633
|
-
|
|
4826
|
+
logger20.debug("Airtable integration initialized");
|
|
4634
4827
|
},
|
|
4635
4828
|
async onAfterConnect(_client) {
|
|
4636
|
-
|
|
4829
|
+
logger20.debug("Airtable integration connected");
|
|
4637
4830
|
}
|
|
4638
4831
|
};
|
|
4639
4832
|
}
|
|
4640
4833
|
// src/integrations/todoist.ts
|
|
4641
|
-
var
|
|
4834
|
+
var logger21 = createLogger("Todoist");
|
|
4642
4835
|
var TODOIST_TOOLS = [
|
|
4643
4836
|
"todoist_list_projects",
|
|
4644
4837
|
"todoist_get_project",
|
|
@@ -4693,15 +4886,15 @@ function todoistIntegration(config = {}) {
|
|
|
4693
4886
|
tools: [...TODOIST_TOOLS],
|
|
4694
4887
|
oauth,
|
|
4695
4888
|
async onInit(_client) {
|
|
4696
|
-
|
|
4889
|
+
logger21.debug("Todoist integration initialized");
|
|
4697
4890
|
},
|
|
4698
4891
|
async onAfterConnect(_client) {
|
|
4699
|
-
|
|
4892
|
+
logger21.debug("Todoist integration connected");
|
|
4700
4893
|
}
|
|
4701
4894
|
};
|
|
4702
4895
|
}
|
|
4703
4896
|
// src/integrations/whatsapp.ts
|
|
4704
|
-
var
|
|
4897
|
+
var logger22 = createLogger("WhatsApp");
|
|
4705
4898
|
var WHATSAPP_TOOLS = [
|
|
4706
4899
|
"whatsapp_send_message",
|
|
4707
4900
|
"whatsapp_reply_message",
|
|
@@ -4747,15 +4940,15 @@ function whatsappIntegration(config = {}) {
|
|
|
4747
4940
|
tools: [...WHATSAPP_TOOLS],
|
|
4748
4941
|
oauth,
|
|
4749
4942
|
async onInit(_client) {
|
|
4750
|
-
|
|
4943
|
+
logger22.debug("WhatsApp Business integration initialized");
|
|
4751
4944
|
},
|
|
4752
4945
|
async onAfterConnect(_client) {
|
|
4753
|
-
|
|
4946
|
+
logger22.debug("WhatsApp Business integration connected");
|
|
4754
4947
|
}
|
|
4755
4948
|
};
|
|
4756
4949
|
}
|
|
4757
4950
|
// src/integrations/calcom.ts
|
|
4758
|
-
var
|
|
4951
|
+
var logger23 = createLogger("Cal.com");
|
|
4759
4952
|
var CALCOM_TOOLS = [
|
|
4760
4953
|
"calcom_list_bookings",
|
|
4761
4954
|
"calcom_get_booking",
|
|
@@ -4831,15 +5024,15 @@ function calcomIntegration(config = {}) {
|
|
|
4831
5024
|
tools: [...CALCOM_TOOLS],
|
|
4832
5025
|
oauth,
|
|
4833
5026
|
async onInit(_client) {
|
|
4834
|
-
|
|
5027
|
+
logger23.debug("Cal.com integration initialized");
|
|
4835
5028
|
},
|
|
4836
5029
|
async onAfterConnect(_client) {
|
|
4837
|
-
|
|
5030
|
+
logger23.debug("Cal.com integration connected");
|
|
4838
5031
|
}
|
|
4839
5032
|
};
|
|
4840
5033
|
}
|
|
4841
5034
|
// src/integrations/ramp.ts
|
|
4842
|
-
var
|
|
5035
|
+
var logger24 = createLogger("Ramp");
|
|
4843
5036
|
var RAMP_TOOLS = [
|
|
4844
5037
|
"ramp_list_transactions",
|
|
4845
5038
|
"ramp_get_transaction",
|
|
@@ -4871,15 +5064,15 @@ function rampIntegration(config = {}) {
|
|
|
4871
5064
|
tools: [...RAMP_TOOLS],
|
|
4872
5065
|
oauth,
|
|
4873
5066
|
async onInit(_client) {
|
|
4874
|
-
|
|
5067
|
+
logger24.debug("Ramp integration initialized");
|
|
4875
5068
|
},
|
|
4876
5069
|
async onAfterConnect(_client) {
|
|
4877
|
-
|
|
5070
|
+
logger24.debug("Ramp integration connected");
|
|
4878
5071
|
}
|
|
4879
5072
|
};
|
|
4880
5073
|
}
|
|
4881
5074
|
// src/integrations/onedrive.ts
|
|
4882
|
-
var
|
|
5075
|
+
var logger25 = createLogger("OneDrive");
|
|
4883
5076
|
var ONEDRIVE_TOOLS = [
|
|
4884
5077
|
"onedrive_list_files",
|
|
4885
5078
|
"onedrive_get_file",
|
|
@@ -4908,15 +5101,15 @@ function onedriveIntegration(config = {}) {
|
|
|
4908
5101
|
tools: [...ONEDRIVE_TOOLS],
|
|
4909
5102
|
oauth,
|
|
4910
5103
|
async onInit(_client) {
|
|
4911
|
-
|
|
5104
|
+
logger25.debug("OneDrive integration initialized");
|
|
4912
5105
|
},
|
|
4913
5106
|
async onAfterConnect(_client) {
|
|
4914
|
-
|
|
5107
|
+
logger25.debug("OneDrive integration connected");
|
|
4915
5108
|
}
|
|
4916
5109
|
};
|
|
4917
5110
|
}
|
|
4918
5111
|
// src/integrations/dropbox.ts
|
|
4919
|
-
var
|
|
5112
|
+
var logger26 = createLogger("Dropbox");
|
|
4920
5113
|
var DROPBOX_TOOLS = [
|
|
4921
5114
|
"dropbox_get_current_account",
|
|
4922
5115
|
"dropbox_get_space_usage",
|
|
@@ -4955,15 +5148,15 @@ function dropboxIntegration(options = {}) {
|
|
|
4955
5148
|
authType: "oauth",
|
|
4956
5149
|
oauth,
|
|
4957
5150
|
async onInit(_client) {
|
|
4958
|
-
|
|
5151
|
+
logger26.debug("Dropbox integration initialized");
|
|
4959
5152
|
},
|
|
4960
5153
|
async onAfterConnect(_client) {
|
|
4961
|
-
|
|
5154
|
+
logger26.debug("Dropbox integration connected");
|
|
4962
5155
|
}
|
|
4963
5156
|
};
|
|
4964
5157
|
}
|
|
4965
5158
|
// src/integrations/gdocs.ts
|
|
4966
|
-
var
|
|
5159
|
+
var logger27 = createLogger("Google Docs");
|
|
4967
5160
|
var GDOCS_TOOLS = [
|
|
4968
5161
|
"gdocs_list",
|
|
4969
5162
|
"gdocs_get",
|
|
@@ -4988,15 +5181,15 @@ function gdocsIntegration(config = {}) {
|
|
|
4988
5181
|
tools: [...GDOCS_TOOLS],
|
|
4989
5182
|
oauth,
|
|
4990
5183
|
async onInit(_client) {
|
|
4991
|
-
|
|
5184
|
+
logger27.debug("Google Docs integration initialized");
|
|
4992
5185
|
},
|
|
4993
5186
|
async onAfterConnect(_client) {
|
|
4994
|
-
|
|
5187
|
+
logger27.debug("Google Docs integration connected");
|
|
4995
5188
|
}
|
|
4996
5189
|
};
|
|
4997
5190
|
}
|
|
4998
5191
|
// src/integrations/gsheets.ts
|
|
4999
|
-
var
|
|
5192
|
+
var logger28 = createLogger("Google Sheets");
|
|
5000
5193
|
var GSHEETS_TOOLS = [
|
|
5001
5194
|
"gsheets_list",
|
|
5002
5195
|
"gsheets_get",
|
|
@@ -5024,15 +5217,15 @@ function gsheetsIntegration(config = {}) {
|
|
|
5024
5217
|
tools: [...GSHEETS_TOOLS],
|
|
5025
5218
|
oauth,
|
|
5026
5219
|
async onInit(_client) {
|
|
5027
|
-
|
|
5220
|
+
logger28.debug("Google Sheets integration initialized");
|
|
5028
5221
|
},
|
|
5029
5222
|
async onAfterConnect(_client) {
|
|
5030
|
-
|
|
5223
|
+
logger28.debug("Google Sheets integration connected");
|
|
5031
5224
|
}
|
|
5032
5225
|
};
|
|
5033
5226
|
}
|
|
5034
5227
|
// src/integrations/gslides.ts
|
|
5035
|
-
var
|
|
5228
|
+
var logger29 = createLogger("Google Slides");
|
|
5036
5229
|
var GSLIDES_TOOLS = [
|
|
5037
5230
|
"gslides_list",
|
|
5038
5231
|
"gslides_get",
|
|
@@ -5059,15 +5252,15 @@ function gslidesIntegration(config = {}) {
|
|
|
5059
5252
|
tools: [...GSLIDES_TOOLS],
|
|
5060
5253
|
oauth,
|
|
5061
5254
|
async onInit(_client) {
|
|
5062
|
-
|
|
5255
|
+
logger29.debug("Google Slides integration initialized");
|
|
5063
5256
|
},
|
|
5064
5257
|
async onAfterConnect(_client) {
|
|
5065
|
-
|
|
5258
|
+
logger29.debug("Google Slides integration connected");
|
|
5066
5259
|
}
|
|
5067
5260
|
};
|
|
5068
5261
|
}
|
|
5069
5262
|
// src/integrations/polar.ts
|
|
5070
|
-
var
|
|
5263
|
+
var logger30 = createLogger("Polar");
|
|
5071
5264
|
var POLAR_TOOLS = [
|
|
5072
5265
|
"polar_list_products",
|
|
5073
5266
|
"polar_get_product",
|
|
@@ -5124,15 +5317,15 @@ function polarIntegration(config = {}) {
|
|
|
5124
5317
|
tools: [...POLAR_TOOLS],
|
|
5125
5318
|
oauth,
|
|
5126
5319
|
async onInit(_client) {
|
|
5127
|
-
|
|
5320
|
+
logger30.debug("Polar integration initialized");
|
|
5128
5321
|
},
|
|
5129
5322
|
async onAfterConnect(_client) {
|
|
5130
|
-
|
|
5323
|
+
logger30.debug("Polar integration connected");
|
|
5131
5324
|
}
|
|
5132
5325
|
};
|
|
5133
5326
|
}
|
|
5134
5327
|
// src/integrations/figma.ts
|
|
5135
|
-
var
|
|
5328
|
+
var logger31 = createLogger("Figma");
|
|
5136
5329
|
var FIGMA_TOOLS = [
|
|
5137
5330
|
"figma_get_file",
|
|
5138
5331
|
"figma_get_file_nodes",
|
|
@@ -5198,15 +5391,15 @@ function figmaIntegration(config = {}) {
|
|
|
5198
5391
|
tools: [...FIGMA_TOOLS],
|
|
5199
5392
|
oauth,
|
|
5200
5393
|
async onInit(_client) {
|
|
5201
|
-
|
|
5394
|
+
logger31.debug("Figma integration initialized");
|
|
5202
5395
|
},
|
|
5203
5396
|
async onAfterConnect(_client) {
|
|
5204
|
-
|
|
5397
|
+
logger31.debug("Figma integration connected");
|
|
5205
5398
|
}
|
|
5206
5399
|
};
|
|
5207
5400
|
}
|
|
5208
5401
|
// src/integrations/intercom.ts
|
|
5209
|
-
var
|
|
5402
|
+
var logger32 = createLogger("Intercom");
|
|
5210
5403
|
var INTERCOM_TOOLS = [
|
|
5211
5404
|
"intercom_list_contacts",
|
|
5212
5405
|
"intercom_get_contact",
|
|
@@ -5237,15 +5430,15 @@ function intercomIntegration(config = {}) {
|
|
|
5237
5430
|
tools: [...INTERCOM_TOOLS],
|
|
5238
5431
|
oauth,
|
|
5239
5432
|
async onInit(_client) {
|
|
5240
|
-
|
|
5433
|
+
logger32.debug("Intercom integration initialized");
|
|
5241
5434
|
},
|
|
5242
5435
|
async onAfterConnect(_client) {
|
|
5243
|
-
|
|
5436
|
+
logger32.debug("Intercom integration connected");
|
|
5244
5437
|
}
|
|
5245
5438
|
};
|
|
5246
5439
|
}
|
|
5247
5440
|
// src/integrations/hubspot.ts
|
|
5248
|
-
var
|
|
5441
|
+
var logger33 = createLogger("HubSpot");
|
|
5249
5442
|
var HUBSPOT_TOOLS = [
|
|
5250
5443
|
"hubspot_list_contacts",
|
|
5251
5444
|
"hubspot_get_contact",
|
|
@@ -5295,15 +5488,15 @@ function hubspotIntegration(config = {}) {
|
|
|
5295
5488
|
tools: [...HUBSPOT_TOOLS],
|
|
5296
5489
|
oauth,
|
|
5297
5490
|
async onInit(_client) {
|
|
5298
|
-
|
|
5491
|
+
logger33.debug("HubSpot integration initialized");
|
|
5299
5492
|
},
|
|
5300
5493
|
async onAfterConnect(_client) {
|
|
5301
|
-
|
|
5494
|
+
logger33.debug("HubSpot integration connected");
|
|
5302
5495
|
}
|
|
5303
5496
|
};
|
|
5304
5497
|
}
|
|
5305
5498
|
// src/integrations/youtube.ts
|
|
5306
|
-
var
|
|
5499
|
+
var logger34 = createLogger("YouTube");
|
|
5307
5500
|
var YOUTUBE_TOOLS = [
|
|
5308
5501
|
"youtube_search",
|
|
5309
5502
|
"youtube_get_video",
|
|
@@ -5349,15 +5542,15 @@ function youtubeIntegration(config = {}) {
|
|
|
5349
5542
|
tools: [...YOUTUBE_TOOLS],
|
|
5350
5543
|
oauth,
|
|
5351
5544
|
async onInit(_client) {
|
|
5352
|
-
|
|
5545
|
+
logger34.debug("YouTube integration initialized");
|
|
5353
5546
|
},
|
|
5354
5547
|
async onAfterConnect(_client) {
|
|
5355
|
-
|
|
5548
|
+
logger34.debug("YouTube integration connected");
|
|
5356
5549
|
}
|
|
5357
5550
|
};
|
|
5358
5551
|
}
|
|
5359
5552
|
// src/integrations/cursor.ts
|
|
5360
|
-
var
|
|
5553
|
+
var logger35 = createLogger("Cursor");
|
|
5361
5554
|
var CURSOR_TOOLS = [
|
|
5362
5555
|
"cursor_list_agents",
|
|
5363
5556
|
"cursor_get_agent",
|
|
@@ -5377,10 +5570,104 @@ function cursorIntegration(_config = {}) {
|
|
|
5377
5570
|
logoUrl: "https://wdvtnli2jn3texa6.public.blob.vercel-storage.com/cursor.jpeg",
|
|
5378
5571
|
tools: [...CURSOR_TOOLS],
|
|
5379
5572
|
async onInit(_client) {
|
|
5380
|
-
|
|
5573
|
+
logger35.debug("Cursor integration initialized");
|
|
5574
|
+
},
|
|
5575
|
+
async onAfterConnect(_client) {
|
|
5576
|
+
logger35.debug("Cursor integration connected");
|
|
5577
|
+
}
|
|
5578
|
+
};
|
|
5579
|
+
}
|
|
5580
|
+
// src/integrations/posthog.ts
|
|
5581
|
+
var logger36 = createLogger("PostHog");
|
|
5582
|
+
var DEFAULT_POSTHOG_BASE_URL = "https://us.posthog.com";
|
|
5583
|
+
var POSTHOG_SCOPES = [
|
|
5584
|
+
"openid",
|
|
5585
|
+
"profile",
|
|
5586
|
+
"email",
|
|
5587
|
+
"organization:read",
|
|
5588
|
+
"project:read",
|
|
5589
|
+
"user:read",
|
|
5590
|
+
"query:read",
|
|
5591
|
+
"insight:read",
|
|
5592
|
+
"dashboard:read",
|
|
5593
|
+
"feature_flag:read",
|
|
5594
|
+
"experiment:read",
|
|
5595
|
+
"annotation:read",
|
|
5596
|
+
"cohort:read",
|
|
5597
|
+
"person:read",
|
|
5598
|
+
"event_definition:read",
|
|
5599
|
+
"property_definition:read",
|
|
5600
|
+
"session_recording:read",
|
|
5601
|
+
"action:read"
|
|
5602
|
+
];
|
|
5603
|
+
var POSTHOG_TOOLS = [
|
|
5604
|
+
"posthog_get_current_user",
|
|
5605
|
+
"posthog_list_organizations",
|
|
5606
|
+
"posthog_get_organization",
|
|
5607
|
+
"posthog_list_projects",
|
|
5608
|
+
"posthog_get_project",
|
|
5609
|
+
"posthog_run_hogql_query",
|
|
5610
|
+
"posthog_list_insights",
|
|
5611
|
+
"posthog_get_insight",
|
|
5612
|
+
"posthog_list_dashboards",
|
|
5613
|
+
"posthog_get_dashboard",
|
|
5614
|
+
"posthog_list_feature_flags",
|
|
5615
|
+
"posthog_get_feature_flag",
|
|
5616
|
+
"posthog_list_experiments",
|
|
5617
|
+
"posthog_get_experiment",
|
|
5618
|
+
"posthog_list_annotations",
|
|
5619
|
+
"posthog_get_annotation",
|
|
5620
|
+
"posthog_list_cohorts",
|
|
5621
|
+
"posthog_get_cohort",
|
|
5622
|
+
"posthog_list_event_definitions",
|
|
5623
|
+
"posthog_get_event_definition",
|
|
5624
|
+
"posthog_list_property_definitions",
|
|
5625
|
+
"posthog_get_property_definition",
|
|
5626
|
+
"posthog_list_persons",
|
|
5627
|
+
"posthog_get_person",
|
|
5628
|
+
"posthog_list_session_recordings",
|
|
5629
|
+
"posthog_get_session_recording"
|
|
5630
|
+
];
|
|
5631
|
+
function normalizePostHogBaseUrl(baseUrl) {
|
|
5632
|
+
const value = (baseUrl || DEFAULT_POSTHOG_BASE_URL).trim().replace(/\/+$/, "");
|
|
5633
|
+
if (!value) {
|
|
5634
|
+
return DEFAULT_POSTHOG_BASE_URL;
|
|
5635
|
+
}
|
|
5636
|
+
return /^https?:\/\//i.test(value) ? value : `https://${value}`;
|
|
5637
|
+
}
|
|
5638
|
+
function posthogIntegration(config = {}) {
|
|
5639
|
+
const baseUrl = normalizePostHogBaseUrl(config.baseUrl);
|
|
5640
|
+
const oauth = {
|
|
5641
|
+
provider: "posthog",
|
|
5642
|
+
clientId: config.clientId ?? getEnv("POSTHOG_CLIENT_ID"),
|
|
5643
|
+
clientSecret: config.clientSecret ?? getEnv("POSTHOG_CLIENT_SECRET"),
|
|
5644
|
+
scopes: config.scopes ?? [...POSTHOG_SCOPES],
|
|
5645
|
+
optionalScopes: config.optionalScopes,
|
|
5646
|
+
redirectUri: config.redirectUri,
|
|
5647
|
+
config: {
|
|
5648
|
+
baseUrl,
|
|
5649
|
+
apiBaseUrl: baseUrl,
|
|
5650
|
+
authorization_endpoint: `${baseUrl}/oauth/authorize/`,
|
|
5651
|
+
token_endpoint: `${baseUrl}/oauth/token/`,
|
|
5652
|
+
token_auth_method: "client_secret_post",
|
|
5653
|
+
response_type: "code",
|
|
5654
|
+
grant_types_supported: ["authorization_code", "refresh_token"],
|
|
5655
|
+
code_challenge_method: "S256"
|
|
5656
|
+
}
|
|
5657
|
+
};
|
|
5658
|
+
return {
|
|
5659
|
+
id: "posthog",
|
|
5660
|
+
name: "PostHog",
|
|
5661
|
+
logoUrl: "https://wdvtnli2jn3texa6.public.blob.vercel-storage.com/posthog.png",
|
|
5662
|
+
description: "Read PostHog organizations, projects, insights, flags, and analytics data",
|
|
5663
|
+
category: "Analytics",
|
|
5664
|
+
tools: [...POSTHOG_TOOLS],
|
|
5665
|
+
oauth,
|
|
5666
|
+
async onInit(_client) {
|
|
5667
|
+
logger36.debug("PostHog integration initialized");
|
|
5381
5668
|
},
|
|
5382
5669
|
async onAfterConnect(_client) {
|
|
5383
|
-
|
|
5670
|
+
logger36.debug("PostHog integration connected");
|
|
5384
5671
|
}
|
|
5385
5672
|
};
|
|
5386
5673
|
}
|
|
@@ -5502,7 +5789,7 @@ function validateStepLimit(stepIndex, maxSteps) {
|
|
|
5502
5789
|
return { valid: true };
|
|
5503
5790
|
}
|
|
5504
5791
|
// src/triggers/webhooks.ts
|
|
5505
|
-
var
|
|
5792
|
+
var logger37 = createLogger("Webhooks", "server");
|
|
5506
5793
|
async function signPayload(payload, secret) {
|
|
5507
5794
|
const encoder = new TextEncoder;
|
|
5508
5795
|
const data = encoder.encode(JSON.stringify(payload));
|
|
@@ -5528,7 +5815,7 @@ async function deliverWebhook(webhook, payload, timeoutMs) {
|
|
|
5528
5815
|
signal: controller.signal
|
|
5529
5816
|
});
|
|
5530
5817
|
if (!response.ok) {
|
|
5531
|
-
|
|
5818
|
+
logger37.warn(`Webhook delivery to ${webhook.url} returned ${response.status}`);
|
|
5532
5819
|
}
|
|
5533
5820
|
} finally {
|
|
5534
5821
|
clearTimeout(timeout);
|
|
@@ -5541,7 +5828,7 @@ async function deliverWebhooks(webhooks, payload, timeoutMs) {
|
|
|
5541
5828
|
for (let i = 0;i < results.length; i++) {
|
|
5542
5829
|
const result = results[i];
|
|
5543
5830
|
if (result.status === "rejected") {
|
|
5544
|
-
|
|
5831
|
+
logger37.warn(`Webhook delivery to ${webhooks[i].url} failed:`, result.reason);
|
|
5545
5832
|
}
|
|
5546
5833
|
}
|
|
5547
5834
|
}
|
|
@@ -5578,7 +5865,7 @@ function createSimpleIntegration(config) {
|
|
|
5578
5865
|
};
|
|
5579
5866
|
}
|
|
5580
5867
|
// src/integrations/word.ts
|
|
5581
|
-
var
|
|
5868
|
+
var logger38 = createLogger("Word");
|
|
5582
5869
|
var WORD_TOOLS = [
|
|
5583
5870
|
"word_list",
|
|
5584
5871
|
"word_get",
|
|
@@ -5604,16 +5891,16 @@ function wordIntegration(config = {}) {
|
|
|
5604
5891
|
tools: [...WORD_TOOLS],
|
|
5605
5892
|
oauth,
|
|
5606
5893
|
async onInit(_client) {
|
|
5607
|
-
|
|
5894
|
+
logger38.debug("Word integration initialized");
|
|
5608
5895
|
},
|
|
5609
5896
|
async onAfterConnect(_client) {
|
|
5610
|
-
|
|
5897
|
+
logger38.debug("Word integration connected");
|
|
5611
5898
|
}
|
|
5612
5899
|
};
|
|
5613
5900
|
}
|
|
5614
5901
|
|
|
5615
5902
|
// src/integrations/excel.ts
|
|
5616
|
-
var
|
|
5903
|
+
var logger39 = createLogger("Excel");
|
|
5617
5904
|
var EXCEL_TOOLS = [
|
|
5618
5905
|
"excel_list",
|
|
5619
5906
|
"excel_get",
|
|
@@ -5649,16 +5936,16 @@ function excelIntegration(config = {}) {
|
|
|
5649
5936
|
tools: [...EXCEL_TOOLS],
|
|
5650
5937
|
oauth,
|
|
5651
5938
|
async onInit(_client) {
|
|
5652
|
-
|
|
5939
|
+
logger39.debug("Excel integration initialized");
|
|
5653
5940
|
},
|
|
5654
5941
|
async onAfterConnect(_client) {
|
|
5655
|
-
|
|
5942
|
+
logger39.debug("Excel integration connected");
|
|
5656
5943
|
}
|
|
5657
5944
|
};
|
|
5658
5945
|
}
|
|
5659
5946
|
|
|
5660
5947
|
// src/integrations/powerpoint.ts
|
|
5661
|
-
var
|
|
5948
|
+
var logger40 = createLogger("PowerPoint");
|
|
5662
5949
|
var POWERPOINT_TOOLS = [
|
|
5663
5950
|
"powerpoint_list",
|
|
5664
5951
|
"powerpoint_get",
|
|
@@ -5684,16 +5971,16 @@ function powerpointIntegration(config = {}) {
|
|
|
5684
5971
|
tools: [...POWERPOINT_TOOLS],
|
|
5685
5972
|
oauth,
|
|
5686
5973
|
async onInit(_client) {
|
|
5687
|
-
|
|
5974
|
+
logger40.debug("PowerPoint integration initialized");
|
|
5688
5975
|
},
|
|
5689
5976
|
async onAfterConnect(_client) {
|
|
5690
|
-
|
|
5977
|
+
logger40.debug("PowerPoint integration connected");
|
|
5691
5978
|
}
|
|
5692
5979
|
};
|
|
5693
5980
|
}
|
|
5694
5981
|
|
|
5695
5982
|
// src/integrations/gdrive.ts
|
|
5696
|
-
var
|
|
5983
|
+
var logger41 = createLogger("Google Drive");
|
|
5697
5984
|
var GDRIVE_TOOLS = [
|
|
5698
5985
|
"gdrive_list_files",
|
|
5699
5986
|
"gdrive_get_file",
|
|
@@ -5727,10 +6014,10 @@ function gdriveIntegration(config = {}) {
|
|
|
5727
6014
|
tools: [...GDRIVE_TOOLS],
|
|
5728
6015
|
oauth,
|
|
5729
6016
|
async onInit(_client) {
|
|
5730
|
-
|
|
6017
|
+
logger41.debug("Google Drive integration initialized");
|
|
5731
6018
|
},
|
|
5732
6019
|
async onAfterConnect(_client) {
|
|
5733
|
-
|
|
6020
|
+
logger41.debug("Google Drive integration connected");
|
|
5734
6021
|
}
|
|
5735
6022
|
};
|
|
5736
6023
|
}
|
|
@@ -5766,7 +6053,8 @@ var client = createMCPClient({
|
|
|
5766
6053
|
intercomIntegration(),
|
|
5767
6054
|
hubspotIntegration(),
|
|
5768
6055
|
youtubeIntegration(),
|
|
5769
|
-
cursorIntegration()
|
|
6056
|
+
cursorIntegration(),
|
|
6057
|
+
posthogIntegration()
|
|
5770
6058
|
],
|
|
5771
6059
|
useServerConfig: true
|
|
5772
6060
|
});
|
|
@@ -5783,6 +6071,8 @@ export {
|
|
|
5783
6071
|
slackIntegration,
|
|
5784
6072
|
sendCallbackToOpener,
|
|
5785
6073
|
rampIntegration,
|
|
6074
|
+
railwayIntegration,
|
|
6075
|
+
posthogIntegration,
|
|
5786
6076
|
polarIntegration,
|
|
5787
6077
|
parseState,
|
|
5788
6078
|
parseServerError,
|