@tangle-network/agent-integrations 0.7.1 → 0.8.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
@@ -35,6 +35,8 @@ agent-facing tool contract.
35
35
  - A declarative REST adapter factory for promoting REST APIs from reviewed specs.
36
36
  - A broad coverage catalog for planning hundreds of integrations without
37
37
  pretending every catalog item is executable.
38
+ - A generated `IntegrationSpec` registry used for setup docs, admin UI steps,
39
+ normalized permissions, healthcheck plans, and tool descriptions.
38
40
 
39
41
  ## Architecture
40
42
 
@@ -78,6 +80,9 @@ pnpm add @tangle-network/agent-integrations
78
80
  | `createHttpIntegrationProvider` | Adapter for hosted integration gateways. |
79
81
  | `createConnectorAdapterProvider` | Runs first-party `ConnectorAdapter`s through the same provider contract. |
80
82
  | `declarativeRestConnector` | Builds REST-backed first-party adapters from compact specs. |
83
+ | `listIntegrationSpecs` | Generates setup/execution specs from the coverage catalog and family defaults. |
84
+ | `renderRunbookMarkdown` / `renderConsoleSteps` | Render operator docs or admin UI steps from the same spec source. |
85
+ | `validateCredentialSet` / `buildHealthcheckPlan` | Validate setup input and describe the correct healthcheck path. |
81
86
 
82
87
  ## Provider Strategy
83
88
 
package/dist/index.d.ts CHANGED
@@ -1205,6 +1205,189 @@ declare function buildIntegrationCoverageConnectors(options?: {
1205
1205
  }): IntegrationConnector[];
1206
1206
  declare function integrationCoverageChecklistMarkdown(): string;
1207
1207
 
1208
+ type IntegrationAuthMode = 'oauth2' | 'api_key' | 'hmac' | 'none' | 'custom';
1209
+ type IntegrationSpecStatus = 'catalog' | 'executable' | 'deprecated';
1210
+ type IntegrationFamilyId = 'google' | 'microsoft-graph' | 'atlassian' | 'salesforce' | 'hubspot' | 'slack' | 'notion' | 'standard-oauth2' | 'api-key' | 'hmac' | 'none';
1211
+ type NormalizedPermission = `${string}.read` | `${string}.write` | `${string}.delete` | `${string}.admin`;
1212
+ interface IntegrationSpec {
1213
+ kind: string;
1214
+ title: string;
1215
+ category: IntegrationConnectorCategory;
1216
+ status: IntegrationSpecStatus;
1217
+ family: IntegrationFamilyId;
1218
+ auth: IntegrationAuthSpec;
1219
+ permissions: PermissionDescriptor[];
1220
+ actions: IntegrationConnectorAction[];
1221
+ triggers?: IntegrationConnectorTrigger[];
1222
+ setup: IntegrationSetupSpec;
1223
+ lifecycle?: IntegrationLifecycleSpec;
1224
+ plannerHints?: IntegrationPlannerHints;
1225
+ metadata?: Record<string, unknown>;
1226
+ }
1227
+ type IntegrationAuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | HmacAuthSpec | NoneAuthSpec | CustomAuthSpec;
1228
+ interface OAuth2AuthSpec {
1229
+ mode: 'oauth2';
1230
+ authorizationUrl: string;
1231
+ tokenUrl: string;
1232
+ clientIdEnv?: string;
1233
+ clientSecretEnv?: string;
1234
+ scopes: ScopeDescriptor[];
1235
+ extraAuthParams?: Record<string, string>;
1236
+ redirectUriTemplate: string;
1237
+ pkce?: 'required' | 'supported' | 'unsupported';
1238
+ }
1239
+ interface ApiKeyAuthSpec {
1240
+ mode: 'api_key';
1241
+ credential: CredentialFieldSpec;
1242
+ placement?: 'bearer' | 'header' | 'query' | 'basic';
1243
+ }
1244
+ interface HmacAuthSpec {
1245
+ mode: 'hmac';
1246
+ credential: CredentialFieldSpec;
1247
+ signatureHeader?: string;
1248
+ }
1249
+ interface NoneAuthSpec {
1250
+ mode: 'none';
1251
+ }
1252
+ interface CustomAuthSpec {
1253
+ mode: 'custom';
1254
+ description: string;
1255
+ }
1256
+ interface ScopeDescriptor {
1257
+ normalized: NormalizedPermission;
1258
+ providerScope: string;
1259
+ title: string;
1260
+ reason: string;
1261
+ risk: IntegrationActionRisk;
1262
+ dataClass: IntegrationDataClass;
1263
+ }
1264
+ interface PermissionDescriptor {
1265
+ normalized: NormalizedPermission;
1266
+ providerScopes: string[];
1267
+ title: string;
1268
+ risk: IntegrationActionRisk;
1269
+ dataClass: IntegrationDataClass;
1270
+ reason: string;
1271
+ }
1272
+ interface CredentialFieldSpec {
1273
+ label: string;
1274
+ description: string;
1275
+ env?: string;
1276
+ example?: string;
1277
+ regex?: string;
1278
+ secret: boolean;
1279
+ }
1280
+ interface ConsoleStep {
1281
+ id: string;
1282
+ title: string;
1283
+ detail: string;
1284
+ copyValue?: string;
1285
+ }
1286
+ interface Quirk {
1287
+ id: string;
1288
+ severity: 'info' | 'warning' | 'critical';
1289
+ message: string;
1290
+ }
1291
+ interface PostSetupCheck {
1292
+ id: string;
1293
+ title: string;
1294
+ detail: string;
1295
+ }
1296
+ interface HealthcheckSpec {
1297
+ id: string;
1298
+ level: 'client_config' | 'connection' | 'webhook' | 'static';
1299
+ method?: 'GET' | 'POST';
1300
+ url?: string;
1301
+ expectedStatus?: number[];
1302
+ description: string;
1303
+ }
1304
+ interface IntegrationSetupSpec {
1305
+ consoleUrl?: string;
1306
+ consoleSteps: ConsoleStep[];
1307
+ credentialFields: CredentialFieldSpec[];
1308
+ redirectUriTemplate?: string;
1309
+ knownQuirks?: Quirk[];
1310
+ postSetup?: PostSetupCheck[];
1311
+ healthcheck?: HealthcheckSpec;
1312
+ }
1313
+ interface IntegrationLifecycleSpec {
1314
+ supportsRefresh: boolean;
1315
+ supportsRevoke: boolean;
1316
+ supportsIncrementalAuth: boolean;
1317
+ recommendedHealthcheckIntervalHours?: number;
1318
+ freshnessSloMinutes?: number;
1319
+ }
1320
+ interface IntegrationPlannerHints {
1321
+ useFor: string[];
1322
+ avoidFor?: string[];
1323
+ dataFreshness: 'realtime' | 'near_realtime' | 'eventual' | 'manual';
1324
+ writeRisk: 'low' | 'medium' | 'high';
1325
+ }
1326
+ interface IntegrationFamilySpec {
1327
+ id: IntegrationFamilyId;
1328
+ title: string;
1329
+ authMode: IntegrationAuthMode;
1330
+ consoleUrl?: string;
1331
+ authorizationUrl?: string;
1332
+ tokenUrl?: string;
1333
+ redirectUriTemplate?: string;
1334
+ credentialFields: CredentialFieldSpec[];
1335
+ consoleSteps: ConsoleStep[];
1336
+ knownQuirks?: Quirk[];
1337
+ lifecycle: IntegrationLifecycleSpec;
1338
+ }
1339
+ interface IntegrationSpecValidationIssue {
1340
+ path: string;
1341
+ message: string;
1342
+ }
1343
+ interface IntegrationSpecValidationResult {
1344
+ ok: boolean;
1345
+ issues: IntegrationSpecValidationIssue[];
1346
+ }
1347
+ interface RenderSpecOptions {
1348
+ host: string;
1349
+ callbackPath?: string;
1350
+ }
1351
+ interface RenderedConsoleStep extends ConsoleStep {
1352
+ detail: string;
1353
+ copyValue?: string;
1354
+ }
1355
+ interface CredentialValidationInput {
1356
+ field: CredentialFieldSpec;
1357
+ value: string;
1358
+ }
1359
+ interface CredentialValidationResult {
1360
+ ok: boolean;
1361
+ field: string;
1362
+ message?: string;
1363
+ }
1364
+ interface HealthcheckPlan {
1365
+ kind: string;
1366
+ healthcheck: HealthcheckSpec;
1367
+ requires: Array<'client_id' | 'client_secret' | 'api_key' | 'hmac_secret' | 'connection_credentials'>;
1368
+ message: string;
1369
+ }
1370
+ declare function specAuthToConnectorAuth(auth: IntegrationAuthSpec): IntegrationConnector['auth'];
1371
+
1372
+ declare const INTEGRATION_FAMILIES: Record<IntegrationFamilyId, IntegrationFamilySpec>;
1373
+ declare function getIntegrationFamily(id: IntegrationFamilyId): IntegrationFamilySpec;
1374
+
1375
+ declare function listIntegrationSpecs(): IntegrationSpec[];
1376
+ declare function getIntegrationSpec(kind: string): IntegrationSpec | undefined;
1377
+ declare function listExecutableIntegrationSpecs(): IntegrationSpec[];
1378
+ declare function integrationSpecToConnector(spec: IntegrationSpec, providerId?: string): IntegrationConnector;
1379
+
1380
+ declare function renderConsoleSteps(spec: IntegrationSpec, options: RenderSpecOptions): RenderedConsoleStep[];
1381
+ declare function renderRunbookMarkdown(spec: IntegrationSpec, options: RenderSpecOptions): string;
1382
+ declare function renderAgentToolDescription(spec: IntegrationSpec): string;
1383
+ declare function buildHealthcheckPlan(spec: IntegrationSpec): HealthcheckPlan;
1384
+ declare function consoleStepsToText(steps: ConsoleStep[]): string;
1385
+
1386
+ declare function validateIntegrationSpec(spec: IntegrationSpec): IntegrationSpecValidationResult;
1387
+ declare function assertValidIntegrationSpec(spec: IntegrationSpec): void;
1388
+ declare function validateCredentialFormat(field: CredentialFieldSpec, value: string): CredentialValidationResult;
1389
+ declare function validateCredentialSet(spec: IntegrationSpec, values: Record<string, string>): CredentialValidationResult[];
1390
+
1208
1391
  type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'executor' | 'custom';
1209
1392
  type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
1210
1393
  type IntegrationActionRisk = 'read' | 'write' | 'destructive';
@@ -1501,4 +1684,4 @@ declare function createHttpIntegrationProvider(options: HttpIntegrationProviderO
1501
1684
  declare function signCapability(capability: IntegrationCapability, secret: string): string;
1502
1685
  declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
1503
1686
 
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 };
1687
+ export { type ApiKeyAuthSpec, 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, type ConsoleStep, type CredentialFieldSpec, type CredentialValidationInput, type CredentialValidationResult, CredentialsExpired, type CustomAuthSpec, DEFAULT_SIGNATURE_TOLERANCE_SECONDS, type DataSourceMetadata, type EventHandlerResult, type ExchangeCodeInput, type GenericHmacVerifyOptions, type GoogleCalendarOptions, type GoogleSheetsOptions, type GraphqlOperationSpec, type HealthcheckPlan, type HealthcheckSpec, type HmacAuthSpec, type HttpIntegrationProviderOptions, type HubSpotOptions, INTEGRATION_FAMILIES, type ImportCatalogOptions, InMemoryConnectionStore, InMemoryOAuthFlowStore, type InboundEvent, type IntegrationActionGuard, type IntegrationActionPack, type IntegrationActionRequest, type IntegrationActionResult, type IntegrationActionRisk, type IntegrationActor, type IntegrationApprovalRequest, type IntegrationApprovalResolution, type IntegrationAuthMode, type IntegrationAuthSpec, type IntegrationCapability, type IntegrationConnection, type IntegrationConnectionStore, type IntegrationConnector, type IntegrationConnectorAction, type IntegrationConnectorCategory, type IntegrationConnectorTrigger, type IntegrationCoveragePriority, type IntegrationCoverageSpec, type IntegrationDataClass, IntegrationError, type IntegrationFamilyId, type IntegrationFamilySpec, type IntegrationGuardContext, IntegrationHub, type IntegrationHubOptions, type IntegrationInvocationEnvelope, type IntegrationInvocationEnvelopeValidationOptions, type IntegrationLifecycleSpec, type IntegrationPlannerHints, type IntegrationPolicyDecision, type IntegrationPolicyEffect, type IntegrationPolicyEngine, type IntegrationPolicyRule, type IntegrationProvider, type IntegrationProviderKind, type IntegrationSetupSpec, type IntegrationSpec, type IntegrationSpecStatus, type IntegrationSpecValidationIssue, type IntegrationSpecValidationResult, 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 NoneAuthSpec, type NormalizedIntegrationResult, type NormalizedPermission, type NotionDatabaseOptions, type OAuth2AuthSpec, type OAuthFlowStore, type OAuthTokens, type OpenApiDocument, type OpenApiOperation, type ParsedStripeSignatureHeader, type PendingOAuthFlow, type PermissionDescriptor, type PostSetupCheck, type Quirk, type RateLimitSpec, type RefreshInput, type RenderSpecOptions, type RenderedConsoleStep, type ResolvedDataSource, ResourceContention, type RestConnectorSpec, type RestCredentialPlacement, type RestOperationSpec, type RestRequestSpec, type ScopeDescriptor, 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, assertValidIntegrationSpec, buildApprovalRequest, buildHealthcheckPlan, buildIntegrationCoverageConnectors, buildIntegrationInvocationEnvelope, buildIntegrationToolCatalog, consoleStepsToText, consumePendingFlow, createConnectorAdapterProvider, createDefaultIntegrationPolicyEngine, createHttpIntegrationProvider, createMockIntegrationProvider, declarativeRestConnector, exchangeAuthorizationCode, firstHeader, getIntegrationFamily, getIntegrationSpec, githubConnector, gitlabConnector, googleCalendar, googleSheets, hubspot, importGraphqlConnector, importMcpConnector, importOpenApiConnector, integrationCoverageChecklistMarkdown, integrationSpecToConnector, integrationToolName, invocationRequestFromEnvelope, listExecutableIntegrationSpecs, listIntegrationCoverageSpecs, listIntegrationSpecs, manifestToConnector, microsoftCalendar, normalizeIntegrationResult, notionDatabase, parseIntegrationToolName, parseStripeSignatureHeader, redactApprovalRequest, redactCapability, redactInvocationEnvelope, refreshAccessToken, renderAgentToolDescription, renderConsoleSteps, renderRunbookMarkdown, salesforceConnector, sanitizeConnection, searchIntegrationTools, signCapability, slack, slackEventsConnector, specAuthToConnectorAuth, startOAuthFlow, stripePackConnector, stripeWebhookReceiverConnector, toMcpTools, twilioSmsConnector, validateConnectorManifest, validateCredentialFormat, validateCredentialSet, validateIntegrationInvocationEnvelope, validateIntegrationSpec, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature, webhookConnector };