@tangle-network/agent-integrations 0.15.0 → 0.16.1
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/README.md +27 -0
- package/dist/chunk-DIJ3I66K.js +1000 -0
- package/dist/chunk-DIJ3I66K.js.map +1 -0
- package/dist/index.d.ts +1 -2333
- package/dist/index.js +845 -1198
- package/dist/index.js.map +1 -1
- package/dist/specs.d.ts +2499 -0
- package/dist/specs.js +37 -0
- package/dist/specs.js.map +1 -0
- package/docs/repo-structure.md +47 -0
- package/examples/calendar-exercise-app.ts +78 -0
- package/package.json +6 -1
|
@@ -0,0 +1,1000 @@
|
|
|
1
|
+
// src/specs/types.ts
|
|
2
|
+
function specAuthToConnectorAuth(auth) {
|
|
3
|
+
if (auth.mode === "api_key") return "api_key";
|
|
4
|
+
if (auth.mode === "oauth2") return "oauth2";
|
|
5
|
+
if (auth.mode === "none") return "none";
|
|
6
|
+
return "custom";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/specs/families.ts
|
|
10
|
+
var INTEGRATION_FAMILIES = {
|
|
11
|
+
google: {
|
|
12
|
+
id: "google",
|
|
13
|
+
title: "Google OAuth",
|
|
14
|
+
authMode: "oauth2",
|
|
15
|
+
consoleUrl: "https://console.cloud.google.com/apis/credentials",
|
|
16
|
+
authorizationUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
17
|
+
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
18
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/google/callback",
|
|
19
|
+
credentialFields: [
|
|
20
|
+
{ label: "Client ID", env: "GOOGLE_OAUTH_CLIENT_ID", description: "Google OAuth client ID.", example: "1234567890-abc.apps.googleusercontent.com", regex: "^[0-9]+-[a-zA-Z0-9_-]+\\.apps\\.googleusercontent\\.com$", secret: false },
|
|
21
|
+
{ label: "Client Secret", env: "GOOGLE_OAUTH_CLIENT_SECRET", description: "Google OAuth client secret.", example: "GOCSPX-...", secret: true }
|
|
22
|
+
],
|
|
23
|
+
consoleSteps: [
|
|
24
|
+
{ id: "project", title: "Select project", detail: "Open Google Cloud Console and select the project that owns the OAuth client." },
|
|
25
|
+
{ id: "consent", title: "Configure consent screen", detail: "Configure OAuth consent, app name, support email, and publishing status appropriate for the deployment." },
|
|
26
|
+
{ id: "client", title: "Create web client", detail: "Create an OAuth client of type Web application." },
|
|
27
|
+
{ id: "redirect", title: "Add redirect URI", detail: "Add {redirectUri} as an authorized redirect URI.", copyValue: "{redirectUri}" },
|
|
28
|
+
{ id: "scopes", title: "Add scopes", detail: "Add the provider scopes listed in this spec." }
|
|
29
|
+
],
|
|
30
|
+
knownQuirks: [
|
|
31
|
+
{ id: "offline-access", severity: "warning", message: "Use access_type=offline and prompt=consent when refresh tokens are required." },
|
|
32
|
+
{ id: "verification", severity: "warning", message: "Sensitive or restricted scopes may require Google verification before broad external use." }
|
|
33
|
+
],
|
|
34
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: true, supportsIncrementalAuth: true, recommendedHealthcheckIntervalHours: 24 }
|
|
35
|
+
},
|
|
36
|
+
"microsoft-graph": {
|
|
37
|
+
id: "microsoft-graph",
|
|
38
|
+
title: "Microsoft Graph OAuth",
|
|
39
|
+
authMode: "oauth2",
|
|
40
|
+
consoleUrl: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",
|
|
41
|
+
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
|
|
42
|
+
tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
|
|
43
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/microsoft/callback",
|
|
44
|
+
credentialFields: [
|
|
45
|
+
{ label: "Client ID", env: "MS_OAUTH_CLIENT_ID", description: "Microsoft Entra application client ID.", example: "00000000-0000-0000-0000-000000000000", regex: "^[0-9a-fA-F-]{36}$", secret: false },
|
|
46
|
+
{ label: "Client Secret", env: "MS_OAUTH_CLIENT_SECRET", description: "Microsoft Entra client secret value.", secret: true }
|
|
47
|
+
],
|
|
48
|
+
consoleSteps: [
|
|
49
|
+
{ id: "app", title: "Register app", detail: "Create or open an app registration in Microsoft Entra." },
|
|
50
|
+
{ id: "redirect", title: "Add redirect URI", detail: "Add {redirectUri} as a Web redirect URI.", copyValue: "{redirectUri}" },
|
|
51
|
+
{ id: "secret", title: "Create secret", detail: "Create a client secret and store the secret value, not the secret ID." },
|
|
52
|
+
{ id: "permissions", title: "Add Graph permissions", detail: "Add the delegated Graph scopes listed in this spec and grant admin consent where required." }
|
|
53
|
+
],
|
|
54
|
+
knownQuirks: [
|
|
55
|
+
{ id: "tenant-common", severity: "info", message: "The common tenant supports multi-tenant OAuth; single-tenant deployments should override the tenant segment." },
|
|
56
|
+
{ id: "admin-consent", severity: "warning", message: "Some Graph scopes require tenant admin consent." }
|
|
57
|
+
],
|
|
58
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: true, supportsIncrementalAuth: true, recommendedHealthcheckIntervalHours: 24 }
|
|
59
|
+
},
|
|
60
|
+
atlassian: {
|
|
61
|
+
id: "atlassian",
|
|
62
|
+
title: "Atlassian OAuth",
|
|
63
|
+
authMode: "oauth2",
|
|
64
|
+
consoleUrl: "https://developer.atlassian.com/console/myapps/",
|
|
65
|
+
authorizationUrl: "https://auth.atlassian.com/authorize",
|
|
66
|
+
tokenUrl: "https://auth.atlassian.com/oauth/token",
|
|
67
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/atlassian/callback",
|
|
68
|
+
credentialFields: [
|
|
69
|
+
{ label: "Client ID", description: "Atlassian OAuth client ID.", secret: false },
|
|
70
|
+
{ label: "Client Secret", description: "Atlassian OAuth client secret.", secret: true }
|
|
71
|
+
],
|
|
72
|
+
consoleSteps: [
|
|
73
|
+
{ id: "app", title: "Create OAuth app", detail: "Create an OAuth 2.0 app in the Atlassian developer console." },
|
|
74
|
+
{ id: "redirect", title: "Add callback URL", detail: "Add {redirectUri} as the callback URL.", copyValue: "{redirectUri}" },
|
|
75
|
+
{ id: "apis", title: "Enable APIs", detail: "Enable the Jira or Confluence APIs required by this connector." }
|
|
76
|
+
],
|
|
77
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: false, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
78
|
+
},
|
|
79
|
+
salesforce: {
|
|
80
|
+
id: "salesforce",
|
|
81
|
+
title: "Salesforce OAuth",
|
|
82
|
+
authMode: "oauth2",
|
|
83
|
+
consoleUrl: "https://login.salesforce.com",
|
|
84
|
+
authorizationUrl: "https://login.salesforce.com/services/oauth2/authorize",
|
|
85
|
+
tokenUrl: "https://login.salesforce.com/services/oauth2/token",
|
|
86
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/salesforce/callback",
|
|
87
|
+
credentialFields: [
|
|
88
|
+
{ label: "Client ID", env: "SALESFORCE_OAUTH_CLIENT_ID", description: "Salesforce connected app consumer key.", secret: false },
|
|
89
|
+
{ label: "Client Secret", env: "SALESFORCE_OAUTH_CLIENT_SECRET", description: "Salesforce connected app consumer secret.", secret: true }
|
|
90
|
+
],
|
|
91
|
+
consoleSteps: [
|
|
92
|
+
{ id: "connected-app", title: "Create connected app", detail: "Create a Salesforce connected app with OAuth enabled." },
|
|
93
|
+
{ id: "callback", title: "Add callback URL", detail: "Add {redirectUri} as the callback URL.", copyValue: "{redirectUri}" },
|
|
94
|
+
{ id: "scopes", title: "Select scopes", detail: "Add api and refresh_token/offline_access, plus any connector-specific scopes." }
|
|
95
|
+
],
|
|
96
|
+
knownQuirks: [
|
|
97
|
+
{ id: "instance-url", severity: "critical", message: "Runtime calls must use the instance_url returned by the token response." }
|
|
98
|
+
],
|
|
99
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
100
|
+
},
|
|
101
|
+
hubspot: {
|
|
102
|
+
id: "hubspot",
|
|
103
|
+
title: "HubSpot OAuth",
|
|
104
|
+
authMode: "oauth2",
|
|
105
|
+
consoleUrl: "https://developers.hubspot.com/",
|
|
106
|
+
authorizationUrl: "https://app.hubspot.com/oauth/authorize",
|
|
107
|
+
tokenUrl: "https://api.hubapi.com/oauth/v1/token",
|
|
108
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/hubspot/callback",
|
|
109
|
+
credentialFields: [
|
|
110
|
+
{ label: "Client ID", env: "HUBSPOT_OAUTH_CLIENT_ID", description: "HubSpot app client ID.", secret: false },
|
|
111
|
+
{ label: "Client Secret", env: "HUBSPOT_OAUTH_CLIENT_SECRET", description: "HubSpot app client secret.", secret: true }
|
|
112
|
+
],
|
|
113
|
+
consoleSteps: [
|
|
114
|
+
{ id: "app", title: "Create private/public app", detail: "Create a HubSpot app and configure OAuth." },
|
|
115
|
+
{ id: "redirect", title: "Add redirect URL", detail: "Add {redirectUri} to the app redirect URLs.", copyValue: "{redirectUri}" },
|
|
116
|
+
{ id: "scopes", title: "Add CRM scopes", detail: "Add the CRM object scopes listed in this spec." }
|
|
117
|
+
],
|
|
118
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
119
|
+
},
|
|
120
|
+
slack: {
|
|
121
|
+
id: "slack",
|
|
122
|
+
title: "Slack OAuth",
|
|
123
|
+
authMode: "oauth2",
|
|
124
|
+
consoleUrl: "https://api.slack.com/apps",
|
|
125
|
+
authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
126
|
+
tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
127
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/slack/callback",
|
|
128
|
+
credentialFields: [
|
|
129
|
+
{ label: "Client ID", env: "SLACK_OAUTH_CLIENT_ID", description: "Slack app client ID.", secret: false },
|
|
130
|
+
{ label: "Client Secret", env: "SLACK_OAUTH_CLIENT_SECRET", description: "Slack app client secret.", secret: true }
|
|
131
|
+
],
|
|
132
|
+
consoleSteps: [
|
|
133
|
+
{ id: "app", title: "Create Slack app", detail: "Create or open a Slack app." },
|
|
134
|
+
{ id: "redirect", title: "Add redirect URL", detail: "Add {redirectUri} under OAuth & Permissions.", copyValue: "{redirectUri}" },
|
|
135
|
+
{ id: "scopes", title: "Add bot scopes", detail: "Add the bot token scopes listed in this spec and reinstall the app." }
|
|
136
|
+
],
|
|
137
|
+
knownQuirks: [
|
|
138
|
+
{ id: "bot-token", severity: "info", message: "Slack usually returns a bot access token; refresh tokens require token rotation." }
|
|
139
|
+
],
|
|
140
|
+
lifecycle: { supportsRefresh: false, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
141
|
+
},
|
|
142
|
+
notion: {
|
|
143
|
+
id: "notion",
|
|
144
|
+
title: "Notion OAuth",
|
|
145
|
+
authMode: "oauth2",
|
|
146
|
+
consoleUrl: "https://www.notion.so/my-integrations",
|
|
147
|
+
authorizationUrl: "https://api.notion.com/v1/oauth/authorize",
|
|
148
|
+
tokenUrl: "https://api.notion.com/v1/oauth/token",
|
|
149
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/notion/callback",
|
|
150
|
+
credentialFields: [
|
|
151
|
+
{ label: "Client ID", env: "NOTION_OAUTH_CLIENT_ID", description: "Notion integration OAuth client ID.", secret: false },
|
|
152
|
+
{ label: "Client Secret", env: "NOTION_OAUTH_CLIENT_SECRET", description: "Notion integration OAuth client secret.", secret: true }
|
|
153
|
+
],
|
|
154
|
+
consoleSteps: [
|
|
155
|
+
{ id: "integration", title: "Create integration", detail: "Create a Notion public integration." },
|
|
156
|
+
{ id: "redirect", title: "Add redirect URI", detail: "Add {redirectUri} as the redirect URI.", copyValue: "{redirectUri}" },
|
|
157
|
+
{ id: "capabilities", title: "Select capabilities", detail: "Enable read/update/insert capabilities matching this connector." }
|
|
158
|
+
],
|
|
159
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
160
|
+
},
|
|
161
|
+
"standard-oauth2": {
|
|
162
|
+
id: "standard-oauth2",
|
|
163
|
+
title: "Standard OAuth 2.0",
|
|
164
|
+
authMode: "oauth2",
|
|
165
|
+
redirectUriTemplate: "https://{host}/api/integrations/oauth/{kind}/callback",
|
|
166
|
+
credentialFields: [
|
|
167
|
+
{ label: "Client ID", description: "OAuth client ID.", secret: false },
|
|
168
|
+
{ label: "Client Secret", description: "OAuth client secret.", secret: true }
|
|
169
|
+
],
|
|
170
|
+
consoleSteps: [
|
|
171
|
+
{ id: "app", title: "Create OAuth app", detail: "Create an OAuth app in the provider console." },
|
|
172
|
+
{ id: "redirect", title: "Add redirect URI", detail: "Add {redirectUri} as an allowed redirect URI.", copyValue: "{redirectUri}" },
|
|
173
|
+
{ id: "scopes", title: "Add scopes", detail: "Add the scopes listed in this spec." }
|
|
174
|
+
],
|
|
175
|
+
lifecycle: { supportsRefresh: true, supportsRevoke: false, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
176
|
+
},
|
|
177
|
+
"api-key": {
|
|
178
|
+
id: "api-key",
|
|
179
|
+
title: "API key",
|
|
180
|
+
authMode: "api_key",
|
|
181
|
+
credentialFields: [
|
|
182
|
+
{ label: "API Key", description: "Provider API key or token.", example: "sk_...", secret: true }
|
|
183
|
+
],
|
|
184
|
+
consoleSteps: [
|
|
185
|
+
{ id: "token", title: "Create token", detail: "Create an API key/token in the provider console with the minimum required permissions." }
|
|
186
|
+
],
|
|
187
|
+
lifecycle: { supportsRefresh: false, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
188
|
+
},
|
|
189
|
+
hmac: {
|
|
190
|
+
id: "hmac",
|
|
191
|
+
title: "HMAC secret",
|
|
192
|
+
authMode: "hmac",
|
|
193
|
+
credentialFields: [
|
|
194
|
+
{ label: "Signing Secret", description: "Webhook signing secret.", secret: true }
|
|
195
|
+
],
|
|
196
|
+
consoleSteps: [
|
|
197
|
+
{ id: "secret", title: "Configure signing secret", detail: "Configure the shared signing secret in the sender and receiver." }
|
|
198
|
+
],
|
|
199
|
+
lifecycle: { supportsRefresh: false, supportsRevoke: true, supportsIncrementalAuth: false, recommendedHealthcheckIntervalHours: 24 }
|
|
200
|
+
},
|
|
201
|
+
none: {
|
|
202
|
+
id: "none",
|
|
203
|
+
title: "No authentication",
|
|
204
|
+
authMode: "none",
|
|
205
|
+
credentialFields: [],
|
|
206
|
+
consoleSteps: [
|
|
207
|
+
{ id: "configure", title: "Configure endpoint", detail: "No provider credentials are required." }
|
|
208
|
+
],
|
|
209
|
+
lifecycle: { supportsRefresh: false, supportsRevoke: false, supportsIncrementalAuth: false }
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
function getIntegrationFamily(id) {
|
|
213
|
+
return INTEGRATION_FAMILIES[id];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/coverage-catalog.ts
|
|
217
|
+
var DEFAULT_PROVIDER_KINDS = ["first_party", "nango", "pipedream", "activepieces", "custom"];
|
|
218
|
+
var COVERAGE_SPECS = [
|
|
219
|
+
["gmail", "Gmail", "email", "email", "tier_0", "email,google,workspace,inbox"],
|
|
220
|
+
["outlook-mail", "Outlook Mail", "email", "email", "tier_0", "email,microsoft,office,inbox"],
|
|
221
|
+
["google-calendar", "Google Calendar", "calendar", "calendar", "tier_0", "calendar,google,workspace,scheduling"],
|
|
222
|
+
["outlook-calendar", "Outlook Calendar", "calendar", "calendar", "tier_0", "calendar,microsoft,office,scheduling"],
|
|
223
|
+
["slack", "Slack", "chat", "chat", "tier_0", "chat,collaboration,internal-comms"],
|
|
224
|
+
["microsoft-teams", "Microsoft Teams", "chat", "chat", "tier_0", "chat,microsoft,collaboration"],
|
|
225
|
+
["google-drive", "Google Drive", "storage", "storage", "tier_0", "files,google,workspace,storage"],
|
|
226
|
+
["onedrive", "OneDrive", "storage", "storage", "tier_0", "files,microsoft,office,storage"],
|
|
227
|
+
["dropbox", "Dropbox", "storage", "storage", "tier_1", "files,storage"],
|
|
228
|
+
["box", "Box", "storage", "storage", "tier_1", "files,enterprise,storage"],
|
|
229
|
+
["google-docs", "Google Docs", "docs", "docs", "tier_0", "docs,google,workspace"],
|
|
230
|
+
["google-sheets", "Google Sheets", "database", "database", "tier_0", "sheets,spreadsheet,google,database"],
|
|
231
|
+
["microsoft-excel", "Microsoft Excel", "database", "database", "tier_0", "sheets,spreadsheet,microsoft,database"],
|
|
232
|
+
["notion", "Notion", "docs", "docs", "tier_0", "docs,wiki,knowledge"],
|
|
233
|
+
["airtable", "Airtable", "database", "database", "tier_0", "database,spreadsheet,ops"],
|
|
234
|
+
["coda", "Coda", "docs", "docs", "tier_1", "docs,wiki,ops"],
|
|
235
|
+
["confluence", "Confluence", "docs", "docs", "tier_1", "docs,wiki,atlassian"],
|
|
236
|
+
["sharepoint", "SharePoint", "storage", "storage", "tier_1", "files,microsoft,enterprise"],
|
|
237
|
+
["hubspot", "HubSpot", "crm", "crm", "tier_0", "crm,sales,marketing"],
|
|
238
|
+
["salesforce", "Salesforce", "crm", "crm", "tier_0", "crm,sales,enterprise"],
|
|
239
|
+
["pipedrive", "Pipedrive", "crm", "crm", "tier_1", "crm,sales"],
|
|
240
|
+
["zoho-crm", "Zoho CRM", "crm", "crm", "tier_1", "crm,sales"],
|
|
241
|
+
["close", "Close", "crm", "crm", "tier_1", "crm,sales"],
|
|
242
|
+
["attio", "Attio", "crm", "crm", "tier_1", "crm,sales,startups"],
|
|
243
|
+
["linear", "Linear", "workflow", "project", "tier_0", "project,engineering,tickets"],
|
|
244
|
+
["jira", "Jira", "workflow", "project", "tier_0", "project,engineering,tickets,atlassian"],
|
|
245
|
+
["github", "GitHub", "workflow", "dev", "tier_0", "code,dev,issues,git"],
|
|
246
|
+
["gitlab", "GitLab", "workflow", "dev", "tier_1", "code,dev,issues,git"],
|
|
247
|
+
["bitbucket", "Bitbucket", "workflow", "dev", "tier_2", "code,dev,git,atlassian"],
|
|
248
|
+
["asana", "Asana", "workflow", "project", "tier_1", "project,tasks"],
|
|
249
|
+
["trello", "Trello", "workflow", "project", "tier_1", "project,tasks,atlassian"],
|
|
250
|
+
["monday", "monday.com", "workflow", "project", "tier_1", "project,tasks,ops"],
|
|
251
|
+
["clickup", "ClickUp", "workflow", "project", "tier_1", "project,tasks,ops"],
|
|
252
|
+
["basecamp", "Basecamp", "workflow", "project", "tier_2", "project,tasks"],
|
|
253
|
+
["zendesk", "Zendesk", "crm", "support", "tier_0", "support,tickets,customer-success"],
|
|
254
|
+
["intercom", "Intercom", "crm", "support", "tier_0", "support,chat,customer-success"],
|
|
255
|
+
["freshdesk", "Freshdesk", "crm", "support", "tier_1", "support,tickets"],
|
|
256
|
+
["helpscout", "Help Scout", "crm", "support", "tier_1", "support,tickets"],
|
|
257
|
+
["front", "Front", "email", "support", "tier_1", "support,email,shared-inbox"],
|
|
258
|
+
["gorgias", "Gorgias", "crm", "support", "tier_1", "support,ecommerce"],
|
|
259
|
+
["stripe", "Stripe", "workflow", "finance", "tier_0", "payments,billing,finance"],
|
|
260
|
+
["quickbooks", "QuickBooks", "workflow", "finance", "tier_0", "accounting,finance"],
|
|
261
|
+
["xero", "Xero", "workflow", "finance", "tier_1", "accounting,finance"],
|
|
262
|
+
["netsuite", "NetSuite", "workflow", "finance", "tier_1", "erp,finance,enterprise"],
|
|
263
|
+
["sage", "Sage", "workflow", "finance", "tier_2", "accounting,finance"],
|
|
264
|
+
["plaid", "Plaid", "workflow", "finance", "tier_1", "banking,finance"],
|
|
265
|
+
["shopify", "Shopify", "workflow", "commerce", "tier_0", "ecommerce,orders,commerce"],
|
|
266
|
+
["woocommerce", "WooCommerce", "workflow", "commerce", "tier_1", "ecommerce,orders,wordpress"],
|
|
267
|
+
["bigcommerce", "BigCommerce", "workflow", "commerce", "tier_1", "ecommerce,orders"],
|
|
268
|
+
["amazon-seller-central", "Amazon Seller Central", "workflow", "commerce", "tier_1", "marketplace,ecommerce"],
|
|
269
|
+
["ebay", "eBay", "workflow", "commerce", "tier_2", "marketplace,ecommerce"],
|
|
270
|
+
["etsy", "Etsy", "workflow", "commerce", "tier_2", "marketplace,ecommerce"],
|
|
271
|
+
["mailchimp", "Mailchimp", "workflow", "marketing", "tier_0", "email-marketing,marketing"],
|
|
272
|
+
["klaviyo", "Klaviyo", "workflow", "marketing", "tier_0", "email-marketing,ecommerce,marketing"],
|
|
273
|
+
["marketo", "Marketo", "workflow", "marketing", "tier_1", "marketing,enterprise"],
|
|
274
|
+
["braze", "Braze", "workflow", "marketing", "tier_1", "marketing,lifecycle"],
|
|
275
|
+
["customer-io", "Customer.io", "workflow", "marketing", "tier_1", "marketing,lifecycle"],
|
|
276
|
+
["sendgrid", "SendGrid", "email", "email", "tier_1", "email,transactional"],
|
|
277
|
+
["postmark", "Postmark", "email", "email", "tier_1", "email,transactional"],
|
|
278
|
+
["twilio", "Twilio", "chat", "chat", "tier_0", "sms,voice,communications"],
|
|
279
|
+
["discord", "Discord", "chat", "chat", "tier_1", "chat,community"],
|
|
280
|
+
["telegram", "Telegram", "chat", "chat", "tier_1", "chat,community"],
|
|
281
|
+
["whatsapp-business", "WhatsApp Business", "chat", "chat", "tier_1", "chat,meta,customer-comms"],
|
|
282
|
+
["facebook-pages", "Facebook Pages", "workflow", "marketing", "tier_1", "social,meta,marketing"],
|
|
283
|
+
["instagram-business", "Instagram Business", "workflow", "marketing", "tier_1", "social,meta,marketing"],
|
|
284
|
+
["linkedin", "LinkedIn", "workflow", "sales", "tier_1", "social,sales,gtm"],
|
|
285
|
+
["x-twitter", "X / Twitter", "workflow", "marketing", "tier_1", "social,marketing"],
|
|
286
|
+
["youtube", "YouTube", "storage", "storage", "tier_1", "video,content"],
|
|
287
|
+
["tiktok", "TikTok", "workflow", "marketing", "tier_2", "social,video,marketing"],
|
|
288
|
+
["google-analytics", "Google Analytics", "database", "analytics", "tier_0", "analytics,web,marketing"],
|
|
289
|
+
["mixpanel", "Mixpanel", "database", "analytics", "tier_1", "analytics,product"],
|
|
290
|
+
["amplitude", "Amplitude", "database", "analytics", "tier_1", "analytics,product"],
|
|
291
|
+
["segment", "Segment", "database", "analytics", "tier_1", "analytics,cdp"],
|
|
292
|
+
["snowflake", "Snowflake", "database", "database", "tier_0", "warehouse,data"],
|
|
293
|
+
["bigquery", "BigQuery", "database", "database", "tier_0", "warehouse,google,data"],
|
|
294
|
+
["redshift", "Redshift", "database", "database", "tier_1", "warehouse,aws,data"],
|
|
295
|
+
["postgres", "Postgres", "database", "database", "tier_0", "database,sql"],
|
|
296
|
+
["mysql", "MySQL", "database", "database", "tier_1", "database,sql"],
|
|
297
|
+
["mongodb", "MongoDB", "database", "database", "tier_1", "database,nosql"],
|
|
298
|
+
["supabase", "Supabase", "database", "database", "tier_1", "database,postgres"],
|
|
299
|
+
["firebase", "Firebase", "database", "database", "tier_1", "database,google,app"],
|
|
300
|
+
["redis", "Redis", "database", "database", "tier_2", "database,cache"],
|
|
301
|
+
["aws-s3", "Amazon S3", "storage", "storage", "tier_0", "files,aws,storage"],
|
|
302
|
+
["aws-lambda", "AWS Lambda", "workflow", "dev", "tier_1", "aws,serverless,dev"],
|
|
303
|
+
["aws-cloudwatch", "AWS CloudWatch", "database", "analytics", "tier_1", "aws,logs,observability"],
|
|
304
|
+
["google-cloud-storage", "Google Cloud Storage", "storage", "storage", "tier_1", "files,gcp,storage"],
|
|
305
|
+
["azure-blob-storage", "Azure Blob Storage", "storage", "storage", "tier_1", "files,azure,storage"],
|
|
306
|
+
["vercel", "Vercel", "workflow", "dev", "tier_1", "deployments,dev"],
|
|
307
|
+
["netlify", "Netlify", "workflow", "dev", "tier_2", "deployments,dev"],
|
|
308
|
+
["cloudflare", "Cloudflare", "workflow", "dev", "tier_1", "edge,dev,dns"],
|
|
309
|
+
["sentry", "Sentry", "workflow", "dev", "tier_1", "errors,observability,dev"],
|
|
310
|
+
["datadog", "Datadog", "database", "analytics", "tier_1", "observability,logs,metrics"],
|
|
311
|
+
["new-relic", "New Relic", "database", "analytics", "tier_2", "observability,logs,metrics"],
|
|
312
|
+
["pagerduty", "PagerDuty", "workflow", "project", "tier_1", "incident,on-call"],
|
|
313
|
+
["opsgenie", "Opsgenie", "workflow", "project", "tier_2", "incident,on-call,atlassian"],
|
|
314
|
+
["okta", "Okta", "internal", "workflow", "tier_1", "identity,security"],
|
|
315
|
+
["auth0", "Auth0", "internal", "workflow", "tier_1", "identity,security"],
|
|
316
|
+
["workday", "Workday", "workflow", "hr", "tier_1", "hr,finance,enterprise"],
|
|
317
|
+
["bamboohr", "BambooHR", "workflow", "hr", "tier_1", "hr,people"],
|
|
318
|
+
["greenhouse", "Greenhouse", "workflow", "hr", "tier_1", "recruiting,hr"],
|
|
319
|
+
["lever", "Lever", "workflow", "hr", "tier_1", "recruiting,hr"],
|
|
320
|
+
["gusto", "Gusto", "workflow", "hr", "tier_1", "payroll,hr"],
|
|
321
|
+
["rippling", "Rippling", "workflow", "hr", "tier_1", "hr,it,identity"],
|
|
322
|
+
["docusign", "DocuSign", "docs", "docs", "tier_1", "contracts,signature,legal"],
|
|
323
|
+
["pandadoc", "PandaDoc", "docs", "docs", "tier_1", "contracts,signature,sales"],
|
|
324
|
+
["hellosign", "Dropbox Sign", "docs", "docs", "tier_2", "contracts,signature"],
|
|
325
|
+
["clio", "Clio", "workflow", "project", "tier_1", "legal,practice-management"],
|
|
326
|
+
["ironclad", "Ironclad", "docs", "docs", "tier_1", "legal,contracts"],
|
|
327
|
+
["lexisnexis", "LexisNexis", "docs", "docs", "tier_2", "legal,research"],
|
|
328
|
+
["calendly", "Calendly", "calendar", "calendar", "tier_0", "scheduling,calendar"],
|
|
329
|
+
["cal-com", "Cal.com", "calendar", "calendar", "tier_1", "scheduling,calendar"],
|
|
330
|
+
["zoom", "Zoom", "calendar", "calendar", "tier_0", "meetings,video,calendar"],
|
|
331
|
+
["google-meet", "Google Meet", "calendar", "calendar", "tier_1", "meetings,google,video"],
|
|
332
|
+
["microsoft-graph", "Microsoft Graph", "internal", "workflow", "tier_0", "microsoft,enterprise,identity"],
|
|
333
|
+
["openai", "OpenAI", "workflow", "ai", "tier_0", "ai,llm"],
|
|
334
|
+
["anthropic", "Anthropic", "workflow", "ai", "tier_1", "ai,llm"],
|
|
335
|
+
["gemini", "Google Gemini", "workflow", "ai", "tier_1", "ai,llm,google"],
|
|
336
|
+
["huggingface", "Hugging Face", "workflow", "ai", "tier_1", "ai,models"],
|
|
337
|
+
["pinecone", "Pinecone", "database", "database", "tier_1", "vector,database,ai"],
|
|
338
|
+
["weaviate", "Weaviate", "database", "database", "tier_1", "vector,database,ai"],
|
|
339
|
+
["qdrant", "Qdrant", "database", "database", "tier_1", "vector,database,ai"],
|
|
340
|
+
["zapier", "Zapier", "workflow", "workflow", "tier_1", "automation,workflow"],
|
|
341
|
+
["make", "Make", "workflow", "workflow", "tier_1", "automation,workflow"],
|
|
342
|
+
["nango", "Nango", "workflow", "workflow", "tier_1", "integration-platform,oauth"],
|
|
343
|
+
["pipedream", "Pipedream", "workflow", "workflow", "tier_1", "integration-platform,workflow"],
|
|
344
|
+
["activepieces", "Activepieces", "workflow", "workflow", "tier_1", "automation,workflow,open-source"],
|
|
345
|
+
["webhook", "Generic Webhook", "webhook", "webhook", "tier_0", "webhook,http,events", "none"],
|
|
346
|
+
["http", "HTTP Request", "workflow", "webhook", "tier_0", "http,api,webhook", "none"],
|
|
347
|
+
["rss", "RSS", "webhook", "webhook", "tier_1", "feeds,content", "none"],
|
|
348
|
+
["zapier-transfer", "Zapier Transfer", "workflow", "workflow", "long_tail", "automation,migration"],
|
|
349
|
+
["typeform", "Typeform", "workflow", "marketing", "tier_1", "forms,marketing"],
|
|
350
|
+
["google-forms", "Google Forms", "workflow", "marketing", "tier_1", "forms,google"],
|
|
351
|
+
["jotform", "Jotform", "workflow", "marketing", "tier_2", "forms"],
|
|
352
|
+
["webflow", "Webflow", "workflow", "marketing", "tier_1", "cms,website"],
|
|
353
|
+
["wordpress", "WordPress", "workflow", "marketing", "tier_1", "cms,website"],
|
|
354
|
+
["contentful", "Contentful", "docs", "docs", "tier_1", "cms,content"],
|
|
355
|
+
["sanity", "Sanity", "docs", "docs", "tier_1", "cms,content"],
|
|
356
|
+
["figma", "Figma", "docs", "docs", "tier_0", "design,creative"],
|
|
357
|
+
["canva", "Canva", "docs", "docs", "tier_1", "design,creative"],
|
|
358
|
+
["adobe-creative-cloud", "Adobe Creative Cloud", "storage", "storage", "tier_1", "design,creative,files"],
|
|
359
|
+
["miro", "Miro", "docs", "docs", "tier_1", "whiteboard,collaboration"],
|
|
360
|
+
["figjam", "FigJam", "docs", "docs", "tier_2", "whiteboard,design"]
|
|
361
|
+
];
|
|
362
|
+
function listIntegrationCoverageSpecs() {
|
|
363
|
+
return COVERAGE_SPECS.map(([id, title, category, actionPack2, priority, domains, auth = "oauth2"]) => ({
|
|
364
|
+
id,
|
|
365
|
+
title,
|
|
366
|
+
category,
|
|
367
|
+
actionPack: actionPack2,
|
|
368
|
+
priority,
|
|
369
|
+
auth,
|
|
370
|
+
providerKinds: providerKindsFor(auth),
|
|
371
|
+
domains: domains.split(",").map((domain) => domain.trim()).filter(Boolean),
|
|
372
|
+
scopes: scopesFor(id, actionPack2)
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
function buildIntegrationCoverageConnectors(options = {}) {
|
|
376
|
+
const providerId = options.providerId ?? "coverage";
|
|
377
|
+
return listIntegrationCoverageSpecs().filter((spec) => !options.priorities || options.priorities.includes(spec.priority)).filter((spec) => !options.categories || options.categories.includes(spec.category)).filter((spec) => !options.actionPacks || options.actionPacks.includes(spec.actionPack)).map((spec) => specToConnector(spec, providerId));
|
|
378
|
+
}
|
|
379
|
+
function integrationCoverageChecklistMarkdown() {
|
|
380
|
+
const specs = listIntegrationCoverageSpecs();
|
|
381
|
+
const lines = [
|
|
382
|
+
"# Agent Integrations Coverage Checklist",
|
|
383
|
+
"",
|
|
384
|
+
"Generated from `listIntegrationCoverageSpecs()`. Catalog presence means the product can plan/request/connect the integration; executable first-party adapters are promoted separately behind the same provider contract.",
|
|
385
|
+
"",
|
|
386
|
+
"## Summary",
|
|
387
|
+
"",
|
|
388
|
+
`- Total cataloged integrations: ${specs.length}`,
|
|
389
|
+
`- Tier 0: ${specs.filter((spec) => spec.priority === "tier_0").length}`,
|
|
390
|
+
`- Tier 1: ${specs.filter((spec) => spec.priority === "tier_1").length}`,
|
|
391
|
+
`- Tier 2: ${specs.filter((spec) => spec.priority === "tier_2").length}`,
|
|
392
|
+
`- Long tail: ${specs.filter((spec) => spec.priority === "long_tail").length}`,
|
|
393
|
+
"",
|
|
394
|
+
"## Checklist",
|
|
395
|
+
""
|
|
396
|
+
];
|
|
397
|
+
for (const spec of specs) {
|
|
398
|
+
lines.push(`- [ ] ${spec.priority} / ${spec.category} / ${spec.title} (${spec.id}) - ${spec.domains.join(", ")}`);
|
|
399
|
+
}
|
|
400
|
+
return `${lines.join("\n")}
|
|
401
|
+
`;
|
|
402
|
+
}
|
|
403
|
+
function specToConnector(spec, providerId) {
|
|
404
|
+
const actions = actionPack(spec.actionPack, spec.scopes ?? []);
|
|
405
|
+
return {
|
|
406
|
+
id: spec.id,
|
|
407
|
+
providerId,
|
|
408
|
+
title: spec.title,
|
|
409
|
+
category: spec.category,
|
|
410
|
+
auth: spec.auth,
|
|
411
|
+
scopes: spec.scopes ?? [],
|
|
412
|
+
actions,
|
|
413
|
+
triggers: triggersFor(spec.actionPack, spec.scopes ?? []),
|
|
414
|
+
metadata: {
|
|
415
|
+
source: "coverage-catalog",
|
|
416
|
+
priority: spec.priority,
|
|
417
|
+
domains: spec.domains,
|
|
418
|
+
providerKinds: spec.providerKinds,
|
|
419
|
+
executable: false
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function actionPack(pack, scopes) {
|
|
424
|
+
const readScope = scopes.find((scope2) => scope2.endsWith(".read")) ?? scopes[0];
|
|
425
|
+
const writeScope = scopes.find((scope2) => scope2.endsWith(".write")) ?? scopes[1] ?? readScope;
|
|
426
|
+
const scope = (value) => value ? [value] : [];
|
|
427
|
+
const read = (id, title, description) => ({
|
|
428
|
+
id,
|
|
429
|
+
title,
|
|
430
|
+
description,
|
|
431
|
+
risk: "read",
|
|
432
|
+
requiredScopes: scope(readScope),
|
|
433
|
+
dataClass: dataClassFor(pack),
|
|
434
|
+
inputSchema: objectSchema()
|
|
435
|
+
});
|
|
436
|
+
const write = (id, title, description) => ({
|
|
437
|
+
id,
|
|
438
|
+
title,
|
|
439
|
+
description,
|
|
440
|
+
risk: "write",
|
|
441
|
+
requiredScopes: scope(writeScope),
|
|
442
|
+
dataClass: dataClassFor(pack),
|
|
443
|
+
approvalRequired: true,
|
|
444
|
+
inputSchema: objectSchema()
|
|
445
|
+
});
|
|
446
|
+
const destructive = (id, title, description) => ({
|
|
447
|
+
id,
|
|
448
|
+
title,
|
|
449
|
+
description,
|
|
450
|
+
risk: "destructive",
|
|
451
|
+
requiredScopes: scope(writeScope),
|
|
452
|
+
dataClass: dataClassFor(pack),
|
|
453
|
+
approvalRequired: true,
|
|
454
|
+
inputSchema: objectSchema()
|
|
455
|
+
});
|
|
456
|
+
switch (pack) {
|
|
457
|
+
case "email":
|
|
458
|
+
return [read("messages.search", "Search messages", "Search messages and threads."), read("messages.read", "Read message", "Read a message by id."), write("drafts.create", "Create draft", "Create an email draft."), write("messages.send", "Send message", "Send or reply to an email message.")];
|
|
459
|
+
case "calendar":
|
|
460
|
+
return [read("events.search", "Search events", "Search calendar events."), read("availability.read", "Read availability", "Read availability windows."), write("events.create", "Create event", "Create a calendar event."), write("events.update", "Update event", "Update a calendar event."), destructive("events.cancel", "Cancel event", "Cancel a calendar event.")];
|
|
461
|
+
case "chat":
|
|
462
|
+
return [read("messages.search", "Search messages", "Search channel or direct messages."), read("channels.list", "List channels", "List channels or rooms."), write("messages.post", "Send message", "Send a message to a channel or direct message."), write("threads.reply", "Reply in thread", "Reply to a thread or conversation.")];
|
|
463
|
+
case "crm":
|
|
464
|
+
return [read("records.search", "Search records", "Search contacts, companies, and deals."), read("records.read", "Read record", "Read a CRM record."), write("records.upsert", "Upsert record", "Create or update a CRM record."), write("notes.create", "Create note", "Add a note or activity.")];
|
|
465
|
+
case "storage":
|
|
466
|
+
return [read("files.search", "Search files", "Search files and folders."), read("files.read", "Read file", "Read file metadata or content."), write("files.upload", "Upload file", "Upload a file."), write("files.update", "Update file", "Update file metadata or content.")];
|
|
467
|
+
case "docs":
|
|
468
|
+
return [read("documents.search", "Search documents", "Search documents or pages."), read("documents.read", "Read document", "Read a document."), write("documents.create", "Create document", "Create a document or page."), write("documents.update", "Update document", "Update a document or page.")];
|
|
469
|
+
case "database":
|
|
470
|
+
return [read("records.query", "Query records", "Query rows, records, or objects."), read("records.read", "Read record", "Read one row, record, or object."), write("records.upsert", "Upsert record", "Create or update a row, record, or object."), destructive("records.delete", "Delete record", "Delete a row, record, or object.")];
|
|
471
|
+
case "project":
|
|
472
|
+
return [read("tasks.search", "Search tasks", "Search tasks, tickets, or issues."), read("tasks.read", "Read task", "Read a task, ticket, or issue."), write("tasks.create", "Create task", "Create a task, ticket, or issue."), write("tasks.update", "Update task", "Update a task, ticket, or issue.")];
|
|
473
|
+
case "support":
|
|
474
|
+
return [read("tickets.search", "Search tickets", "Search support tickets or conversations."), read("customers.read", "Read customer", "Read a customer profile."), write("tickets.reply", "Reply to ticket", "Reply to a support ticket."), write("tickets.update", "Update ticket", "Update ticket status, tags, or assignee.")];
|
|
475
|
+
case "marketing":
|
|
476
|
+
return [read("contacts.search", "Search contacts", "Search marketing contacts or audiences."), read("campaigns.read", "Read campaign", "Read campaign metadata and performance."), write("contacts.upsert", "Upsert contact", "Create or update a contact."), write("campaigns.create", "Create campaign", "Create a campaign draft.")];
|
|
477
|
+
case "sales":
|
|
478
|
+
return [read("prospects.search", "Search prospects", "Search prospects, leads, or accounts."), read("activities.read", "Read activities", "Read sales activity history."), write("prospects.upsert", "Upsert prospect", "Create or update a prospect."), write("sequence.enqueue", "Enroll in sequence", "Enroll a prospect in a sales sequence.")];
|
|
479
|
+
case "commerce":
|
|
480
|
+
return [read("orders.search", "Search orders", "Search orders."), read("customers.read", "Read customer", "Read customer and purchase history."), write("orders.update", "Update order", "Update order metadata or fulfillment state."), write("products.update", "Update product", "Update product metadata.")];
|
|
481
|
+
case "finance":
|
|
482
|
+
return [read("transactions.search", "Search transactions", "Search transactions, invoices, or payments."), read("accounts.read", "Read account", "Read account or customer financial record."), write("invoices.create", "Create invoice", "Create an invoice or payment object."), write("records.sync", "Sync record", "Sync a finance or accounting record.")];
|
|
483
|
+
case "hr":
|
|
484
|
+
return [read("people.search", "Search people", "Search employees, candidates, or contractors."), read("people.read", "Read person", "Read a person profile."), write("people.update", "Update person", "Update a person profile."), write("events.create", "Create HR event", "Create a recruiting or HR event.")];
|
|
485
|
+
case "dev":
|
|
486
|
+
return [read("resources.search", "Search resources", "Search issues, repos, deployments, logs, or incidents."), read("resources.read", "Read resource", "Read a developer resource."), write("resources.create", "Create resource", "Create an issue, deployment, incident, or config."), write("resources.update", "Update resource", "Update a developer resource.")];
|
|
487
|
+
case "ai":
|
|
488
|
+
return [read("models.list", "List models", "List available models or endpoints."), write("responses.create", "Create response", "Create an AI response or job."), write("embeddings.create", "Create embeddings", "Create embeddings or vector jobs."), read("usage.read", "Read usage", "Read usage metadata.")];
|
|
489
|
+
case "analytics":
|
|
490
|
+
return [read("reports.query", "Query reports", "Query analytics reports."), read("events.search", "Search events", "Search analytics events."), write("events.track", "Track event", "Track an analytics event."), write("audiences.sync", "Sync audience", "Sync an audience or cohort.")];
|
|
491
|
+
case "workflow":
|
|
492
|
+
return [read("runs.search", "Search runs", "Search workflow runs or jobs."), read("templates.list", "List templates", "List workflow templates."), write("runs.start", "Start run", "Start a workflow run."), write("webhooks.dispatch", "Dispatch webhook", "Dispatch a workflow webhook.")];
|
|
493
|
+
case "webhook":
|
|
494
|
+
return [write("requests.send", "Send request", "Send an HTTP request or webhook event."), read("events.search", "Search events", "Search received webhook events."), write("subscriptions.create", "Create subscription", "Create a webhook subscription."), destructive("subscriptions.delete", "Delete subscription", "Delete a webhook subscription.")];
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
function triggersFor(pack, scopes) {
|
|
498
|
+
const readScope = scopes.find((scope) => scope.endsWith(".read")) ?? scopes[0];
|
|
499
|
+
const requiredScopes = readScope ? [readScope] : [];
|
|
500
|
+
if (pack === "email") return [{ id: "message.received", title: "Message received", requiredScopes, dataClass: "private" }];
|
|
501
|
+
if (pack === "calendar") return [{ id: "event.changed", title: "Event changed", requiredScopes, dataClass: "private" }];
|
|
502
|
+
if (pack === "chat") return [{ id: "message.posted", title: "Message posted", requiredScopes, dataClass: "private" }];
|
|
503
|
+
if (pack === "crm") return [{ id: "record.changed", title: "Record changed", requiredScopes, dataClass: "private" }];
|
|
504
|
+
if (pack === "support") return [{ id: "ticket.changed", title: "Ticket changed", requiredScopes, dataClass: "private" }];
|
|
505
|
+
if (pack === "commerce") return [{ id: "order.changed", title: "Order changed", requiredScopes, dataClass: "sensitive" }];
|
|
506
|
+
if (pack === "finance") return [{ id: "transaction.changed", title: "Transaction changed", requiredScopes, dataClass: "sensitive" }];
|
|
507
|
+
if (pack === "workflow" || pack === "webhook") return [{ id: "event.received", title: "Event received", requiredScopes, dataClass: "internal" }];
|
|
508
|
+
return void 0;
|
|
509
|
+
}
|
|
510
|
+
function scopesFor(id, pack) {
|
|
511
|
+
if (pack === "webhook") return [];
|
|
512
|
+
return [`${id}.read`, `${id}.write`];
|
|
513
|
+
}
|
|
514
|
+
function providerKindsFor(auth) {
|
|
515
|
+
if (auth === "none") return ["first_party", "pipedream", "activepieces", "custom"];
|
|
516
|
+
return DEFAULT_PROVIDER_KINDS;
|
|
517
|
+
}
|
|
518
|
+
function dataClassFor(pack) {
|
|
519
|
+
if (pack === "finance" || pack === "commerce" || pack === "hr") return "sensitive";
|
|
520
|
+
if (pack === "workflow" || pack === "webhook" || pack === "dev" || pack === "analytics") return "internal";
|
|
521
|
+
return "private";
|
|
522
|
+
}
|
|
523
|
+
function objectSchema() {
|
|
524
|
+
return { type: "object", additionalProperties: true, properties: {} };
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// src/specs/overrides.ts
|
|
528
|
+
var INTEGRATION_OVERRIDES = {
|
|
529
|
+
// ── Stripe pack ────────────────────────────────────────────────────
|
|
530
|
+
// Stripe issues two key types: secret keys (sk_*) and restricted keys
|
|
531
|
+
// (rk_*). For voice-agent workloads, restricted keys are the right call
|
|
532
|
+
// — least-privilege scoped to the specific resources the agent can
|
|
533
|
+
// touch. The hint nudges operators toward that path.
|
|
534
|
+
"stripe-pack": {
|
|
535
|
+
consoleUrl: "https://dashboard.stripe.com/apikeys",
|
|
536
|
+
credentialFields: [
|
|
537
|
+
{
|
|
538
|
+
label: "Stripe secret key",
|
|
539
|
+
description: "Restricted key recommended. Dashboard \u2192 Developers \u2192 API keys \u2192 Create restricted key. Grant write access on Customers, Invoices, and Checkout Sessions.",
|
|
540
|
+
example: "sk_live_\u2026 or rk_live_\u2026 (use sk_test_\u2026 / rk_test_\u2026 for staging)",
|
|
541
|
+
regex: "^(sk|rk)_(live|test)_[A-Za-z0-9]+$",
|
|
542
|
+
secret: true
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
consoleSteps: [
|
|
546
|
+
{
|
|
547
|
+
id: "open-keys",
|
|
548
|
+
title: "Open Stripe API keys",
|
|
549
|
+
detail: "Visit https://dashboard.stripe.com/apikeys",
|
|
550
|
+
copyValue: "https://dashboard.stripe.com/apikeys"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
id: "create-restricted",
|
|
554
|
+
title: "Create a restricted key",
|
|
555
|
+
detail: 'Click "Create restricted key". Name it something descriptive (e.g. "ph0ny voice agent \u2014 prod"). Grant WRITE on Customers, Invoices, and Checkout Sessions. Leave everything else NONE.'
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: "paste",
|
|
559
|
+
title: "Paste the key",
|
|
560
|
+
detail: "Copy the key Stripe shows once (rk_live_\u2026 or sk_live_\u2026). Paste it into ph0ny. The key is sealed before persistence."
|
|
561
|
+
}
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
// ── Twilio SMS ─────────────────────────────────────────────────────
|
|
565
|
+
// Twilio's REST API uses Basic auth with two parts: Account SID
|
|
566
|
+
// (public-ish, AC…) + Auth Token (secret). The default api-key family
|
|
567
|
+
// only exposes one field, which doesn't fit. Providing both fields
|
|
568
|
+
// explicitly lets the consumer's UI render two inputs.
|
|
569
|
+
"twilio-sms": {
|
|
570
|
+
consoleUrl: "https://console.twilio.com/",
|
|
571
|
+
credentialFields: [
|
|
572
|
+
{
|
|
573
|
+
label: "Account SID",
|
|
574
|
+
description: "Your Twilio Account SID. Console \u2192 Account \u2192 API keys & tokens.",
|
|
575
|
+
example: "AC\u2026 (34 hex chars)",
|
|
576
|
+
regex: "^AC[a-f0-9]{32}$",
|
|
577
|
+
secret: false
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
label: "Auth Token",
|
|
581
|
+
description: "Your Twilio Auth Token (or Standard API Key secret). Use a non-primary auth token in production so rotating it won't break other Twilio integrations.",
|
|
582
|
+
secret: true
|
|
583
|
+
}
|
|
584
|
+
],
|
|
585
|
+
consoleSteps: [
|
|
586
|
+
{
|
|
587
|
+
id: "open",
|
|
588
|
+
title: "Open Twilio console",
|
|
589
|
+
detail: "Visit https://console.twilio.com/",
|
|
590
|
+
copyValue: "https://console.twilio.com/"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "find",
|
|
594
|
+
title: "Find your Account SID + Auth Token",
|
|
595
|
+
detail: "Account info is on the dashboard home. For better security, create a Standard API Key (Account \u2192 API keys & tokens \u2192 Create API Key) and use the SID + Secret pair instead of the primary auth token."
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
id: "paste",
|
|
599
|
+
title: "Paste both values",
|
|
600
|
+
detail: "Account SID is non-secret; Auth Token is sealed before persistence."
|
|
601
|
+
}
|
|
602
|
+
],
|
|
603
|
+
knownQuirks: [
|
|
604
|
+
{
|
|
605
|
+
id: "subaccount-tokens",
|
|
606
|
+
severity: "info",
|
|
607
|
+
message: "If you use Twilio subaccounts, paste the SID/Token of the subaccount that owns the phone numbers your agent calls \u2014 not the master account."
|
|
608
|
+
}
|
|
609
|
+
]
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
function getIntegrationOverride(kind) {
|
|
613
|
+
return INTEGRATION_OVERRIDES[kind];
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// src/specs/registry.ts
|
|
617
|
+
var EXECUTABLE_KINDS = /* @__PURE__ */ new Set([
|
|
618
|
+
"google-calendar",
|
|
619
|
+
"google-sheets",
|
|
620
|
+
"outlook-calendar",
|
|
621
|
+
"microsoft-calendar",
|
|
622
|
+
"slack",
|
|
623
|
+
"hubspot",
|
|
624
|
+
"notion",
|
|
625
|
+
"notion-database",
|
|
626
|
+
"salesforce",
|
|
627
|
+
"github",
|
|
628
|
+
"gitlab",
|
|
629
|
+
"airtable",
|
|
630
|
+
"asana",
|
|
631
|
+
"stripe",
|
|
632
|
+
"stripe-pack",
|
|
633
|
+
"twilio",
|
|
634
|
+
"twilio-sms",
|
|
635
|
+
"webhook"
|
|
636
|
+
]);
|
|
637
|
+
var KIND_ALIASES = {
|
|
638
|
+
"outlook-calendar": "microsoft-calendar",
|
|
639
|
+
notion: "notion-database",
|
|
640
|
+
stripe: "stripe-pack",
|
|
641
|
+
twilio: "twilio-sms"
|
|
642
|
+
};
|
|
643
|
+
function listIntegrationSpecs() {
|
|
644
|
+
const connectors = new Map(buildIntegrationCoverageConnectors({ providerId: "spec" }).map((c) => [c.id, c]));
|
|
645
|
+
return listIntegrationCoverageSpecs().map((coverage) => {
|
|
646
|
+
const connector = connectors.get(coverage.id);
|
|
647
|
+
if (!connector) throw new Error(`missing coverage connector for ${coverage.id}`);
|
|
648
|
+
return specFromCoverage(coverage, connector);
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
function getIntegrationSpec(kind) {
|
|
652
|
+
const canonical = KIND_ALIASES[kind] ?? kind;
|
|
653
|
+
return listIntegrationSpecs().find((spec) => spec.kind === canonical || KIND_ALIASES[spec.kind] === canonical);
|
|
654
|
+
}
|
|
655
|
+
function listExecutableIntegrationSpecs() {
|
|
656
|
+
return listIntegrationSpecs().filter((spec) => spec.status === "executable");
|
|
657
|
+
}
|
|
658
|
+
function integrationSpecToConnector(spec, providerId = "spec") {
|
|
659
|
+
return {
|
|
660
|
+
id: spec.kind,
|
|
661
|
+
providerId,
|
|
662
|
+
title: spec.title,
|
|
663
|
+
category: spec.category,
|
|
664
|
+
auth: spec.auth.mode === "api_key" ? "api_key" : spec.auth.mode === "oauth2" ? "oauth2" : spec.auth.mode === "none" ? "none" : "custom",
|
|
665
|
+
scopes: spec.permissions.flatMap((permission) => permission.providerScopes),
|
|
666
|
+
actions: spec.actions,
|
|
667
|
+
triggers: spec.triggers,
|
|
668
|
+
metadata: {
|
|
669
|
+
...spec.metadata ?? {},
|
|
670
|
+
source: "integration-spec",
|
|
671
|
+
status: spec.status,
|
|
672
|
+
family: spec.family,
|
|
673
|
+
plannerHints: spec.plannerHints
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function specFromCoverage(coverage, connector) {
|
|
678
|
+
const kind = KIND_ALIASES[coverage.id] ?? coverage.id;
|
|
679
|
+
const family = familyFor(coverage);
|
|
680
|
+
const familySpec = getIntegrationFamily(family);
|
|
681
|
+
const permissions = permissionsFor(coverage, connector.actions);
|
|
682
|
+
const auth = authFor(coverage, family, permissions);
|
|
683
|
+
const status = statusFor(kind);
|
|
684
|
+
const override = getIntegrationOverride(kind) ?? getIntegrationOverride(coverage.id);
|
|
685
|
+
const knownQuirks = override?.knownQuirks ? [...familySpec.knownQuirks ?? [], ...override.knownQuirks] : familySpec.knownQuirks;
|
|
686
|
+
return {
|
|
687
|
+
kind,
|
|
688
|
+
title: connector.title,
|
|
689
|
+
category: connector.category,
|
|
690
|
+
status,
|
|
691
|
+
family,
|
|
692
|
+
auth,
|
|
693
|
+
permissions,
|
|
694
|
+
actions: connector.actions,
|
|
695
|
+
triggers: connector.triggers,
|
|
696
|
+
setup: {
|
|
697
|
+
consoleUrl: override?.consoleUrl ?? familySpec.consoleUrl,
|
|
698
|
+
consoleSteps: override?.consoleSteps ?? familySpec.consoleSteps,
|
|
699
|
+
credentialFields: override?.credentialFields ?? credentialFieldsFor(auth),
|
|
700
|
+
redirectUriTemplate: auth.mode === "oauth2" ? auth.redirectUriTemplate : familySpec.redirectUriTemplate,
|
|
701
|
+
knownQuirks,
|
|
702
|
+
postSetup: override?.postSetup,
|
|
703
|
+
healthcheck: override?.healthcheck ?? healthcheckFor(kind, status, auth)
|
|
704
|
+
},
|
|
705
|
+
lifecycle: familySpec.lifecycle,
|
|
706
|
+
plannerHints: plannerHintsFor(coverage, connector.actions),
|
|
707
|
+
metadata: { priority: coverage.priority, domains: coverage.domains }
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function familyFor(spec) {
|
|
711
|
+
if (hmacKinds.has(spec.id)) return "hmac";
|
|
712
|
+
if (spec.auth === "none") return "none";
|
|
713
|
+
if (spec.id.startsWith("google-") || spec.domains.includes("google")) return "google";
|
|
714
|
+
if (spec.id.startsWith("microsoft-") || ["outlook-mail", "outlook-calendar", "onedrive", "sharepoint"].includes(spec.id)) return "microsoft-graph";
|
|
715
|
+
if (["jira", "confluence", "trello", "bitbucket"].includes(spec.id)) return "atlassian";
|
|
716
|
+
if (spec.id === "salesforce") return "salesforce";
|
|
717
|
+
if (spec.id === "hubspot") return "hubspot";
|
|
718
|
+
if (spec.id === "slack") return "slack";
|
|
719
|
+
if (spec.id === "notion") return "notion";
|
|
720
|
+
if (apiKeyKinds.has(spec.id)) return "api-key";
|
|
721
|
+
return "standard-oauth2";
|
|
722
|
+
}
|
|
723
|
+
var apiKeyKinds = /* @__PURE__ */ new Set(["github", "gitlab", "airtable", "asana", "stripe", "twilio", "sendgrid", "postmark"]);
|
|
724
|
+
var hmacKinds = /* @__PURE__ */ new Set(["webhook"]);
|
|
725
|
+
function authFor(spec, family, permissions) {
|
|
726
|
+
const f = INTEGRATION_FAMILIES[family];
|
|
727
|
+
if (family === "none") return { mode: "none" };
|
|
728
|
+
if (family === "hmac") {
|
|
729
|
+
return { mode: "hmac", credential: f.credentialFields[0], signatureHeader: `${spec.id}-signature` };
|
|
730
|
+
}
|
|
731
|
+
if (family === "api-key") {
|
|
732
|
+
return { mode: "api_key", credential: apiKeyFieldFor(spec.id), placement: apiKeyPlacementFor(spec.id) };
|
|
733
|
+
}
|
|
734
|
+
const scopes = permissions.flatMap(
|
|
735
|
+
(permission) => permission.providerScopes.map((providerScope) => ({
|
|
736
|
+
normalized: permission.normalized,
|
|
737
|
+
providerScope,
|
|
738
|
+
title: permission.title,
|
|
739
|
+
reason: permission.reason,
|
|
740
|
+
risk: permission.risk,
|
|
741
|
+
dataClass: permission.dataClass
|
|
742
|
+
}))
|
|
743
|
+
);
|
|
744
|
+
return {
|
|
745
|
+
mode: "oauth2",
|
|
746
|
+
authorizationUrl: f.authorizationUrl ?? `https://example.invalid/${spec.id}/authorize`,
|
|
747
|
+
tokenUrl: f.tokenUrl ?? `https://example.invalid/${spec.id}/token`,
|
|
748
|
+
clientIdEnv: f.credentialFields.find((field) => !field.secret)?.env,
|
|
749
|
+
clientSecretEnv: f.credentialFields.find((field) => field.secret)?.env,
|
|
750
|
+
scopes,
|
|
751
|
+
extraAuthParams: extraAuthParamsFor(family),
|
|
752
|
+
redirectUriTemplate: (f.redirectUriTemplate ?? "https://{host}/api/integrations/oauth/{kind}/callback").replace("{kind}", spec.id),
|
|
753
|
+
pkce: family === "google" || family === "microsoft-graph" ? "supported" : "unsupported"
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
function credentialFieldsFor(auth) {
|
|
757
|
+
if (auth.mode === "api_key" || auth.mode === "hmac") return [auth.credential];
|
|
758
|
+
if (auth.mode === "oauth2") {
|
|
759
|
+
return [
|
|
760
|
+
{ label: "Client ID", env: auth.clientIdEnv, description: "OAuth client ID.", secret: false },
|
|
761
|
+
{ label: "Client Secret", env: auth.clientSecretEnv, description: "OAuth client secret.", secret: true }
|
|
762
|
+
];
|
|
763
|
+
}
|
|
764
|
+
return [];
|
|
765
|
+
}
|
|
766
|
+
function permissionsFor(spec, actions) {
|
|
767
|
+
const dataClass = dataClassFor2(actions);
|
|
768
|
+
const readScope = providerScopeFor(spec, "read");
|
|
769
|
+
const writeScope = providerScopeFor(spec, "write");
|
|
770
|
+
const permissions = [
|
|
771
|
+
{
|
|
772
|
+
normalized: `${spec.actionPack}.read`,
|
|
773
|
+
providerScopes: readScope ? [readScope] : [],
|
|
774
|
+
title: `${spec.title} read`,
|
|
775
|
+
risk: "read",
|
|
776
|
+
dataClass,
|
|
777
|
+
reason: `Read ${spec.title} data for user-authorized agent workflows.`
|
|
778
|
+
}
|
|
779
|
+
];
|
|
780
|
+
if (actions.some((a) => a.risk !== "read")) {
|
|
781
|
+
permissions.push({
|
|
782
|
+
normalized: `${spec.actionPack}.write`,
|
|
783
|
+
providerScopes: writeScope ? [writeScope] : [],
|
|
784
|
+
title: `${spec.title} write`,
|
|
785
|
+
risk: "write",
|
|
786
|
+
dataClass,
|
|
787
|
+
reason: `Create or update ${spec.title} resources after policy approval.`
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
return permissions;
|
|
791
|
+
}
|
|
792
|
+
function providerScopeFor(spec, mode) {
|
|
793
|
+
const explicit = explicitScopes[spec.id]?.[mode];
|
|
794
|
+
if (explicit) return explicit;
|
|
795
|
+
if (spec.auth === "none") return "";
|
|
796
|
+
return `${spec.id}.${mode}`;
|
|
797
|
+
}
|
|
798
|
+
var explicitScopes = {
|
|
799
|
+
gmail: { read: "https://www.googleapis.com/auth/gmail.readonly", write: "https://www.googleapis.com/auth/gmail.modify" },
|
|
800
|
+
"google-calendar": { read: "https://www.googleapis.com/auth/calendar.readonly", write: "https://www.googleapis.com/auth/calendar" },
|
|
801
|
+
"google-sheets": { read: "https://www.googleapis.com/auth/spreadsheets.readonly", write: "https://www.googleapis.com/auth/spreadsheets" },
|
|
802
|
+
"google-drive": { read: "https://www.googleapis.com/auth/drive.readonly", write: "https://www.googleapis.com/auth/drive.file" },
|
|
803
|
+
"google-docs": { read: "https://www.googleapis.com/auth/documents.readonly", write: "https://www.googleapis.com/auth/documents" },
|
|
804
|
+
"outlook-mail": { read: "Mail.Read", write: "Mail.Send" },
|
|
805
|
+
"outlook-calendar": { read: "Calendars.Read", write: "Calendars.ReadWrite" },
|
|
806
|
+
"microsoft-teams": { read: "ChannelMessage.Read.All", write: "ChannelMessage.Send" },
|
|
807
|
+
onedrive: { read: "Files.Read", write: "Files.ReadWrite" },
|
|
808
|
+
sharepoint: { read: "Sites.Read.All", write: "Sites.ReadWrite.All" },
|
|
809
|
+
slack: { read: "channels:read", write: "chat:write" },
|
|
810
|
+
hubspot: { read: "crm.objects.contacts.read", write: "crm.objects.contacts.write" },
|
|
811
|
+
salesforce: { read: "api", write: "api" },
|
|
812
|
+
notion: { read: "", write: "" },
|
|
813
|
+
github: { read: "repo:read", write: "repo" },
|
|
814
|
+
gitlab: { read: "read_api", write: "api" },
|
|
815
|
+
airtable: { read: "data.records:read", write: "data.records:write" },
|
|
816
|
+
asana: { read: "default", write: "default" },
|
|
817
|
+
stripe: { read: "read_only", write: "standard" },
|
|
818
|
+
twilio: { read: "api_key", write: "api_key" }
|
|
819
|
+
};
|
|
820
|
+
function plannerHintsFor(spec, actions) {
|
|
821
|
+
return {
|
|
822
|
+
useFor: spec.domains.map((domain) => domain.replace(/-/g, " ")),
|
|
823
|
+
dataFreshness: ["calendar", "chat", "commerce", "finance", "support"].includes(spec.actionPack) ? "near_realtime" : "eventual",
|
|
824
|
+
writeRisk: actions.some((a) => a.risk === "destructive") ? "high" : actions.some((a) => a.risk === "write") ? "medium" : "low"
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
function healthcheckFor(kind, status, auth) {
|
|
828
|
+
if (status !== "executable") {
|
|
829
|
+
return { id: `${kind}.static`, level: "static", description: "Catalog-only integration; no executable connector healthcheck is available yet." };
|
|
830
|
+
}
|
|
831
|
+
if (auth.mode === "oauth2") {
|
|
832
|
+
return { id: `${kind}.connection`, level: "connection", description: "Validate a user connection by calling the connector test endpoint." };
|
|
833
|
+
}
|
|
834
|
+
if (auth.mode === "api_key") {
|
|
835
|
+
return { id: `${kind}.connection`, level: "connection", description: "Validate API credentials by calling the connector test endpoint." };
|
|
836
|
+
}
|
|
837
|
+
if (auth.mode === "hmac") {
|
|
838
|
+
return { id: `${kind}.webhook`, level: "webhook", description: "Validate webhook signing configuration with a signed test payload." };
|
|
839
|
+
}
|
|
840
|
+
return { id: `${kind}.static`, level: "static", description: "No credentials are required." };
|
|
841
|
+
}
|
|
842
|
+
function statusFor(kind) {
|
|
843
|
+
return EXECUTABLE_KINDS.has(kind) ? "executable" : "catalog";
|
|
844
|
+
}
|
|
845
|
+
function dataClassFor2(actions) {
|
|
846
|
+
if (actions.some((a) => a.dataClass === "secret")) return "secret";
|
|
847
|
+
if (actions.some((a) => a.dataClass === "sensitive")) return "sensitive";
|
|
848
|
+
if (actions.some((a) => a.dataClass === "private")) return "private";
|
|
849
|
+
if (actions.some((a) => a.dataClass === "internal")) return "internal";
|
|
850
|
+
return "public";
|
|
851
|
+
}
|
|
852
|
+
function apiKeyFieldFor(kind) {
|
|
853
|
+
return {
|
|
854
|
+
label: `${kind} API key`,
|
|
855
|
+
description: `API key or token for ${kind}.`,
|
|
856
|
+
example: kind === "stripe" ? "sk_live_..." : void 0,
|
|
857
|
+
secret: true
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function apiKeyPlacementFor(kind) {
|
|
861
|
+
if (kind === "gitlab") return "header";
|
|
862
|
+
return "bearer";
|
|
863
|
+
}
|
|
864
|
+
function extraAuthParamsFor(family) {
|
|
865
|
+
if (family === "google") return { access_type: "offline", prompt: "consent", include_granted_scopes: "true" };
|
|
866
|
+
if (family === "notion") return { owner: "user" };
|
|
867
|
+
return void 0;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// src/specs/renderers.ts
|
|
871
|
+
function renderConsoleSteps(spec, options) {
|
|
872
|
+
const redirectUri = renderRedirectUri(spec, options);
|
|
873
|
+
return spec.setup.consoleSteps.map((step) => ({
|
|
874
|
+
...step,
|
|
875
|
+
detail: renderTemplate(step.detail, spec, options, redirectUri),
|
|
876
|
+
copyValue: step.copyValue ? renderTemplate(step.copyValue, spec, options, redirectUri) : void 0
|
|
877
|
+
}));
|
|
878
|
+
}
|
|
879
|
+
function renderRunbookMarkdown(spec, options) {
|
|
880
|
+
const steps = renderConsoleSteps(spec, options);
|
|
881
|
+
const lines = [
|
|
882
|
+
`# ${spec.title} Integration Setup`,
|
|
883
|
+
"",
|
|
884
|
+
`- Kind: \`${spec.kind}\``,
|
|
885
|
+
`- Status: \`${spec.status}\``,
|
|
886
|
+
`- Auth: \`${spec.auth.mode}\``,
|
|
887
|
+
`- Family: \`${spec.family}\``
|
|
888
|
+
];
|
|
889
|
+
if (spec.setup.consoleUrl) lines.push(`- Console: ${spec.setup.consoleUrl}`);
|
|
890
|
+
if (spec.setup.redirectUriTemplate) lines.push(`- Redirect URI: \`${renderRedirectUri(spec, options)}\``);
|
|
891
|
+
lines.push("", "## Credentials", "");
|
|
892
|
+
for (const field of spec.setup.credentialFields) {
|
|
893
|
+
lines.push(`- ${field.secret ? "[secret] " : ""}${field.label}${field.env ? ` (\`${field.env}\`)` : ""}: ${field.description}`);
|
|
894
|
+
}
|
|
895
|
+
lines.push("", "## Permissions", "");
|
|
896
|
+
for (const permission of spec.permissions) {
|
|
897
|
+
lines.push(`- \`${permission.normalized}\`: ${permission.providerScopes.length ? permission.providerScopes.map((scope) => `\`${scope}\``).join(", ") : "no provider scope"} - ${permission.reason}`);
|
|
898
|
+
}
|
|
899
|
+
lines.push("", "## Console Steps", "");
|
|
900
|
+
for (const [i, step] of steps.entries()) {
|
|
901
|
+
lines.push(`${i + 1}. ${step.title}: ${step.detail}`);
|
|
902
|
+
}
|
|
903
|
+
if (spec.setup.knownQuirks?.length) {
|
|
904
|
+
lines.push("", "## Known Quirks", "");
|
|
905
|
+
for (const quirk of spec.setup.knownQuirks) lines.push(`- ${quirk.severity}: ${quirk.message}`);
|
|
906
|
+
}
|
|
907
|
+
return `${lines.join("\n")}
|
|
908
|
+
`;
|
|
909
|
+
}
|
|
910
|
+
function renderAgentToolDescription(spec) {
|
|
911
|
+
const hints = spec.plannerHints;
|
|
912
|
+
const useFor = hints?.useFor?.length ? `Use for ${hints.useFor.join(", ")}.` : `Use for ${spec.title} workflows.`;
|
|
913
|
+
const risk = hints ? `Freshness: ${hints.dataFreshness}. Write risk: ${hints.writeRisk}.` : "";
|
|
914
|
+
return `${spec.title} (${spec.kind}). ${useFor} ${risk}`.trim();
|
|
915
|
+
}
|
|
916
|
+
function buildHealthcheckPlan(spec) {
|
|
917
|
+
const healthcheck = spec.setup.healthcheck ?? { id: `${spec.kind}.static`, level: "static", description: "No healthcheck defined." };
|
|
918
|
+
const requires = [];
|
|
919
|
+
if (healthcheck.level === "connection") requires.push("connection_credentials");
|
|
920
|
+
if (healthcheck.level === "client_config" && spec.auth.mode === "oauth2") requires.push("client_id", "client_secret");
|
|
921
|
+
if (spec.auth.mode === "api_key") requires.push("api_key");
|
|
922
|
+
if (spec.auth.mode === "hmac") requires.push("hmac_secret");
|
|
923
|
+
return {
|
|
924
|
+
kind: spec.kind,
|
|
925
|
+
healthcheck,
|
|
926
|
+
requires,
|
|
927
|
+
message: healthcheck.description
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
function renderTemplate(template, spec, options, redirectUri) {
|
|
931
|
+
return template.replaceAll("{host}", options.host).replaceAll("{kind}", spec.kind).replaceAll("{redirectUri}", redirectUri ?? renderRedirectUri(spec, options));
|
|
932
|
+
}
|
|
933
|
+
function renderRedirectUri(spec, options) {
|
|
934
|
+
return (options.callbackPath ?? spec.setup.redirectUriTemplate ?? "").replaceAll("{host}", options.host).replaceAll("{kind}", spec.kind);
|
|
935
|
+
}
|
|
936
|
+
function consoleStepsToText(steps) {
|
|
937
|
+
return steps.map((step, index) => `${index + 1}. ${step.title}: ${step.detail}`).join("\n");
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// src/specs/validation.ts
|
|
941
|
+
function validateIntegrationSpec(spec) {
|
|
942
|
+
const issues = [];
|
|
943
|
+
if (!spec.kind.trim()) issues.push({ path: "kind", message: "kind is required" });
|
|
944
|
+
if (!spec.title.trim()) issues.push({ path: "title", message: "title is required" });
|
|
945
|
+
if (!spec.actions.length) issues.push({ path: "actions", message: "at least one action is required" });
|
|
946
|
+
if (!spec.permissions.length) issues.push({ path: "permissions", message: "at least one permission is required" });
|
|
947
|
+
if (spec.auth.mode === "oauth2") {
|
|
948
|
+
if (!spec.auth.authorizationUrl) issues.push({ path: "auth.authorizationUrl", message: "authorizationUrl is required" });
|
|
949
|
+
if (!spec.auth.tokenUrl) issues.push({ path: "auth.tokenUrl", message: "tokenUrl is required" });
|
|
950
|
+
if (!spec.auth.redirectUriTemplate) issues.push({ path: "auth.redirectUriTemplate", message: "redirectUriTemplate is required" });
|
|
951
|
+
}
|
|
952
|
+
const actionIds = /* @__PURE__ */ new Set();
|
|
953
|
+
for (const [index, action] of spec.actions.entries()) {
|
|
954
|
+
if (actionIds.has(action.id)) issues.push({ path: `actions[${index}].id`, message: `duplicate action id ${action.id}` });
|
|
955
|
+
actionIds.add(action.id);
|
|
956
|
+
}
|
|
957
|
+
return { ok: issues.length === 0, issues };
|
|
958
|
+
}
|
|
959
|
+
function assertValidIntegrationSpec(spec) {
|
|
960
|
+
const result = validateIntegrationSpec(spec);
|
|
961
|
+
if (!result.ok) {
|
|
962
|
+
throw new Error(`Invalid integration spec ${spec.kind}: ${result.issues.map((i) => `${i.path}: ${i.message}`).join("; ")}`);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
function validateCredentialFormat(field, value) {
|
|
966
|
+
if (!value.trim()) return { ok: false, field: field.label, message: `${field.label} is required` };
|
|
967
|
+
if (field.regex && !new RegExp(field.regex).test(value)) {
|
|
968
|
+
return { ok: false, field: field.label, message: `${field.label} does not match expected format` };
|
|
969
|
+
}
|
|
970
|
+
return { ok: true, field: field.label };
|
|
971
|
+
}
|
|
972
|
+
function validateCredentialSet(spec, values) {
|
|
973
|
+
return spec.setup.credentialFields.map((field) => {
|
|
974
|
+
const key = field.env ?? field.label;
|
|
975
|
+
return validateCredentialFormat(field, values[key] ?? "");
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export {
|
|
980
|
+
listIntegrationCoverageSpecs,
|
|
981
|
+
buildIntegrationCoverageConnectors,
|
|
982
|
+
integrationCoverageChecklistMarkdown,
|
|
983
|
+
INTEGRATION_FAMILIES,
|
|
984
|
+
getIntegrationFamily,
|
|
985
|
+
listIntegrationSpecs,
|
|
986
|
+
getIntegrationSpec,
|
|
987
|
+
listExecutableIntegrationSpecs,
|
|
988
|
+
integrationSpecToConnector,
|
|
989
|
+
specAuthToConnectorAuth,
|
|
990
|
+
renderConsoleSteps,
|
|
991
|
+
renderRunbookMarkdown,
|
|
992
|
+
renderAgentToolDescription,
|
|
993
|
+
buildHealthcheckPlan,
|
|
994
|
+
consoleStepsToText,
|
|
995
|
+
validateIntegrationSpec,
|
|
996
|
+
assertValidIntegrationSpec,
|
|
997
|
+
validateCredentialFormat,
|
|
998
|
+
validateCredentialSet
|
|
999
|
+
};
|
|
1000
|
+
//# sourceMappingURL=chunk-DIJ3I66K.js.map
|