@tangle-network/agent-integrations 0.6.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 +17 -0
- package/dist/index.d.ts +56 -1
- package/dist/index.js +547 -0
- package/dist/index.js.map +1 -1
- package/docs/integration-coverage-checklist.md +9 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,8 @@ The SDK surface for that flow is:
|
|
|
65
65
|
action/tool consistency, idempotency-key, metadata-shape, known-tool, and
|
|
66
66
|
input-size checks.
|
|
67
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.
|
|
68
70
|
|
|
69
71
|
```ts
|
|
70
72
|
import {
|
|
@@ -136,6 +138,21 @@ const provider = createHttpIntegrationProvider({
|
|
|
136
138
|
The HTTP adapter keeps product code stable while the backing provider can be
|
|
137
139
|
Nango, Pipedream, Activepieces, a Zapier-style service, or an internal gateway.
|
|
138
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
|
+
|
|
139
156
|
See [Provider Decision Matrix](./docs/provider-decision-matrix.md) for the
|
|
140
157
|
build-vs-buy policy. The short version: use a vendor gateway only to compress
|
|
141
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;
|
|
@@ -1446,4 +1501,4 @@ declare function createHttpIntegrationProvider(options: HttpIntegrationProviderO
|
|
|
1446
1501
|
declare function signCapability(capability: IntegrationCapability, secret: string): string;
|
|
1447
1502
|
declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
|
|
1448
1503
|
|
|
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 };
|
|
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 };
|