@tangle-network/agent-integrations 0.32.0 → 0.33.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.
Files changed (49) hide show
  1. package/dist/bin/tangle-catalog-runtime.js +7 -7
  2. package/dist/catalog.d.ts +74 -8
  3. package/dist/catalog.js +7 -7
  4. package/dist/{chunk-JCHD6L3B.js → chunk-43VQSANC.js} +2 -2
  5. package/dist/{chunk-F4YILONK.js → chunk-6N23S4JY.js} +21530 -257
  6. package/dist/chunk-6N23S4JY.js.map +1 -0
  7. package/dist/{chunk-VVC7U7W7.js → chunk-7T5YTVER.js} +51 -2
  8. package/dist/chunk-7T5YTVER.js.map +1 -0
  9. package/dist/{chunk-Q5X3QNHR.js → chunk-NQ7OPDUM.js} +261 -1
  10. package/dist/chunk-NQ7OPDUM.js.map +1 -0
  11. package/dist/{chunk-S2MVWQYL.js → chunk-RF3RH374.js} +2 -2
  12. package/dist/{chunk-DN6DNPPH.js → chunk-XO2RSS6Y.js} +125 -11
  13. package/dist/chunk-XO2RSS6Y.js.map +1 -0
  14. package/dist/{chunk-CDY2ETYT.js → chunk-YPZORI3G.js} +2 -2
  15. package/dist/connect/index.d.ts +2 -1
  16. package/dist/connect/index.js +2 -2
  17. package/dist/connectors/adapters/index.d.ts +113 -25
  18. package/dist/connectors/adapters/index.js +4 -2
  19. package/dist/connectors/index.d.ts +3 -2
  20. package/dist/connectors/index.js +4 -2
  21. package/dist/consumer-CzJgntej.d.ts +292 -0
  22. package/dist/consumer.d.ts +6 -8
  23. package/dist/consumer.js +2 -2
  24. package/dist/core-types-D5Dc65Ud.d.ts +355 -0
  25. package/dist/index.d.ts +1282 -4
  26. package/dist/index.js +13 -7
  27. package/dist/middleware/index.d.ts +2 -1
  28. package/dist/middleware/index.js +2 -2
  29. package/dist/registry.d.ts +3 -2424
  30. package/dist/registry.js +7 -7
  31. package/dist/runtime.d.ts +137 -8
  32. package/dist/runtime.js +7 -7
  33. package/dist/specs.d.ts +208 -8
  34. package/dist/specs.js +1 -1
  35. package/dist/tangle-catalog-runtime-2HddXxoM.d.ts +242 -0
  36. package/dist/tangle-catalog-runtime.d.ts +3 -8
  37. package/dist/tangle-catalog-runtime.js +7 -7
  38. package/dist/tangle-id-DA_qj-O_.d.ts +192 -0
  39. package/dist/{tangle-id-Dj0ipP4E.d.ts → types-XdpvaIzW.d.ts} +1 -167
  40. package/docs/integration-execution-audit.md +7 -5
  41. package/docs/integration-execution-matrix.json +32 -0
  42. package/package.json +12 -10
  43. package/dist/chunk-DN6DNPPH.js.map +0 -1
  44. package/dist/chunk-F4YILONK.js.map +0 -1
  45. package/dist/chunk-Q5X3QNHR.js.map +0 -1
  46. package/dist/chunk-VVC7U7W7.js.map +0 -1
  47. /package/dist/{chunk-JCHD6L3B.js.map → chunk-43VQSANC.js.map} +0 -0
  48. /package/dist/{chunk-S2MVWQYL.js.map → chunk-RF3RH374.js.map} +0 -0
  49. /package/dist/{chunk-CDY2ETYT.js.map → chunk-YPZORI3G.js.map} +0 -0
@@ -1,17 +1,7 @@
1
- import { C as ConnectorAdapter, R as ResolvedDataSource, d as ConnectorCredentials } from './tangle-id-Dj0ipP4E.js';
2
- import './errors-Bg3_rxnQ.js';
3
- import './connect/index.js';
4
- import './middleware/index.js';
5
- import './connectors/index.js';
6
- import './connectors/adapters/index.js';
7
- import { Server, IncomingMessage, ServerResponse } from 'node:http';
1
+ import { b as IntegrationConnector, h as IntegrationCatalogSource } from './core-types-D5Dc65Ud.js';
2
+ import './types-XdpvaIzW.js';
8
3
 
9
4
  type IntegrationSupportTier = 'catalogOnly' | 'setupReady' | 'gatewayExecutable' | 'firstPartyExecutable' | 'sandboxExecutable';
10
- interface IntegrationCatalogSource {
11
- id: string;
12
- connectors: IntegrationConnector[];
13
- precedence?: number;
14
- }
15
5
  interface IntegrationRegistrySourceRef {
16
6
  sourceId: string;
17
7
  providerId: string;
@@ -85,2415 +75,4 @@ declare function summarizeIntegrationRegistry(registry: IntegrationRegistry): In
85
75
  declare function canonicalConnectorId(id: string, aliases?: Record<string, string>): string;
86
76
  declare function inferIntegrationSupportTier(connector: IntegrationConnector): IntegrationSupportTier;
87
77
 
88
- /** OAuth client credentials the host resolves at start/exchange time.
89
- * The lib never reads env or any vault — kept edge-runtime-safe. */
90
- interface OAuthClientCredentials {
91
- clientId: string;
92
- clientSecret: string;
93
- }
94
- interface ConnectorAdapterProviderOptions {
95
- id?: string;
96
- kind?: IntegrationProviderKind;
97
- adapters: ConnectorAdapter[];
98
- resolveDataSource: (connection: IntegrationConnection) => Promise<ResolvedDataSource> | ResolvedDataSource;
99
- /** Invoked when an adapter rotates credentials during executeRead /
100
- * executeMutation (e.g. an OAuth access token refreshed on expiry). The
101
- * host re-encrypts + persists the rotated envelope so the next expiry
102
- * does not force a reconnect. Carries the connection so the host can
103
- * resolve the secretRef. */
104
- onCredentialsRotated?: (event: {
105
- connection: IntegrationConnection;
106
- credentials: ConnectorCredentials;
107
- }) => Promise<void> | void;
108
- /** Resolve OAuth client_id / client_secret for an oauth2 adapter at
109
- * start- and exchange-time. Host owns env, vault, and per-tenant
110
- * overrides. Return null to refuse the flow (lib will throw
111
- * `config_missing`). The lib never logs the secret nor includes it
112
- * in thrown error messages. */
113
- resolveOAuthClient?: (input: {
114
- connectorId: string;
115
- }) => Promise<OAuthClientCredentials | null> | OAuthClientCredentials | null;
116
- /** Fetch implementation forwarded to the OAuth token exchange. Default
117
- * is `globalThis.fetch`. Tests inject a mock. */
118
- fetchImpl?: typeof fetch;
119
- now?: () => Date;
120
- }
121
- declare function createConnectorAdapterProvider(options: ConnectorAdapterProviderOptions): IntegrationProvider;
122
- declare function adapterManifestsToConnectors(adapters: ConnectorAdapter[], providerId?: string): IntegrationConnector[];
123
- declare function createConnectorAdapterCatalogSource(options: {
124
- id?: string;
125
- providerId?: string;
126
- adapters: ConnectorAdapter[];
127
- precedence?: number;
128
- }): IntegrationCatalogSource;
129
- declare function manifestToConnector(providerId: string, adapter: ConnectorAdapter): IntegrationConnector;
130
-
131
- interface IntegrationSecretStore {
132
- get(ref: SecretRef): Promise<ConnectorCredentials | undefined> | ConnectorCredentials | undefined;
133
- put(ref: SecretRef, credentials: ConnectorCredentials): Promise<void> | void;
134
- delete?(ref: SecretRef): Promise<void> | void;
135
- }
136
- /** Single-use record stashed at OAuth-start and consumed once at callback to
137
- * guard against CSRF / replay. The hub injects its own durable
138
- * implementation (KV/Redis/D1) so the callback can land on any worker. */
139
- interface IntegrationOAuthState {
140
- /** Opaque value round-tripped through the provider redirect. */
141
- state: string;
142
- /** Provider the auth flow targets. */
143
- providerId: string;
144
- /** Connector the user is connecting. */
145
- connectorId: string;
146
- /** Owner initiating the flow. */
147
- owner: IntegrationActor;
148
- /** Scopes requested at start; verified against the granted scopes on callback. */
149
- requestedScopes: string[];
150
- /** Redirect URI used at start; MUST match exactly on callback exchange. */
151
- redirectUri: string;
152
- /** PKCE code_verifier, when the connector uses PKCE. */
153
- codeVerifier?: string;
154
- /** Absolute expiry (UTC ms since epoch). consume() MUST treat an expired
155
- * record as a miss. */
156
- expiresAt: number;
157
- /** Arbitrary non-secret context the host pinned at start-time. */
158
- metadata?: Record<string, unknown>;
159
- }
160
- /** Outcome of consuming an OAuth state record. Callers MUST inspect `ok`
161
- * before using `state`; a miss (`unknown`/`expired`) is the CSRF/replay
162
- * guard firing, not an exception. */
163
- type IntegrationOAuthStateOutcome = {
164
- ok: true;
165
- state: IntegrationOAuthState;
166
- } | {
167
- ok: false;
168
- reason: 'unknown' | 'expired';
169
- };
170
- /** Host-injectable store for single-use OAuth-start records. The default is
171
- * in-memory for local/dev and tests; multi-tenant hubs inject a durable
172
- * encrypted store so callbacks survive worker hops. consume() MUST be
173
- * single-use: a second consume of the same state returns `{ ok: false }`. */
174
- interface IntegrationOAuthStateStore {
175
- put(state: IntegrationOAuthState): Promise<void> | void;
176
- consume(state: string): Promise<IntegrationOAuthStateOutcome> | IntegrationOAuthStateOutcome;
177
- sweep?(now: number): Promise<void> | void;
178
- }
179
- interface ConnectionCredentialResolverOptions {
180
- secrets: IntegrationSecretStore;
181
- connections?: IntegrationConnectionStore;
182
- adapters?: ConnectorAdapter[];
183
- now?: () => Date;
184
- markConnectionError?: (connection: IntegrationConnection, error: Error) => Promise<void> | void;
185
- }
186
- declare class InMemoryIntegrationSecretStore implements IntegrationSecretStore {
187
- private readonly secrets;
188
- get(ref: SecretRef): ConnectorCredentials | undefined;
189
- put(ref: SecretRef, credentials: ConnectorCredentials): void;
190
- delete(ref: SecretRef): void;
191
- }
192
- /** Test/dev double for {@link IntegrationOAuthStateStore}. Production hubs
193
- * inject a durable implementation; this one keeps records in a Map and
194
- * enforces the single-use + expiry contract. */
195
- declare class InMemoryIntegrationOAuthStateStore implements IntegrationOAuthStateStore {
196
- private readonly states;
197
- put(state: IntegrationOAuthState): void;
198
- consume(state: string): IntegrationOAuthStateOutcome;
199
- sweep(now: number): void;
200
- }
201
- declare function createConnectionCredentialResolver(options: ConnectionCredentialResolverOptions): (connection: IntegrationConnection) => Promise<ResolvedDataSource>;
202
- declare function resolveConnectionCredentials(input: IntegrationConnection, options: ConnectionCredentialResolverOptions): Promise<ConnectorCredentials>;
203
- type CredentialBackedAdapterProviderOptions = Omit<ConnectorAdapterProviderOptions, 'resolveDataSource' | 'onCredentialsRotated'> & ConnectionCredentialResolverOptions & {
204
- /** Fired after the provider re-persists rotated credentials to the
205
- * secret + connection stores. Receives the hub-shaped event including
206
- * the resolved secretRef so the host can drive external re-encryption
207
- * or telemetry. */
208
- onCredentialsRotated?: (event: IntegrationCredentialsRotatedEvent) => Promise<void> | void;
209
- };
210
- declare function createCredentialBackedAdapterProvider(options: CredentialBackedAdapterProviderOptions): IntegrationProvider;
211
- declare function revokeConnection(input: {
212
- connection: IntegrationConnection;
213
- connections?: IntegrationConnectionStore;
214
- secrets?: IntegrationSecretStore;
215
- now?: () => Date;
216
- }): Promise<IntegrationConnection>;
217
-
218
- type IntegrationAuditEventType = 'connection.created' | 'connection.updated' | 'connection.revoked' | 'grant.created' | 'grant.revoked' | 'capability.issued' | 'action.invoked' | 'action.failed' | 'trigger.subscribed' | 'trigger.received' | 'workflow.installed' | 'approval.requested' | 'approval.resolved' | 'healthcheck.completed';
219
- interface IntegrationAuditEvent {
220
- id: string;
221
- type: IntegrationAuditEventType;
222
- occurredAt: string;
223
- actor?: IntegrationActor;
224
- connectionId?: string;
225
- providerId?: string;
226
- connectorId?: string;
227
- action?: string;
228
- risk?: IntegrationConnectorAction['risk'];
229
- dataClass?: IntegrationDataClass;
230
- ok?: boolean;
231
- message?: string;
232
- metadata?: Record<string, unknown>;
233
- }
234
- interface IntegrationAuditSink {
235
- record(event: IntegrationAuditEvent): Promise<void> | void;
236
- }
237
- interface IntegrationAuditStore extends IntegrationAuditSink {
238
- list(filter?: IntegrationAuditFilter): Promise<IntegrationAuditEvent[]> | IntegrationAuditEvent[];
239
- }
240
- interface IntegrationAuditFilter {
241
- type?: IntegrationAuditEventType;
242
- actor?: IntegrationActor;
243
- connectionId?: string;
244
- providerId?: string;
245
- connectorId?: string;
246
- action?: string;
247
- }
248
- declare class InMemoryIntegrationAuditStore implements IntegrationAuditStore {
249
- private readonly events;
250
- record(event: IntegrationAuditEvent): void;
251
- list(filter?: IntegrationAuditFilter): IntegrationAuditEvent[];
252
- }
253
- declare function createIntegrationAuditEvent(input: Omit<IntegrationAuditEvent, 'id' | 'occurredAt'> & {
254
- id?: string;
255
- occurredAt?: string | Date;
256
- now?: () => Date;
257
- }): IntegrationAuditEvent;
258
- declare function createAuditingActionGuard(options: {
259
- sink: IntegrationAuditSink;
260
- subject?: IntegrationActor;
261
- now?: () => Date;
262
- includeInputPreview?: boolean;
263
- }): IntegrationActionGuard;
264
- declare function sanitizeAuditConnection(connection: IntegrationConnection): Record<string, unknown>;
265
-
266
- type IntegrationApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired';
267
- interface IntegrationApprovalRecord {
268
- id: string;
269
- request: IntegrationApprovalRequest;
270
- status: IntegrationApprovalStatus;
271
- requestedAt: string;
272
- resolvedAt?: string;
273
- resolvedBy?: IntegrationActor;
274
- reason?: string;
275
- expiresAt?: string;
276
- metadata?: Record<string, unknown>;
277
- }
278
- interface IntegrationApprovalStore {
279
- get(approvalId: string): Promise<IntegrationApprovalRecord | undefined> | IntegrationApprovalRecord | undefined;
280
- put(record: IntegrationApprovalRecord): Promise<void> | void;
281
- list(filter?: IntegrationApprovalFilter): Promise<IntegrationApprovalRecord[]> | IntegrationApprovalRecord[];
282
- }
283
- interface IntegrationApprovalFilter {
284
- status?: IntegrationApprovalStatus;
285
- connectionId?: string;
286
- connectorId?: string;
287
- action?: string;
288
- actor?: IntegrationActor;
289
- }
290
- interface ApprovalBackedPolicyOptions {
291
- base: IntegrationPolicyEngine;
292
- store: IntegrationApprovalStore;
293
- audit?: IntegrationAuditSink;
294
- now?: () => Date;
295
- approvalTtlMs?: number;
296
- }
297
- declare class InMemoryIntegrationApprovalStore implements IntegrationApprovalStore {
298
- private readonly records;
299
- get(approvalId: string): IntegrationApprovalRecord | undefined;
300
- put(record: IntegrationApprovalRecord): void;
301
- list(filter?: IntegrationApprovalFilter): IntegrationApprovalRecord[];
302
- }
303
- declare class ApprovalBackedPolicyEngine implements IntegrationPolicyEngine {
304
- private readonly base;
305
- private readonly store;
306
- private readonly audit;
307
- private readonly now;
308
- private readonly approvalTtlMs;
309
- constructor(options: ApprovalBackedPolicyOptions);
310
- decide(ctx: IntegrationGuardContext & {
311
- subject: IntegrationActor;
312
- }): Promise<IntegrationPolicyDecision>;
313
- private findApprovedRecord;
314
- }
315
- declare function createApprovalBackedPolicyEngine(options: ApprovalBackedPolicyOptions): ApprovalBackedPolicyEngine;
316
- declare function resolveIntegrationApproval(input: {
317
- store: IntegrationApprovalStore;
318
- approvalId: string;
319
- approved: boolean;
320
- resolvedBy: IntegrationActor;
321
- reason?: string;
322
- metadata?: Record<string, unknown>;
323
- audit?: IntegrationAuditSink;
324
- now?: () => Date;
325
- }): Promise<IntegrationApprovalRecord>;
326
-
327
- declare const CANONICAL_INTEGRATION_ACTIONS: {
328
- readonly googleCalendarEventsList: "google-calendar.events.list";
329
- readonly googleCalendarEventsCreate: "google-calendar.events.create";
330
- readonly gmailMessagesSearch: "gmail.messages.search";
331
- readonly gmailMessagesSend: "gmail.messages.send";
332
- readonly googleDriveFilesSearch: "google-drive.files.search";
333
- readonly googleDriveFilesRead: "google-drive.files.read";
334
- readonly githubRepositoriesGet: "github.repositories.get";
335
- readonly githubIssuesSearch: "github.issues.search";
336
- readonly githubIssuesCreate: "github.issues.create";
337
- readonly githubPullRequestsComment: "github.pull-requests.comment";
338
- readonly slackChannelsList: "slack.channels.list";
339
- readonly slackMessagesSearch: "slack.messages.search";
340
- readonly slackMessagesPost: "slack.messages.post";
341
- readonly providerHttpRequest: "provider.http.request";
342
- };
343
- type CanonicalIntegrationActionId = typeof CANONICAL_INTEGRATION_ACTIONS[keyof typeof CANONICAL_INTEGRATION_ACTIONS];
344
- interface CanonicalLaunchConnectorOptions {
345
- providerId?: string;
346
- includeProviderPassthrough?: boolean;
347
- }
348
- declare function buildCanonicalLaunchConnectors(options?: CanonicalLaunchConnectorOptions): IntegrationConnector[];
349
- declare function canonicalActionConnectorId(actionId: string): string | undefined;
350
-
351
- interface IntegrationToolDefinition {
352
- name: string;
353
- title: string;
354
- description: string;
355
- providerId: string;
356
- connectorId: string;
357
- connectorTitle: string;
358
- category: IntegrationConnectorCategory;
359
- action: IntegrationConnectorAction;
360
- risk: IntegrationActionRisk;
361
- dataClass: IntegrationDataClass;
362
- requiredScopes: string[];
363
- inputSchema?: unknown;
364
- outputSchema?: unknown;
365
- tags: string[];
366
- supportTier?: IntegrationSupportTier;
367
- runnable?: boolean;
368
- }
369
- interface IntegrationCatalogView {
370
- connectors: IntegrationConnector[];
371
- conflicts: IntegrationRegistry['entries'][number]['conflicts'];
372
- summary: IntegrationRegistrySummary;
373
- tools: IntegrationToolDefinition[];
374
- runtimeTools: IntegrationToolDefinition[];
375
- discoveryTools: IntegrationToolDefinition[];
376
- }
377
- interface IntegrationToolSearchFilters {
378
- providerId?: string;
379
- connectorId?: string;
380
- category?: IntegrationConnectorCategory;
381
- maxRisk?: IntegrationActionRisk;
382
- dataClass?: IntegrationDataClass;
383
- limit?: number;
384
- }
385
- interface IntegrationToolSearchResult {
386
- tool: IntegrationToolDefinition;
387
- score: number;
388
- matched: string[];
389
- }
390
- interface McpToolDefinition {
391
- name: string;
392
- description: string;
393
- inputSchema: unknown;
394
- }
395
- declare function integrationToolName(providerId: string, connectorId: string, actionId: string): string;
396
- declare function parseIntegrationToolName(name: string): {
397
- providerId: string;
398
- connectorId: string;
399
- actionId: string;
400
- };
401
- declare function buildIntegrationToolCatalog(connectors: IntegrationConnector[]): IntegrationToolDefinition[];
402
- /** Flatten a single (connector, action) pair into the tool descriptor the
403
- * catalog exposes. The inverse of {@link parseIntegrationToolName} +
404
- * {@link integrationToolName}: every tool name round-trips back to exactly
405
- * this shape via {@link describeIntegrationTool}. */
406
- declare function flattenIntegrationToolDefinition(connector: IntegrationConnector, action: IntegrationConnectorAction): IntegrationToolDefinition;
407
- /** Resolve a single tool's full descriptor from an opaque
408
- * `int_<provider>_<connector>_<action>` name against a composed registry.
409
- * Returns undefined when the name is malformed, the connector is unknown,
410
- * or the action is not defined by that connector. Powers `/tools/describe`
411
- * without callers re-implementing parse → byId → action → flatten. */
412
- declare function describeIntegrationTool(registry: IntegrationRegistry, toolName: string): IntegrationToolDefinition | undefined;
413
- declare function buildIntegrationCatalogView(input: {
414
- discoveryRegistry: IntegrationRegistry;
415
- executableRegistry?: IntegrationRegistry;
416
- }): IntegrationCatalogView;
417
- declare function searchIntegrationTools(catalog: IntegrationToolDefinition[], query: string, filters?: IntegrationToolSearchFilters): IntegrationToolSearchResult[];
418
- declare function toMcpTools(tools: IntegrationToolDefinition[]): McpToolDefinition[];
419
-
420
- type IntegrationRequirementMode = 'read' | 'write' | 'trigger';
421
- type IntegrationRequirementStatus = 'ready' | 'missing_connection' | 'not_executable' | 'unknown_connector';
422
- interface IntegrationRequirement {
423
- id: string;
424
- connectorId: string;
425
- reason: string;
426
- mode: IntegrationRequirementMode;
427
- requiredActions?: string[];
428
- requiredTriggers?: string[];
429
- requiredScopes?: string[];
430
- optional?: boolean;
431
- }
432
- interface IntegrationManifest {
433
- id: string;
434
- title?: string;
435
- owner?: IntegrationActor;
436
- requirements: IntegrationRequirement[];
437
- metadata?: Record<string, unknown>;
438
- }
439
- interface IntegrationRequirementResolution {
440
- requirement: IntegrationRequirement;
441
- status: IntegrationRequirementStatus;
442
- connector?: IntegrationConnector;
443
- registryEntry?: IntegrationRegistryEntry;
444
- connection?: IntegrationConnection;
445
- missingScopes: string[];
446
- missingActions: string[];
447
- missingTriggers: string[];
448
- message: string;
449
- }
450
- interface IntegrationManifestResolution {
451
- manifest: IntegrationManifest;
452
- owner: IntegrationActor;
453
- ready: IntegrationRequirementResolution[];
454
- missing: IntegrationRequirementResolution[];
455
- optionalMissing: IntegrationRequirementResolution[];
456
- }
457
- interface IntegrationGrant {
458
- id: string;
459
- manifestId: string;
460
- requirementId: string;
461
- owner: IntegrationActor;
462
- grantee: IntegrationActor;
463
- connectionId: string;
464
- connectorId: string;
465
- scopes: string[];
466
- allowedActions: string[];
467
- allowedTriggers: string[];
468
- status: 'active' | 'revoked';
469
- createdAt: string;
470
- updatedAt: string;
471
- metadata?: Record<string, unknown>;
472
- }
473
- interface IntegrationGrantStore {
474
- get(grantId: string): Promise<IntegrationGrant | undefined> | IntegrationGrant | undefined;
475
- put(grant: IntegrationGrant): Promise<void> | void;
476
- listByManifest(manifestId: string, grantee?: IntegrationActor): Promise<IntegrationGrant[]> | IntegrationGrant[];
477
- listByGrantee(grantee: IntegrationActor): Promise<IntegrationGrant[]> | IntegrationGrant[];
478
- listByIds?(grantIds: string[]): Promise<IntegrationGrant[]> | IntegrationGrant[];
479
- delete?(grantId: string): Promise<void> | void;
480
- }
481
- interface IntegrationCapabilityBinding {
482
- requirementId: string;
483
- connectorId: string;
484
- connectionId: string;
485
- grantId: string;
486
- scopes: string[];
487
- allowedActions: string[];
488
- allowedTriggers: string[];
489
- capability: IssuedIntegrationCapability;
490
- }
491
- interface IntegrationSandboxBundle {
492
- manifestId: string;
493
- subject: IntegrationActor;
494
- capabilities: IntegrationCapabilityBinding[];
495
- connectors: IntegrationConnector[];
496
- tools: IntegrationToolDefinition[];
497
- expiresAt: string;
498
- }
499
- interface IntegrationRuntimeHub {
500
- listRegistry(): Promise<IntegrationRegistry> | IntegrationRegistry;
501
- listConnections(owner: IntegrationActor): Promise<IntegrationConnection[]> | IntegrationConnection[];
502
- getConnection(connectionId: string): Promise<IntegrationConnection | undefined> | IntegrationConnection | undefined;
503
- issueCapability(input: {
504
- subject: IntegrationActor;
505
- connectionId: string;
506
- scopes: string[];
507
- allowedActions: string[];
508
- ttlMs: number;
509
- metadata?: Record<string, unknown>;
510
- }): Promise<IssuedIntegrationCapability> | IssuedIntegrationCapability;
511
- }
512
- interface IntegrationRuntimeOptions {
513
- hub: IntegrationRuntimeHub;
514
- grants?: IntegrationGrantStore;
515
- now?: () => Date;
516
- }
517
- declare class InMemoryIntegrationGrantStore implements IntegrationGrantStore {
518
- private readonly grants;
519
- get(grantId: string): IntegrationGrant | undefined;
520
- put(grant: IntegrationGrant): void;
521
- listByManifest(manifestId: string, grantee?: IntegrationActor): IntegrationGrant[];
522
- listByGrantee(grantee: IntegrationActor): IntegrationGrant[];
523
- listByIds(grantIds: string[]): IntegrationGrant[];
524
- delete(grantId: string): void;
525
- }
526
- declare class IntegrationRuntime {
527
- private readonly hub;
528
- private readonly grants;
529
- private readonly now;
530
- constructor(options: IntegrationRuntimeOptions);
531
- registry(): Promise<IntegrationRegistry>;
532
- resolveManifest(manifest: IntegrationManifest, owner: IntegrationActor): Promise<IntegrationManifestResolution>;
533
- createGrants(input: {
534
- manifest: IntegrationManifest;
535
- owner: IntegrationActor;
536
- grantee: IntegrationActor;
537
- metadata?: Record<string, unknown>;
538
- }): Promise<IntegrationGrant[]>;
539
- buildSandboxBundle(input: {
540
- manifestId?: string;
541
- grantIds?: string[];
542
- owner: IntegrationActor;
543
- subject: IntegrationActor;
544
- ttlMs: number;
545
- grantee?: IntegrationActor;
546
- }): Promise<IntegrationSandboxBundle>;
547
- private resolveBundleGrants;
548
- }
549
- declare function createIntegrationRuntime(options: IntegrationRuntimeOptions): IntegrationRuntime;
550
-
551
- declare const DEFAULT_INTEGRATION_BRIDGE_ENV = "TANGLE_INTEGRATION_BUNDLE";
552
- interface IntegrationBridgePayload {
553
- version: 1;
554
- manifestId: string;
555
- subject: IntegrationSandboxBundle['subject'];
556
- expiresAt: string;
557
- tools: IntegrationBridgeToolBinding[];
558
- }
559
- interface IntegrationBridgeToolBinding {
560
- name: string;
561
- title: string;
562
- connectorId: string;
563
- connectionId: string;
564
- action: string;
565
- risk: string;
566
- dataClass: string;
567
- requiredScopes: string[];
568
- capabilityToken: string;
569
- }
570
- declare function buildIntegrationBridgePayload(bundle: IntegrationSandboxBundle): IntegrationBridgePayload;
571
- declare function encodeIntegrationBridgePayload(payload: IntegrationBridgePayload): string;
572
- declare function decodeIntegrationBridgePayload(encoded: string): IntegrationBridgePayload;
573
- declare function buildIntegrationBridgeEnvironment(bundle: IntegrationSandboxBundle, options?: {
574
- envVar?: string;
575
- }): Record<string, string>;
576
- declare function parseIntegrationBridgeEnvironment(env: Record<string, string | undefined>, options?: {
577
- envVar?: string;
578
- }): IntegrationBridgePayload;
579
- declare function redactIntegrationBridgePayload(payload: IntegrationBridgePayload): IntegrationBridgePayload;
580
-
581
- interface TangleIntegrationsClientOptions {
582
- endpoint: string;
583
- bridge?: IntegrationBridgePayload;
584
- env?: Record<string, string | undefined>;
585
- envVar?: string;
586
- fetchImpl?: typeof fetch;
587
- getCapabilityToken?: (tool: IntegrationBridgeToolBinding) => string | Promise<string>;
588
- }
589
- interface TangleIntegrationInvokeInput<TInput = unknown> {
590
- tool: string;
591
- input?: TInput;
592
- idempotencyKey?: string;
593
- dryRun?: boolean;
594
- metadata?: Record<string, unknown>;
595
- }
596
- interface TangleIntegrationInvokeResult<TOutput = unknown> {
597
- status: 'ok' | 'approval_required' | 'failed';
598
- action: string;
599
- output?: TOutput;
600
- approval?: unknown;
601
- error?: string;
602
- metadata?: Record<string, unknown>;
603
- }
604
- declare class TangleIntegrationsClient {
605
- private readonly endpoint;
606
- private readonly bridge;
607
- private readonly fetchImpl;
608
- private readonly getCapabilityToken;
609
- constructor(options: TangleIntegrationsClientOptions);
610
- tools(): IntegrationBridgeToolBinding[];
611
- findTool(toolOrAction: string): IntegrationBridgeToolBinding;
612
- invoke<TOutput = unknown, TInput = unknown>(input: TangleIntegrationInvokeInput<TInput>): Promise<TangleIntegrationInvokeResult<TOutput>>;
613
- }
614
- declare function createTangleIntegrationsClient(options: TangleIntegrationsClientOptions): TangleIntegrationsClient;
615
-
616
- type IntegrationHealthcheckStatus = 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
617
- interface IntegrationHealthcheckCheck {
618
- id: string;
619
- status: IntegrationHealthcheckStatus;
620
- message: string;
621
- metadata?: Record<string, unknown>;
622
- }
623
- interface IntegrationHealthcheckResult {
624
- connectionId: string;
625
- providerId: string;
626
- connectorId: string;
627
- status: IntegrationHealthcheckStatus;
628
- checkedAt: string;
629
- checks: IntegrationHealthcheckCheck[];
630
- metadata?: Record<string, unknown>;
631
- }
632
- interface IntegrationHealthcheckStore {
633
- put(result: IntegrationHealthcheckResult): Promise<void> | void;
634
- get(connectionId: string): Promise<IntegrationHealthcheckResult | undefined> | IntegrationHealthcheckResult | undefined;
635
- list(): Promise<IntegrationHealthcheckResult[]> | IntegrationHealthcheckResult[];
636
- }
637
- declare class InMemoryIntegrationHealthcheckStore implements IntegrationHealthcheckStore {
638
- private readonly results;
639
- put(result: IntegrationHealthcheckResult): void;
640
- get(connectionId: string): IntegrationHealthcheckResult | undefined;
641
- list(): IntegrationHealthcheckResult[];
642
- }
643
- declare function runIntegrationHealthcheck(input: {
644
- connection: IntegrationConnection;
645
- connector?: IntegrationConnector;
646
- registry?: IntegrationRegistry;
647
- test?: (connection: IntegrationConnection, connector: IntegrationConnector) => Promise<IntegrationActionResult | boolean> | IntegrationActionResult | boolean;
648
- audit?: IntegrationAuditSink;
649
- now?: () => Date;
650
- }): Promise<IntegrationHealthcheckResult>;
651
- declare function runIntegrationHealthchecks(input: {
652
- connections: IntegrationConnection[];
653
- registry?: IntegrationRegistry;
654
- store?: IntegrationHealthcheckStore;
655
- audit?: IntegrationAuditSink;
656
- now?: () => Date;
657
- test?: (connection: IntegrationConnection, connector: IntegrationConnector) => Promise<IntegrationActionResult | boolean> | IntegrationActionResult | boolean;
658
- }): Promise<IntegrationHealthcheckResult[]>;
659
- declare function healthcheckRequest(action?: string): IntegrationActionRequest;
660
-
661
- /**
662
- * @stable Integration Hub consumer client.
663
- *
664
- * The third client-shaped surface a product needs, alongside the two that
665
- * already ship:
666
- *
667
- * - `createTangleIntegrationsClient` (`client.ts`) — the *invoke* client.
668
- * Capability-token auth, runs INSIDE a sandbox / generated app, single
669
- * endpoint `/v1/integrations/invoke`.
670
- * - `startConnectFlow` / `finishConnectFlow` (`connect/index.ts`) — the
671
- * *user-consent* flow, mirrors `/cross-site/*`.
672
- * - **this** — the S2S *management* client. A product BACKEND (blueprint-
673
- * agent, sandbox, gtm-agent, tax-agent, legal-agent, evals, …) drives the
674
- * `/v1/integrations/{resolve-manifest,grants,capabilities/bundle,
675
- * healthchecks/run}` management surface on `id.tangle.tools` on behalf of
676
- * an identified user.
677
- *
678
- * Every consumer needs the identical client — the wire protocol, the
679
- * `{ success, data }` envelope, the auth header shape are all platform-owned.
680
- * Re-implementing a bespoke fetch loop per product forks the protocol and the
681
- * copies drift. This module is that shared implementation. It mirrors the
682
- * `connect/index.ts` design rule one-for-one: DO NOT invent the wire protocol
683
- * — speak exactly what `products/platform/api/src/routes/integrations.ts`
684
- * serves.
685
- *
686
- * Two auth modes — the route layer (`authMiddleware`) accepts either:
687
- *
688
- * - `service` — a `svc_*` service token + `X-Service-Name`. The acting
689
- * user travels in `X-Platform-User-Id`. The platform honors that header
690
- * only for service tokens whose `SERVICE_SCOPES` set contains
691
- * `impersonate:user`; a token without it is rejected (403). Reaches the
692
- * four management paths the platform allowlists for service tokens.
693
- * - `user-key` — a per-user `sk-tan-*` API key (minted via the connect
694
- * flow). The key identifies the user; no impersonation header. Reaches
695
- * every route the user themselves can.
696
- *
697
- * The capability-token `invoke` endpoint is intentionally NOT exposed here —
698
- * that is `createTangleIntegrationsClient`'s job and uses a different auth.
699
- */
700
-
701
- type IntegrationHubAuth = {
702
- mode: 'service';
703
- /** The `svc_*` token issued to this product. */
704
- serviceToken: string;
705
- /** Registered service name — sent as `X-Service-Name`. Required
706
- * because one token may be shared across services, in which case the
707
- * platform demands the header to disambiguate. */
708
- serviceName: string;
709
- } | {
710
- mode: 'user-key';
711
- /** A per-user `sk-tan-*` key bound to the acting user. */
712
- apiKey: string;
713
- };
714
- interface IntegrationHubClientOptions {
715
- /** The product / consumer identifier (e.g. `blueprint-agent`). Sent as the
716
- * `product` field of resolve-manifest calls; recorded platform-side. */
717
- product: string;
718
- /** Service-token or per-user-key auth. */
719
- auth: IntegrationHubAuth;
720
- /** Platform base URL. Defaults to `https://id.tangle.tools`. */
721
- endpoint?: string;
722
- /** Injected for tests. Defaults to the global `fetch`. */
723
- fetchImpl?: typeof fetch;
724
- /** Per-request timeout in ms. Default 10_000. */
725
- timeoutMs?: number;
726
- /** Max attempts on transient (network / 502 / 503 / 504) failures.
727
- * Default 2 — i.e. one retry. */
728
- maxAttempts?: number;
729
- }
730
- /** Thrown for every non-2xx response and every transport failure. Carries the
731
- * HTTP status and the platform error code so callers can branch precisely
732
- * (`403` + `impersonate` → the service token lacks the scope; `409` /
733
- * `missing_connection` → prompt the user to connect). */
734
- declare class IntegrationHubRequestError extends Error {
735
- readonly name = "IntegrationHubRequestError";
736
- /** HTTP status, or 0 for a network-level failure. */
737
- readonly status: number;
738
- /** Platform error code (`VALIDATION_ERROR`, `scope_missing`, …) or
739
- * `network_error` / `http_error` when no structured code was returned. */
740
- readonly code: string;
741
- /** `METHOD /path` the request targeted. */
742
- readonly endpoint: string;
743
- /** True when the failure class is transient and a retry could succeed. */
744
- readonly retryable: boolean;
745
- constructor(input: {
746
- status: number;
747
- code: string;
748
- message: string;
749
- endpoint: string;
750
- retryable: boolean;
751
- });
752
- }
753
- interface ResolveManifestInput {
754
- /** The acting user — the connection owner. */
755
- userId: string;
756
- manifest: IntegrationManifest;
757
- /** Overrides the client-level `product` for this call. */
758
- product?: string;
759
- }
760
- interface CreateGrantsInput {
761
- /** The acting user — the connection owner. */
762
- userId: string;
763
- /** Who the grant is FOR (the sandbox / agent / app that will invoke). */
764
- grantee: IntegrationActor;
765
- manifest: IntegrationManifest;
766
- metadata?: Record<string, unknown>;
767
- }
768
- interface ListGrantsInput {
769
- /** The acting user — the connection owner. */
770
- userId: string;
771
- /** Optional grantee filter; both fields travel together as query params. */
772
- grantee?: IntegrationActor;
773
- }
774
- interface MintCapabilityBundleInput {
775
- /** The acting user — must own every connection behind the grants. */
776
- userId: string;
777
- /** Who the capability bundle is issued TO (the sandbox / agent process). */
778
- subject: IntegrationActor;
779
- /** Mint from every grant of a manifest … */
780
- manifestId?: string;
781
- /** … or from an explicit grant id list. Exactly one of the two is required. */
782
- grantIds?: string[];
783
- grantee?: IntegrationActor;
784
- /** Bundle TTL in ms. Platform clamps to [1s, 60m]; default 15m. */
785
- ttlMs?: number;
786
- }
787
- interface CapabilityBundleResult {
788
- bundle: IntegrationSandboxBundle;
789
- /** Bridge environment variables to inject into the sandbox process —
790
- * `buildIntegrationBridgeEnvironment(bundle)`, computed platform-side. */
791
- env: Record<string, string>;
792
- }
793
- interface CheckConnectorInput {
794
- /** The acting user. */
795
- userId: string;
796
- /** Connector to probe — `github`, `google-calendar`, `tangle-id`, … */
797
- connectorId: string;
798
- /** Defaults to `read`. */
799
- mode?: IntegrationRequirementMode;
800
- requiredScopes?: string[];
801
- requiredActions?: string[];
802
- }
803
- interface CheckConnectorResult {
804
- /** True when the user has an active connection satisfying the requirement. */
805
- connected: boolean;
806
- /** The satisfying connection, present iff `connected`. */
807
- connection?: IntegrationConnection;
808
- /** The full requirement resolution — status, missing scopes/actions, message. */
809
- resolution: IntegrationRequirementResolution;
810
- }
811
- /**
812
- * S2S management client for the `id.tangle.tools` integration hub. One per
813
- * product; methods are stateless and safe to call concurrently.
814
- */
815
- declare class IntegrationHubClient {
816
- private readonly endpoint;
817
- private readonly product;
818
- private readonly auth;
819
- private readonly fetchImpl;
820
- private readonly timeoutMs;
821
- private readonly maxAttempts;
822
- constructor(options: IntegrationHubClientOptions);
823
- /**
824
- * Resolve a manifest against a user's connections. The returned
825
- * `ready` / `missing` split is the canonical way to ask "does this user
826
- * have the connections this work needs" — the raw connection list is not
827
- * reachable by a service token by design.
828
- */
829
- resolveManifest(input: ResolveManifestInput): Promise<IntegrationManifestResolution>;
830
- /**
831
- * Convenience over {@link resolveManifest} — probe a single connector and
832
- * get back a boolean plus the satisfying connection. The Surface-A quest
833
- * primitive ("is the user's GitHub linked?").
834
- */
835
- checkConnector(input: CheckConnectorInput): Promise<CheckConnectorResult>;
836
- /** Create grants for every satisfiable requirement of a manifest. The
837
- * platform rejects the call if any non-optional requirement is missing a
838
- * connection. */
839
- createGrants(input: CreateGrantsInput): Promise<IntegrationGrant[]>;
840
- /** List the acting user's grants, optionally filtered to one grantee. */
841
- listGrants(input: ListGrantsInput): Promise<IntegrationGrant[]>;
842
- /** Mint a short-lived capability bundle for a sandbox / agent process.
843
- * Provider credentials never leave the platform — the bundle carries only
844
- * scoped, expiring capability tokens. */
845
- mintCapabilityBundle(input: MintCapabilityBundleInput): Promise<CapabilityBundleResult>;
846
- /** Run live healthchecks across all of the acting user's connections. */
847
- runHealthchecks(input: {
848
- userId: string;
849
- }): Promise<IntegrationHealthcheckResult[]>;
850
- private buildHeaders;
851
- private request;
852
- }
853
- declare function createIntegrationHubClient(options: IntegrationHubClientOptions): IntegrationHubClient;
854
-
855
- interface ConsentSummary {
856
- title: string;
857
- body: string;
858
- bullets: string[];
859
- primaryAction: string;
860
- risk: 'read' | 'write' | 'destructive';
861
- connectorIds: string[];
862
- }
863
- interface RenderConsentOptions {
864
- appName?: string;
865
- connectors?: IntegrationConnector[];
866
- }
867
- declare function renderConsentSummary(manifestOrResolution: IntegrationManifest | IntegrationManifestResolution, options?: RenderConsentOptions): ConsentSummary;
868
- declare function renderApprovalCopy(input: {
869
- appName: string;
870
- connectorTitle: string;
871
- action: IntegrationConnectorAction;
872
- approvalId?: string;
873
- }): ConsentSummary;
874
-
875
- /**
876
- * Workspace capability discovery — answers "what can this workspace do?"
877
- * with a typed list of MCP-shape tool descriptors that the agent runtime
878
- * can flatten into a planner's tool registry.
879
- *
880
- * The agent runtime's gating question is one level above the existing
881
- * connector catalog ("which integrations exist?") and one level below
882
- * the issued capability-token surface ("temporarily delegate scope X
883
- * via this signed token"). This module bridges the two:
884
- *
885
- * discoverWorkspaceCapabilities({ owner, connectors, connections, scopes })
886
- * → WorkspaceCapability[]
887
- *
888
- * A `WorkspaceCapability` is hand-shaped to be cheap to emit alongside a
889
- * connector manifest and trivial to render into:
890
- * - an LLM tool-choice JSON array
891
- * - an MCP `tools/list` response
892
- * - a UI surface ("Connect Gmail to enable: send_reply, list_messages…")
893
- *
894
- * What this is NOT:
895
- * - A capability-token issuer. That stays in IntegrationHub.issueCapability.
896
- * - A connector registry. That stays in IntegrationRegistry / catalog.
897
- *
898
- * Scopes are the load-bearing input: a connector advertises N actions,
899
- * but only the subset whose `requiredScopes` are a subset of the
900
- * connection's `grantedScopes` is reachable. The discovery function
901
- * filters on that automatically.
902
- *
903
- * Stability: `@stable` — additions to WorkspaceCapability must be
904
- * additive and non-breaking.
905
- */
906
-
907
- /** MCP-shape tool descriptor. Mirrors the
908
- * [Model Context Protocol tool schema](https://modelcontextprotocol.io/specification)
909
- * closely enough that consumers can pipe a WorkspaceCapability straight
910
- * into a `tools/list` response. */
911
- interface WorkspaceToolSchema {
912
- name: string;
913
- description?: string;
914
- /** JSON-schema describing the action's input. */
915
- inputSchema?: unknown;
916
- /** Optional JSON-schema describing the action's output. */
917
- outputSchema?: unknown;
918
- }
919
- /** One discoverable capability — an action a connector exposes that the
920
- * workspace has the connection + scopes to invoke. */
921
- interface WorkspaceCapability {
922
- /** Stable, fully-qualified id. Format `<connector-id>.<action-id>`. */
923
- id: string;
924
- /** Human label safe for UI. */
925
- title: string;
926
- /** Optional one-line description. */
927
- description?: string;
928
- /** Connector category for grouping. */
929
- category: IntegrationConnectorCategory;
930
- /** Connector that hosts this capability. */
931
- connectorId: string;
932
- /** Provider that hosts this connector (first-party, gateway, …). */
933
- providerId: string;
934
- /** Underlying action id on the connector. */
935
- actionId: string;
936
- /** Scopes required to invoke. The discovery function only returns
937
- * capabilities whose required scopes are a subset of the connection's
938
- * grantedScopes. */
939
- scopes: string[];
940
- /** Risk class — useful for UI ("write" / "destructive" lights). */
941
- risk: IntegrationActionRisk;
942
- /** Data class of the action's output, when known. */
943
- dataClass: IntegrationDataClass;
944
- /** MCP-shape tool schema the agent runtime can register directly. */
945
- toolSchema: WorkspaceToolSchema;
946
- /** True iff the workspace has an active connection backing this
947
- * capability. False capabilities (advertised by the connector but
948
- * not yet connected) are included when `includeUnconnected: true`
949
- * is passed — useful for "connect to unlock" UI affordances. */
950
- connected: boolean;
951
- /** Connection id backing this capability. Undefined when
952
- * `connected: false`. */
953
- connectionId?: string;
954
- /** Whether the action requires explicit approval before invocation. */
955
- approvalRequired?: boolean;
956
- }
957
- /** Optional inbound trigger surface. Same shape as a capability so the
958
- * consumer can render both with one component. */
959
- interface WorkspaceTrigger {
960
- id: string;
961
- title: string;
962
- description?: string;
963
- category: IntegrationConnectorCategory;
964
- connectorId: string;
965
- providerId: string;
966
- triggerId: string;
967
- scopes: string[];
968
- dataClass: IntegrationDataClass;
969
- connected: boolean;
970
- connectionId?: string;
971
- }
972
- interface DiscoverWorkspaceCapabilitiesInput {
973
- /** Workspace owner. Used to scope the connection lookup when `store`
974
- * is supplied (the canonical production path). */
975
- owner: IntegrationActor;
976
- /** Either an explicit connection list (test/fixture path) or a store
977
- * the function should query for connections by owner. Exactly one
978
- * of `connections` / `store` MUST be provided. */
979
- connections?: IntegrationConnection[];
980
- store?: IntegrationConnectionStore;
981
- /** Either an explicit connector list (test/fixture path) or a set of
982
- * providers the function should query via `listConnectors()`. */
983
- connectors?: IntegrationConnector[];
984
- providers?: IntegrationProvider[];
985
- /** Include capabilities whose connector is in the catalog but the
986
- * workspace has no active connection for. Useful to render
987
- * "connect to unlock" affordances. Default: false. */
988
- includeUnconnected?: boolean;
989
- /** When true, include capabilities even if some required scopes are
990
- * missing from the connection grant. The default `false` hides such
991
- * capabilities — the agent runtime never sees them. */
992
- includeMissingScopes?: boolean;
993
- }
994
- interface WorkspaceCapabilityDiscovery {
995
- capabilities: WorkspaceCapability[];
996
- triggers: WorkspaceTrigger[];
997
- /** Counts grouped by connector for telemetry / UI badges. */
998
- countsByConnector: Record<string, number>;
999
- /** Connectors the workspace is connected to but the planner cannot
1000
- * reach any actions on (e.g., zero scopes granted, or all actions
1001
- * require an additional scope). */
1002
- unreachableConnectors: Array<{
1003
- connectorId: string;
1004
- reason: string;
1005
- }>;
1006
- }
1007
- /** Resolve workspace-visible capabilities + triggers. Pure with respect
1008
- * to the inputs — caller decides whether to back `connections` and
1009
- * `connectors` with persistent state or static fixtures. */
1010
- declare function discoverWorkspaceCapabilities(input: DiscoverWorkspaceCapabilitiesInput): Promise<WorkspaceCapabilityDiscovery>;
1011
- /**
1012
- * Filter a {@link WorkspaceCapabilityDiscovery} result by the calling
1013
- * user's effective id.tangle.tools workspace scopes. Pair with the
1014
- * `tangleIdentity()` adapter's `list_workspaces` / `switch_workspace`
1015
- * output to keep what the agent runtime sees aligned with what the
1016
- * workspace's plan actually permits.
1017
- *
1018
- * Semantics:
1019
- * - Every workspace scope is matched against every capability's
1020
- * `scopes` list. Wildcard scopes (`tangle:*`, `<connectorId>:*`) are
1021
- * respected — a workspace with `tangle:*` sees everything; a
1022
- * workspace with `gmail:*` sees every gmail capability regardless of
1023
- * the upstream OAuth scope.
1024
- * - When `workspaceScopes` is empty, returns the discovery as-is (no
1025
- * workspace gate). Pass an explicit `denyByDefault: true` to flip
1026
- * that to "empty workspace sees nothing" — matches the platform's
1027
- * fail-closed posture for production tenants.
1028
- *
1029
- * Pure with respect to the inputs — no side effects.
1030
- */
1031
- declare function filterDiscoveryByWorkspaceScopes(discovery: WorkspaceCapabilityDiscovery, workspaceScopes: string[], opts?: {
1032
- denyByDefault?: boolean;
1033
- }): WorkspaceCapabilityDiscovery;
1034
-
1035
- interface IntegrationWorkflowDefinition {
1036
- id: string;
1037
- title?: string;
1038
- manifest: IntegrationManifest;
1039
- trigger: {
1040
- requirementId: string;
1041
- triggerId: string;
1042
- targetUrl?: string;
1043
- };
1044
- metadata?: Record<string, unknown>;
1045
- }
1046
- interface InstalledIntegrationWorkflow {
1047
- id: string;
1048
- workflowId: string;
1049
- manifestId: string;
1050
- owner: IntegrationActor;
1051
- grantee: IntegrationActor;
1052
- triggerGrantId: string;
1053
- subscription: IntegrationTriggerSubscription;
1054
- status: 'active' | 'paused' | 'error';
1055
- createdAt: string;
1056
- metadata?: Record<string, unknown>;
1057
- }
1058
- interface IntegrationWorkflowStore {
1059
- put(workflow: InstalledIntegrationWorkflow): Promise<void> | void;
1060
- get(id: string): Promise<InstalledIntegrationWorkflow | undefined> | InstalledIntegrationWorkflow | undefined;
1061
- list(): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
1062
- listByWorkflow(workflowId: string): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
1063
- listByOwner(owner: IntegrationActor): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
1064
- }
1065
- interface IntegrationWorkflowRuntimeHub {
1066
- subscribeTrigger(connectionId: string, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
1067
- }
1068
- interface IntegrationWorkflowRuntimeOptions {
1069
- runtime: IntegrationRuntime;
1070
- hub: IntegrationWorkflowRuntimeHub;
1071
- grants: IntegrationGrantStore;
1072
- store?: IntegrationWorkflowStore;
1073
- now?: () => Date;
1074
- }
1075
- declare class InMemoryIntegrationWorkflowStore implements IntegrationWorkflowStore {
1076
- private readonly workflows;
1077
- put(workflow: InstalledIntegrationWorkflow): void;
1078
- get(id: string): InstalledIntegrationWorkflow | undefined;
1079
- list(): InstalledIntegrationWorkflow[];
1080
- listByWorkflow(workflowId: string): InstalledIntegrationWorkflow[];
1081
- listByOwner(owner: IntegrationActor): InstalledIntegrationWorkflow[];
1082
- }
1083
- declare class IntegrationWorkflowRuntime {
1084
- private readonly runtime;
1085
- private readonly hub;
1086
- private readonly grants;
1087
- private readonly store;
1088
- private readonly now;
1089
- constructor(options: IntegrationWorkflowRuntimeOptions);
1090
- install(input: {
1091
- workflow: IntegrationWorkflowDefinition;
1092
- owner: IntegrationActor;
1093
- grantee: IntegrationActor;
1094
- }): Promise<InstalledIntegrationWorkflow>;
1095
- dispatchEvent<T = unknown>(event: IntegrationTriggerEvent<T>, handler: (input: {
1096
- event: IntegrationTriggerEvent<T>;
1097
- workflows: InstalledIntegrationWorkflow[];
1098
- }) => Promise<void> | void): Promise<{
1099
- matched: InstalledIntegrationWorkflow[];
1100
- }>;
1101
- }
1102
- declare function createIntegrationWorkflowRuntime(options: IntegrationWorkflowRuntimeOptions): IntegrationWorkflowRuntime;
1103
-
1104
- interface StoredIntegrationEvent {
1105
- id: string;
1106
- sourceId: string;
1107
- connectorId: string;
1108
- eventType: string;
1109
- providerEventId?: string;
1110
- receivedAt: string;
1111
- payload: Record<string, unknown>;
1112
- dispatchedAt?: string;
1113
- metadata?: Record<string, unknown>;
1114
- }
1115
- interface IntegrationEventStore {
1116
- put(event: StoredIntegrationEvent): Promise<void> | void;
1117
- hasProviderEvent(sourceId: string, providerEventId: string): Promise<boolean> | boolean;
1118
- list(): Promise<StoredIntegrationEvent[]> | StoredIntegrationEvent[];
1119
- }
1120
- interface IntegrationWebhookReceiverResult {
1121
- status: number;
1122
- body: unknown;
1123
- headers?: Record<string, string>;
1124
- received: StoredIntegrationEvent[];
1125
- duplicates: StoredIntegrationEvent[];
1126
- }
1127
- declare class InMemoryIntegrationEventStore implements IntegrationEventStore {
1128
- private readonly events;
1129
- private readonly providerIds;
1130
- put(event: StoredIntegrationEvent): void;
1131
- hasProviderEvent(sourceId: string, providerEventId: string): boolean;
1132
- list(): StoredIntegrationEvent[];
1133
- }
1134
- declare function receiveIntegrationWebhook(input: {
1135
- adapter: ConnectorAdapter;
1136
- source: ResolvedDataSource;
1137
- rawBody: string;
1138
- headers: Record<string, string | string[] | undefined>;
1139
- store: IntegrationEventStore;
1140
- workflowRuntime?: IntegrationWorkflowRuntime;
1141
- allowUnsignedWebhook?: boolean;
1142
- now?: () => Date;
1143
- }): Promise<IntegrationWebhookReceiverResult>;
1144
- declare function storedEventToTriggerEvent(event: StoredIntegrationEvent, source: ResolvedDataSource): IntegrationTriggerEvent;
1145
-
1146
- interface IntegrationIdempotencyRecord {
1147
- key: string;
1148
- requestHash: string;
1149
- result: IntegrationActionResult;
1150
- createdAt: string;
1151
- }
1152
- interface IntegrationIdempotencyStore {
1153
- get(key: string): Promise<IntegrationIdempotencyRecord | undefined> | IntegrationIdempotencyRecord | undefined;
1154
- put(record: IntegrationIdempotencyRecord): Promise<void> | void;
1155
- }
1156
- interface IntegrationRateLimitDecision {
1157
- allowed: boolean;
1158
- retryAfterMs?: number;
1159
- reason?: string;
1160
- }
1161
- interface IntegrationRateLimiter {
1162
- check(ctx: IntegrationGuardContext): Promise<IntegrationRateLimitDecision> | IntegrationRateLimitDecision;
1163
- }
1164
- declare class InMemoryIntegrationIdempotencyStore implements IntegrationIdempotencyStore {
1165
- private readonly records;
1166
- get(key: string): IntegrationIdempotencyRecord | undefined;
1167
- put(record: IntegrationIdempotencyRecord): void;
1168
- }
1169
- declare class DefaultIntegrationActionGuard implements IntegrationActionGuard {
1170
- private readonly idempotency;
1171
- private readonly audit;
1172
- private readonly rateLimiter;
1173
- private readonly requireIdempotencyForMutations;
1174
- private readonly now;
1175
- constructor(options?: {
1176
- idempotency?: IntegrationIdempotencyStore;
1177
- audit?: IntegrationAuditSink;
1178
- rateLimiter?: IntegrationRateLimiter;
1179
- requireIdempotencyForMutations?: boolean;
1180
- now?: () => Date;
1181
- });
1182
- invokeAction(ctx: IntegrationGuardContext, proceed: () => Promise<IntegrationActionResult>): Promise<IntegrationActionResult>;
1183
- private writeIdempotency;
1184
- }
1185
- declare function createDefaultIntegrationActionGuard(options?: ConstructorParameters<typeof DefaultIntegrationActionGuard>[0]): DefaultIntegrationActionGuard;
1186
-
1187
- interface ManifestValidationIssue {
1188
- path: string;
1189
- message: string;
1190
- }
1191
- interface ManifestValidationResult {
1192
- ok: boolean;
1193
- issues: ManifestValidationIssue[];
1194
- }
1195
- interface InferIntegrationRequirementsOptions {
1196
- manifestId: string;
1197
- title?: string;
1198
- tools: Array<string | {
1199
- action: string;
1200
- reason?: string;
1201
- mode?: IntegrationRequirementMode;
1202
- connectorId?: string;
1203
- scopes?: string[];
1204
- }>;
1205
- metadata?: Record<string, unknown>;
1206
- }
1207
- interface MissingRequirementExplanation {
1208
- requirementId: string;
1209
- connectorId: string;
1210
- status: string;
1211
- message: string;
1212
- userAction: 'connect' | 'enable' | 'ignore_optional';
1213
- }
1214
- declare function validateIntegrationManifest(manifest: IntegrationManifest): ManifestValidationResult;
1215
- declare function assertValidIntegrationManifest(manifest: IntegrationManifest): void;
1216
- declare function inferIntegrationManifestFromTools(options: InferIntegrationRequirementsOptions): IntegrationManifest;
1217
- declare function explainMissingRequirements(resolution: IntegrationManifestResolution): MissingRequirementExplanation[];
1218
- declare function calendarExercisePlannerManifest(id?: string): IntegrationManifest;
1219
-
1220
- interface ProviderHttpRequestInput {
1221
- method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
1222
- path: string;
1223
- query?: Record<string, string | number | boolean | undefined>;
1224
- headers?: Record<string, string>;
1225
- body?: unknown;
1226
- }
1227
- interface ProviderPassthroughPolicy {
1228
- enabled: boolean;
1229
- allowedMethods?: ProviderHttpRequestInput['method'][];
1230
- allowedPathPrefixes?: string[];
1231
- maxBodyBytes?: number;
1232
- }
1233
- declare const PROVIDER_PASSTHROUGH_ACTION: "provider.http.request";
1234
- declare function validateProviderPassthroughRequest(input: ProviderHttpRequestInput, policy: ProviderPassthroughPolicy): void;
1235
-
1236
- type IntegrationPolicyEffect = 'allow' | 'require_approval' | 'deny';
1237
- interface IntegrationPolicyRule {
1238
- id: string;
1239
- effect: IntegrationPolicyEffect;
1240
- reason: string;
1241
- providerId?: string;
1242
- connectorId?: string;
1243
- action?: string;
1244
- maxRisk?: IntegrationActionRisk;
1245
- risk?: IntegrationActionRisk;
1246
- dataClass?: IntegrationDataClass;
1247
- }
1248
- interface StaticIntegrationPolicyOptions {
1249
- rules?: IntegrationPolicyRule[];
1250
- defaultReadEffect?: IntegrationPolicyEffect;
1251
- defaultWriteEffect?: IntegrationPolicyEffect;
1252
- defaultDestructiveEffect?: IntegrationPolicyEffect;
1253
- now?: () => Date;
1254
- }
1255
- interface IntegrationApprovalResolution {
1256
- approvalId: string;
1257
- approved: boolean;
1258
- resolvedBy: string;
1259
- resolvedAt: string;
1260
- reason?: string;
1261
- metadata?: Record<string, unknown>;
1262
- }
1263
- declare class StaticIntegrationPolicyEngine implements IntegrationPolicyEngine {
1264
- private readonly rules;
1265
- private readonly defaultReadEffect;
1266
- private readonly defaultWriteEffect;
1267
- private readonly defaultDestructiveEffect;
1268
- private readonly now;
1269
- constructor(options?: StaticIntegrationPolicyOptions);
1270
- decide(ctx: IntegrationGuardContext & {
1271
- subject: {
1272
- type: string;
1273
- id: string;
1274
- };
1275
- }): IntegrationPolicyDecision;
1276
- private defaultEffect;
1277
- }
1278
- declare function createDefaultIntegrationPolicyEngine(options?: Omit<StaticIntegrationPolicyOptions, 'rules'>): StaticIntegrationPolicyEngine;
1279
- declare function buildApprovalRequest(ctx: IntegrationGuardContext & {
1280
- subject: {
1281
- type: string;
1282
- id: string;
1283
- };
1284
- }, reason: string, requestedAt: Date): IntegrationApprovalRequest;
1285
- declare function redactApprovalRequest(request: IntegrationApprovalRequest): IntegrationApprovalRequest;
1286
-
1287
- interface PlatformIntegrationPolicyPresetOptions extends Omit<StaticIntegrationPolicyOptions, 'defaultReadEffect' | 'defaultWriteEffect' | 'defaultDestructiveEffect'> {
1288
- allowWritesWithoutApproval?: boolean;
1289
- allowDestructiveActions?: boolean;
1290
- allowProviderPassthrough?: boolean;
1291
- }
1292
- declare function createPlatformIntegrationPolicyPreset(options?: PlatformIntegrationPolicyPresetOptions): StaticIntegrationPolicyEngine;
1293
-
1294
- interface CatalogExecutorInvocation {
1295
- connection: IntegrationConnection;
1296
- request: IntegrationActionRequest;
1297
- connector: IntegrationConnector;
1298
- action: IntegrationConnector['actions'][number];
1299
- }
1300
- interface CatalogExecutorProviderOptions {
1301
- id: string;
1302
- kind: IntegrationProviderKind;
1303
- connectors: IntegrationConnector[];
1304
- startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
1305
- completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
1306
- executeAction: (invocation: CatalogExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
1307
- subscribeTrigger?: (connection: IntegrationConnection, trigger: NonNullable<IntegrationConnector['triggers']>[number], targetUrl?: string) => Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
1308
- unsubscribeTrigger?: (subscriptionId: string) => Promise<void> | void;
1309
- normalizeTriggerEvent?: (raw: unknown) => Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
1310
- }
1311
- declare function createCatalogExecutorProvider(options: CatalogExecutorProviderOptions): IntegrationProvider;
1312
-
1313
- interface IntegrationInvocationEnvelope {
1314
- kind: 'integration.invocation';
1315
- capabilityToken: string;
1316
- toolName: string;
1317
- action: string;
1318
- input?: unknown;
1319
- idempotencyKey: string;
1320
- dryRun?: boolean;
1321
- metadata?: Record<string, unknown>;
1322
- }
1323
- interface IntegrationInvocationEnvelopeValidationOptions {
1324
- connectors?: IntegrationConnector[];
1325
- maxInputBytes?: number;
1326
- requireKnownTool?: boolean;
1327
- }
1328
- type NormalizedIntegrationResult = {
1329
- status: 'ok';
1330
- action: string;
1331
- output?: unknown;
1332
- metadata?: Record<string, unknown>;
1333
- } | {
1334
- status: 'approval_required';
1335
- action: string;
1336
- approval: IntegrationApprovalRequest;
1337
- metadata?: Record<string, unknown>;
1338
- } | {
1339
- status: 'failed';
1340
- action: string;
1341
- error: string;
1342
- metadata?: Record<string, unknown>;
1343
- };
1344
- interface IntegrationSandboxHostHub {
1345
- invokeWithCapability(token: string, request: InvokeWithCapabilityRequest): Promise<IntegrationActionResult> | IntegrationActionResult;
1346
- }
1347
- interface IntegrationSandboxHostOptions extends IntegrationInvocationEnvelopeValidationOptions {
1348
- hub: IntegrationSandboxHostHub;
1349
- }
1350
- declare function buildIntegrationInvocationEnvelope(input: {
1351
- capabilityToken: string;
1352
- toolName: string;
1353
- args?: unknown;
1354
- idempotencyKey: string;
1355
- dryRun?: boolean;
1356
- metadata?: Record<string, unknown>;
1357
- }): IntegrationInvocationEnvelope;
1358
- declare function invocationRequestFromEnvelope(envelope: IntegrationInvocationEnvelope): InvokeWithCapabilityRequest;
1359
- declare function validateIntegrationInvocationEnvelope(envelope: IntegrationInvocationEnvelope, options?: IntegrationInvocationEnvelopeValidationOptions): void;
1360
- declare function redactInvocationEnvelope(envelope: IntegrationInvocationEnvelope): Omit<IntegrationInvocationEnvelope, 'capabilityToken'> & {
1361
- capabilityToken: '[REDACTED]';
1362
- };
1363
- declare function redactCapability(capability: IntegrationCapability): IntegrationCapability;
1364
- declare function normalizeIntegrationResult(result: IntegrationActionResult): NormalizedIntegrationResult;
1365
- declare function dispatchIntegrationInvocation(envelope: IntegrationInvocationEnvelope, options: IntegrationSandboxHostOptions): Promise<NormalizedIntegrationResult>;
1366
- declare class IntegrationSandboxHost {
1367
- private readonly options;
1368
- constructor(options: IntegrationSandboxHostOptions);
1369
- dispatch(envelope: IntegrationInvocationEnvelope): Promise<NormalizedIntegrationResult>;
1370
- }
1371
-
1372
- interface ImportCatalogOptions {
1373
- providerId: string;
1374
- connectorId: string;
1375
- connectorTitle: string;
1376
- category?: IntegrationConnectorCategory;
1377
- auth?: IntegrationConnector['auth'];
1378
- scopes?: string[];
1379
- dataClass?: IntegrationDataClass;
1380
- defaultRisk?: IntegrationActionRisk;
1381
- }
1382
- interface OpenApiDocument {
1383
- openapi?: string;
1384
- swagger?: string;
1385
- info?: {
1386
- title?: string;
1387
- };
1388
- paths?: Record<string, Record<string, OpenApiOperation | unknown>>;
1389
- }
1390
- interface OpenApiOperation {
1391
- operationId?: string;
1392
- summary?: string;
1393
- description?: string;
1394
- parameters?: unknown[];
1395
- requestBody?: unknown;
1396
- responses?: unknown;
1397
- security?: Array<Record<string, string[]>>;
1398
- tags?: string[];
1399
- }
1400
- interface GraphqlOperationSpec {
1401
- name: string;
1402
- kind: 'query' | 'mutation';
1403
- description?: string;
1404
- inputSchema?: unknown;
1405
- outputSchema?: unknown;
1406
- requiredScopes?: string[];
1407
- }
1408
- interface McpCatalogTool {
1409
- name: string;
1410
- description?: string;
1411
- inputSchema?: unknown;
1412
- annotations?: {
1413
- readOnlyHint?: boolean;
1414
- destructiveHint?: boolean;
1415
- openWorldHint?: boolean;
1416
- title?: string;
1417
- };
1418
- }
1419
- interface McpCatalog {
1420
- tools: McpCatalogTool[];
1421
- }
1422
- declare function importOpenApiConnector(document: OpenApiDocument, options: ImportCatalogOptions): IntegrationConnector;
1423
- declare function importGraphqlConnector(operations: GraphqlOperationSpec[], options: ImportCatalogOptions): IntegrationConnector;
1424
- declare function importMcpConnector(catalog: McpCatalog, options: ImportCatalogOptions): IntegrationConnector;
1425
-
1426
- interface GatewayCatalogProviderOptions {
1427
- id: string;
1428
- kind: Extract<IntegrationProviderKind, 'nango' | 'pipedream' | 'activepieces' | 'tangle_catalog' | 'zapier' | 'executor' | 'custom'>;
1429
- fetchCatalog: () => Promise<GatewayCatalogEntry[]> | GatewayCatalogEntry[];
1430
- startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
1431
- completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
1432
- invokeAction?: (connection: IntegrationConnection, request: IntegrationActionRequest) => Promise<IntegrationActionResult> | IntegrationActionResult;
1433
- cacheTtlMs?: number;
1434
- now?: () => Date;
1435
- }
1436
- interface GatewayCatalogEntry {
1437
- id?: string;
1438
- key?: string;
1439
- name?: string;
1440
- title?: string;
1441
- category?: string;
1442
- auth?: 'oauth2' | 'api_key' | 'none' | 'custom' | string;
1443
- scopes?: string[];
1444
- actions?: GatewayCatalogAction[];
1445
- triggers?: GatewayCatalogTrigger[];
1446
- metadata?: Record<string, unknown>;
1447
- }
1448
- interface GatewayCatalogAction {
1449
- id?: string;
1450
- key?: string;
1451
- name?: string;
1452
- title?: string;
1453
- description?: string;
1454
- risk?: 'read' | 'write' | 'destructive' | string;
1455
- scopes?: string[];
1456
- requiredScopes?: string[];
1457
- dataClass?: IntegrationDataClass | string;
1458
- approvalRequired?: boolean;
1459
- inputSchema?: unknown;
1460
- outputSchema?: unknown;
1461
- }
1462
- interface GatewayCatalogTrigger {
1463
- id?: string;
1464
- key?: string;
1465
- name?: string;
1466
- title?: string;
1467
- description?: string;
1468
- scopes?: string[];
1469
- requiredScopes?: string[];
1470
- dataClass?: IntegrationDataClass | string;
1471
- payloadSchema?: unknown;
1472
- }
1473
- declare function createGatewayCatalogProvider(options: GatewayCatalogProviderOptions): IntegrationProvider;
1474
- declare function normalizeGatewayCatalog(entries: GatewayCatalogEntry[], options: {
1475
- providerId: string;
1476
- providerKind: IntegrationProviderKind;
1477
- }): IntegrationConnector[];
1478
-
1479
- interface ActivepiecesCatalogEntry {
1480
- id: string;
1481
- title: string;
1482
- description: string;
1483
- npmPackage?: string;
1484
- version?: string;
1485
- category: IntegrationConnectorCategory;
1486
- auth: IntegrationConnector['auth'];
1487
- authFields?: ActivepiecesCatalogAuthField[];
1488
- domains: string[];
1489
- actions: Array<{
1490
- id: string;
1491
- title: string;
1492
- risk: IntegrationActionRisk;
1493
- upstreamName?: string;
1494
- }>;
1495
- triggers: Array<{
1496
- id: string;
1497
- title: string;
1498
- upstreamName?: string;
1499
- }>;
1500
- source: {
1501
- repository: string;
1502
- path: string;
1503
- license: 'MIT';
1504
- };
1505
- }
1506
- interface ActivepiecesCatalogAuthField {
1507
- key: string;
1508
- label: string;
1509
- required: boolean;
1510
- secret: boolean;
1511
- kind: 'text' | 'number' | 'boolean' | 'select' | 'object' | 'unknown';
1512
- description?: string;
1513
- }
1514
- declare function listActivepiecesCatalogEntries(): ActivepiecesCatalogEntry[];
1515
- declare function buildActivepiecesConnectors(options?: {
1516
- providerId?: string;
1517
- includeCatalogActions?: boolean;
1518
- executable?: boolean;
1519
- }): IntegrationConnector[];
1520
-
1521
- interface ActivepiecesPieceOverride {
1522
- category?: IntegrationConnectorCategory;
1523
- actionRisks?: Record<string, IntegrationActionRisk>;
1524
- approvalRequired?: Record<string, boolean>;
1525
- }
1526
- declare const ACTIVEPIECES_OVERRIDES: Record<string, ActivepiecesPieceOverride>;
1527
- declare function getActivepiecesOverride(id: string): ActivepiecesPieceOverride | undefined;
1528
-
1529
- interface ActivepiecesExecutorInvocation {
1530
- connection: IntegrationConnection;
1531
- request: IntegrationActionRequest;
1532
- connector: IntegrationConnector;
1533
- catalogEntry: ActivepiecesCatalogEntry;
1534
- piece: {
1535
- id: string;
1536
- npmPackage?: string;
1537
- version?: string;
1538
- actionId: string;
1539
- upstreamActionName?: string;
1540
- };
1541
- }
1542
- interface ActivepiecesExecutorProviderOptions {
1543
- id?: string;
1544
- connectors?: IntegrationConnector[];
1545
- startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
1546
- completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
1547
- executeAction: (invocation: ActivepiecesExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
1548
- }
1549
- declare function createActivepiecesExecutorProvider(options: ActivepiecesExecutorProviderOptions): IntegrationProvider;
1550
-
1551
- declare const ACTIVEPIECES_RUNTIME_SIGNATURE_HEADER = "x-tangle-activepieces-signature";
1552
- declare const TANGLE_CATALOG_RUNTIME_SIGNATURE_HEADER = "x-tangle-catalog-signature";
1553
- interface TangleCatalogRuntimeActionRequest {
1554
- id: string;
1555
- input: unknown;
1556
- idempotencyKey?: string;
1557
- dryRun?: boolean;
1558
- metadata?: Record<string, unknown>;
1559
- }
1560
- interface TangleCatalogRuntimePiece {
1561
- id: string;
1562
- packageName?: string;
1563
- version?: string;
1564
- actionId: string;
1565
- upstreamActionName?: string;
1566
- }
1567
- interface TangleCatalogHttpExecutorOptions {
1568
- endpoint: string;
1569
- path?: string;
1570
- signatureHeader?: string;
1571
- secret?: string;
1572
- fetchImpl?: typeof fetch;
1573
- headers?: Record<string, string>;
1574
- timeoutMs?: number;
1575
- requestId?: () => string;
1576
- }
1577
- interface TangleCatalogHttpExecutorInvocation extends Omit<ActivepiecesExecutorInvocation, 'catalogEntry' | 'piece'> {
1578
- catalogEntry: unknown;
1579
- piece: TangleCatalogRuntimePiece;
1580
- }
1581
- /**
1582
- * @deprecated Use the Tangle catalog runtime types. This name is kept only for
1583
- * compatibility with the upstream catalog ingestion backend.
1584
- */
1585
- interface ActivepiecesRuntimeRequest {
1586
- version: 1;
1587
- requestId: string;
1588
- providerId: string;
1589
- connection: IntegrationConnection;
1590
- connector: Pick<IntegrationConnector, 'id' | 'title' | 'auth' | 'scopes' | 'metadata'>;
1591
- piece: ActivepiecesExecutorInvocation['piece'];
1592
- action: TangleCatalogRuntimeActionRequest;
1593
- }
1594
- /**
1595
- * @deprecated Use `TangleCatalogHttpExecutorOptions`.
1596
- */
1597
- type ActivepiecesHttpExecutorOptions = TangleCatalogHttpExecutorOptions;
1598
- /**
1599
- * @deprecated Use `createTangleCatalogHttpExecutor`.
1600
- */
1601
- declare function createActivepiecesHttpExecutor(options: ActivepiecesHttpExecutorOptions): ActivepiecesExecutorProviderOptions['executeAction'];
1602
- /**
1603
- * @deprecated Use `buildTangleCatalogRuntimeRequest`.
1604
- */
1605
- declare function buildActivepiecesRuntimeRequest(invocation: ActivepiecesExecutorInvocation, requestId?: string): ActivepiecesRuntimeRequest;
1606
- /**
1607
- * @deprecated Use `signTangleCatalogRuntimeRequest`.
1608
- */
1609
- declare function signActivepiecesRuntimeRequest(serializedBody: string, secret: string): string;
1610
- /**
1611
- * @deprecated Use `verifyTangleCatalogRuntimeSignature`.
1612
- */
1613
- declare function verifyActivepiecesRuntimeSignature(serializedBody: string, signature: string | null | undefined, secret: string): boolean;
1614
- interface TangleCatalogRuntimeRequest {
1615
- version: 1;
1616
- requestId: string;
1617
- providerId: string;
1618
- connection: IntegrationConnection;
1619
- connector: Pick<IntegrationConnector, 'id' | 'title' | 'auth' | 'scopes' | 'metadata'>;
1620
- piece: TangleCatalogRuntimePiece;
1621
- action: TangleCatalogRuntimeActionRequest;
1622
- }
1623
- declare function createTangleCatalogHttpExecutor(options: TangleCatalogHttpExecutorOptions): (invocation: TangleCatalogHttpExecutorInvocation) => Promise<IntegrationActionResult>;
1624
- declare function buildTangleCatalogRuntimeRequest(invocation: TangleCatalogHttpExecutorInvocation, requestId?: string): TangleCatalogRuntimeRequest;
1625
- declare const signTangleCatalogRuntimeRequest: typeof signActivepiecesRuntimeRequest;
1626
- declare const verifyTangleCatalogRuntimeSignature: typeof verifyActivepiecesRuntimeSignature;
1627
-
1628
- interface IntegrationCatalogFreshnessOptions {
1629
- liveActivepieces?: boolean;
1630
- minActivepiecesConnectors?: number;
1631
- staleConnectorDelta?: number;
1632
- fetchImpl?: typeof fetch;
1633
- }
1634
- interface IntegrationCatalogFreshnessResult {
1635
- ok: boolean;
1636
- generatedAt: string;
1637
- local: {
1638
- activepiecesEntries: number;
1639
- activepiecesConnectors: number;
1640
- activepiecesActions: number;
1641
- activepiecesTriggers: number;
1642
- executableActivepiecesConnectors: number;
1643
- executableActivepiecesActions: number;
1644
- executableActivepiecesTriggers: number;
1645
- executableToolDefinitions: number;
1646
- unsupportedExecutableConnectorIds: string[];
1647
- registryEntries: number;
1648
- registrySummary: IntegrationRegistrySummary;
1649
- conflictSamples: IntegrationRegistryConflict[];
1650
- };
1651
- upstream?: {
1652
- activepiecesPieces?: number;
1653
- activepiecesDelta?: number;
1654
- checkedUrl: string;
1655
- warning?: string;
1656
- };
1657
- warnings: string[];
1658
- }
1659
- declare const ACTIVEPIECES_PUBLIC_CATALOG_URL = "https://www.activepieces.com/pieces";
1660
- declare function extractActivepiecesPublicPieceCount(html: string): number | undefined;
1661
- declare function auditIntegrationCatalogFreshness(options?: IntegrationCatalogFreshnessOptions): Promise<IntegrationCatalogFreshnessResult>;
1662
-
1663
- declare const TANGLE_INTEGRATIONS_CATALOG_PROVIDER_ID = "tangle-catalog";
1664
- declare const TANGLE_INTEGRATIONS_CATALOG_SOURCE = "tangle-integrations-catalog";
1665
- type TangleIntegrationImplementationKind = 'native_adapter' | 'package_runtime';
1666
- type TangleIntegrationContractStatus = 'contract_ready' | 'runtime_backed' | 'native_backed';
1667
- interface TangleIntegrationCatalogEntry {
1668
- id: string;
1669
- title: string;
1670
- description: string;
1671
- category: IntegrationConnector['category'];
1672
- auth: IntegrationConnector['auth'];
1673
- authFields?: ActivepiecesCatalogEntry['authFields'];
1674
- domains: string[];
1675
- actions: Array<{
1676
- id: string;
1677
- title: string;
1678
- risk: IntegrationConnector['actions'][number]['risk'];
1679
- upstreamName?: string;
1680
- }>;
1681
- triggers: Array<{
1682
- id: string;
1683
- title: string;
1684
- upstreamName?: string;
1685
- }>;
1686
- }
1687
- interface TangleIntegrationContract {
1688
- id: string;
1689
- title: string;
1690
- description: string;
1691
- category: IntegrationConnector['category'];
1692
- auth: IntegrationConnector['auth'];
1693
- authFields: NonNullable<ActivepiecesCatalogEntry['authFields']>;
1694
- actions: Array<{
1695
- id: string;
1696
- title: string;
1697
- risk: IntegrationConnector['actions'][number]['risk'];
1698
- upstreamName: string;
1699
- }>;
1700
- triggers: Array<{
1701
- id: string;
1702
- title: string;
1703
- upstreamName: string;
1704
- }>;
1705
- implementation: {
1706
- kind: TangleIntegrationImplementationKind;
1707
- runtimePackage?: string;
1708
- version?: string;
1709
- };
1710
- status: TangleIntegrationContractStatus;
1711
- quality: {
1712
- tangleContract: true;
1713
- authFieldsMapped: boolean;
1714
- actionNamesMapped: boolean;
1715
- triggerNamesMapped: boolean;
1716
- runtimePackageMapped: boolean;
1717
- nativeAdapter: boolean;
1718
- };
1719
- }
1720
- interface TangleCatalogRuntimePackageManifestOptions {
1721
- name?: string;
1722
- includeAgentIntegrationsPackage?: boolean;
1723
- agentIntegrationsVersion?: string;
1724
- additionalDependencies?: Record<string, string>;
1725
- }
1726
- interface TangleCatalogRuntimePackageManifest {
1727
- name: string;
1728
- private: true;
1729
- type: 'module';
1730
- dependencies: Record<string, string>;
1731
- tangle: {
1732
- integrationContracts: number;
1733
- packageRuntimeBackends: number;
1734
- generatedFrom: typeof TANGLE_INTEGRATIONS_CATALOG_SOURCE;
1735
- };
1736
- }
1737
- interface TangleCatalogExecutorInvocation {
1738
- connection: IntegrationConnection;
1739
- request: IntegrationActionRequest;
1740
- connector: IntegrationConnector;
1741
- catalogEntry: TangleIntegrationCatalogEntry;
1742
- piece: {
1743
- id: string;
1744
- packageName?: string;
1745
- version?: string;
1746
- actionId: string;
1747
- upstreamActionName?: string;
1748
- };
1749
- }
1750
- interface TangleCatalogTriggerInvocation {
1751
- connection: IntegrationConnection;
1752
- connector: IntegrationConnector;
1753
- catalogEntry: TangleIntegrationCatalogEntry;
1754
- trigger: NonNullable<IntegrationConnector['triggers']>[number];
1755
- targetUrl?: string;
1756
- piece: {
1757
- id: string;
1758
- packageName?: string;
1759
- version?: string;
1760
- triggerId: string;
1761
- upstreamTriggerName?: string;
1762
- };
1763
- }
1764
- interface TangleCatalogExecutorProviderOptions {
1765
- id?: string;
1766
- connectors?: IntegrationConnector[];
1767
- startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
1768
- completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
1769
- executeAction: (invocation: TangleCatalogExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
1770
- subscribeTrigger?: (invocation: TangleCatalogTriggerInvocation) => Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
1771
- unsubscribeTrigger?: (subscriptionId: string) => Promise<void> | void;
1772
- normalizeTriggerEvent?: (raw: unknown) => Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
1773
- }
1774
- type TangleIntegrationCatalogFreshnessOptions = IntegrationCatalogFreshnessOptions;
1775
- interface TangleIntegrationCatalogFreshnessResult {
1776
- ok: boolean;
1777
- generatedAt: string;
1778
- local: {
1779
- catalogEntries: number;
1780
- catalogConnectors: number;
1781
- catalogActions: number;
1782
- catalogTriggers: number;
1783
- executableCatalogConnectors: number;
1784
- executableCatalogActions: number;
1785
- executableCatalogTriggers: number;
1786
- executableToolDefinitions: number;
1787
- unsupportedExecutableConnectorIds: string[];
1788
- registryEntries: number;
1789
- registrySummary: Awaited<ReturnType<typeof auditIntegrationCatalogFreshness>>['local']['registrySummary'];
1790
- conflictSamples: Awaited<ReturnType<typeof auditIntegrationCatalogFreshness>>['local']['conflictSamples'];
1791
- };
1792
- upstream?: {
1793
- externalEntries?: number;
1794
- externalDelta?: number;
1795
- checkedUrl: string;
1796
- warning?: string;
1797
- };
1798
- warnings: string[];
1799
- }
1800
- declare function listTangleIntegrationCatalogEntries(): TangleIntegrationCatalogEntry[];
1801
- declare function listTangleIntegrationContracts(): TangleIntegrationContract[];
1802
- declare function listTangleIntegrationCatalogRuntimePackages(): Array<{
1803
- connectorId: string;
1804
- packageName: string;
1805
- version?: string;
1806
- }>;
1807
- declare function buildTangleCatalogRuntimePackageManifest(options?: TangleCatalogRuntimePackageManifestOptions): TangleCatalogRuntimePackageManifest;
1808
- declare function renderTangleCatalogRuntimePnpmAddCommand(options?: {
1809
- includeAgentIntegrationsPackage?: boolean;
1810
- agentIntegrationsVersion?: string;
1811
- }): string;
1812
- declare function buildTangleIntegrationCatalogConnectors(options?: {
1813
- providerId?: string;
1814
- includeCatalogActions?: boolean;
1815
- executable?: boolean;
1816
- }): IntegrationConnector[];
1817
- declare function createTangleCatalogExecutorProvider(options: TangleCatalogExecutorProviderOptions): IntegrationProvider;
1818
- declare const extractExternalCatalogPublicCount: typeof extractActivepiecesPublicPieceCount;
1819
- declare function auditTangleIntegrationCatalogFreshness(options?: TangleIntegrationCatalogFreshnessOptions): Promise<TangleIntegrationCatalogFreshnessResult>;
1820
-
1821
- interface TangleCatalogRuntimeInvocation {
1822
- request: TangleCatalogRuntimeRequest;
1823
- connection: IntegrationConnection;
1824
- connector: IntegrationConnector;
1825
- action: IntegrationConnectorAction;
1826
- }
1827
- interface TangleCatalogRuntimeHandlerOptions {
1828
- secret?: string;
1829
- requireSignature?: boolean;
1830
- signatureHeader?: string;
1831
- connectors?: IntegrationConnector[];
1832
- maxBodyBytes?: number;
1833
- executeAction: (invocation: TangleCatalogRuntimeInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
1834
- }
1835
- interface TangleCatalogInstalledPackageExecutorOptions {
1836
- moduleLoader?: (packageName: string) => Promise<unknown> | unknown;
1837
- actionAliases?: Record<string, Record<string, string>>;
1838
- allowFuzzyActionMatch?: boolean;
1839
- resolveAuth?: (connection: IntegrationConnection) => Promise<unknown> | unknown;
1840
- beforeRun?: (invocation: TangleCatalogRuntimeInvocation) => Promise<void> | void;
1841
- }
1842
- interface TangleCatalogAuthResolverOptions {
1843
- secrets: IntegrationSecretStore;
1844
- mapCredentials?: (input: {
1845
- connection: IntegrationConnection;
1846
- credentials: ConnectorCredentials;
1847
- connectorId: string;
1848
- }) => unknown;
1849
- }
1850
- interface TangleCatalogHttpAuthResolverOptions {
1851
- endpoint: string;
1852
- secret: string;
1853
- path?: string;
1854
- timeoutMs?: number;
1855
- fetchImpl?: typeof fetch;
1856
- headers?: Record<string, string>;
1857
- requestId?: () => string;
1858
- }
1859
- interface TangleCatalogHttpAuthResolverRequest {
1860
- version: 1;
1861
- requestId: string;
1862
- providerId: string;
1863
- connectorId: string;
1864
- connectionId: string;
1865
- secretRef?: IntegrationConnection['secretRef'];
1866
- }
1867
- interface TangleCatalogRuntimeModuleAction {
1868
- name?: string;
1869
- displayName?: string;
1870
- run?: (context: {
1871
- auth: unknown;
1872
- propsValue: unknown;
1873
- input: unknown;
1874
- connection: IntegrationConnection;
1875
- request: TangleCatalogRuntimeRequest;
1876
- }) => Promise<unknown> | unknown;
1877
- }
1878
- interface TangleCatalogRuntimeHttpRequest {
1879
- body: string | Uint8Array | TangleCatalogRuntimeRequest;
1880
- headers?: Headers | Record<string, string | string[] | undefined>;
1881
- }
1882
- interface TangleCatalogRuntimeHttpResponse {
1883
- status: number;
1884
- headers: Record<string, string>;
1885
- body: IntegrationActionResult | {
1886
- ok: false;
1887
- action: string;
1888
- output: {
1889
- code: string;
1890
- message: string;
1891
- };
1892
- };
1893
- }
1894
- interface TangleCatalogRuntimePackageCoverageRow {
1895
- connectorId: string;
1896
- packageName: string;
1897
- packageInstalled: boolean;
1898
- packageLoads: boolean;
1899
- pieceExportFound: boolean;
1900
- actionMappingsVerified: number;
1901
- actionMappingsTotal: number;
1902
- triggerMappingsFound: number;
1903
- triggerMappingsTotal: number;
1904
- triggerHostingSupported: boolean;
1905
- error?: string;
1906
- }
1907
- interface TangleCatalogRuntimePackageCoverageOptions {
1908
- connectorIds?: string[];
1909
- moduleLoader?: (packageName: string) => Promise<unknown> | unknown;
1910
- }
1911
- declare function createTangleCatalogRuntimeHandler(options: TangleCatalogRuntimeHandlerOptions): (input: TangleCatalogRuntimeHttpRequest) => Promise<TangleCatalogRuntimeHttpResponse>;
1912
- declare function createTangleCatalogInstalledPackageExecutor(options?: TangleCatalogInstalledPackageExecutorOptions): TangleCatalogRuntimeHandlerOptions['executeAction'];
1913
- declare function auditTangleCatalogRuntimePackages(options?: TangleCatalogRuntimePackageCoverageOptions): Promise<TangleCatalogRuntimePackageCoverageRow[]>;
1914
- declare function createTangleCatalogCredentialAuthResolver(options: TangleCatalogAuthResolverOptions): (connection: IntegrationConnection) => Promise<unknown>;
1915
- declare function createTangleCatalogHttpAuthResolver(options: TangleCatalogHttpAuthResolverOptions): (connection: IntegrationConnection) => Promise<unknown>;
1916
- declare function tangleCatalogAuthValue(credentials: ConnectorCredentials): unknown;
1917
-
1918
- interface TangleCatalogRuntimeNodeServerOptions {
1919
- secret: string;
1920
- host?: string;
1921
- port?: number;
1922
- path?: string;
1923
- maxBodyBytes?: number;
1924
- requireSignature?: boolean;
1925
- authResolver?: false | TangleCatalogHttpAuthResolverOptions;
1926
- executor?: Omit<TangleCatalogInstalledPackageExecutorOptions, 'resolveAuth'> & {
1927
- resolveAuth?: TangleCatalogInstalledPackageExecutorOptions['resolveAuth'];
1928
- };
1929
- onLog?: (event: {
1930
- level: 'info' | 'warn' | 'error';
1931
- message: string;
1932
- metadata?: Record<string, unknown>;
1933
- }) => void;
1934
- }
1935
- interface StartedTangleCatalogRuntimeNodeServer {
1936
- server: Server;
1937
- url: string;
1938
- close: () => Promise<void>;
1939
- }
1940
- declare function createTangleCatalogRuntimeNodeRequestListener(options: TangleCatalogRuntimeNodeServerOptions): (request: IncomingMessage, response: ServerResponse) => Promise<void>;
1941
- declare function startTangleCatalogRuntimeNodeServer(options: TangleCatalogRuntimeNodeServerOptions): Promise<StartedTangleCatalogRuntimeNodeServer>;
1942
-
1943
- type IntegrationCoveragePriority = 'tier_0' | 'tier_1' | 'tier_2' | 'long_tail';
1944
- interface IntegrationCoverageSpec {
1945
- id: string;
1946
- title: string;
1947
- category: IntegrationConnectorCategory;
1948
- auth: IntegrationConnector['auth'];
1949
- priority: IntegrationCoveragePriority;
1950
- providerKinds: IntegrationProviderKind[];
1951
- domains: string[];
1952
- actionPack: IntegrationActionPack;
1953
- scopes?: string[];
1954
- }
1955
- type IntegrationActionPack = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'project' | 'support' | 'marketing' | 'sales' | 'commerce' | 'finance' | 'hr' | 'dev' | 'ai' | 'analytics' | 'workflow' | 'webhook';
1956
- declare function listIntegrationCoverageSpecs(): IntegrationCoverageSpec[];
1957
- declare function buildIntegrationCoverageConnectors(options?: {
1958
- providerId?: string;
1959
- priorities?: IntegrationCoveragePriority[];
1960
- categories?: IntegrationConnectorCategory[];
1961
- actionPacks?: IntegrationActionPack[];
1962
- }): IntegrationConnector[];
1963
- declare function integrationCoverageChecklistMarkdown(): string;
1964
-
1965
- type IntegrationAuthMode = 'oauth2' | 'api_key' | 'hmac' | 'none' | 'custom';
1966
- type IntegrationSpecStatus = 'catalog' | 'executable' | 'deprecated';
1967
- type IntegrationFamilyId = 'google' | 'microsoft-graph' | 'atlassian' | 'salesforce' | 'hubspot' | 'slack' | 'notion' | 'standard-oauth2' | 'api-key' | 'hmac' | 'none';
1968
- type NormalizedPermission = `${string}.read` | `${string}.write` | `${string}.delete` | `${string}.admin`;
1969
- interface IntegrationSpec {
1970
- kind: string;
1971
- title: string;
1972
- category: IntegrationConnectorCategory;
1973
- status: IntegrationSpecStatus;
1974
- family: IntegrationFamilyId;
1975
- auth: IntegrationAuthSpec;
1976
- permissions: PermissionDescriptor[];
1977
- actions: IntegrationConnectorAction[];
1978
- triggers?: IntegrationConnectorTrigger[];
1979
- setup: IntegrationSetupSpec;
1980
- lifecycle?: IntegrationLifecycleSpec;
1981
- plannerHints?: IntegrationPlannerHints;
1982
- metadata?: Record<string, unknown>;
1983
- }
1984
- type IntegrationAuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | HmacAuthSpec | NoneAuthSpec | CustomAuthSpec;
1985
- interface OAuth2AuthSpec {
1986
- mode: 'oauth2';
1987
- authorizationUrl: string;
1988
- tokenUrl: string;
1989
- clientIdEnv?: string;
1990
- clientSecretEnv?: string;
1991
- scopes: ScopeDescriptor[];
1992
- extraAuthParams?: Record<string, string>;
1993
- redirectUriTemplate: string;
1994
- pkce?: 'required' | 'supported' | 'unsupported';
1995
- }
1996
- interface ApiKeyAuthSpec {
1997
- mode: 'api_key';
1998
- credential: CredentialFieldSpec;
1999
- placement?: 'bearer' | 'header' | 'query' | 'basic';
2000
- }
2001
- interface HmacAuthSpec {
2002
- mode: 'hmac';
2003
- credential: CredentialFieldSpec;
2004
- signatureHeader?: string;
2005
- }
2006
- interface NoneAuthSpec {
2007
- mode: 'none';
2008
- }
2009
- interface CustomAuthSpec {
2010
- mode: 'custom';
2011
- description: string;
2012
- }
2013
- interface ScopeDescriptor {
2014
- normalized: NormalizedPermission;
2015
- providerScope: string;
2016
- title: string;
2017
- reason: string;
2018
- risk: IntegrationActionRisk;
2019
- dataClass: IntegrationDataClass;
2020
- }
2021
- interface PermissionDescriptor {
2022
- normalized: NormalizedPermission;
2023
- providerScopes: string[];
2024
- title: string;
2025
- risk: IntegrationActionRisk;
2026
- dataClass: IntegrationDataClass;
2027
- reason: string;
2028
- }
2029
- interface CredentialFieldSpec {
2030
- label: string;
2031
- description: string;
2032
- env?: string;
2033
- example?: string;
2034
- regex?: string;
2035
- secret: boolean;
2036
- }
2037
- interface ConsoleStep {
2038
- id: string;
2039
- title: string;
2040
- detail: string;
2041
- copyValue?: string;
2042
- }
2043
- interface Quirk {
2044
- id: string;
2045
- severity: 'info' | 'warning' | 'critical';
2046
- message: string;
2047
- }
2048
- interface PostSetupCheck {
2049
- id: string;
2050
- title: string;
2051
- detail: string;
2052
- }
2053
- interface HealthcheckSpec {
2054
- id: string;
2055
- level: 'client_config' | 'connection' | 'webhook' | 'static';
2056
- method?: 'GET' | 'POST';
2057
- url?: string;
2058
- expectedStatus?: number[];
2059
- description: string;
2060
- }
2061
- interface IntegrationSetupSpec {
2062
- consoleUrl?: string;
2063
- consoleSteps: ConsoleStep[];
2064
- credentialFields: CredentialFieldSpec[];
2065
- redirectUriTemplate?: string;
2066
- knownQuirks?: Quirk[];
2067
- postSetup?: PostSetupCheck[];
2068
- healthcheck?: HealthcheckSpec;
2069
- }
2070
- interface IntegrationLifecycleSpec {
2071
- supportsRefresh: boolean;
2072
- supportsRevoke: boolean;
2073
- supportsIncrementalAuth: boolean;
2074
- recommendedHealthcheckIntervalHours?: number;
2075
- freshnessSloMinutes?: number;
2076
- }
2077
- interface IntegrationPlannerHints {
2078
- useFor: string[];
2079
- avoidFor?: string[];
2080
- dataFreshness: 'realtime' | 'near_realtime' | 'eventual' | 'manual';
2081
- writeRisk: 'low' | 'medium' | 'high';
2082
- }
2083
- interface IntegrationFamilySpec {
2084
- id: IntegrationFamilyId;
2085
- title: string;
2086
- authMode: IntegrationAuthMode;
2087
- consoleUrl?: string;
2088
- authorizationUrl?: string;
2089
- tokenUrl?: string;
2090
- redirectUriTemplate?: string;
2091
- credentialFields: CredentialFieldSpec[];
2092
- consoleSteps: ConsoleStep[];
2093
- knownQuirks?: Quirk[];
2094
- lifecycle: IntegrationLifecycleSpec;
2095
- }
2096
- interface IntegrationSpecValidationIssue {
2097
- path: string;
2098
- message: string;
2099
- }
2100
- interface IntegrationSpecValidationResult {
2101
- ok: boolean;
2102
- issues: IntegrationSpecValidationIssue[];
2103
- }
2104
- interface RenderSpecOptions {
2105
- host: string;
2106
- callbackPath?: string;
2107
- }
2108
- interface RenderedConsoleStep extends ConsoleStep {
2109
- detail: string;
2110
- copyValue?: string;
2111
- }
2112
- interface CredentialValidationInput {
2113
- field: CredentialFieldSpec;
2114
- value: string;
2115
- }
2116
- interface CredentialValidationResult {
2117
- ok: boolean;
2118
- field: string;
2119
- message?: string;
2120
- }
2121
- interface HealthcheckPlan {
2122
- kind: string;
2123
- healthcheck: HealthcheckSpec;
2124
- requires: Array<'client_id' | 'client_secret' | 'api_key' | 'hmac_secret' | 'connection_credentials'>;
2125
- message: string;
2126
- }
2127
- declare function specAuthToConnectorAuth(auth: IntegrationAuthSpec): IntegrationConnector['auth'];
2128
-
2129
- declare const INTEGRATION_FAMILIES: Record<IntegrationFamilyId, IntegrationFamilySpec>;
2130
- declare function getIntegrationFamily(id: IntegrationFamilyId): IntegrationFamilySpec;
2131
-
2132
- declare function listIntegrationSpecs(): IntegrationSpec[];
2133
- declare function getIntegrationSpec(kind: string): IntegrationSpec | undefined;
2134
- /** Auth-driving descriptor the hub uses to start a connect flow per provider
2135
- * instead of hard-coding scopes/auth kind. Derived from the spec catalog
2136
- * ({@link getIntegrationSpec}); undefined when the kind is not in the
2137
- * catalog. */
2138
- interface ConnectorAuthSpec {
2139
- kind: string;
2140
- authKind: 'oauth2' | 'api_key' | 'none' | 'custom';
2141
- /** Provider scopes to request in the authorization grant. Empty for
2142
- * api_key / none / custom. */
2143
- requestedScopes: string[];
2144
- /** OAuth-only: authorization + token endpoints and PKCE posture. Present
2145
- * only when authKind === 'oauth2'. */
2146
- authorizationUrl?: string;
2147
- tokenUrl?: string;
2148
- pkce?: 'required' | 'supported' | 'unsupported';
2149
- redirectUriTemplate?: string;
2150
- clientIdEnv?: string;
2151
- clientSecretEnv?: string;
2152
- extraAuthParams?: Record<string, string>;
2153
- }
2154
- declare function resolveConnectorAuthSpec(kind: string): ConnectorAuthSpec | undefined;
2155
- declare function listExecutableIntegrationSpecs(): IntegrationSpec[];
2156
- declare function integrationSpecToConnector(spec: IntegrationSpec, providerId?: string): IntegrationConnector;
2157
-
2158
- declare function renderConsoleSteps(spec: IntegrationSpec, options: RenderSpecOptions): RenderedConsoleStep[];
2159
- declare function renderRunbookMarkdown(spec: IntegrationSpec, options: RenderSpecOptions): string;
2160
- declare function renderAgentToolDescription(spec: IntegrationSpec): string;
2161
- declare function buildHealthcheckPlan(spec: IntegrationSpec): HealthcheckPlan;
2162
- declare function consoleStepsToText(steps: ConsoleStep[]): string;
2163
-
2164
- declare function validateIntegrationSpec(spec: IntegrationSpec): IntegrationSpecValidationResult;
2165
- declare function assertValidIntegrationSpec(spec: IntegrationSpec): void;
2166
- declare function validateCredentialFormat(field: CredentialFieldSpec, value: string): CredentialValidationResult;
2167
- declare function validateCredentialSet(spec: IntegrationSpec, values: Record<string, string>): CredentialValidationResult[];
2168
-
2169
- type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'tangle_catalog' | 'executor' | 'custom';
2170
- type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
2171
- type IntegrationActionRisk = 'read' | 'write' | 'destructive';
2172
- type IntegrationDataClass = 'public' | 'internal' | 'private' | 'sensitive' | 'secret';
2173
- interface IntegrationActor {
2174
- type: 'user' | 'team' | 'app' | 'agent' | 'sandbox' | 'system';
2175
- id: string;
2176
- }
2177
- interface IntegrationConnectorAction {
2178
- id: string;
2179
- title: string;
2180
- risk: IntegrationActionRisk;
2181
- requiredScopes: string[];
2182
- dataClass: IntegrationDataClass;
2183
- description?: string;
2184
- approvalRequired?: boolean;
2185
- inputSchema?: unknown;
2186
- outputSchema?: unknown;
2187
- }
2188
- interface IntegrationConnectorTrigger {
2189
- id: string;
2190
- title: string;
2191
- requiredScopes: string[];
2192
- dataClass: IntegrationDataClass;
2193
- description?: string;
2194
- payloadSchema?: unknown;
2195
- }
2196
- interface IntegrationConnector {
2197
- id: string;
2198
- providerId: string;
2199
- title: string;
2200
- category: IntegrationConnectorCategory;
2201
- auth: 'oauth2' | 'api_key' | 'none' | 'custom';
2202
- scopes: string[];
2203
- actions: IntegrationConnectorAction[];
2204
- triggers?: IntegrationConnectorTrigger[];
2205
- metadata?: Record<string, unknown>;
2206
- }
2207
- interface SecretRef {
2208
- provider: string;
2209
- id: string;
2210
- label?: string;
2211
- }
2212
- interface IntegrationConnection {
2213
- id: string;
2214
- owner: IntegrationActor;
2215
- providerId: string;
2216
- connectorId: string;
2217
- status: 'pending' | 'active' | 'expired' | 'revoked' | 'error';
2218
- grantedScopes: string[];
2219
- account?: {
2220
- id?: string;
2221
- email?: string;
2222
- displayName?: string;
2223
- };
2224
- secretRef?: SecretRef;
2225
- createdAt: string;
2226
- updatedAt: string;
2227
- expiresAt?: string;
2228
- lastUsedAt?: string;
2229
- metadata?: Record<string, unknown>;
2230
- }
2231
- interface StartAuthRequest {
2232
- connectorId: string;
2233
- owner: IntegrationActor;
2234
- requestedScopes: string[];
2235
- redirectUri: string;
2236
- state?: string;
2237
- metadata?: Record<string, unknown>;
2238
- }
2239
- interface StartAuthResult {
2240
- providerId: string;
2241
- connectorId: string;
2242
- authUrl: string;
2243
- state: string;
2244
- expiresAt?: string;
2245
- metadata?: Record<string, unknown>;
2246
- }
2247
- interface CompleteAuthRequest {
2248
- connectorId: string;
2249
- owner: IntegrationActor;
2250
- code?: string;
2251
- state: string;
2252
- redirectUri: string;
2253
- metadata?: Record<string, unknown>;
2254
- }
2255
- interface IntegrationActionRequest {
2256
- connectionId: string;
2257
- action: string;
2258
- input?: unknown;
2259
- idempotencyKey?: string;
2260
- dryRun?: boolean;
2261
- metadata?: Record<string, unknown>;
2262
- }
2263
- interface IntegrationActionResult<T = unknown> {
2264
- ok: boolean;
2265
- action: string;
2266
- output?: T;
2267
- externalId?: string;
2268
- warnings?: string[];
2269
- metadata?: Record<string, unknown>;
2270
- }
2271
- interface IntegrationTriggerSubscription {
2272
- id: string;
2273
- connectionId: string;
2274
- trigger: string;
2275
- targetUrl?: string;
2276
- status: 'active' | 'paused' | 'error';
2277
- createdAt: string;
2278
- metadata?: Record<string, unknown>;
2279
- }
2280
- interface IntegrationTriggerEvent<T = unknown> {
2281
- id: string;
2282
- providerId: string;
2283
- connectorId: string;
2284
- connectionId: string;
2285
- trigger: string;
2286
- occurredAt: string;
2287
- payload: T;
2288
- metadata?: Record<string, unknown>;
2289
- }
2290
- interface IntegrationProvider {
2291
- id: string;
2292
- kind: IntegrationProviderKind;
2293
- listConnectors(): Promise<IntegrationConnector[]> | IntegrationConnector[];
2294
- startAuth?(request: StartAuthRequest): Promise<StartAuthResult> | StartAuthResult;
2295
- completeAuth?(request: CompleteAuthRequest): Promise<IntegrationConnection> | IntegrationConnection;
2296
- invokeAction(connection: IntegrationConnection, request: IntegrationActionRequest): Promise<IntegrationActionResult> | IntegrationActionResult;
2297
- subscribeTrigger?(connection: IntegrationConnection, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
2298
- unsubscribeTrigger?(subscriptionId: string): Promise<void> | void;
2299
- normalizeTriggerEvent?(raw: unknown): Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
2300
- }
2301
- interface IntegrationConnectionStore {
2302
- get(connectionId: string): Promise<IntegrationConnection | undefined> | IntegrationConnection | undefined;
2303
- put(connection: IntegrationConnection): Promise<void> | void;
2304
- listByOwner(owner: IntegrationActor): Promise<IntegrationConnection[]> | IntegrationConnection[];
2305
- delete?(connectionId: string): Promise<void> | void;
2306
- }
2307
- interface IssueCapabilityRequest {
2308
- subject: IntegrationActor;
2309
- connectionId: string;
2310
- scopes: string[];
2311
- allowedActions: string[];
2312
- ttlMs: number;
2313
- metadata?: Record<string, unknown>;
2314
- }
2315
- interface IntegrationCapability {
2316
- id: string;
2317
- subject: IntegrationActor;
2318
- connectionId: string;
2319
- scopes: string[];
2320
- allowedActions: string[];
2321
- issuedAt: string;
2322
- expiresAt: string;
2323
- metadata?: Record<string, unknown>;
2324
- }
2325
- interface IssuedIntegrationCapability {
2326
- capability: IntegrationCapability;
2327
- token: string;
2328
- }
2329
- /**
2330
- * Wraps every action invocation with cross-cutting discipline (idempotency,
2331
- * conflict detection, rate-limiting, audit logging). Optional. When set on
2332
- * the hub, runs BEFORE provider.invokeAction; can short-circuit (return a
2333
- * result directly) or pass through (call `proceed()` to invoke the provider).
2334
- *
2335
- * Why this hook exists: production deployments need conflict-resolution
2336
- * guarantees that span every provider, gateway, and webhook receiver. The
2337
- * canonical implementation is a "MutationGuard" that:
2338
- * 1. Short-circuits on a known idempotency key (returns recorded response).
2339
- * 2. Refuses same-key-different-args (drift detection).
2340
- * 3. Wraps `proceed()` and audit-logs the outcome.
2341
- * 4. Translates upstream conflict signals into a structured result with
2342
- * alternatives the agent can act on.
2343
- *
2344
- * Implementations live in consumers (every product has different
2345
- * persistence + telemetry needs); this interface is the contract.
2346
- */
2347
- interface IntegrationActionGuard {
2348
- /** Wrap an invokeAction call. Implementations MUST call `proceed()` to
2349
- * invoke the underlying provider unless they're returning a cached or
2350
- * short-circuited result.
2351
- *
2352
- * @param ctx connection + request the hub is about to dispatch
2353
- * @param proceed call to invoke the wrapped provider; returns the
2354
- * underlying IntegrationActionResult
2355
- * @returns the result the hub should return to the caller
2356
- */
2357
- invokeAction(ctx: IntegrationGuardContext, proceed: () => Promise<IntegrationActionResult>): Promise<IntegrationActionResult>;
2358
- }
2359
- interface IntegrationGuardContext {
2360
- connection: IntegrationConnection;
2361
- request: IntegrationActionRequest;
2362
- /** The action descriptor from the connector manifest, if discovered. */
2363
- action?: IntegrationConnectorAction;
2364
- }
2365
- type IntegrationPolicyDecision = {
2366
- decision: 'allow';
2367
- reason: string;
2368
- metadata?: Record<string, unknown>;
2369
- } | {
2370
- decision: 'require_approval';
2371
- reason: string;
2372
- approval: IntegrationApprovalRequest;
2373
- metadata?: Record<string, unknown>;
2374
- } | {
2375
- decision: 'deny';
2376
- reason: string;
2377
- metadata?: Record<string, unknown>;
2378
- };
2379
- interface IntegrationApprovalRequest {
2380
- id: string;
2381
- connectionId: string;
2382
- providerId: string;
2383
- connectorId: string;
2384
- action: string;
2385
- actor: IntegrationActor;
2386
- risk: IntegrationActionRisk;
2387
- dataClass: IntegrationDataClass;
2388
- reason: string;
2389
- requestedAt: string;
2390
- inputPreview?: unknown;
2391
- metadata?: Record<string, unknown>;
2392
- }
2393
- interface IntegrationPolicyEngine {
2394
- decide(ctx: IntegrationGuardContext & {
2395
- subject: IntegrationActor;
2396
- }): Promise<IntegrationPolicyDecision> | IntegrationPolicyDecision;
2397
- }
2398
- interface IntegrationHubOptions {
2399
- providers: IntegrationProvider[];
2400
- store: IntegrationConnectionStore;
2401
- capabilitySecret: string;
2402
- /** Optional cross-cutting guard. If provided, every invokeAction call
2403
- * passes through it before reaching the provider. See {@link IntegrationActionGuard}. */
2404
- guard?: IntegrationActionGuard;
2405
- /** Optional policy engine. Runs after capability/scope checks and before
2406
- * provider invocation. Use it to pause writes, deny destructive actions,
2407
- * or apply tenant-specific allow rules. */
2408
- policy?: IntegrationPolicyEngine;
2409
- /** Host-injectable secret store. Multi-tenant hubs inject a durable
2410
- * encrypted store; defaults to {@link InMemoryIntegrationSecretStore} for
2411
- * local/dev and tests. The interface is the contract — the lib never
2412
- * ships a D1/KV/encryption impl. */
2413
- secretStore?: IntegrationSecretStore;
2414
- /** Host-injectable single-use OAuth-state store guarding the start →
2415
- * callback CSRF boundary. Defaults to
2416
- * {@link InMemoryIntegrationOAuthStateStore}. */
2417
- oauthStateStore?: IntegrationOAuthStateStore;
2418
- /** TTL applied to OAuth-state records the hub stashes at startAuth.
2419
- * Defaults to 10 minutes. */
2420
- oauthStateTtlMs?: number;
2421
- /** Fired whenever a provider surfaces rotated credentials during an
2422
- * invoke (e.g. an OAuth access token refreshed on expiry). The host
2423
- * re-encrypts + persists the rotated envelope so the next expiry does
2424
- * not force a reconnect. The hub also writes the rotated credentials to
2425
- * {@link secretStore} when the connection carries a secretRef. */
2426
- credentialsRotated?: (event: IntegrationCredentialsRotatedEvent) => Promise<void> | void;
2427
- now?: () => Date;
2428
- }
2429
- /** Emitted when a provider rotates credentials mid-invoke. The host
2430
- * re-persists `credentials` against `secretRef` (when present) so the
2431
- * refreshed token survives the call. */
2432
- interface IntegrationCredentialsRotatedEvent {
2433
- connection: IntegrationConnection;
2434
- secretRef?: SecretRef;
2435
- credentials: ConnectorCredentials;
2436
- }
2437
- interface HttpIntegrationProviderOptions {
2438
- id: string;
2439
- kind?: IntegrationProviderKind;
2440
- connectors: IntegrationConnector[];
2441
- baseUrl: string;
2442
- bearer?: string;
2443
- fetchImpl?: typeof fetch;
2444
- }
2445
- interface InvokeWithCapabilityRequest extends Omit<IntegrationActionRequest, 'connectionId'> {
2446
- connectionId?: never;
2447
- }
2448
- declare class IntegrationError extends Error {
2449
- readonly code: 'provider_not_found' | 'connector_not_found' | 'connection_not_found' | 'connection_not_active' | 'auth_not_supported' | 'capability_invalid' | 'capability_expired' | 'scope_denied' | 'action_denied' | 'action_not_found' | 'trigger_not_found' | 'approval_required' | 'policy_denied' | 'config_missing' | 'provider_failure';
2450
- constructor(message: string, code: 'provider_not_found' | 'connector_not_found' | 'connection_not_found' | 'connection_not_active' | 'auth_not_supported' | 'capability_invalid' | 'capability_expired' | 'scope_denied' | 'action_denied' | 'action_not_found' | 'trigger_not_found' | 'approval_required' | 'policy_denied' | 'config_missing' | 'provider_failure');
2451
- }
2452
- declare class InMemoryConnectionStore implements IntegrationConnectionStore {
2453
- private readonly connections;
2454
- get(connectionId: string): IntegrationConnection | undefined;
2455
- put(connection: IntegrationConnection): void;
2456
- listByOwner(owner: IntegrationActor): IntegrationConnection[];
2457
- delete(connectionId: string): void;
2458
- }
2459
- declare class IntegrationHub {
2460
- private readonly providers;
2461
- private readonly store;
2462
- private readonly capabilitySecret;
2463
- private readonly guard;
2464
- private readonly policy;
2465
- /** Host-injected (or in-memory default) secret store. The hub re-persists
2466
- * rotated credentials here when a connection carries a secretRef. */
2467
- readonly secretStore: IntegrationSecretStore;
2468
- private readonly oauthStateStore;
2469
- private readonly oauthStateTtlMs;
2470
- private readonly credentialsRotated;
2471
- private readonly now;
2472
- constructor(options: IntegrationHubOptions);
2473
- listConnectors(): Promise<IntegrationConnector[]>;
2474
- listRegistry(options?: ComposeIntegrationRegistryOptions): Promise<IntegrationRegistry>;
2475
- startAuth(providerId: string, request: StartAuthRequest): Promise<StartAuthResult>;
2476
- completeAuth(providerId: string, request: CompleteAuthRequest): Promise<IntegrationConnection>;
2477
- upsertConnection(connection: IntegrationConnection): Promise<IntegrationConnection>;
2478
- listConnections(owner: IntegrationActor): Promise<IntegrationConnection[]>;
2479
- getConnection(connectionId: string): Promise<IntegrationConnection | undefined>;
2480
- issueCapability(request: IssueCapabilityRequest): Promise<IssuedIntegrationCapability>;
2481
- verifyCapability(token: string): IntegrationCapability;
2482
- invokeWithCapability(token: string, request: InvokeWithCapabilityRequest): Promise<IntegrationActionResult>;
2483
- subscribeTrigger(connectionId: string, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription>;
2484
- private requireProvider;
2485
- private requireConnector;
2486
- private requireConnection;
2487
- private assertConnectionActive;
2488
- }
2489
- declare function sanitizeConnection(connection: IntegrationConnection): Record<string, unknown>;
2490
- declare function createMockIntegrationProvider(options?: {
2491
- id?: string;
2492
- connectors?: IntegrationConnector[];
2493
- onInvoke?: (connection: IntegrationConnection, request: IntegrationActionRequest) => IntegrationActionResult | Promise<IntegrationActionResult>;
2494
- }): IntegrationProvider;
2495
- declare function createHttpIntegrationProvider(options: HttpIntegrationProviderOptions): IntegrationProvider;
2496
- declare function signCapability(capability: IntegrationCapability, secret: string): string;
2497
- declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
2498
-
2499
- export { createTangleCatalogCredentialAuthResolver as $, type CheckConnectorInput as A, type CheckConnectorResult as B, type CapabilityBundleResult as C, type ComposeIntegrationRegistryOptions, type CreateGrantsInput as D, type IntegrationHubAuth as E, IntegrationHubClient as F, type IntegrationHubClientOptions as G, IntegrationHubRequestError as H, type IntegrationCatalogView as I, type IntegrationCatalogExecutability, type IntegrationCatalogSource, type IntegrationRegistry, type IntegrationRegistryConflict, type IntegrationRegistryEntry, type IntegrationRegistrySourceRef, type IntegrationRegistrySummary, type IntegrationSupportTier, type MintCapabilityBundleInput as J, createIntegrationHubClient as K, type ListGrantsInput as L, type McpToolDefinition as M, type TangleCatalogAuthResolverOptions as N, type TangleCatalogHttpAuthResolverOptions as O, type TangleCatalogHttpAuthResolverRequest as P, type TangleCatalogInstalledPackageExecutorOptions as Q, type ResolveManifestInput as R, type TangleCatalogRuntimeHandlerOptions as S, TANGLE_CATALOG_RUNTIME_SIGNATURE_HEADER as T, type TangleCatalogRuntimeHttpRequest as U, type TangleCatalogRuntimeHttpResponse as V, type TangleCatalogRuntimeInvocation as W, type TangleCatalogRuntimeModuleAction as X, type TangleCatalogRuntimePackageCoverageOptions as Y, type TangleCatalogRuntimePackageCoverageRow as Z, auditTangleCatalogRuntimePackages as _, type IntegrationToolDefinition as a, ApprovalBackedPolicyEngine as a$, createTangleCatalogHttpAuthResolver as a0, createTangleCatalogInstalledPackageExecutor as a1, createTangleCatalogRuntimeHandler as a2, signTangleCatalogRuntimeRequest as a3, tangleCatalogAuthValue as a4, verifyTangleCatalogRuntimeSignature as a5, type ApiKeyAuthSpec as a6, type ConnectorAuthSpec as a7, type ConsoleStep as a8, type CredentialFieldSpec as a9, type ScopeDescriptor as aA, assertValidIntegrationSpec as aB, buildHealthcheckPlan as aC, consoleStepsToText as aD, getIntegrationFamily as aE, getIntegrationSpec as aF, integrationSpecToConnector as aG, listExecutableIntegrationSpecs as aH, listIntegrationSpecs as aI, renderAgentToolDescription as aJ, renderConsoleSteps as aK, renderRunbookMarkdown as aL, resolveConnectorAuthSpec as aM, specAuthToConnectorAuth as aN, validateCredentialFormat as aO, validateCredentialSet as aP, validateIntegrationSpec as aQ, ACTIVEPIECES_OVERRIDES as aR, ACTIVEPIECES_PUBLIC_CATALOG_URL as aS, ACTIVEPIECES_RUNTIME_SIGNATURE_HEADER as aT, type ActivepiecesCatalogAuthField as aU, type ActivepiecesCatalogEntry as aV, type ActivepiecesExecutorInvocation as aW, type ActivepiecesExecutorProviderOptions as aX, type ActivepiecesHttpExecutorOptions as aY, type ActivepiecesPieceOverride as aZ, type ActivepiecesRuntimeRequest as a_, type CredentialValidationInput as aa, type CredentialValidationResult as ab, type CustomAuthSpec as ac, type HealthcheckPlan as ad, type HealthcheckSpec as ae, type HmacAuthSpec as af, INTEGRATION_FAMILIES as ag, type IntegrationAuthMode as ah, type IntegrationAuthSpec as ai, type IntegrationFamilyId as aj, type IntegrationFamilySpec as ak, type IntegrationLifecycleSpec as al, type IntegrationPlannerHints as am, type IntegrationSetupSpec as an, type IntegrationSpec as ao, type IntegrationSpecStatus as ap, type IntegrationSpecValidationIssue as aq, type IntegrationSpecValidationResult as ar, type NoneAuthSpec as as, type NormalizedPermission as at, type OAuth2AuthSpec as au, type PermissionDescriptor as av, type PostSetupCheck as aw, type Quirk as ax, type RenderSpecOptions as ay, type RenderedConsoleStep as az, type IntegrationToolSearchFilters as b, type IntegrationDataClass as b$, type ApprovalBackedPolicyOptions as b0, CANONICAL_INTEGRATION_ACTIONS as b1, type CanonicalIntegrationActionId as b2, type CanonicalLaunchConnectorOptions as b3, type CatalogExecutorInvocation as b4, type CatalogExecutorProviderOptions as b5, type CompleteAuthRequest as b6, type ConnectionCredentialResolverOptions as b7, type ConnectorAdapterProviderOptions as b8, type ConsentSummary as b9, type IntegrationActionRisk as bA, type IntegrationActor as bB, type IntegrationApprovalFilter as bC, type IntegrationApprovalRecord as bD, type IntegrationApprovalRequest as bE, type IntegrationApprovalResolution as bF, type IntegrationApprovalStatus as bG, type IntegrationApprovalStore as bH, type IntegrationAuditEvent as bI, type IntegrationAuditEventType as bJ, type IntegrationAuditFilter as bK, type IntegrationAuditSink as bL, type IntegrationAuditStore as bM, type IntegrationBridgePayload as bN, type IntegrationBridgeToolBinding as bO, type IntegrationCapability as bP, type IntegrationCatalogFreshnessOptions as bQ, type IntegrationCatalogFreshnessResult as bR, type IntegrationConnection as bS, type IntegrationConnectionStore as bT, type IntegrationConnector as bU, type IntegrationConnectorAction as bV, type IntegrationConnectorCategory as bW, type IntegrationConnectorTrigger as bX, type IntegrationCoveragePriority as bY, type IntegrationCoverageSpec as bZ, type IntegrationCredentialsRotatedEvent as b_, type CredentialBackedAdapterProviderOptions as ba, DEFAULT_INTEGRATION_BRIDGE_ENV as bb, DefaultIntegrationActionGuard as bc, type DiscoverWorkspaceCapabilitiesInput as bd, type GatewayCatalogAction as be, type GatewayCatalogEntry as bf, type GatewayCatalogProviderOptions as bg, type GatewayCatalogTrigger as bh, type GraphqlOperationSpec as bi, type HttpIntegrationProviderOptions as bj, type ImportCatalogOptions as bk, InMemoryConnectionStore as bl, InMemoryIntegrationApprovalStore as bm, InMemoryIntegrationAuditStore as bn, InMemoryIntegrationEventStore as bo, InMemoryIntegrationHealthcheckStore as bp, InMemoryIntegrationIdempotencyStore as bq, InMemoryIntegrationOAuthStateStore as br, InMemoryIntegrationSecretStore as bs, InMemoryIntegrationWorkflowStore as bt, type InferIntegrationRequirementsOptions as bu, buildDefaultIntegrationRegistry, type InstalledIntegrationWorkflow as bv, type IntegrationActionGuard as bw, type IntegrationActionPack as bx, type IntegrationActionRequest as by, type IntegrationActionResult as bz, type IntegrationToolSearchResult as c, type TangleCatalogExecutorProviderOptions as c$, IntegrationError as c0, type IntegrationEventStore as c1, type IntegrationGuardContext as c2, type IntegrationHealthcheckCheck as c3, type IntegrationHealthcheckResult as c4, type IntegrationHealthcheckStatus as c5, type IntegrationHealthcheckStore as c6, IntegrationHub as c7, type IntegrationHubOptions as c8, type IntegrationIdempotencyRecord as c9, type InvokeWithCapabilityRequest as cA, type IssueCapabilityRequest as cB, type IssuedIntegrationCapability as cC, type ManifestValidationIssue as cD, type ManifestValidationResult as cE, type McpCatalog as cF, type McpCatalogTool as cG, type MissingRequirementExplanation as cH, type NormalizedIntegrationResult as cI, type OAuthClientCredentials as cJ, type OpenApiDocument as cK, type OpenApiOperation as cL, PROVIDER_PASSTHROUGH_ACTION as cM, type PlatformIntegrationPolicyPresetOptions as cN, type ProviderHttpRequestInput as cO, type ProviderPassthroughPolicy as cP, type RenderConsentOptions as cQ, type SecretRef as cR, type StartAuthRequest as cS, type StartAuthResult as cT, type StartedTangleCatalogRuntimeNodeServer as cU, StaticIntegrationPolicyEngine as cV, type StaticIntegrationPolicyOptions as cW, type StoredIntegrationEvent as cX, TANGLE_INTEGRATIONS_CATALOG_PROVIDER_ID as cY, TANGLE_INTEGRATIONS_CATALOG_SOURCE as cZ, type TangleCatalogExecutorInvocation as c_, type IntegrationIdempotencyStore as ca, canonicalConnectorId, type IntegrationInvocationEnvelope as cb, type IntegrationInvocationEnvelopeValidationOptions as cc, type IntegrationOAuthState as cd, type IntegrationOAuthStateOutcome as ce, type IntegrationOAuthStateStore as cf, type IntegrationPolicyDecision as cg, type IntegrationPolicyEffect as ch, type IntegrationPolicyEngine as ci, type IntegrationPolicyRule as cj, type IntegrationProvider as ck, type IntegrationProviderKind as cl, classifyIntegrationCatalogExecutability, type IntegrationRateLimitDecision as cm, type IntegrationRateLimiter as cn, IntegrationSandboxHost as co, composeIntegrationRegistry, type IntegrationSandboxHostHub as cp, type IntegrationSandboxHostOptions as cq, type IntegrationSecretStore as cr, type IntegrationTriggerEvent as cs, type IntegrationTriggerSubscription as ct, type IntegrationWebhookReceiverResult as cu, type IntegrationWorkflowDefinition as cv, IntegrationWorkflowRuntime as cw, type IntegrationWorkflowRuntimeHub as cx, type IntegrationWorkflowRuntimeOptions as cy, type IntegrationWorkflowStore as cz, buildIntegrationCatalogView as d, discoverWorkspaceCapabilities as d$, type TangleCatalogHttpExecutorInvocation as d0, type TangleCatalogHttpExecutorOptions as d1, type TangleCatalogRuntimeActionRequest as d2, type TangleCatalogRuntimeNodeServerOptions as d3, type TangleCatalogRuntimePackageManifest as d4, type TangleCatalogRuntimePackageManifestOptions as d5, type TangleCatalogRuntimePiece as d6, type TangleCatalogRuntimeRequest as d7, type TangleCatalogTriggerInvocation as d8, type TangleIntegrationCatalogEntry as d9, buildTangleCatalogRuntimePackageManifest as dA, buildTangleCatalogRuntimeRequest as dB, buildTangleIntegrationCatalogConnectors as dC, calendarExercisePlannerManifest as dD, canonicalActionConnectorId as dE, createActivepiecesExecutorProvider as dF, createActivepiecesHttpExecutor as dG, createApprovalBackedPolicyEngine as dH, createAuditingActionGuard as dI, createCatalogExecutorProvider as dJ, createConnectionCredentialResolver as dK, createConnectorAdapterCatalogSource as dL, createConnectorAdapterProvider as dM, createCredentialBackedAdapterProvider as dN, createDefaultIntegrationActionGuard as dO, createDefaultIntegrationPolicyEngine as dP, createGatewayCatalogProvider as dQ, createHttpIntegrationProvider as dR, createIntegrationAuditEvent as dS, createIntegrationWorkflowRuntime as dT, createMockIntegrationProvider as dU, createPlatformIntegrationPolicyPreset as dV, createTangleCatalogExecutorProvider as dW, createTangleCatalogHttpExecutor as dX, createTangleCatalogRuntimeNodeRequestListener as dY, createTangleIntegrationsClient as dZ, decodeIntegrationBridgePayload as d_, type TangleIntegrationCatalogFreshnessOptions as da, type TangleIntegrationCatalogFreshnessResult as db, type TangleIntegrationContract as dc, type TangleIntegrationContractStatus as dd, type TangleIntegrationImplementationKind as de, type TangleIntegrationInvokeInput as df, type TangleIntegrationInvokeResult as dg, TangleIntegrationsClient as dh, type TangleIntegrationsClientOptions as di, type WorkspaceCapability as dj, type WorkspaceCapabilityDiscovery as dk, type WorkspaceToolSchema as dl, type WorkspaceTrigger as dm, adapterManifestsToConnectors as dn, assertValidIntegrationManifest as dp, auditIntegrationCatalogFreshness as dq, auditTangleIntegrationCatalogFreshness as dr, buildActivepiecesConnectors as ds, buildActivepiecesRuntimeRequest as dt, buildApprovalRequest as du, buildCanonicalLaunchConnectors as dv, buildIntegrationBridgeEnvironment as dw, buildIntegrationBridgePayload as dx, buildIntegrationCoverageConnectors as dy, buildIntegrationInvocationEnvelope as dz, buildIntegrationToolCatalog as e, dispatchIntegrationInvocation as e0, encodeIntegrationBridgePayload as e1, explainMissingRequirements as e2, extractActivepiecesPublicPieceCount as e3, extractExternalCatalogPublicCount as e4, filterDiscoveryByWorkspaceScopes as e5, getActivepiecesOverride as e6, healthcheckRequest as e7, importGraphqlConnector as e8, importMcpConnector as e9, sanitizeAuditConnection as eA, sanitizeConnection as eB, signActivepiecesRuntimeRequest as eC, signCapability as eD, startTangleCatalogRuntimeNodeServer as eE, storedEventToTriggerEvent as eF, validateIntegrationInvocationEnvelope as eG, validateIntegrationManifest as eH, validateProviderPassthroughRequest as eI, verifyActivepiecesRuntimeSignature as eJ, verifyCapabilityToken as eK, importOpenApiConnector as ea, inferIntegrationManifestFromTools as eb, integrationCoverageChecklistMarkdown as ec, invocationRequestFromEnvelope as ed, listActivepiecesCatalogEntries as ee, listIntegrationCoverageSpecs as ef, listTangleIntegrationCatalogEntries as eg, listTangleIntegrationCatalogRuntimePackages as eh, listTangleIntegrationContracts as ei, manifestToConnector as ej, normalizeGatewayCatalog as ek, normalizeIntegrationResult as el, parseIntegrationBridgeEnvironment as em, receiveIntegrationWebhook as en, redactApprovalRequest as eo, redactCapability as ep, redactIntegrationBridgePayload as eq, redactInvocationEnvelope as er, renderApprovalCopy as es, renderConsentSummary as et, renderTangleCatalogRuntimePnpmAddCommand as eu, resolveConnectionCredentials as ev, resolveIntegrationApproval as ew, revokeConnection as ex, runIntegrationHealthcheck as ey, runIntegrationHealthchecks as ez, describeIntegrationTool as f, flattenIntegrationToolDefinition as g, InMemoryIntegrationGrantStore as h, integrationToolName as i, inferIntegrationSupportTier, type IntegrationCapabilityBinding as j, type IntegrationGrant as k, type IntegrationGrantStore as l, type IntegrationManifest as m, type IntegrationManifestResolution as n, type IntegrationRequirement as o, parseIntegrationToolName as p, type IntegrationRequirementMode as q, type IntegrationRequirementResolution as r, searchIntegrationTools as s, summarizeIntegrationRegistry, toMcpTools as t, type IntegrationRequirementStatus as u, IntegrationRuntime as v, type IntegrationRuntimeHub as w, type IntegrationRuntimeOptions as x, type IntegrationSandboxBundle as y, createIntegrationRuntime as z };
78
+ export { type ComposeIntegrationRegistryOptions, type IntegrationCatalogExecutability, type IntegrationRegistry, type IntegrationRegistryConflict, type IntegrationRegistryEntry, type IntegrationRegistrySourceRef, type IntegrationRegistrySummary, type IntegrationSupportTier, buildDefaultIntegrationRegistry, canonicalConnectorId, classifyIntegrationCatalogExecutability, composeIntegrationRegistry, inferIntegrationSupportTier, summarizeIntegrationRegistry };