@tangle-network/agent-integrations 0.5.0 → 0.7.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,6 +55,8 @@ 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.
@@ -63,6 +65,8 @@ The SDK surface for that flow is:
63
65
  action/tool consistency, idempotency-key, metadata-shape, known-tool, and
64
66
  input-size checks.
65
67
  - `createConnectorAdapterProvider` to run first-party adapters through the hub.
68
+ - `declarativeRestConnector` to promote REST-shaped providers from compact,
69
+ reviewed specs instead of hand-writing one brittle adapter per API.
66
70
 
67
71
  ```ts
68
72
  import {
@@ -134,6 +138,21 @@ const provider = createHttpIntegrationProvider({
134
138
  The HTTP adapter keeps product code stable while the backing provider can be
135
139
  Nango, Pipedream, Activepieces, a Zapier-style service, or an internal gateway.
136
140
 
141
+ For first-party REST APIs, use the declarative adapter factory:
142
+
143
+ ```ts
144
+ import { createConnectorAdapterProvider, githubConnector } from '@tangle-network/agent-integrations'
145
+
146
+ const provider = createConnectorAdapterProvider({
147
+ adapters: [githubConnector],
148
+ resolveDataSource: async (connection) => loadSourceAndCredentials(connection),
149
+ })
150
+ ```
151
+
152
+ Current first-party adapters include Google Calendar, Microsoft Calendar,
153
+ Google Sheets, Slack, HubSpot, Notion database, Stripe, Twilio, webhooks,
154
+ GitHub, GitLab, Airtable, Asana, and Salesforce.
155
+
137
156
  See [Provider Decision Matrix](./docs/provider-decision-matrix.md) for the
138
157
  build-vs-buy policy. The short version: use a vendor gateway only to compress
139
158
  time-to-coverage, but keep all product and sandbox code on this package's
package/dist/index.d.ts CHANGED
@@ -789,6 +789,51 @@ interface NotionDatabaseOptions {
789
789
  }
790
790
  declare function notionDatabase(opts: NotionDatabaseOptions): ConnectorAdapter;
791
791
 
792
+ type RestCredentialPlacement = {
793
+ kind: 'bearer';
794
+ } | {
795
+ kind: 'header';
796
+ header: string;
797
+ prefix?: string;
798
+ } | {
799
+ kind: 'query';
800
+ parameter: string;
801
+ };
802
+ interface RestConnectorSpec {
803
+ kind: string;
804
+ displayName: string;
805
+ description: string;
806
+ auth: ConnectorAdapter['manifest']['auth'];
807
+ category: ConnectorAdapter['manifest']['category'];
808
+ defaultConsistencyModel: ConnectorAdapter['manifest']['defaultConsistencyModel'];
809
+ baseUrl: string | {
810
+ metadataKey: string;
811
+ fallback?: string;
812
+ };
813
+ credentialPlacement?: RestCredentialPlacement;
814
+ defaultHeaders?: Record<string, string>;
815
+ capabilities: RestOperationSpec[];
816
+ test?: RestRequestSpec;
817
+ }
818
+ interface RestOperationSpec {
819
+ name: string;
820
+ class: 'read' | 'mutation';
821
+ description: string;
822
+ parameters: Record<string, unknown>;
823
+ requiredScopes?: string[];
824
+ request: RestRequestSpec;
825
+ cas?: 'etag-if-match' | 'native-idempotency' | 'optimistic-read-verify' | 'none';
826
+ externalEffect?: boolean;
827
+ }
828
+ interface RestRequestSpec {
829
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
830
+ path: string;
831
+ query?: Record<string, string | number | boolean | undefined>;
832
+ headers?: Record<string, string>;
833
+ body?: 'args' | string | Record<string, unknown>;
834
+ }
835
+ declare function declarativeRestConnector(spec: RestConnectorSpec): ConnectorAdapter;
836
+
792
837
  /**
793
838
  * Twilio SMS connector — outbound texts + recent-message lookup. The
794
839
  * agent's "send the caller a confirmation link" surface.
@@ -922,6 +967,16 @@ declare const stripeWebhookReceiverConnector: ConnectorAdapter;
922
967
 
923
968
  declare const slackEventsConnector: ConnectorAdapter;
924
969
 
970
+ declare const githubConnector: ConnectorAdapter;
971
+
972
+ declare const gitlabConnector: ConnectorAdapter;
973
+
974
+ declare const airtableConnector: ConnectorAdapter;
975
+
976
+ declare const asanaConnector: ConnectorAdapter;
977
+
978
+ declare const salesforceConnector: ConnectorAdapter;
979
+
925
980
  interface IntegrationToolDefinition {
926
981
  name: string;
927
982
  title: string;
@@ -1128,6 +1183,28 @@ declare function importOpenApiConnector(document: OpenApiDocument, options: Impo
1128
1183
  declare function importGraphqlConnector(operations: GraphqlOperationSpec[], options: ImportCatalogOptions): IntegrationConnector;
1129
1184
  declare function importMcpConnector(catalog: McpCatalog, options: ImportCatalogOptions): IntegrationConnector;
1130
1185
 
1186
+ type IntegrationCoveragePriority = 'tier_0' | 'tier_1' | 'tier_2' | 'long_tail';
1187
+ interface IntegrationCoverageSpec {
1188
+ id: string;
1189
+ title: string;
1190
+ category: IntegrationConnectorCategory;
1191
+ auth: IntegrationConnector['auth'];
1192
+ priority: IntegrationCoveragePriority;
1193
+ providerKinds: IntegrationProviderKind[];
1194
+ domains: string[];
1195
+ actionPack: IntegrationActionPack;
1196
+ scopes?: string[];
1197
+ }
1198
+ type IntegrationActionPack = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'project' | 'support' | 'marketing' | 'sales' | 'commerce' | 'finance' | 'hr' | 'dev' | 'ai' | 'analytics' | 'workflow' | 'webhook';
1199
+ declare function listIntegrationCoverageSpecs(): IntegrationCoverageSpec[];
1200
+ declare function buildIntegrationCoverageConnectors(options?: {
1201
+ providerId?: string;
1202
+ priorities?: IntegrationCoveragePriority[];
1203
+ categories?: IntegrationConnectorCategory[];
1204
+ actionPacks?: IntegrationActionPack[];
1205
+ }): IntegrationConnector[];
1206
+ declare function integrationCoverageChecklistMarkdown(): string;
1207
+
1131
1208
  type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'executor' | 'custom';
1132
1209
  type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
1133
1210
  type IntegrationActionRisk = 'read' | 'write' | 'destructive';
@@ -1424,4 +1501,4 @@ declare function createHttpIntegrationProvider(options: HttpIntegrationProviderO
1424
1501
  declare function signCapability(capability: IntegrationCapability, secret: string): string;
1425
1502
  declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
1426
1503
 
1427
- 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 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, 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, validateIntegrationInvocationEnvelope, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature, webhookConnector };
1504
+ 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 RestConnectorSpec, type RestCredentialPlacement, type RestOperationSpec, type RestRequestSpec, type SecretRef, type SlackOptions, type SlackVerifyOptions, type StartAuthRequest, type StartAuthResult, type StartOAuthInput, type StartOAuthOutput, StaticIntegrationPolicyEngine, type StaticIntegrationPolicyOptions, type StripeVerifyOptions, type TwilioVerifyOptions, _resetPendingFlowsForTests, airtableConnector, asanaConnector, assertValidConnectorManifest, buildApprovalRequest, buildIntegrationCoverageConnectors, buildIntegrationInvocationEnvelope, buildIntegrationToolCatalog, consumePendingFlow, createConnectorAdapterProvider, createDefaultIntegrationPolicyEngine, createHttpIntegrationProvider, createMockIntegrationProvider, declarativeRestConnector, exchangeAuthorizationCode, firstHeader, githubConnector, gitlabConnector, googleCalendar, googleSheets, hubspot, importGraphqlConnector, importMcpConnector, importOpenApiConnector, integrationCoverageChecklistMarkdown, integrationToolName, invocationRequestFromEnvelope, listIntegrationCoverageSpecs, manifestToConnector, microsoftCalendar, normalizeIntegrationResult, notionDatabase, parseIntegrationToolName, parseStripeSignatureHeader, redactApprovalRequest, redactCapability, redactInvocationEnvelope, refreshAccessToken, salesforceConnector, sanitizeConnection, searchIntegrationTools, signCapability, slack, slackEventsConnector, startOAuthFlow, stripePackConnector, stripeWebhookReceiverConnector, toMcpTools, twilioSmsConnector, validateConnectorManifest, validateIntegrationInvocationEnvelope, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature, webhookConnector };