@tangle-network/agent-integrations 0.4.1 → 0.6.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/README.md CHANGED
@@ -55,10 +55,15 @@ The SDK surface for that flow is:
55
55
 
56
56
  - `buildIntegrationToolCatalog` and `searchIntegrationTools` for discoverable
57
57
  tool catalogs.
58
+ - `buildIntegrationCoverageConnectors` for broad planning coverage across
59
+ 100+ high-value integrations before each one has a first-party executor.
58
60
  - `toMcpTools` for MCP-compatible tool export.
59
61
  - `IntegrationHub.issueCapability` for scoped sandbox handoff.
60
62
  - `createDefaultIntegrationPolicyEngine` for allow / approval / deny decisions.
61
- - `buildIntegrationInvocationEnvelope` for sandbox-safe tool calls.
63
+ - `buildIntegrationInvocationEnvelope` and
64
+ `validateIntegrationInvocationEnvelope` for sandbox-safe tool calls with
65
+ action/tool consistency, idempotency-key, metadata-shape, known-tool, and
66
+ input-size checks.
62
67
  - `createConnectorAdapterProvider` to run first-party adapters through the hub.
63
68
 
64
69
  ```ts
@@ -143,6 +148,7 @@ without changing agent code.
143
148
  - Capability tokens contain no provider credential.
144
149
  - Secret refs are redacted from public telemetry.
145
150
  - Write/destructive actions can be policy-gated.
151
+ - Sandbox invocation envelopes are validated before conversion to hub requests.
146
152
  - Action invocation checks connection ownership, status, scopes, allowed
147
153
  actions, and expiration.
148
154
  - Optional `IntegrationActionGuard` wraps every action invocation for
package/dist/index.d.ts CHANGED
@@ -1027,6 +1027,11 @@ interface IntegrationInvocationEnvelope {
1027
1027
  dryRun?: boolean;
1028
1028
  metadata?: Record<string, unknown>;
1029
1029
  }
1030
+ interface IntegrationInvocationEnvelopeValidationOptions {
1031
+ connectors?: IntegrationConnector[];
1032
+ maxInputBytes?: number;
1033
+ requireKnownTool?: boolean;
1034
+ }
1030
1035
  type NormalizedIntegrationResult = {
1031
1036
  status: 'ok';
1032
1037
  action: string;
@@ -1052,6 +1057,7 @@ declare function buildIntegrationInvocationEnvelope(input: {
1052
1057
  metadata?: Record<string, unknown>;
1053
1058
  }): IntegrationInvocationEnvelope;
1054
1059
  declare function invocationRequestFromEnvelope(envelope: IntegrationInvocationEnvelope): InvokeWithCapabilityRequest;
1060
+ declare function validateIntegrationInvocationEnvelope(envelope: IntegrationInvocationEnvelope, options?: IntegrationInvocationEnvelopeValidationOptions): void;
1055
1061
  declare function redactInvocationEnvelope(envelope: IntegrationInvocationEnvelope): Omit<IntegrationInvocationEnvelope, 'capabilityToken'> & {
1056
1062
  capabilityToken: '[REDACTED]';
1057
1063
  };
@@ -1122,6 +1128,28 @@ declare function importOpenApiConnector(document: OpenApiDocument, options: Impo
1122
1128
  declare function importGraphqlConnector(operations: GraphqlOperationSpec[], options: ImportCatalogOptions): IntegrationConnector;
1123
1129
  declare function importMcpConnector(catalog: McpCatalog, options: ImportCatalogOptions): IntegrationConnector;
1124
1130
 
1131
+ type IntegrationCoveragePriority = 'tier_0' | 'tier_1' | 'tier_2' | 'long_tail';
1132
+ interface IntegrationCoverageSpec {
1133
+ id: string;
1134
+ title: string;
1135
+ category: IntegrationConnectorCategory;
1136
+ auth: IntegrationConnector['auth'];
1137
+ priority: IntegrationCoveragePriority;
1138
+ providerKinds: IntegrationProviderKind[];
1139
+ domains: string[];
1140
+ actionPack: IntegrationActionPack;
1141
+ scopes?: string[];
1142
+ }
1143
+ type IntegrationActionPack = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'project' | 'support' | 'marketing' | 'sales' | 'commerce' | 'finance' | 'hr' | 'dev' | 'ai' | 'analytics' | 'workflow' | 'webhook';
1144
+ declare function listIntegrationCoverageSpecs(): IntegrationCoverageSpec[];
1145
+ declare function buildIntegrationCoverageConnectors(options?: {
1146
+ providerId?: string;
1147
+ priorities?: IntegrationCoveragePriority[];
1148
+ categories?: IntegrationConnectorCategory[];
1149
+ actionPacks?: IntegrationActionPack[];
1150
+ }): IntegrationConnector[];
1151
+ declare function integrationCoverageChecklistMarkdown(): string;
1152
+
1125
1153
  type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'executor' | 'custom';
1126
1154
  type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
1127
1155
  type IntegrationActionRisk = 'read' | 'write' | 'destructive';
@@ -1418,4 +1446,4 @@ declare function createHttpIntegrationProvider(options: HttpIntegrationProviderO
1418
1446
  declare function signCapability(capability: IntegrationCapability, secret: string): string;
1419
1447
  declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
1420
1448
 
1421
- export { type AuthSpec, type CASStrategy, type Capability, type CapabilityClass, type CapabilityMutation, type CapabilityMutationResult, type CapabilityParameterSchema, type CapabilityRead, type CapabilityReadResult, type CompleteAuthRequest, type ConnectorAdapter, type ConnectorAdapterProviderOptions, type ConnectorCredentials, type ConnectorInvocation, type ConnectorManifest, type ConnectorManifestValidationIssue, type ConnectorManifestValidationResult, type ConsistencyModel, CredentialsExpired, DEFAULT_SIGNATURE_TOLERANCE_SECONDS, type DataSourceMetadata, type EventHandlerResult, type ExchangeCodeInput, type GenericHmacVerifyOptions, type GoogleCalendarOptions, type GoogleSheetsOptions, type GraphqlOperationSpec, type HttpIntegrationProviderOptions, type HubSpotOptions, type ImportCatalogOptions, InMemoryConnectionStore, InMemoryOAuthFlowStore, type InboundEvent, type IntegrationActionGuard, type IntegrationActionRequest, type IntegrationActionResult, type IntegrationActionRisk, type IntegrationActor, type IntegrationApprovalRequest, type IntegrationApprovalResolution, type IntegrationCapability, type IntegrationConnection, type IntegrationConnectionStore, type IntegrationConnector, type IntegrationConnectorAction, type IntegrationConnectorCategory, type IntegrationConnectorTrigger, type IntegrationDataClass, IntegrationError, type IntegrationGuardContext, IntegrationHub, type IntegrationHubOptions, type IntegrationInvocationEnvelope, type IntegrationPolicyDecision, type IntegrationPolicyEffect, type IntegrationPolicyEngine, type IntegrationPolicyRule, type IntegrationProvider, type IntegrationProviderKind, type IntegrationToolDefinition, type IntegrationToolSearchFilters, type IntegrationToolSearchResult, type IntegrationTriggerEvent, type IntegrationTriggerSubscription, type InvokeWithCapabilityRequest, type IssueCapabilityRequest, type IssuedIntegrationCapability, type McpCatalog, type McpCatalogTool, type McpToolDefinition, type MicrosoftCalendarOptions, type NormalizedIntegrationResult, type NotionDatabaseOptions, type OAuthFlowStore, type OAuthTokens, type OpenApiDocument, type OpenApiOperation, type ParsedStripeSignatureHeader, type PendingOAuthFlow, type RateLimitSpec, type RefreshInput, type ResolvedDataSource, ResourceContention, type SecretRef, type SlackOptions, type SlackVerifyOptions, type StartAuthRequest, type StartAuthResult, type StartOAuthInput, type StartOAuthOutput, StaticIntegrationPolicyEngine, type StaticIntegrationPolicyOptions, type StripeVerifyOptions, type TwilioVerifyOptions, _resetPendingFlowsForTests, assertValidConnectorManifest, buildApprovalRequest, buildIntegrationInvocationEnvelope, buildIntegrationToolCatalog, consumePendingFlow, createConnectorAdapterProvider, createDefaultIntegrationPolicyEngine, createHttpIntegrationProvider, createMockIntegrationProvider, exchangeAuthorizationCode, firstHeader, googleCalendar, googleSheets, hubspot, importGraphqlConnector, importMcpConnector, importOpenApiConnector, integrationToolName, invocationRequestFromEnvelope, manifestToConnector, microsoftCalendar, normalizeIntegrationResult, notionDatabase, parseIntegrationToolName, parseStripeSignatureHeader, redactApprovalRequest, redactCapability, redactInvocationEnvelope, refreshAccessToken, sanitizeConnection, searchIntegrationTools, signCapability, slack, slackEventsConnector, startOAuthFlow, stripePackConnector, stripeWebhookReceiverConnector, toMcpTools, twilioSmsConnector, validateConnectorManifest, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature, webhookConnector };
1449
+ export { type AuthSpec, type CASStrategy, type Capability, type CapabilityClass, type CapabilityMutation, type CapabilityMutationResult, type CapabilityParameterSchema, type CapabilityRead, type CapabilityReadResult, type CompleteAuthRequest, type ConnectorAdapter, type ConnectorAdapterProviderOptions, type ConnectorCredentials, type ConnectorInvocation, type ConnectorManifest, type ConnectorManifestValidationIssue, type ConnectorManifestValidationResult, type ConsistencyModel, CredentialsExpired, DEFAULT_SIGNATURE_TOLERANCE_SECONDS, type DataSourceMetadata, type EventHandlerResult, type ExchangeCodeInput, type GenericHmacVerifyOptions, type GoogleCalendarOptions, type GoogleSheetsOptions, type GraphqlOperationSpec, type HttpIntegrationProviderOptions, type HubSpotOptions, type ImportCatalogOptions, InMemoryConnectionStore, InMemoryOAuthFlowStore, type InboundEvent, type IntegrationActionGuard, type IntegrationActionPack, type IntegrationActionRequest, type IntegrationActionResult, type IntegrationActionRisk, type IntegrationActor, type IntegrationApprovalRequest, type IntegrationApprovalResolution, type IntegrationCapability, type IntegrationConnection, type IntegrationConnectionStore, type IntegrationConnector, type IntegrationConnectorAction, type IntegrationConnectorCategory, type IntegrationConnectorTrigger, type IntegrationCoveragePriority, type IntegrationCoverageSpec, type IntegrationDataClass, IntegrationError, type IntegrationGuardContext, IntegrationHub, type IntegrationHubOptions, type IntegrationInvocationEnvelope, type IntegrationInvocationEnvelopeValidationOptions, type IntegrationPolicyDecision, type IntegrationPolicyEffect, type IntegrationPolicyEngine, type IntegrationPolicyRule, type IntegrationProvider, type IntegrationProviderKind, type IntegrationToolDefinition, type IntegrationToolSearchFilters, type IntegrationToolSearchResult, type IntegrationTriggerEvent, type IntegrationTriggerSubscription, type InvokeWithCapabilityRequest, type IssueCapabilityRequest, type IssuedIntegrationCapability, type McpCatalog, type McpCatalogTool, type McpToolDefinition, type MicrosoftCalendarOptions, type NormalizedIntegrationResult, type NotionDatabaseOptions, type OAuthFlowStore, type OAuthTokens, type OpenApiDocument, type OpenApiOperation, type ParsedStripeSignatureHeader, type PendingOAuthFlow, type RateLimitSpec, type RefreshInput, type ResolvedDataSource, ResourceContention, type SecretRef, type SlackOptions, type SlackVerifyOptions, type StartAuthRequest, type StartAuthResult, type StartOAuthInput, type StartOAuthOutput, StaticIntegrationPolicyEngine, type StaticIntegrationPolicyOptions, type StripeVerifyOptions, type TwilioVerifyOptions, _resetPendingFlowsForTests, assertValidConnectorManifest, buildApprovalRequest, buildIntegrationCoverageConnectors, buildIntegrationInvocationEnvelope, buildIntegrationToolCatalog, consumePendingFlow, createConnectorAdapterProvider, createDefaultIntegrationPolicyEngine, createHttpIntegrationProvider, createMockIntegrationProvider, exchangeAuthorizationCode, firstHeader, googleCalendar, googleSheets, hubspot, importGraphqlConnector, importMcpConnector, importOpenApiConnector, integrationCoverageChecklistMarkdown, integrationToolName, invocationRequestFromEnvelope, listIntegrationCoverageSpecs, manifestToConnector, microsoftCalendar, normalizeIntegrationResult, notionDatabase, parseIntegrationToolName, parseStripeSignatureHeader, redactApprovalRequest, redactCapability, redactInvocationEnvelope, refreshAccessToken, sanitizeConnection, searchIntegrationTools, signCapability, slack, slackEventsConnector, startOAuthFlow, stripePackConnector, stripeWebhookReceiverConnector, toMcpTools, twilioSmsConnector, validateConnectorManifest, validateIntegrationInvocationEnvelope, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature, webhookConnector };
package/dist/index.js CHANGED
@@ -2757,10 +2757,10 @@ function tokenize(value) {
2757
2757
  return value.toLowerCase().split(/[^a-z0-9]+/g).map((part) => part.trim()).filter(Boolean);
2758
2758
  }
2759
2759
  function encodeToolPart(value) {
2760
- return Buffer.from(value, "utf8").toString("base64url");
2760
+ return Buffer.from(value, "utf8").toString("base64url").replace(/_/g, ".");
2761
2761
  }
2762
2762
  function decodeToolPart(value) {
2763
- return Buffer.from(value, "base64url").toString("utf8");
2763
+ return Buffer.from(value.replace(/\./g, "_"), "base64url").toString("utf8");
2764
2764
  }
2765
2765
  function unique(values) {
2766
2766
  return [...new Set(values)];
@@ -2869,7 +2869,7 @@ function redactUnknown(value) {
2869
2869
  // src/sandbox.ts
2870
2870
  function buildIntegrationInvocationEnvelope(input) {
2871
2871
  const parsed = parseIntegrationToolName(input.toolName);
2872
- return {
2872
+ const envelope = {
2873
2873
  kind: "integration.invocation",
2874
2874
  capabilityToken: input.capabilityToken,
2875
2875
  toolName: input.toolName,
@@ -2879,8 +2879,11 @@ function buildIntegrationInvocationEnvelope(input) {
2879
2879
  dryRun: input.dryRun,
2880
2880
  metadata: input.metadata
2881
2881
  };
2882
+ validateIntegrationInvocationEnvelope(envelope);
2883
+ return envelope;
2882
2884
  }
2883
2885
  function invocationRequestFromEnvelope(envelope) {
2886
+ validateIntegrationInvocationEnvelope(envelope);
2884
2887
  return {
2885
2888
  action: envelope.action,
2886
2889
  input: envelope.input,
@@ -2889,6 +2892,34 @@ function invocationRequestFromEnvelope(envelope) {
2889
2892
  metadata: envelope.metadata
2890
2893
  };
2891
2894
  }
2895
+ function validateIntegrationInvocationEnvelope(envelope, options = {}) {
2896
+ if (!envelope || typeof envelope !== "object") throw new Error("Integration invocation envelope is required.");
2897
+ if (envelope.kind !== "integration.invocation") throw new Error("Invalid integration invocation envelope kind.");
2898
+ if (!isNonEmptyString(envelope.capabilityToken)) throw new Error("Integration invocation envelope is missing capabilityToken.");
2899
+ if (!isNonEmptyString(envelope.toolName)) throw new Error("Integration invocation envelope is missing toolName.");
2900
+ if (!isNonEmptyString(envelope.action)) throw new Error("Integration invocation envelope is missing action.");
2901
+ if (!isNonEmptyString(envelope.idempotencyKey)) throw new Error("Integration invocation envelope is missing idempotencyKey.");
2902
+ if (envelope.metadata !== void 0 && !isPlainRecord(envelope.metadata)) {
2903
+ throw new Error("Integration invocation envelope metadata must be an object.");
2904
+ }
2905
+ const parsed = parseIntegrationToolName(envelope.toolName);
2906
+ if (parsed.actionId !== envelope.action) {
2907
+ throw new Error(`Integration invocation action ${envelope.action} does not match tool ${parsed.actionId}.`);
2908
+ }
2909
+ const inputBytes = Buffer.byteLength(JSON.stringify(envelope.input ?? null), "utf8");
2910
+ const maxInputBytes = options.maxInputBytes ?? 256 * 1024;
2911
+ if (inputBytes > maxInputBytes) {
2912
+ throw new Error(`Integration invocation input exceeds ${maxInputBytes} bytes.`);
2913
+ }
2914
+ if (options.requireKnownTool || options.connectors) {
2915
+ if (!options.connectors) throw new Error("connectors are required when requireKnownTool is true.");
2916
+ const connector = options.connectors.find(
2917
+ (candidate) => candidate.providerId === parsed.providerId && candidate.id === parsed.connectorId
2918
+ );
2919
+ const action = connector?.actions.find((candidate) => candidate.id === parsed.actionId);
2920
+ if (!connector || !action) throw new Error(`Unknown integration tool ${envelope.toolName}.`);
2921
+ }
2922
+ }
2892
2923
  function redactInvocationEnvelope(envelope) {
2893
2924
  return {
2894
2925
  ...envelope,
@@ -2940,6 +2971,12 @@ function redactUnknown2(value) {
2940
2971
  }
2941
2972
  return out;
2942
2973
  }
2974
+ function isNonEmptyString(value) {
2975
+ return typeof value === "string" && value.trim().length > 0;
2976
+ }
2977
+ function isPlainRecord(value) {
2978
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
2979
+ }
2943
2980
 
2944
2981
  // src/adapter-provider.ts
2945
2982
  function createConnectorAdapterProvider(options) {
@@ -3192,6 +3229,317 @@ function unique2(values) {
3192
3229
  return [...new Set(values)];
3193
3230
  }
3194
3231
 
3232
+ // src/coverage-catalog.ts
3233
+ var DEFAULT_PROVIDER_KINDS = ["first_party", "nango", "pipedream", "activepieces", "custom"];
3234
+ var COVERAGE_SPECS = [
3235
+ ["gmail", "Gmail", "email", "email", "tier_0", "email,google,workspace,inbox"],
3236
+ ["outlook-mail", "Outlook Mail", "email", "email", "tier_0", "email,microsoft,office,inbox"],
3237
+ ["google-calendar", "Google Calendar", "calendar", "calendar", "tier_0", "calendar,google,workspace,scheduling"],
3238
+ ["outlook-calendar", "Outlook Calendar", "calendar", "calendar", "tier_0", "calendar,microsoft,office,scheduling"],
3239
+ ["slack", "Slack", "chat", "chat", "tier_0", "chat,collaboration,internal-comms"],
3240
+ ["microsoft-teams", "Microsoft Teams", "chat", "chat", "tier_0", "chat,microsoft,collaboration"],
3241
+ ["google-drive", "Google Drive", "storage", "storage", "tier_0", "files,google,workspace,storage"],
3242
+ ["onedrive", "OneDrive", "storage", "storage", "tier_0", "files,microsoft,office,storage"],
3243
+ ["dropbox", "Dropbox", "storage", "storage", "tier_1", "files,storage"],
3244
+ ["box", "Box", "storage", "storage", "tier_1", "files,enterprise,storage"],
3245
+ ["google-docs", "Google Docs", "docs", "docs", "tier_0", "docs,google,workspace"],
3246
+ ["google-sheets", "Google Sheets", "database", "database", "tier_0", "sheets,spreadsheet,google,database"],
3247
+ ["microsoft-excel", "Microsoft Excel", "database", "database", "tier_0", "sheets,spreadsheet,microsoft,database"],
3248
+ ["notion", "Notion", "docs", "docs", "tier_0", "docs,wiki,knowledge"],
3249
+ ["airtable", "Airtable", "database", "database", "tier_0", "database,spreadsheet,ops"],
3250
+ ["coda", "Coda", "docs", "docs", "tier_1", "docs,wiki,ops"],
3251
+ ["confluence", "Confluence", "docs", "docs", "tier_1", "docs,wiki,atlassian"],
3252
+ ["sharepoint", "SharePoint", "storage", "storage", "tier_1", "files,microsoft,enterprise"],
3253
+ ["hubspot", "HubSpot", "crm", "crm", "tier_0", "crm,sales,marketing"],
3254
+ ["salesforce", "Salesforce", "crm", "crm", "tier_0", "crm,sales,enterprise"],
3255
+ ["pipedrive", "Pipedrive", "crm", "crm", "tier_1", "crm,sales"],
3256
+ ["zoho-crm", "Zoho CRM", "crm", "crm", "tier_1", "crm,sales"],
3257
+ ["close", "Close", "crm", "crm", "tier_1", "crm,sales"],
3258
+ ["attio", "Attio", "crm", "crm", "tier_1", "crm,sales,startups"],
3259
+ ["linear", "Linear", "workflow", "project", "tier_0", "project,engineering,tickets"],
3260
+ ["jira", "Jira", "workflow", "project", "tier_0", "project,engineering,tickets,atlassian"],
3261
+ ["github", "GitHub", "workflow", "dev", "tier_0", "code,dev,issues,git"],
3262
+ ["gitlab", "GitLab", "workflow", "dev", "tier_1", "code,dev,issues,git"],
3263
+ ["bitbucket", "Bitbucket", "workflow", "dev", "tier_2", "code,dev,git,atlassian"],
3264
+ ["asana", "Asana", "workflow", "project", "tier_1", "project,tasks"],
3265
+ ["trello", "Trello", "workflow", "project", "tier_1", "project,tasks,atlassian"],
3266
+ ["monday", "monday.com", "workflow", "project", "tier_1", "project,tasks,ops"],
3267
+ ["clickup", "ClickUp", "workflow", "project", "tier_1", "project,tasks,ops"],
3268
+ ["basecamp", "Basecamp", "workflow", "project", "tier_2", "project,tasks"],
3269
+ ["zendesk", "Zendesk", "crm", "support", "tier_0", "support,tickets,customer-success"],
3270
+ ["intercom", "Intercom", "crm", "support", "tier_0", "support,chat,customer-success"],
3271
+ ["freshdesk", "Freshdesk", "crm", "support", "tier_1", "support,tickets"],
3272
+ ["helpscout", "Help Scout", "crm", "support", "tier_1", "support,tickets"],
3273
+ ["front", "Front", "email", "support", "tier_1", "support,email,shared-inbox"],
3274
+ ["gorgias", "Gorgias", "crm", "support", "tier_1", "support,ecommerce"],
3275
+ ["stripe", "Stripe", "workflow", "finance", "tier_0", "payments,billing,finance"],
3276
+ ["quickbooks", "QuickBooks", "workflow", "finance", "tier_0", "accounting,finance"],
3277
+ ["xero", "Xero", "workflow", "finance", "tier_1", "accounting,finance"],
3278
+ ["netsuite", "NetSuite", "workflow", "finance", "tier_1", "erp,finance,enterprise"],
3279
+ ["sage", "Sage", "workflow", "finance", "tier_2", "accounting,finance"],
3280
+ ["plaid", "Plaid", "workflow", "finance", "tier_1", "banking,finance"],
3281
+ ["shopify", "Shopify", "workflow", "commerce", "tier_0", "ecommerce,orders,commerce"],
3282
+ ["woocommerce", "WooCommerce", "workflow", "commerce", "tier_1", "ecommerce,orders,wordpress"],
3283
+ ["bigcommerce", "BigCommerce", "workflow", "commerce", "tier_1", "ecommerce,orders"],
3284
+ ["amazon-seller-central", "Amazon Seller Central", "workflow", "commerce", "tier_1", "marketplace,ecommerce"],
3285
+ ["ebay", "eBay", "workflow", "commerce", "tier_2", "marketplace,ecommerce"],
3286
+ ["etsy", "Etsy", "workflow", "commerce", "tier_2", "marketplace,ecommerce"],
3287
+ ["mailchimp", "Mailchimp", "workflow", "marketing", "tier_0", "email-marketing,marketing"],
3288
+ ["klaviyo", "Klaviyo", "workflow", "marketing", "tier_0", "email-marketing,ecommerce,marketing"],
3289
+ ["marketo", "Marketo", "workflow", "marketing", "tier_1", "marketing,enterprise"],
3290
+ ["braze", "Braze", "workflow", "marketing", "tier_1", "marketing,lifecycle"],
3291
+ ["customer-io", "Customer.io", "workflow", "marketing", "tier_1", "marketing,lifecycle"],
3292
+ ["sendgrid", "SendGrid", "email", "email", "tier_1", "email,transactional"],
3293
+ ["postmark", "Postmark", "email", "email", "tier_1", "email,transactional"],
3294
+ ["twilio", "Twilio", "chat", "chat", "tier_0", "sms,voice,communications"],
3295
+ ["discord", "Discord", "chat", "chat", "tier_1", "chat,community"],
3296
+ ["telegram", "Telegram", "chat", "chat", "tier_1", "chat,community"],
3297
+ ["whatsapp-business", "WhatsApp Business", "chat", "chat", "tier_1", "chat,meta,customer-comms"],
3298
+ ["facebook-pages", "Facebook Pages", "workflow", "marketing", "tier_1", "social,meta,marketing"],
3299
+ ["instagram-business", "Instagram Business", "workflow", "marketing", "tier_1", "social,meta,marketing"],
3300
+ ["linkedin", "LinkedIn", "workflow", "sales", "tier_1", "social,sales,gtm"],
3301
+ ["x-twitter", "X / Twitter", "workflow", "marketing", "tier_1", "social,marketing"],
3302
+ ["youtube", "YouTube", "storage", "storage", "tier_1", "video,content"],
3303
+ ["tiktok", "TikTok", "workflow", "marketing", "tier_2", "social,video,marketing"],
3304
+ ["google-analytics", "Google Analytics", "database", "analytics", "tier_0", "analytics,web,marketing"],
3305
+ ["mixpanel", "Mixpanel", "database", "analytics", "tier_1", "analytics,product"],
3306
+ ["amplitude", "Amplitude", "database", "analytics", "tier_1", "analytics,product"],
3307
+ ["segment", "Segment", "database", "analytics", "tier_1", "analytics,cdp"],
3308
+ ["snowflake", "Snowflake", "database", "database", "tier_0", "warehouse,data"],
3309
+ ["bigquery", "BigQuery", "database", "database", "tier_0", "warehouse,google,data"],
3310
+ ["redshift", "Redshift", "database", "database", "tier_1", "warehouse,aws,data"],
3311
+ ["postgres", "Postgres", "database", "database", "tier_0", "database,sql"],
3312
+ ["mysql", "MySQL", "database", "database", "tier_1", "database,sql"],
3313
+ ["mongodb", "MongoDB", "database", "database", "tier_1", "database,nosql"],
3314
+ ["supabase", "Supabase", "database", "database", "tier_1", "database,postgres"],
3315
+ ["firebase", "Firebase", "database", "database", "tier_1", "database,google,app"],
3316
+ ["redis", "Redis", "database", "database", "tier_2", "database,cache"],
3317
+ ["aws-s3", "Amazon S3", "storage", "storage", "tier_0", "files,aws,storage"],
3318
+ ["aws-lambda", "AWS Lambda", "workflow", "dev", "tier_1", "aws,serverless,dev"],
3319
+ ["aws-cloudwatch", "AWS CloudWatch", "database", "analytics", "tier_1", "aws,logs,observability"],
3320
+ ["google-cloud-storage", "Google Cloud Storage", "storage", "storage", "tier_1", "files,gcp,storage"],
3321
+ ["azure-blob-storage", "Azure Blob Storage", "storage", "storage", "tier_1", "files,azure,storage"],
3322
+ ["vercel", "Vercel", "workflow", "dev", "tier_1", "deployments,dev"],
3323
+ ["netlify", "Netlify", "workflow", "dev", "tier_2", "deployments,dev"],
3324
+ ["cloudflare", "Cloudflare", "workflow", "dev", "tier_1", "edge,dev,dns"],
3325
+ ["sentry", "Sentry", "workflow", "dev", "tier_1", "errors,observability,dev"],
3326
+ ["datadog", "Datadog", "database", "analytics", "tier_1", "observability,logs,metrics"],
3327
+ ["new-relic", "New Relic", "database", "analytics", "tier_2", "observability,logs,metrics"],
3328
+ ["pagerduty", "PagerDuty", "workflow", "project", "tier_1", "incident,on-call"],
3329
+ ["opsgenie", "Opsgenie", "workflow", "project", "tier_2", "incident,on-call,atlassian"],
3330
+ ["okta", "Okta", "internal", "workflow", "tier_1", "identity,security"],
3331
+ ["auth0", "Auth0", "internal", "workflow", "tier_1", "identity,security"],
3332
+ ["workday", "Workday", "workflow", "hr", "tier_1", "hr,finance,enterprise"],
3333
+ ["bamboohr", "BambooHR", "workflow", "hr", "tier_1", "hr,people"],
3334
+ ["greenhouse", "Greenhouse", "workflow", "hr", "tier_1", "recruiting,hr"],
3335
+ ["lever", "Lever", "workflow", "hr", "tier_1", "recruiting,hr"],
3336
+ ["gusto", "Gusto", "workflow", "hr", "tier_1", "payroll,hr"],
3337
+ ["rippling", "Rippling", "workflow", "hr", "tier_1", "hr,it,identity"],
3338
+ ["docusign", "DocuSign", "docs", "docs", "tier_1", "contracts,signature,legal"],
3339
+ ["pandadoc", "PandaDoc", "docs", "docs", "tier_1", "contracts,signature,sales"],
3340
+ ["hellosign", "Dropbox Sign", "docs", "docs", "tier_2", "contracts,signature"],
3341
+ ["clio", "Clio", "workflow", "project", "tier_1", "legal,practice-management"],
3342
+ ["ironclad", "Ironclad", "docs", "docs", "tier_1", "legal,contracts"],
3343
+ ["lexisnexis", "LexisNexis", "docs", "docs", "tier_2", "legal,research"],
3344
+ ["calendly", "Calendly", "calendar", "calendar", "tier_0", "scheduling,calendar"],
3345
+ ["cal-com", "Cal.com", "calendar", "calendar", "tier_1", "scheduling,calendar"],
3346
+ ["zoom", "Zoom", "calendar", "calendar", "tier_0", "meetings,video,calendar"],
3347
+ ["google-meet", "Google Meet", "calendar", "calendar", "tier_1", "meetings,google,video"],
3348
+ ["microsoft-graph", "Microsoft Graph", "internal", "workflow", "tier_0", "microsoft,enterprise,identity"],
3349
+ ["openai", "OpenAI", "workflow", "ai", "tier_0", "ai,llm"],
3350
+ ["anthropic", "Anthropic", "workflow", "ai", "tier_1", "ai,llm"],
3351
+ ["gemini", "Google Gemini", "workflow", "ai", "tier_1", "ai,llm,google"],
3352
+ ["huggingface", "Hugging Face", "workflow", "ai", "tier_1", "ai,models"],
3353
+ ["pinecone", "Pinecone", "database", "database", "tier_1", "vector,database,ai"],
3354
+ ["weaviate", "Weaviate", "database", "database", "tier_1", "vector,database,ai"],
3355
+ ["qdrant", "Qdrant", "database", "database", "tier_1", "vector,database,ai"],
3356
+ ["zapier", "Zapier", "workflow", "workflow", "tier_1", "automation,workflow"],
3357
+ ["make", "Make", "workflow", "workflow", "tier_1", "automation,workflow"],
3358
+ ["nango", "Nango", "workflow", "workflow", "tier_1", "integration-platform,oauth"],
3359
+ ["pipedream", "Pipedream", "workflow", "workflow", "tier_1", "integration-platform,workflow"],
3360
+ ["activepieces", "Activepieces", "workflow", "workflow", "tier_1", "automation,workflow,open-source"],
3361
+ ["webhook", "Generic Webhook", "webhook", "webhook", "tier_0", "webhook,http,events", "none"],
3362
+ ["http", "HTTP Request", "workflow", "webhook", "tier_0", "http,api,webhook", "none"],
3363
+ ["rss", "RSS", "webhook", "webhook", "tier_1", "feeds,content", "none"],
3364
+ ["zapier-transfer", "Zapier Transfer", "workflow", "workflow", "long_tail", "automation,migration"],
3365
+ ["typeform", "Typeform", "workflow", "marketing", "tier_1", "forms,marketing"],
3366
+ ["google-forms", "Google Forms", "workflow", "marketing", "tier_1", "forms,google"],
3367
+ ["jotform", "Jotform", "workflow", "marketing", "tier_2", "forms"],
3368
+ ["webflow", "Webflow", "workflow", "marketing", "tier_1", "cms,website"],
3369
+ ["wordpress", "WordPress", "workflow", "marketing", "tier_1", "cms,website"],
3370
+ ["contentful", "Contentful", "docs", "docs", "tier_1", "cms,content"],
3371
+ ["sanity", "Sanity", "docs", "docs", "tier_1", "cms,content"],
3372
+ ["figma", "Figma", "docs", "docs", "tier_0", "design,creative"],
3373
+ ["canva", "Canva", "docs", "docs", "tier_1", "design,creative"],
3374
+ ["adobe-creative-cloud", "Adobe Creative Cloud", "storage", "storage", "tier_1", "design,creative,files"],
3375
+ ["miro", "Miro", "docs", "docs", "tier_1", "whiteboard,collaboration"],
3376
+ ["figjam", "FigJam", "docs", "docs", "tier_2", "whiteboard,design"]
3377
+ ];
3378
+ function listIntegrationCoverageSpecs() {
3379
+ return COVERAGE_SPECS.map(([id, title, category, actionPack2, priority, domains, auth = "oauth2"]) => ({
3380
+ id,
3381
+ title,
3382
+ category,
3383
+ actionPack: actionPack2,
3384
+ priority,
3385
+ auth,
3386
+ providerKinds: providerKindsFor(auth),
3387
+ domains: domains.split(",").map((domain) => domain.trim()).filter(Boolean),
3388
+ scopes: scopesFor(id, actionPack2)
3389
+ }));
3390
+ }
3391
+ function buildIntegrationCoverageConnectors(options = {}) {
3392
+ const providerId = options.providerId ?? "coverage";
3393
+ 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));
3394
+ }
3395
+ function integrationCoverageChecklistMarkdown() {
3396
+ const specs = listIntegrationCoverageSpecs();
3397
+ const lines = [
3398
+ "# Agent Integrations Coverage Checklist",
3399
+ "",
3400
+ "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.",
3401
+ "",
3402
+ "## Summary",
3403
+ "",
3404
+ `- Total cataloged integrations: ${specs.length}`,
3405
+ `- Tier 0: ${specs.filter((spec) => spec.priority === "tier_0").length}`,
3406
+ `- Tier 1: ${specs.filter((spec) => spec.priority === "tier_1").length}`,
3407
+ `- Tier 2: ${specs.filter((spec) => spec.priority === "tier_2").length}`,
3408
+ `- Long tail: ${specs.filter((spec) => spec.priority === "long_tail").length}`,
3409
+ "",
3410
+ "## Checklist",
3411
+ ""
3412
+ ];
3413
+ for (const spec of specs) {
3414
+ lines.push(`- [ ] ${spec.priority} / ${spec.category} / ${spec.title} (${spec.id}) - ${spec.domains.join(", ")}`);
3415
+ }
3416
+ return `${lines.join("\n")}
3417
+ `;
3418
+ }
3419
+ function specToConnector(spec, providerId) {
3420
+ const actions = actionPack(spec.actionPack, spec.scopes ?? []);
3421
+ return {
3422
+ id: spec.id,
3423
+ providerId,
3424
+ title: spec.title,
3425
+ category: spec.category,
3426
+ auth: spec.auth,
3427
+ scopes: spec.scopes ?? [],
3428
+ actions,
3429
+ triggers: triggersFor(spec.actionPack, spec.scopes ?? []),
3430
+ metadata: {
3431
+ source: "coverage-catalog",
3432
+ priority: spec.priority,
3433
+ domains: spec.domains,
3434
+ providerKinds: spec.providerKinds,
3435
+ executable: false
3436
+ }
3437
+ };
3438
+ }
3439
+ function actionPack(pack, scopes) {
3440
+ const readScope = scopes.find((scope2) => scope2.endsWith(".read")) ?? scopes[0];
3441
+ const writeScope = scopes.find((scope2) => scope2.endsWith(".write")) ?? scopes[1] ?? readScope;
3442
+ const scope = (value) => value ? [value] : [];
3443
+ const read = (id, title, description) => ({
3444
+ id,
3445
+ title,
3446
+ description,
3447
+ risk: "read",
3448
+ requiredScopes: scope(readScope),
3449
+ dataClass: dataClassFor(pack),
3450
+ inputSchema: objectSchema()
3451
+ });
3452
+ const write = (id, title, description) => ({
3453
+ id,
3454
+ title,
3455
+ description,
3456
+ risk: "write",
3457
+ requiredScopes: scope(writeScope),
3458
+ dataClass: dataClassFor(pack),
3459
+ approvalRequired: true,
3460
+ inputSchema: objectSchema()
3461
+ });
3462
+ const destructive = (id, title, description) => ({
3463
+ id,
3464
+ title,
3465
+ description,
3466
+ risk: "destructive",
3467
+ requiredScopes: scope(writeScope),
3468
+ dataClass: dataClassFor(pack),
3469
+ approvalRequired: true,
3470
+ inputSchema: objectSchema()
3471
+ });
3472
+ switch (pack) {
3473
+ case "email":
3474
+ 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.")];
3475
+ case "calendar":
3476
+ 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.")];
3477
+ case "chat":
3478
+ return [read("messages.search", "Search messages", "Search channel or direct messages."), read("channels.list", "List channels", "List channels or rooms."), write("messages.post", "Post message", "Post a message."), write("threads.reply", "Reply in thread", "Reply to a thread or conversation.")];
3479
+ case "crm":
3480
+ 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.")];
3481
+ case "storage":
3482
+ 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.")];
3483
+ case "docs":
3484
+ 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.")];
3485
+ case "database":
3486
+ 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.")];
3487
+ case "project":
3488
+ 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.")];
3489
+ case "support":
3490
+ 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.")];
3491
+ case "marketing":
3492
+ 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.")];
3493
+ case "sales":
3494
+ 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.")];
3495
+ case "commerce":
3496
+ 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.")];
3497
+ case "finance":
3498
+ 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.")];
3499
+ case "hr":
3500
+ 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.")];
3501
+ case "dev":
3502
+ 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.")];
3503
+ case "ai":
3504
+ 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.")];
3505
+ case "analytics":
3506
+ 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.")];
3507
+ case "workflow":
3508
+ 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.")];
3509
+ case "webhook":
3510
+ 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.")];
3511
+ }
3512
+ }
3513
+ function triggersFor(pack, scopes) {
3514
+ const readScope = scopes.find((scope) => scope.endsWith(".read")) ?? scopes[0];
3515
+ const requiredScopes = readScope ? [readScope] : [];
3516
+ if (pack === "email") return [{ id: "message.received", title: "Message received", requiredScopes, dataClass: "private" }];
3517
+ if (pack === "calendar") return [{ id: "event.changed", title: "Event changed", requiredScopes, dataClass: "private" }];
3518
+ if (pack === "chat") return [{ id: "message.posted", title: "Message posted", requiredScopes, dataClass: "private" }];
3519
+ if (pack === "crm") return [{ id: "record.changed", title: "Record changed", requiredScopes, dataClass: "private" }];
3520
+ if (pack === "support") return [{ id: "ticket.changed", title: "Ticket changed", requiredScopes, dataClass: "private" }];
3521
+ if (pack === "commerce") return [{ id: "order.changed", title: "Order changed", requiredScopes, dataClass: "sensitive" }];
3522
+ if (pack === "finance") return [{ id: "transaction.changed", title: "Transaction changed", requiredScopes, dataClass: "sensitive" }];
3523
+ if (pack === "workflow" || pack === "webhook") return [{ id: "event.received", title: "Event received", requiredScopes, dataClass: "internal" }];
3524
+ return void 0;
3525
+ }
3526
+ function scopesFor(id, pack) {
3527
+ if (pack === "webhook") return [];
3528
+ return [`${id}.read`, `${id}.write`];
3529
+ }
3530
+ function providerKindsFor(auth) {
3531
+ if (auth === "none") return ["first_party", "pipedream", "activepieces", "custom"];
3532
+ return DEFAULT_PROVIDER_KINDS;
3533
+ }
3534
+ function dataClassFor(pack) {
3535
+ if (pack === "finance" || pack === "commerce" || pack === "hr") return "sensitive";
3536
+ if (pack === "workflow" || pack === "webhook" || pack === "dev" || pack === "analytics") return "internal";
3537
+ return "private";
3538
+ }
3539
+ function objectSchema() {
3540
+ return { type: "object", additionalProperties: true, properties: {} };
3541
+ }
3542
+
3195
3543
  // src/index.ts
3196
3544
  var IntegrationError = class extends Error {
3197
3545
  constructor(message, code) {
@@ -3528,6 +3876,7 @@ export {
3528
3876
  _resetPendingFlowsForTests,
3529
3877
  assertValidConnectorManifest,
3530
3878
  buildApprovalRequest,
3879
+ buildIntegrationCoverageConnectors,
3531
3880
  buildIntegrationInvocationEnvelope,
3532
3881
  buildIntegrationToolCatalog,
3533
3882
  consumePendingFlow,
@@ -3543,8 +3892,10 @@ export {
3543
3892
  importGraphqlConnector,
3544
3893
  importMcpConnector,
3545
3894
  importOpenApiConnector,
3895
+ integrationCoverageChecklistMarkdown,
3546
3896
  integrationToolName,
3547
3897
  invocationRequestFromEnvelope,
3898
+ listIntegrationCoverageSpecs,
3548
3899
  manifestToConnector,
3549
3900
  microsoftCalendar,
3550
3901
  normalizeIntegrationResult,
@@ -3566,6 +3917,7 @@ export {
3566
3917
  toMcpTools,
3567
3918
  twilioSmsConnector,
3568
3919
  validateConnectorManifest,
3920
+ validateIntegrationInvocationEnvelope,
3569
3921
  verifyCapabilityToken,
3570
3922
  verifyHmacSignature,
3571
3923
  verifySlackSignature,