@tangle-network/agent-integrations 0.25.2 → 0.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/bin/tangle-catalog-runtime.js +5 -1
- package/dist/bin/tangle-catalog-runtime.js.map +1 -1
- package/dist/catalog.d.ts +4 -0
- package/dist/catalog.js +15 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunk-376UBTNB.js +1 -0
- package/dist/chunk-376UBTNB.js.map +1 -0
- package/dist/chunk-6KWCC42J.js +120 -0
- package/dist/chunk-6KWCC42J.js.map +1 -0
- package/dist/chunk-FQAT4IEE.js +246 -0
- package/dist/chunk-FQAT4IEE.js.map +1 -0
- package/dist/chunk-IDX3KIPA.js +3233 -0
- package/dist/chunk-IDX3KIPA.js.map +1 -0
- package/dist/{chunk-VJ57GPYO.js → chunk-IOO75SJH.js} +3234 -6787
- package/dist/chunk-IOO75SJH.js.map +1 -0
- package/dist/connectors/adapters/index.d.ts +1 -0
- package/dist/connectors/adapters/index.js +39 -0
- package/dist/connectors/adapters/index.js.map +1 -0
- package/dist/connectors/index.d.ts +180 -0
- package/dist/connectors/index.js +74 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/index-BNb1A0Id.d.ts +810 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +51 -44
- package/dist/registry.d.ts +1982 -0
- package/dist/registry.js +20 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +12 -0
- package/dist/runtime.js.map +1 -0
- package/dist/specs.d.ts +4 -2962
- package/dist/tangle-catalog-runtime.d.ts +4 -0
- package/dist/tangle-catalog-runtime.js +28 -0
- package/dist/tangle-catalog-runtime.js.map +1 -0
- package/docs/platform-control-plane.md +54 -0
- package/docs/production-completion-checklist.md +2 -0
- package/package.json +31 -1
- package/dist/chunk-VJ57GPYO.js.map +0 -1
|
@@ -0,0 +1,1982 @@
|
|
|
1
|
+
import { C as ConnectorAdapter, R as ResolvedDataSource, a as ConnectorCredentials } from './index-BNb1A0Id.js';
|
|
2
|
+
import './connectors/index.js';
|
|
3
|
+
import { Server, IncomingMessage, ServerResponse } from 'node:http';
|
|
4
|
+
|
|
5
|
+
type IntegrationSupportTier = 'catalogOnly' | 'setupReady' | 'gatewayExecutable' | 'firstPartyExecutable' | 'sandboxExecutable';
|
|
6
|
+
interface IntegrationCatalogSource {
|
|
7
|
+
id: string;
|
|
8
|
+
connectors: IntegrationConnector[];
|
|
9
|
+
precedence?: number;
|
|
10
|
+
}
|
|
11
|
+
interface IntegrationRegistrySourceRef {
|
|
12
|
+
sourceId: string;
|
|
13
|
+
providerId: string;
|
|
14
|
+
connectorId: string;
|
|
15
|
+
supportTier: IntegrationSupportTier;
|
|
16
|
+
actionCount: number;
|
|
17
|
+
triggerCount: number;
|
|
18
|
+
}
|
|
19
|
+
interface IntegrationRegistryConflict {
|
|
20
|
+
field: 'auth' | 'category';
|
|
21
|
+
values: Array<{
|
|
22
|
+
value: string;
|
|
23
|
+
sourceId: string;
|
|
24
|
+
connectorId: string;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
interface IntegrationRegistryEntry {
|
|
28
|
+
canonicalId: string;
|
|
29
|
+
connector: IntegrationConnector;
|
|
30
|
+
aliases: string[];
|
|
31
|
+
supportTier: IntegrationSupportTier;
|
|
32
|
+
sources: IntegrationRegistrySourceRef[];
|
|
33
|
+
conflicts: IntegrationRegistryConflict[];
|
|
34
|
+
}
|
|
35
|
+
interface IntegrationRegistry {
|
|
36
|
+
entries: IntegrationRegistryEntry[];
|
|
37
|
+
connectors: IntegrationConnector[];
|
|
38
|
+
byId: Map<string, IntegrationRegistryEntry>;
|
|
39
|
+
}
|
|
40
|
+
interface IntegrationRegistrySummary {
|
|
41
|
+
totalEntries: number;
|
|
42
|
+
totalSources: number;
|
|
43
|
+
toolBindableEntries: number;
|
|
44
|
+
conflictEntries: number;
|
|
45
|
+
bySupportTier: Record<IntegrationSupportTier, number>;
|
|
46
|
+
}
|
|
47
|
+
interface ComposeIntegrationRegistryOptions {
|
|
48
|
+
aliases?: Record<string, string>;
|
|
49
|
+
sourcePrecedence?: Record<string, number>;
|
|
50
|
+
}
|
|
51
|
+
declare function buildDefaultIntegrationRegistry(options?: {
|
|
52
|
+
includeSpecs?: boolean;
|
|
53
|
+
includeTangleCatalog?: boolean;
|
|
54
|
+
tangleCatalogRuntimeExecutable?: boolean;
|
|
55
|
+
/** @deprecated Use includeTangleCatalog. */
|
|
56
|
+
includeActivepieces?: boolean;
|
|
57
|
+
}): IntegrationRegistry;
|
|
58
|
+
declare function composeIntegrationRegistry(sources: IntegrationCatalogSource[], options?: ComposeIntegrationRegistryOptions): IntegrationRegistry;
|
|
59
|
+
declare function summarizeIntegrationRegistry(registry: IntegrationRegistry): IntegrationRegistrySummary;
|
|
60
|
+
declare function canonicalConnectorId(id: string, aliases?: Record<string, string>): string;
|
|
61
|
+
declare function inferIntegrationSupportTier(connector: IntegrationConnector): IntegrationSupportTier;
|
|
62
|
+
|
|
63
|
+
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';
|
|
64
|
+
interface IntegrationAuditEvent {
|
|
65
|
+
id: string;
|
|
66
|
+
type: IntegrationAuditEventType;
|
|
67
|
+
occurredAt: string;
|
|
68
|
+
actor?: IntegrationActor;
|
|
69
|
+
connectionId?: string;
|
|
70
|
+
providerId?: string;
|
|
71
|
+
connectorId?: string;
|
|
72
|
+
action?: string;
|
|
73
|
+
risk?: IntegrationConnectorAction['risk'];
|
|
74
|
+
dataClass?: IntegrationDataClass;
|
|
75
|
+
ok?: boolean;
|
|
76
|
+
message?: string;
|
|
77
|
+
metadata?: Record<string, unknown>;
|
|
78
|
+
}
|
|
79
|
+
interface IntegrationAuditSink {
|
|
80
|
+
record(event: IntegrationAuditEvent): Promise<void> | void;
|
|
81
|
+
}
|
|
82
|
+
interface IntegrationAuditStore extends IntegrationAuditSink {
|
|
83
|
+
list(filter?: IntegrationAuditFilter): Promise<IntegrationAuditEvent[]> | IntegrationAuditEvent[];
|
|
84
|
+
}
|
|
85
|
+
interface IntegrationAuditFilter {
|
|
86
|
+
type?: IntegrationAuditEventType;
|
|
87
|
+
actor?: IntegrationActor;
|
|
88
|
+
connectionId?: string;
|
|
89
|
+
providerId?: string;
|
|
90
|
+
connectorId?: string;
|
|
91
|
+
action?: string;
|
|
92
|
+
}
|
|
93
|
+
declare class InMemoryIntegrationAuditStore implements IntegrationAuditStore {
|
|
94
|
+
private readonly events;
|
|
95
|
+
record(event: IntegrationAuditEvent): void;
|
|
96
|
+
list(filter?: IntegrationAuditFilter): IntegrationAuditEvent[];
|
|
97
|
+
}
|
|
98
|
+
declare function createIntegrationAuditEvent(input: Omit<IntegrationAuditEvent, 'id' | 'occurredAt'> & {
|
|
99
|
+
id?: string;
|
|
100
|
+
occurredAt?: string | Date;
|
|
101
|
+
now?: () => Date;
|
|
102
|
+
}): IntegrationAuditEvent;
|
|
103
|
+
declare function createAuditingActionGuard(options: {
|
|
104
|
+
sink: IntegrationAuditSink;
|
|
105
|
+
subject?: IntegrationActor;
|
|
106
|
+
now?: () => Date;
|
|
107
|
+
includeInputPreview?: boolean;
|
|
108
|
+
}): IntegrationActionGuard;
|
|
109
|
+
declare function sanitizeAuditConnection(connection: IntegrationConnection): Record<string, unknown>;
|
|
110
|
+
|
|
111
|
+
type IntegrationApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired';
|
|
112
|
+
interface IntegrationApprovalRecord {
|
|
113
|
+
id: string;
|
|
114
|
+
request: IntegrationApprovalRequest;
|
|
115
|
+
status: IntegrationApprovalStatus;
|
|
116
|
+
requestedAt: string;
|
|
117
|
+
resolvedAt?: string;
|
|
118
|
+
resolvedBy?: IntegrationActor;
|
|
119
|
+
reason?: string;
|
|
120
|
+
expiresAt?: string;
|
|
121
|
+
metadata?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
interface IntegrationApprovalStore {
|
|
124
|
+
get(approvalId: string): Promise<IntegrationApprovalRecord | undefined> | IntegrationApprovalRecord | undefined;
|
|
125
|
+
put(record: IntegrationApprovalRecord): Promise<void> | void;
|
|
126
|
+
list(filter?: IntegrationApprovalFilter): Promise<IntegrationApprovalRecord[]> | IntegrationApprovalRecord[];
|
|
127
|
+
}
|
|
128
|
+
interface IntegrationApprovalFilter {
|
|
129
|
+
status?: IntegrationApprovalStatus;
|
|
130
|
+
connectionId?: string;
|
|
131
|
+
connectorId?: string;
|
|
132
|
+
action?: string;
|
|
133
|
+
actor?: IntegrationActor;
|
|
134
|
+
}
|
|
135
|
+
interface ApprovalBackedPolicyOptions {
|
|
136
|
+
base: IntegrationPolicyEngine;
|
|
137
|
+
store: IntegrationApprovalStore;
|
|
138
|
+
audit?: IntegrationAuditSink;
|
|
139
|
+
now?: () => Date;
|
|
140
|
+
approvalTtlMs?: number;
|
|
141
|
+
}
|
|
142
|
+
declare class InMemoryIntegrationApprovalStore implements IntegrationApprovalStore {
|
|
143
|
+
private readonly records;
|
|
144
|
+
get(approvalId: string): IntegrationApprovalRecord | undefined;
|
|
145
|
+
put(record: IntegrationApprovalRecord): void;
|
|
146
|
+
list(filter?: IntegrationApprovalFilter): IntegrationApprovalRecord[];
|
|
147
|
+
}
|
|
148
|
+
declare class ApprovalBackedPolicyEngine implements IntegrationPolicyEngine {
|
|
149
|
+
private readonly base;
|
|
150
|
+
private readonly store;
|
|
151
|
+
private readonly audit;
|
|
152
|
+
private readonly now;
|
|
153
|
+
private readonly approvalTtlMs;
|
|
154
|
+
constructor(options: ApprovalBackedPolicyOptions);
|
|
155
|
+
decide(ctx: IntegrationGuardContext & {
|
|
156
|
+
subject: IntegrationActor;
|
|
157
|
+
}): Promise<IntegrationPolicyDecision>;
|
|
158
|
+
private findApprovedRecord;
|
|
159
|
+
}
|
|
160
|
+
declare function createApprovalBackedPolicyEngine(options: ApprovalBackedPolicyOptions): ApprovalBackedPolicyEngine;
|
|
161
|
+
declare function resolveIntegrationApproval(input: {
|
|
162
|
+
store: IntegrationApprovalStore;
|
|
163
|
+
approvalId: string;
|
|
164
|
+
approved: boolean;
|
|
165
|
+
resolvedBy: IntegrationActor;
|
|
166
|
+
reason?: string;
|
|
167
|
+
metadata?: Record<string, unknown>;
|
|
168
|
+
audit?: IntegrationAuditSink;
|
|
169
|
+
now?: () => Date;
|
|
170
|
+
}): Promise<IntegrationApprovalRecord>;
|
|
171
|
+
|
|
172
|
+
declare const CANONICAL_INTEGRATION_ACTIONS: {
|
|
173
|
+
readonly googleCalendarEventsList: "google-calendar.events.list";
|
|
174
|
+
readonly googleCalendarEventsCreate: "google-calendar.events.create";
|
|
175
|
+
readonly gmailMessagesSearch: "gmail.messages.search";
|
|
176
|
+
readonly gmailMessagesSend: "gmail.messages.send";
|
|
177
|
+
readonly googleDriveFilesSearch: "google-drive.files.search";
|
|
178
|
+
readonly googleDriveFilesRead: "google-drive.files.read";
|
|
179
|
+
readonly githubRepositoriesGet: "github.repositories.get";
|
|
180
|
+
readonly githubIssuesSearch: "github.issues.search";
|
|
181
|
+
readonly githubIssuesCreate: "github.issues.create";
|
|
182
|
+
readonly githubPullRequestsComment: "github.pull-requests.comment";
|
|
183
|
+
readonly slackChannelsList: "slack.channels.list";
|
|
184
|
+
readonly slackMessagesSearch: "slack.messages.search";
|
|
185
|
+
readonly slackMessagesPost: "slack.messages.post";
|
|
186
|
+
readonly providerHttpRequest: "provider.http.request";
|
|
187
|
+
};
|
|
188
|
+
type CanonicalIntegrationActionId = typeof CANONICAL_INTEGRATION_ACTIONS[keyof typeof CANONICAL_INTEGRATION_ACTIONS];
|
|
189
|
+
interface CanonicalLaunchConnectorOptions {
|
|
190
|
+
providerId?: string;
|
|
191
|
+
includeProviderPassthrough?: boolean;
|
|
192
|
+
}
|
|
193
|
+
declare function buildCanonicalLaunchConnectors(options?: CanonicalLaunchConnectorOptions): IntegrationConnector[];
|
|
194
|
+
declare function canonicalActionConnectorId(actionId: string): string | undefined;
|
|
195
|
+
|
|
196
|
+
interface IntegrationToolDefinition {
|
|
197
|
+
name: string;
|
|
198
|
+
title: string;
|
|
199
|
+
description: string;
|
|
200
|
+
providerId: string;
|
|
201
|
+
connectorId: string;
|
|
202
|
+
connectorTitle: string;
|
|
203
|
+
category: IntegrationConnectorCategory;
|
|
204
|
+
action: IntegrationConnectorAction;
|
|
205
|
+
risk: IntegrationActionRisk;
|
|
206
|
+
dataClass: IntegrationDataClass;
|
|
207
|
+
requiredScopes: string[];
|
|
208
|
+
inputSchema?: unknown;
|
|
209
|
+
outputSchema?: unknown;
|
|
210
|
+
tags: string[];
|
|
211
|
+
}
|
|
212
|
+
interface IntegrationToolSearchFilters {
|
|
213
|
+
providerId?: string;
|
|
214
|
+
connectorId?: string;
|
|
215
|
+
category?: IntegrationConnectorCategory;
|
|
216
|
+
maxRisk?: IntegrationActionRisk;
|
|
217
|
+
dataClass?: IntegrationDataClass;
|
|
218
|
+
limit?: number;
|
|
219
|
+
}
|
|
220
|
+
interface IntegrationToolSearchResult {
|
|
221
|
+
tool: IntegrationToolDefinition;
|
|
222
|
+
score: number;
|
|
223
|
+
matched: string[];
|
|
224
|
+
}
|
|
225
|
+
interface McpToolDefinition {
|
|
226
|
+
name: string;
|
|
227
|
+
description: string;
|
|
228
|
+
inputSchema: unknown;
|
|
229
|
+
}
|
|
230
|
+
declare function integrationToolName(providerId: string, connectorId: string, actionId: string): string;
|
|
231
|
+
declare function parseIntegrationToolName(name: string): {
|
|
232
|
+
providerId: string;
|
|
233
|
+
connectorId: string;
|
|
234
|
+
actionId: string;
|
|
235
|
+
};
|
|
236
|
+
declare function buildIntegrationToolCatalog(connectors: IntegrationConnector[]): IntegrationToolDefinition[];
|
|
237
|
+
declare function searchIntegrationTools(catalog: IntegrationToolDefinition[], query: string, filters?: IntegrationToolSearchFilters): IntegrationToolSearchResult[];
|
|
238
|
+
declare function toMcpTools(tools: IntegrationToolDefinition[]): McpToolDefinition[];
|
|
239
|
+
|
|
240
|
+
type IntegrationRequirementMode = 'read' | 'write' | 'trigger';
|
|
241
|
+
type IntegrationRequirementStatus = 'ready' | 'missing_connection' | 'not_executable' | 'unknown_connector';
|
|
242
|
+
interface IntegrationRequirement {
|
|
243
|
+
id: string;
|
|
244
|
+
connectorId: string;
|
|
245
|
+
reason: string;
|
|
246
|
+
mode: IntegrationRequirementMode;
|
|
247
|
+
requiredActions?: string[];
|
|
248
|
+
requiredTriggers?: string[];
|
|
249
|
+
requiredScopes?: string[];
|
|
250
|
+
optional?: boolean;
|
|
251
|
+
}
|
|
252
|
+
interface IntegrationManifest {
|
|
253
|
+
id: string;
|
|
254
|
+
title?: string;
|
|
255
|
+
owner?: IntegrationActor;
|
|
256
|
+
requirements: IntegrationRequirement[];
|
|
257
|
+
metadata?: Record<string, unknown>;
|
|
258
|
+
}
|
|
259
|
+
interface IntegrationRequirementResolution {
|
|
260
|
+
requirement: IntegrationRequirement;
|
|
261
|
+
status: IntegrationRequirementStatus;
|
|
262
|
+
connector?: IntegrationConnector;
|
|
263
|
+
registryEntry?: IntegrationRegistryEntry;
|
|
264
|
+
connection?: IntegrationConnection;
|
|
265
|
+
missingScopes: string[];
|
|
266
|
+
missingActions: string[];
|
|
267
|
+
missingTriggers: string[];
|
|
268
|
+
message: string;
|
|
269
|
+
}
|
|
270
|
+
interface IntegrationManifestResolution {
|
|
271
|
+
manifest: IntegrationManifest;
|
|
272
|
+
owner: IntegrationActor;
|
|
273
|
+
ready: IntegrationRequirementResolution[];
|
|
274
|
+
missing: IntegrationRequirementResolution[];
|
|
275
|
+
optionalMissing: IntegrationRequirementResolution[];
|
|
276
|
+
}
|
|
277
|
+
interface IntegrationGrant {
|
|
278
|
+
id: string;
|
|
279
|
+
manifestId: string;
|
|
280
|
+
requirementId: string;
|
|
281
|
+
owner: IntegrationActor;
|
|
282
|
+
grantee: IntegrationActor;
|
|
283
|
+
connectionId: string;
|
|
284
|
+
connectorId: string;
|
|
285
|
+
scopes: string[];
|
|
286
|
+
allowedActions: string[];
|
|
287
|
+
allowedTriggers: string[];
|
|
288
|
+
status: 'active' | 'revoked';
|
|
289
|
+
createdAt: string;
|
|
290
|
+
updatedAt: string;
|
|
291
|
+
metadata?: Record<string, unknown>;
|
|
292
|
+
}
|
|
293
|
+
interface IntegrationGrantStore {
|
|
294
|
+
get(grantId: string): Promise<IntegrationGrant | undefined> | IntegrationGrant | undefined;
|
|
295
|
+
put(grant: IntegrationGrant): Promise<void> | void;
|
|
296
|
+
listByManifest(manifestId: string, grantee?: IntegrationActor): Promise<IntegrationGrant[]> | IntegrationGrant[];
|
|
297
|
+
listByGrantee(grantee: IntegrationActor): Promise<IntegrationGrant[]> | IntegrationGrant[];
|
|
298
|
+
listByIds?(grantIds: string[]): Promise<IntegrationGrant[]> | IntegrationGrant[];
|
|
299
|
+
delete?(grantId: string): Promise<void> | void;
|
|
300
|
+
}
|
|
301
|
+
interface IntegrationCapabilityBinding {
|
|
302
|
+
requirementId: string;
|
|
303
|
+
connectorId: string;
|
|
304
|
+
connectionId: string;
|
|
305
|
+
grantId: string;
|
|
306
|
+
scopes: string[];
|
|
307
|
+
allowedActions: string[];
|
|
308
|
+
allowedTriggers: string[];
|
|
309
|
+
capability: IssuedIntegrationCapability;
|
|
310
|
+
}
|
|
311
|
+
interface IntegrationSandboxBundle {
|
|
312
|
+
manifestId: string;
|
|
313
|
+
subject: IntegrationActor;
|
|
314
|
+
capabilities: IntegrationCapabilityBinding[];
|
|
315
|
+
connectors: IntegrationConnector[];
|
|
316
|
+
tools: IntegrationToolDefinition[];
|
|
317
|
+
expiresAt: string;
|
|
318
|
+
}
|
|
319
|
+
interface IntegrationRuntimeHub {
|
|
320
|
+
listRegistry(): Promise<IntegrationRegistry> | IntegrationRegistry;
|
|
321
|
+
listConnections(owner: IntegrationActor): Promise<IntegrationConnection[]> | IntegrationConnection[];
|
|
322
|
+
issueCapability(input: {
|
|
323
|
+
subject: IntegrationActor;
|
|
324
|
+
connectionId: string;
|
|
325
|
+
scopes: string[];
|
|
326
|
+
allowedActions: string[];
|
|
327
|
+
ttlMs: number;
|
|
328
|
+
metadata?: Record<string, unknown>;
|
|
329
|
+
}): Promise<IssuedIntegrationCapability> | IssuedIntegrationCapability;
|
|
330
|
+
}
|
|
331
|
+
interface IntegrationRuntimeOptions {
|
|
332
|
+
hub: IntegrationRuntimeHub;
|
|
333
|
+
grants?: IntegrationGrantStore;
|
|
334
|
+
now?: () => Date;
|
|
335
|
+
}
|
|
336
|
+
declare class InMemoryIntegrationGrantStore implements IntegrationGrantStore {
|
|
337
|
+
private readonly grants;
|
|
338
|
+
get(grantId: string): IntegrationGrant | undefined;
|
|
339
|
+
put(grant: IntegrationGrant): void;
|
|
340
|
+
listByManifest(manifestId: string, grantee?: IntegrationActor): IntegrationGrant[];
|
|
341
|
+
listByGrantee(grantee: IntegrationActor): IntegrationGrant[];
|
|
342
|
+
listByIds(grantIds: string[]): IntegrationGrant[];
|
|
343
|
+
delete(grantId: string): void;
|
|
344
|
+
}
|
|
345
|
+
declare class IntegrationRuntime {
|
|
346
|
+
private readonly hub;
|
|
347
|
+
private readonly grants;
|
|
348
|
+
private readonly now;
|
|
349
|
+
constructor(options: IntegrationRuntimeOptions);
|
|
350
|
+
registry(): Promise<IntegrationRegistry>;
|
|
351
|
+
resolveManifest(manifest: IntegrationManifest, owner: IntegrationActor): Promise<IntegrationManifestResolution>;
|
|
352
|
+
createGrants(input: {
|
|
353
|
+
manifest: IntegrationManifest;
|
|
354
|
+
owner: IntegrationActor;
|
|
355
|
+
grantee: IntegrationActor;
|
|
356
|
+
metadata?: Record<string, unknown>;
|
|
357
|
+
}): Promise<IntegrationGrant[]>;
|
|
358
|
+
buildSandboxBundle(input: {
|
|
359
|
+
manifestId?: string;
|
|
360
|
+
grantIds?: string[];
|
|
361
|
+
subject: IntegrationActor;
|
|
362
|
+
ttlMs: number;
|
|
363
|
+
grantee?: IntegrationActor;
|
|
364
|
+
}): Promise<IntegrationSandboxBundle>;
|
|
365
|
+
private resolveBundleGrants;
|
|
366
|
+
}
|
|
367
|
+
declare function createIntegrationRuntime(options: IntegrationRuntimeOptions): IntegrationRuntime;
|
|
368
|
+
|
|
369
|
+
declare const DEFAULT_INTEGRATION_BRIDGE_ENV = "TANGLE_INTEGRATION_BUNDLE";
|
|
370
|
+
interface IntegrationBridgePayload {
|
|
371
|
+
version: 1;
|
|
372
|
+
manifestId: string;
|
|
373
|
+
subject: IntegrationSandboxBundle['subject'];
|
|
374
|
+
expiresAt: string;
|
|
375
|
+
tools: IntegrationBridgeToolBinding[];
|
|
376
|
+
}
|
|
377
|
+
interface IntegrationBridgeToolBinding {
|
|
378
|
+
name: string;
|
|
379
|
+
title: string;
|
|
380
|
+
connectorId: string;
|
|
381
|
+
connectionId: string;
|
|
382
|
+
action: string;
|
|
383
|
+
risk: string;
|
|
384
|
+
dataClass: string;
|
|
385
|
+
requiredScopes: string[];
|
|
386
|
+
capabilityToken: string;
|
|
387
|
+
}
|
|
388
|
+
declare function buildIntegrationBridgePayload(bundle: IntegrationSandboxBundle): IntegrationBridgePayload;
|
|
389
|
+
declare function encodeIntegrationBridgePayload(payload: IntegrationBridgePayload): string;
|
|
390
|
+
declare function decodeIntegrationBridgePayload(encoded: string): IntegrationBridgePayload;
|
|
391
|
+
declare function buildIntegrationBridgeEnvironment(bundle: IntegrationSandboxBundle, options?: {
|
|
392
|
+
envVar?: string;
|
|
393
|
+
}): Record<string, string>;
|
|
394
|
+
declare function parseIntegrationBridgeEnvironment(env: Record<string, string | undefined>, options?: {
|
|
395
|
+
envVar?: string;
|
|
396
|
+
}): IntegrationBridgePayload;
|
|
397
|
+
declare function redactIntegrationBridgePayload(payload: IntegrationBridgePayload): IntegrationBridgePayload;
|
|
398
|
+
|
|
399
|
+
interface TangleIntegrationsClientOptions {
|
|
400
|
+
endpoint: string;
|
|
401
|
+
bridge?: IntegrationBridgePayload;
|
|
402
|
+
env?: Record<string, string | undefined>;
|
|
403
|
+
envVar?: string;
|
|
404
|
+
fetchImpl?: typeof fetch;
|
|
405
|
+
getCapabilityToken?: (tool: IntegrationBridgeToolBinding) => string | Promise<string>;
|
|
406
|
+
}
|
|
407
|
+
interface TangleIntegrationInvokeInput<TInput = unknown> {
|
|
408
|
+
tool: string;
|
|
409
|
+
input?: TInput;
|
|
410
|
+
idempotencyKey?: string;
|
|
411
|
+
dryRun?: boolean;
|
|
412
|
+
metadata?: Record<string, unknown>;
|
|
413
|
+
}
|
|
414
|
+
interface TangleIntegrationInvokeResult<TOutput = unknown> {
|
|
415
|
+
status: 'ok' | 'approval_required' | 'failed';
|
|
416
|
+
action: string;
|
|
417
|
+
output?: TOutput;
|
|
418
|
+
approval?: unknown;
|
|
419
|
+
error?: string;
|
|
420
|
+
metadata?: Record<string, unknown>;
|
|
421
|
+
}
|
|
422
|
+
declare class TangleIntegrationsClient {
|
|
423
|
+
private readonly endpoint;
|
|
424
|
+
private readonly bridge;
|
|
425
|
+
private readonly fetchImpl;
|
|
426
|
+
private readonly getCapabilityToken;
|
|
427
|
+
constructor(options: TangleIntegrationsClientOptions);
|
|
428
|
+
tools(): IntegrationBridgeToolBinding[];
|
|
429
|
+
findTool(toolOrAction: string): IntegrationBridgeToolBinding;
|
|
430
|
+
invoke<TOutput = unknown, TInput = unknown>(input: TangleIntegrationInvokeInput<TInput>): Promise<TangleIntegrationInvokeResult<TOutput>>;
|
|
431
|
+
}
|
|
432
|
+
declare function createTangleIntegrationsClient(options: TangleIntegrationsClientOptions): TangleIntegrationsClient;
|
|
433
|
+
|
|
434
|
+
interface ConsentSummary {
|
|
435
|
+
title: string;
|
|
436
|
+
body: string;
|
|
437
|
+
bullets: string[];
|
|
438
|
+
primaryAction: string;
|
|
439
|
+
risk: 'read' | 'write' | 'destructive';
|
|
440
|
+
connectorIds: string[];
|
|
441
|
+
}
|
|
442
|
+
interface RenderConsentOptions {
|
|
443
|
+
appName?: string;
|
|
444
|
+
connectors?: IntegrationConnector[];
|
|
445
|
+
}
|
|
446
|
+
declare function renderConsentSummary(manifestOrResolution: IntegrationManifest | IntegrationManifestResolution, options?: RenderConsentOptions): ConsentSummary;
|
|
447
|
+
declare function renderApprovalCopy(input: {
|
|
448
|
+
appName: string;
|
|
449
|
+
connectorTitle: string;
|
|
450
|
+
action: IntegrationConnectorAction;
|
|
451
|
+
approvalId?: string;
|
|
452
|
+
}): ConsentSummary;
|
|
453
|
+
|
|
454
|
+
interface ConnectorAdapterProviderOptions {
|
|
455
|
+
id?: string;
|
|
456
|
+
kind?: IntegrationProviderKind;
|
|
457
|
+
adapters: ConnectorAdapter[];
|
|
458
|
+
resolveDataSource: (connection: IntegrationConnection) => Promise<ResolvedDataSource> | ResolvedDataSource;
|
|
459
|
+
now?: () => Date;
|
|
460
|
+
}
|
|
461
|
+
declare function createConnectorAdapterProvider(options: ConnectorAdapterProviderOptions): IntegrationProvider;
|
|
462
|
+
declare function adapterManifestsToConnectors(adapters: ConnectorAdapter[], providerId?: string): IntegrationConnector[];
|
|
463
|
+
declare function createConnectorAdapterCatalogSource(options: {
|
|
464
|
+
id?: string;
|
|
465
|
+
providerId?: string;
|
|
466
|
+
adapters: ConnectorAdapter[];
|
|
467
|
+
precedence?: number;
|
|
468
|
+
}): IntegrationCatalogSource;
|
|
469
|
+
declare function manifestToConnector(providerId: string, adapter: ConnectorAdapter): IntegrationConnector;
|
|
470
|
+
|
|
471
|
+
interface IntegrationSecretStore {
|
|
472
|
+
get(ref: SecretRef): Promise<ConnectorCredentials | undefined> | ConnectorCredentials | undefined;
|
|
473
|
+
put(ref: SecretRef, credentials: ConnectorCredentials): Promise<void> | void;
|
|
474
|
+
delete?(ref: SecretRef): Promise<void> | void;
|
|
475
|
+
}
|
|
476
|
+
interface ConnectionCredentialResolverOptions {
|
|
477
|
+
secrets: IntegrationSecretStore;
|
|
478
|
+
connections?: IntegrationConnectionStore;
|
|
479
|
+
adapters?: ConnectorAdapter[];
|
|
480
|
+
now?: () => Date;
|
|
481
|
+
markConnectionError?: (connection: IntegrationConnection, error: Error) => Promise<void> | void;
|
|
482
|
+
}
|
|
483
|
+
declare class InMemoryIntegrationSecretStore implements IntegrationSecretStore {
|
|
484
|
+
private readonly secrets;
|
|
485
|
+
get(ref: SecretRef): ConnectorCredentials | undefined;
|
|
486
|
+
put(ref: SecretRef, credentials: ConnectorCredentials): void;
|
|
487
|
+
delete(ref: SecretRef): void;
|
|
488
|
+
}
|
|
489
|
+
declare function createConnectionCredentialResolver(options: ConnectionCredentialResolverOptions): (connection: IntegrationConnection) => Promise<ResolvedDataSource>;
|
|
490
|
+
declare function resolveConnectionCredentials(input: IntegrationConnection, options: ConnectionCredentialResolverOptions): Promise<ConnectorCredentials>;
|
|
491
|
+
declare function createCredentialBackedAdapterProvider(options: Omit<ConnectorAdapterProviderOptions, 'resolveDataSource'> & ConnectionCredentialResolverOptions): IntegrationProvider;
|
|
492
|
+
declare function revokeConnection(input: {
|
|
493
|
+
connection: IntegrationConnection;
|
|
494
|
+
connections?: IntegrationConnectionStore;
|
|
495
|
+
secrets?: IntegrationSecretStore;
|
|
496
|
+
now?: () => Date;
|
|
497
|
+
}): Promise<IntegrationConnection>;
|
|
498
|
+
|
|
499
|
+
type IntegrationErrorCode = 'missing_connection' | 'missing_grant' | 'approval_required' | 'approval_denied' | 'connection_revoked' | 'connection_expired' | 'scope_missing' | 'action_denied' | 'action_not_found' | 'trigger_not_found' | 'provider_rate_limited' | 'provider_auth_failed' | 'provider_unavailable' | 'provider_error' | 'capability_expired' | 'capability_invalid' | 'manifest_invalid' | 'passthrough_disabled' | 'input_invalid' | 'unknown';
|
|
500
|
+
interface IntegrationUserAction {
|
|
501
|
+
type: 'connect' | 'reconnect' | 'approve' | 'retry' | 'contact_support' | 'change_request';
|
|
502
|
+
label: string;
|
|
503
|
+
connectorId?: string;
|
|
504
|
+
approvalId?: string;
|
|
505
|
+
}
|
|
506
|
+
declare class IntegrationRuntimeError extends Error {
|
|
507
|
+
readonly code: IntegrationErrorCode;
|
|
508
|
+
readonly status: number;
|
|
509
|
+
readonly userAction?: IntegrationUserAction;
|
|
510
|
+
readonly metadata?: Record<string, unknown>;
|
|
511
|
+
constructor(input: {
|
|
512
|
+
code: IntegrationErrorCode;
|
|
513
|
+
message: string;
|
|
514
|
+
status?: number;
|
|
515
|
+
userAction?: IntegrationUserAction;
|
|
516
|
+
metadata?: Record<string, unknown>;
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
interface NormalizedIntegrationError {
|
|
520
|
+
ok: false;
|
|
521
|
+
code: IntegrationErrorCode;
|
|
522
|
+
message: string;
|
|
523
|
+
status: number;
|
|
524
|
+
userAction?: IntegrationUserAction;
|
|
525
|
+
metadata?: Record<string, unknown>;
|
|
526
|
+
}
|
|
527
|
+
declare function normalizeIntegrationError(error: unknown): NormalizedIntegrationError;
|
|
528
|
+
declare function statusForCode(code: IntegrationErrorCode): number;
|
|
529
|
+
|
|
530
|
+
interface IntegrationWorkflowDefinition {
|
|
531
|
+
id: string;
|
|
532
|
+
title?: string;
|
|
533
|
+
manifest: IntegrationManifest;
|
|
534
|
+
trigger: {
|
|
535
|
+
requirementId: string;
|
|
536
|
+
triggerId: string;
|
|
537
|
+
targetUrl?: string;
|
|
538
|
+
};
|
|
539
|
+
metadata?: Record<string, unknown>;
|
|
540
|
+
}
|
|
541
|
+
interface InstalledIntegrationWorkflow {
|
|
542
|
+
id: string;
|
|
543
|
+
workflowId: string;
|
|
544
|
+
manifestId: string;
|
|
545
|
+
owner: IntegrationActor;
|
|
546
|
+
grantee: IntegrationActor;
|
|
547
|
+
triggerGrantId: string;
|
|
548
|
+
subscription: IntegrationTriggerSubscription;
|
|
549
|
+
status: 'active' | 'paused' | 'error';
|
|
550
|
+
createdAt: string;
|
|
551
|
+
metadata?: Record<string, unknown>;
|
|
552
|
+
}
|
|
553
|
+
interface IntegrationWorkflowStore {
|
|
554
|
+
put(workflow: InstalledIntegrationWorkflow): Promise<void> | void;
|
|
555
|
+
get(id: string): Promise<InstalledIntegrationWorkflow | undefined> | InstalledIntegrationWorkflow | undefined;
|
|
556
|
+
list(): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
|
|
557
|
+
listByWorkflow(workflowId: string): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
|
|
558
|
+
listByOwner(owner: IntegrationActor): Promise<InstalledIntegrationWorkflow[]> | InstalledIntegrationWorkflow[];
|
|
559
|
+
}
|
|
560
|
+
interface IntegrationWorkflowRuntimeHub {
|
|
561
|
+
subscribeTrigger(connectionId: string, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
|
|
562
|
+
}
|
|
563
|
+
interface IntegrationWorkflowRuntimeOptions {
|
|
564
|
+
runtime: IntegrationRuntime;
|
|
565
|
+
hub: IntegrationWorkflowRuntimeHub;
|
|
566
|
+
grants: IntegrationGrantStore;
|
|
567
|
+
store?: IntegrationWorkflowStore;
|
|
568
|
+
now?: () => Date;
|
|
569
|
+
}
|
|
570
|
+
declare class InMemoryIntegrationWorkflowStore implements IntegrationWorkflowStore {
|
|
571
|
+
private readonly workflows;
|
|
572
|
+
put(workflow: InstalledIntegrationWorkflow): void;
|
|
573
|
+
get(id: string): InstalledIntegrationWorkflow | undefined;
|
|
574
|
+
list(): InstalledIntegrationWorkflow[];
|
|
575
|
+
listByWorkflow(workflowId: string): InstalledIntegrationWorkflow[];
|
|
576
|
+
listByOwner(owner: IntegrationActor): InstalledIntegrationWorkflow[];
|
|
577
|
+
}
|
|
578
|
+
declare class IntegrationWorkflowRuntime {
|
|
579
|
+
private readonly runtime;
|
|
580
|
+
private readonly hub;
|
|
581
|
+
private readonly grants;
|
|
582
|
+
private readonly store;
|
|
583
|
+
private readonly now;
|
|
584
|
+
constructor(options: IntegrationWorkflowRuntimeOptions);
|
|
585
|
+
install(input: {
|
|
586
|
+
workflow: IntegrationWorkflowDefinition;
|
|
587
|
+
owner: IntegrationActor;
|
|
588
|
+
grantee: IntegrationActor;
|
|
589
|
+
}): Promise<InstalledIntegrationWorkflow>;
|
|
590
|
+
dispatchEvent<T = unknown>(event: IntegrationTriggerEvent<T>, handler: (input: {
|
|
591
|
+
event: IntegrationTriggerEvent<T>;
|
|
592
|
+
workflows: InstalledIntegrationWorkflow[];
|
|
593
|
+
}) => Promise<void> | void): Promise<{
|
|
594
|
+
matched: InstalledIntegrationWorkflow[];
|
|
595
|
+
}>;
|
|
596
|
+
}
|
|
597
|
+
declare function createIntegrationWorkflowRuntime(options: IntegrationWorkflowRuntimeOptions): IntegrationWorkflowRuntime;
|
|
598
|
+
|
|
599
|
+
interface StoredIntegrationEvent {
|
|
600
|
+
id: string;
|
|
601
|
+
sourceId: string;
|
|
602
|
+
connectorId: string;
|
|
603
|
+
eventType: string;
|
|
604
|
+
providerEventId?: string;
|
|
605
|
+
receivedAt: string;
|
|
606
|
+
payload: Record<string, unknown>;
|
|
607
|
+
dispatchedAt?: string;
|
|
608
|
+
metadata?: Record<string, unknown>;
|
|
609
|
+
}
|
|
610
|
+
interface IntegrationEventStore {
|
|
611
|
+
put(event: StoredIntegrationEvent): Promise<void> | void;
|
|
612
|
+
hasProviderEvent(sourceId: string, providerEventId: string): Promise<boolean> | boolean;
|
|
613
|
+
list(): Promise<StoredIntegrationEvent[]> | StoredIntegrationEvent[];
|
|
614
|
+
}
|
|
615
|
+
interface IntegrationWebhookReceiverResult {
|
|
616
|
+
status: number;
|
|
617
|
+
body: unknown;
|
|
618
|
+
headers?: Record<string, string>;
|
|
619
|
+
received: StoredIntegrationEvent[];
|
|
620
|
+
duplicates: StoredIntegrationEvent[];
|
|
621
|
+
}
|
|
622
|
+
declare class InMemoryIntegrationEventStore implements IntegrationEventStore {
|
|
623
|
+
private readonly events;
|
|
624
|
+
private readonly providerIds;
|
|
625
|
+
put(event: StoredIntegrationEvent): void;
|
|
626
|
+
hasProviderEvent(sourceId: string, providerEventId: string): boolean;
|
|
627
|
+
list(): StoredIntegrationEvent[];
|
|
628
|
+
}
|
|
629
|
+
declare function receiveIntegrationWebhook(input: {
|
|
630
|
+
adapter: ConnectorAdapter;
|
|
631
|
+
source: ResolvedDataSource;
|
|
632
|
+
rawBody: string;
|
|
633
|
+
headers: Record<string, string | string[] | undefined>;
|
|
634
|
+
store: IntegrationEventStore;
|
|
635
|
+
workflowRuntime?: IntegrationWorkflowRuntime;
|
|
636
|
+
now?: () => Date;
|
|
637
|
+
}): Promise<IntegrationWebhookReceiverResult>;
|
|
638
|
+
declare function storedEventToTriggerEvent(event: StoredIntegrationEvent, source: ResolvedDataSource): IntegrationTriggerEvent;
|
|
639
|
+
|
|
640
|
+
interface IntegrationIdempotencyRecord {
|
|
641
|
+
key: string;
|
|
642
|
+
requestHash: string;
|
|
643
|
+
result: IntegrationActionResult;
|
|
644
|
+
createdAt: string;
|
|
645
|
+
}
|
|
646
|
+
interface IntegrationIdempotencyStore {
|
|
647
|
+
get(key: string): Promise<IntegrationIdempotencyRecord | undefined> | IntegrationIdempotencyRecord | undefined;
|
|
648
|
+
put(record: IntegrationIdempotencyRecord): Promise<void> | void;
|
|
649
|
+
}
|
|
650
|
+
interface IntegrationRateLimitDecision {
|
|
651
|
+
allowed: boolean;
|
|
652
|
+
retryAfterMs?: number;
|
|
653
|
+
reason?: string;
|
|
654
|
+
}
|
|
655
|
+
interface IntegrationRateLimiter {
|
|
656
|
+
check(ctx: IntegrationGuardContext): Promise<IntegrationRateLimitDecision> | IntegrationRateLimitDecision;
|
|
657
|
+
}
|
|
658
|
+
declare class InMemoryIntegrationIdempotencyStore implements IntegrationIdempotencyStore {
|
|
659
|
+
private readonly records;
|
|
660
|
+
get(key: string): IntegrationIdempotencyRecord | undefined;
|
|
661
|
+
put(record: IntegrationIdempotencyRecord): void;
|
|
662
|
+
}
|
|
663
|
+
declare class DefaultIntegrationActionGuard implements IntegrationActionGuard {
|
|
664
|
+
private readonly idempotency;
|
|
665
|
+
private readonly audit;
|
|
666
|
+
private readonly rateLimiter;
|
|
667
|
+
private readonly now;
|
|
668
|
+
constructor(options?: {
|
|
669
|
+
idempotency?: IntegrationIdempotencyStore;
|
|
670
|
+
audit?: IntegrationAuditSink;
|
|
671
|
+
rateLimiter?: IntegrationRateLimiter;
|
|
672
|
+
now?: () => Date;
|
|
673
|
+
});
|
|
674
|
+
invokeAction(ctx: IntegrationGuardContext, proceed: () => Promise<IntegrationActionResult>): Promise<IntegrationActionResult>;
|
|
675
|
+
private writeIdempotency;
|
|
676
|
+
}
|
|
677
|
+
declare function createDefaultIntegrationActionGuard(options?: ConstructorParameters<typeof DefaultIntegrationActionGuard>[0]): DefaultIntegrationActionGuard;
|
|
678
|
+
|
|
679
|
+
type IntegrationHealthcheckStatus = 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
|
|
680
|
+
interface IntegrationHealthcheckCheck {
|
|
681
|
+
id: string;
|
|
682
|
+
status: IntegrationHealthcheckStatus;
|
|
683
|
+
message: string;
|
|
684
|
+
metadata?: Record<string, unknown>;
|
|
685
|
+
}
|
|
686
|
+
interface IntegrationHealthcheckResult {
|
|
687
|
+
connectionId: string;
|
|
688
|
+
providerId: string;
|
|
689
|
+
connectorId: string;
|
|
690
|
+
status: IntegrationHealthcheckStatus;
|
|
691
|
+
checkedAt: string;
|
|
692
|
+
checks: IntegrationHealthcheckCheck[];
|
|
693
|
+
metadata?: Record<string, unknown>;
|
|
694
|
+
}
|
|
695
|
+
interface IntegrationHealthcheckStore {
|
|
696
|
+
put(result: IntegrationHealthcheckResult): Promise<void> | void;
|
|
697
|
+
get(connectionId: string): Promise<IntegrationHealthcheckResult | undefined> | IntegrationHealthcheckResult | undefined;
|
|
698
|
+
list(): Promise<IntegrationHealthcheckResult[]> | IntegrationHealthcheckResult[];
|
|
699
|
+
}
|
|
700
|
+
declare class InMemoryIntegrationHealthcheckStore implements IntegrationHealthcheckStore {
|
|
701
|
+
private readonly results;
|
|
702
|
+
put(result: IntegrationHealthcheckResult): void;
|
|
703
|
+
get(connectionId: string): IntegrationHealthcheckResult | undefined;
|
|
704
|
+
list(): IntegrationHealthcheckResult[];
|
|
705
|
+
}
|
|
706
|
+
declare function runIntegrationHealthcheck(input: {
|
|
707
|
+
connection: IntegrationConnection;
|
|
708
|
+
connector?: IntegrationConnector;
|
|
709
|
+
registry?: IntegrationRegistry;
|
|
710
|
+
test?: (connection: IntegrationConnection, connector: IntegrationConnector) => Promise<IntegrationActionResult | boolean> | IntegrationActionResult | boolean;
|
|
711
|
+
audit?: IntegrationAuditSink;
|
|
712
|
+
now?: () => Date;
|
|
713
|
+
}): Promise<IntegrationHealthcheckResult>;
|
|
714
|
+
declare function runIntegrationHealthchecks(input: {
|
|
715
|
+
connections: IntegrationConnection[];
|
|
716
|
+
registry?: IntegrationRegistry;
|
|
717
|
+
store?: IntegrationHealthcheckStore;
|
|
718
|
+
audit?: IntegrationAuditSink;
|
|
719
|
+
now?: () => Date;
|
|
720
|
+
test?: (connection: IntegrationConnection, connector: IntegrationConnector) => Promise<IntegrationActionResult | boolean> | IntegrationActionResult | boolean;
|
|
721
|
+
}): Promise<IntegrationHealthcheckResult[]>;
|
|
722
|
+
declare function healthcheckRequest(action?: string): IntegrationActionRequest;
|
|
723
|
+
|
|
724
|
+
interface ManifestValidationIssue {
|
|
725
|
+
path: string;
|
|
726
|
+
message: string;
|
|
727
|
+
}
|
|
728
|
+
interface ManifestValidationResult {
|
|
729
|
+
ok: boolean;
|
|
730
|
+
issues: ManifestValidationIssue[];
|
|
731
|
+
}
|
|
732
|
+
interface InferIntegrationRequirementsOptions {
|
|
733
|
+
manifestId: string;
|
|
734
|
+
title?: string;
|
|
735
|
+
tools: Array<string | {
|
|
736
|
+
action: string;
|
|
737
|
+
reason?: string;
|
|
738
|
+
mode?: IntegrationRequirementMode;
|
|
739
|
+
connectorId?: string;
|
|
740
|
+
scopes?: string[];
|
|
741
|
+
}>;
|
|
742
|
+
metadata?: Record<string, unknown>;
|
|
743
|
+
}
|
|
744
|
+
interface MissingRequirementExplanation {
|
|
745
|
+
requirementId: string;
|
|
746
|
+
connectorId: string;
|
|
747
|
+
status: string;
|
|
748
|
+
message: string;
|
|
749
|
+
userAction: 'connect' | 'enable' | 'ignore_optional';
|
|
750
|
+
}
|
|
751
|
+
declare function validateIntegrationManifest(manifest: IntegrationManifest): ManifestValidationResult;
|
|
752
|
+
declare function assertValidIntegrationManifest(manifest: IntegrationManifest): void;
|
|
753
|
+
declare function inferIntegrationManifestFromTools(options: InferIntegrationRequirementsOptions): IntegrationManifest;
|
|
754
|
+
declare function explainMissingRequirements(resolution: IntegrationManifestResolution): MissingRequirementExplanation[];
|
|
755
|
+
declare function calendarExercisePlannerManifest(id?: string): IntegrationManifest;
|
|
756
|
+
|
|
757
|
+
interface ProviderHttpRequestInput {
|
|
758
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
759
|
+
path: string;
|
|
760
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
761
|
+
headers?: Record<string, string>;
|
|
762
|
+
body?: unknown;
|
|
763
|
+
}
|
|
764
|
+
interface ProviderPassthroughPolicy {
|
|
765
|
+
enabled: boolean;
|
|
766
|
+
allowedMethods?: ProviderHttpRequestInput['method'][];
|
|
767
|
+
allowedPathPrefixes?: string[];
|
|
768
|
+
maxBodyBytes?: number;
|
|
769
|
+
}
|
|
770
|
+
declare const PROVIDER_PASSTHROUGH_ACTION: "provider.http.request";
|
|
771
|
+
declare function validateProviderPassthroughRequest(input: ProviderHttpRequestInput, policy: ProviderPassthroughPolicy): void;
|
|
772
|
+
|
|
773
|
+
type IntegrationPolicyEffect = 'allow' | 'require_approval' | 'deny';
|
|
774
|
+
interface IntegrationPolicyRule {
|
|
775
|
+
id: string;
|
|
776
|
+
effect: IntegrationPolicyEffect;
|
|
777
|
+
reason: string;
|
|
778
|
+
providerId?: string;
|
|
779
|
+
connectorId?: string;
|
|
780
|
+
action?: string;
|
|
781
|
+
maxRisk?: IntegrationActionRisk;
|
|
782
|
+
risk?: IntegrationActionRisk;
|
|
783
|
+
dataClass?: IntegrationDataClass;
|
|
784
|
+
}
|
|
785
|
+
interface StaticIntegrationPolicyOptions {
|
|
786
|
+
rules?: IntegrationPolicyRule[];
|
|
787
|
+
defaultReadEffect?: IntegrationPolicyEffect;
|
|
788
|
+
defaultWriteEffect?: IntegrationPolicyEffect;
|
|
789
|
+
defaultDestructiveEffect?: IntegrationPolicyEffect;
|
|
790
|
+
now?: () => Date;
|
|
791
|
+
}
|
|
792
|
+
interface IntegrationApprovalResolution {
|
|
793
|
+
approvalId: string;
|
|
794
|
+
approved: boolean;
|
|
795
|
+
resolvedBy: string;
|
|
796
|
+
resolvedAt: string;
|
|
797
|
+
reason?: string;
|
|
798
|
+
metadata?: Record<string, unknown>;
|
|
799
|
+
}
|
|
800
|
+
declare class StaticIntegrationPolicyEngine implements IntegrationPolicyEngine {
|
|
801
|
+
private readonly rules;
|
|
802
|
+
private readonly defaultReadEffect;
|
|
803
|
+
private readonly defaultWriteEffect;
|
|
804
|
+
private readonly defaultDestructiveEffect;
|
|
805
|
+
private readonly now;
|
|
806
|
+
constructor(options?: StaticIntegrationPolicyOptions);
|
|
807
|
+
decide(ctx: IntegrationGuardContext & {
|
|
808
|
+
subject: {
|
|
809
|
+
type: string;
|
|
810
|
+
id: string;
|
|
811
|
+
};
|
|
812
|
+
}): IntegrationPolicyDecision;
|
|
813
|
+
private defaultEffect;
|
|
814
|
+
}
|
|
815
|
+
declare function createDefaultIntegrationPolicyEngine(options?: Omit<StaticIntegrationPolicyOptions, 'rules'>): StaticIntegrationPolicyEngine;
|
|
816
|
+
declare function buildApprovalRequest(ctx: IntegrationGuardContext & {
|
|
817
|
+
subject: {
|
|
818
|
+
type: string;
|
|
819
|
+
id: string;
|
|
820
|
+
};
|
|
821
|
+
}, reason: string, requestedAt: Date): IntegrationApprovalRequest;
|
|
822
|
+
declare function redactApprovalRequest(request: IntegrationApprovalRequest): IntegrationApprovalRequest;
|
|
823
|
+
|
|
824
|
+
interface PlatformIntegrationPolicyPresetOptions extends Omit<StaticIntegrationPolicyOptions, 'defaultReadEffect' | 'defaultWriteEffect' | 'defaultDestructiveEffect'> {
|
|
825
|
+
allowWritesWithoutApproval?: boolean;
|
|
826
|
+
allowDestructiveActions?: boolean;
|
|
827
|
+
allowProviderPassthrough?: boolean;
|
|
828
|
+
}
|
|
829
|
+
declare function createPlatformIntegrationPolicyPreset(options?: PlatformIntegrationPolicyPresetOptions): StaticIntegrationPolicyEngine;
|
|
830
|
+
|
|
831
|
+
interface CatalogExecutorInvocation {
|
|
832
|
+
connection: IntegrationConnection;
|
|
833
|
+
request: IntegrationActionRequest;
|
|
834
|
+
connector: IntegrationConnector;
|
|
835
|
+
action: IntegrationConnector['actions'][number];
|
|
836
|
+
}
|
|
837
|
+
interface CatalogExecutorProviderOptions {
|
|
838
|
+
id: string;
|
|
839
|
+
kind: IntegrationProviderKind;
|
|
840
|
+
connectors: IntegrationConnector[];
|
|
841
|
+
startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
|
|
842
|
+
completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
|
|
843
|
+
executeAction: (invocation: CatalogExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
844
|
+
subscribeTrigger?: (connection: IntegrationConnection, trigger: NonNullable<IntegrationConnector['triggers']>[number], targetUrl?: string) => Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
|
|
845
|
+
unsubscribeTrigger?: (subscriptionId: string) => Promise<void> | void;
|
|
846
|
+
normalizeTriggerEvent?: (raw: unknown) => Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
|
|
847
|
+
}
|
|
848
|
+
declare function createCatalogExecutorProvider(options: CatalogExecutorProviderOptions): IntegrationProvider;
|
|
849
|
+
|
|
850
|
+
interface IntegrationInvocationEnvelope {
|
|
851
|
+
kind: 'integration.invocation';
|
|
852
|
+
capabilityToken: string;
|
|
853
|
+
toolName: string;
|
|
854
|
+
action: string;
|
|
855
|
+
input?: unknown;
|
|
856
|
+
idempotencyKey: string;
|
|
857
|
+
dryRun?: boolean;
|
|
858
|
+
metadata?: Record<string, unknown>;
|
|
859
|
+
}
|
|
860
|
+
interface IntegrationInvocationEnvelopeValidationOptions {
|
|
861
|
+
connectors?: IntegrationConnector[];
|
|
862
|
+
maxInputBytes?: number;
|
|
863
|
+
requireKnownTool?: boolean;
|
|
864
|
+
}
|
|
865
|
+
type NormalizedIntegrationResult = {
|
|
866
|
+
status: 'ok';
|
|
867
|
+
action: string;
|
|
868
|
+
output?: unknown;
|
|
869
|
+
metadata?: Record<string, unknown>;
|
|
870
|
+
} | {
|
|
871
|
+
status: 'approval_required';
|
|
872
|
+
action: string;
|
|
873
|
+
approval: IntegrationApprovalRequest;
|
|
874
|
+
metadata?: Record<string, unknown>;
|
|
875
|
+
} | {
|
|
876
|
+
status: 'failed';
|
|
877
|
+
action: string;
|
|
878
|
+
error: string;
|
|
879
|
+
metadata?: Record<string, unknown>;
|
|
880
|
+
};
|
|
881
|
+
interface IntegrationSandboxHostHub {
|
|
882
|
+
invokeWithCapability(token: string, request: InvokeWithCapabilityRequest): Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
883
|
+
}
|
|
884
|
+
interface IntegrationSandboxHostOptions extends IntegrationInvocationEnvelopeValidationOptions {
|
|
885
|
+
hub: IntegrationSandboxHostHub;
|
|
886
|
+
}
|
|
887
|
+
declare function buildIntegrationInvocationEnvelope(input: {
|
|
888
|
+
capabilityToken: string;
|
|
889
|
+
toolName: string;
|
|
890
|
+
args?: unknown;
|
|
891
|
+
idempotencyKey: string;
|
|
892
|
+
dryRun?: boolean;
|
|
893
|
+
metadata?: Record<string, unknown>;
|
|
894
|
+
}): IntegrationInvocationEnvelope;
|
|
895
|
+
declare function invocationRequestFromEnvelope(envelope: IntegrationInvocationEnvelope): InvokeWithCapabilityRequest;
|
|
896
|
+
declare function validateIntegrationInvocationEnvelope(envelope: IntegrationInvocationEnvelope, options?: IntegrationInvocationEnvelopeValidationOptions): void;
|
|
897
|
+
declare function redactInvocationEnvelope(envelope: IntegrationInvocationEnvelope): Omit<IntegrationInvocationEnvelope, 'capabilityToken'> & {
|
|
898
|
+
capabilityToken: '[REDACTED]';
|
|
899
|
+
};
|
|
900
|
+
declare function redactCapability(capability: IntegrationCapability): IntegrationCapability;
|
|
901
|
+
declare function normalizeIntegrationResult(result: IntegrationActionResult): NormalizedIntegrationResult;
|
|
902
|
+
declare function dispatchIntegrationInvocation(envelope: IntegrationInvocationEnvelope, options: IntegrationSandboxHostOptions): Promise<NormalizedIntegrationResult>;
|
|
903
|
+
declare class IntegrationSandboxHost {
|
|
904
|
+
private readonly options;
|
|
905
|
+
constructor(options: IntegrationSandboxHostOptions);
|
|
906
|
+
dispatch(envelope: IntegrationInvocationEnvelope): Promise<NormalizedIntegrationResult>;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
interface ImportCatalogOptions {
|
|
910
|
+
providerId: string;
|
|
911
|
+
connectorId: string;
|
|
912
|
+
connectorTitle: string;
|
|
913
|
+
category?: IntegrationConnectorCategory;
|
|
914
|
+
auth?: IntegrationConnector['auth'];
|
|
915
|
+
scopes?: string[];
|
|
916
|
+
dataClass?: IntegrationDataClass;
|
|
917
|
+
defaultRisk?: IntegrationActionRisk;
|
|
918
|
+
}
|
|
919
|
+
interface OpenApiDocument {
|
|
920
|
+
openapi?: string;
|
|
921
|
+
swagger?: string;
|
|
922
|
+
info?: {
|
|
923
|
+
title?: string;
|
|
924
|
+
};
|
|
925
|
+
paths?: Record<string, Record<string, OpenApiOperation | unknown>>;
|
|
926
|
+
}
|
|
927
|
+
interface OpenApiOperation {
|
|
928
|
+
operationId?: string;
|
|
929
|
+
summary?: string;
|
|
930
|
+
description?: string;
|
|
931
|
+
parameters?: unknown[];
|
|
932
|
+
requestBody?: unknown;
|
|
933
|
+
responses?: unknown;
|
|
934
|
+
security?: Array<Record<string, string[]>>;
|
|
935
|
+
tags?: string[];
|
|
936
|
+
}
|
|
937
|
+
interface GraphqlOperationSpec {
|
|
938
|
+
name: string;
|
|
939
|
+
kind: 'query' | 'mutation';
|
|
940
|
+
description?: string;
|
|
941
|
+
inputSchema?: unknown;
|
|
942
|
+
outputSchema?: unknown;
|
|
943
|
+
requiredScopes?: string[];
|
|
944
|
+
}
|
|
945
|
+
interface McpCatalogTool {
|
|
946
|
+
name: string;
|
|
947
|
+
description?: string;
|
|
948
|
+
inputSchema?: unknown;
|
|
949
|
+
annotations?: {
|
|
950
|
+
readOnlyHint?: boolean;
|
|
951
|
+
destructiveHint?: boolean;
|
|
952
|
+
openWorldHint?: boolean;
|
|
953
|
+
title?: string;
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
interface McpCatalog {
|
|
957
|
+
tools: McpCatalogTool[];
|
|
958
|
+
}
|
|
959
|
+
declare function importOpenApiConnector(document: OpenApiDocument, options: ImportCatalogOptions): IntegrationConnector;
|
|
960
|
+
declare function importGraphqlConnector(operations: GraphqlOperationSpec[], options: ImportCatalogOptions): IntegrationConnector;
|
|
961
|
+
declare function importMcpConnector(catalog: McpCatalog, options: ImportCatalogOptions): IntegrationConnector;
|
|
962
|
+
|
|
963
|
+
interface GatewayCatalogProviderOptions {
|
|
964
|
+
id: string;
|
|
965
|
+
kind: Extract<IntegrationProviderKind, 'nango' | 'pipedream' | 'activepieces' | 'tangle_catalog' | 'zapier' | 'executor' | 'custom'>;
|
|
966
|
+
fetchCatalog: () => Promise<GatewayCatalogEntry[]> | GatewayCatalogEntry[];
|
|
967
|
+
startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
|
|
968
|
+
completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
|
|
969
|
+
invokeAction?: (connection: IntegrationConnection, request: IntegrationActionRequest) => Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
970
|
+
cacheTtlMs?: number;
|
|
971
|
+
now?: () => Date;
|
|
972
|
+
}
|
|
973
|
+
interface GatewayCatalogEntry {
|
|
974
|
+
id?: string;
|
|
975
|
+
key?: string;
|
|
976
|
+
name?: string;
|
|
977
|
+
title?: string;
|
|
978
|
+
category?: string;
|
|
979
|
+
auth?: 'oauth2' | 'api_key' | 'none' | 'custom' | string;
|
|
980
|
+
scopes?: string[];
|
|
981
|
+
actions?: GatewayCatalogAction[];
|
|
982
|
+
triggers?: GatewayCatalogTrigger[];
|
|
983
|
+
metadata?: Record<string, unknown>;
|
|
984
|
+
}
|
|
985
|
+
interface GatewayCatalogAction {
|
|
986
|
+
id?: string;
|
|
987
|
+
key?: string;
|
|
988
|
+
name?: string;
|
|
989
|
+
title?: string;
|
|
990
|
+
description?: string;
|
|
991
|
+
risk?: 'read' | 'write' | 'destructive' | string;
|
|
992
|
+
scopes?: string[];
|
|
993
|
+
requiredScopes?: string[];
|
|
994
|
+
dataClass?: IntegrationDataClass | string;
|
|
995
|
+
approvalRequired?: boolean;
|
|
996
|
+
inputSchema?: unknown;
|
|
997
|
+
outputSchema?: unknown;
|
|
998
|
+
}
|
|
999
|
+
interface GatewayCatalogTrigger {
|
|
1000
|
+
id?: string;
|
|
1001
|
+
key?: string;
|
|
1002
|
+
name?: string;
|
|
1003
|
+
title?: string;
|
|
1004
|
+
description?: string;
|
|
1005
|
+
scopes?: string[];
|
|
1006
|
+
requiredScopes?: string[];
|
|
1007
|
+
dataClass?: IntegrationDataClass | string;
|
|
1008
|
+
payloadSchema?: unknown;
|
|
1009
|
+
}
|
|
1010
|
+
declare function createGatewayCatalogProvider(options: GatewayCatalogProviderOptions): IntegrationProvider;
|
|
1011
|
+
declare function normalizeGatewayCatalog(entries: GatewayCatalogEntry[], options: {
|
|
1012
|
+
providerId: string;
|
|
1013
|
+
providerKind: IntegrationProviderKind;
|
|
1014
|
+
}): IntegrationConnector[];
|
|
1015
|
+
|
|
1016
|
+
interface ActivepiecesCatalogEntry {
|
|
1017
|
+
id: string;
|
|
1018
|
+
title: string;
|
|
1019
|
+
description: string;
|
|
1020
|
+
npmPackage?: string;
|
|
1021
|
+
version?: string;
|
|
1022
|
+
category: IntegrationConnectorCategory;
|
|
1023
|
+
auth: IntegrationConnector['auth'];
|
|
1024
|
+
authFields?: ActivepiecesCatalogAuthField[];
|
|
1025
|
+
domains: string[];
|
|
1026
|
+
actions: Array<{
|
|
1027
|
+
id: string;
|
|
1028
|
+
title: string;
|
|
1029
|
+
risk: IntegrationActionRisk;
|
|
1030
|
+
upstreamName?: string;
|
|
1031
|
+
}>;
|
|
1032
|
+
triggers: Array<{
|
|
1033
|
+
id: string;
|
|
1034
|
+
title: string;
|
|
1035
|
+
upstreamName?: string;
|
|
1036
|
+
}>;
|
|
1037
|
+
source: {
|
|
1038
|
+
repository: string;
|
|
1039
|
+
path: string;
|
|
1040
|
+
license: 'MIT';
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
interface ActivepiecesCatalogAuthField {
|
|
1044
|
+
key: string;
|
|
1045
|
+
label: string;
|
|
1046
|
+
required: boolean;
|
|
1047
|
+
secret: boolean;
|
|
1048
|
+
kind: 'text' | 'number' | 'boolean' | 'select' | 'object' | 'unknown';
|
|
1049
|
+
description?: string;
|
|
1050
|
+
}
|
|
1051
|
+
declare function listActivepiecesCatalogEntries(): ActivepiecesCatalogEntry[];
|
|
1052
|
+
declare function buildActivepiecesConnectors(options?: {
|
|
1053
|
+
providerId?: string;
|
|
1054
|
+
includeCatalogActions?: boolean;
|
|
1055
|
+
executable?: boolean;
|
|
1056
|
+
}): IntegrationConnector[];
|
|
1057
|
+
|
|
1058
|
+
interface ActivepiecesPieceOverride {
|
|
1059
|
+
category?: IntegrationConnectorCategory;
|
|
1060
|
+
actionRisks?: Record<string, IntegrationActionRisk>;
|
|
1061
|
+
approvalRequired?: Record<string, boolean>;
|
|
1062
|
+
}
|
|
1063
|
+
declare const ACTIVEPIECES_OVERRIDES: Record<string, ActivepiecesPieceOverride>;
|
|
1064
|
+
declare function getActivepiecesOverride(id: string): ActivepiecesPieceOverride | undefined;
|
|
1065
|
+
|
|
1066
|
+
interface ActivepiecesExecutorInvocation {
|
|
1067
|
+
connection: IntegrationConnection;
|
|
1068
|
+
request: IntegrationActionRequest;
|
|
1069
|
+
connector: IntegrationConnector;
|
|
1070
|
+
catalogEntry: ActivepiecesCatalogEntry;
|
|
1071
|
+
piece: {
|
|
1072
|
+
id: string;
|
|
1073
|
+
npmPackage?: string;
|
|
1074
|
+
version?: string;
|
|
1075
|
+
actionId: string;
|
|
1076
|
+
upstreamActionName?: string;
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
interface ActivepiecesExecutorProviderOptions {
|
|
1080
|
+
id?: string;
|
|
1081
|
+
connectors?: IntegrationConnector[];
|
|
1082
|
+
startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
|
|
1083
|
+
completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
|
|
1084
|
+
executeAction: (invocation: ActivepiecesExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
1085
|
+
}
|
|
1086
|
+
declare function createActivepiecesExecutorProvider(options: ActivepiecesExecutorProviderOptions): IntegrationProvider;
|
|
1087
|
+
|
|
1088
|
+
declare const ACTIVEPIECES_RUNTIME_SIGNATURE_HEADER = "x-tangle-activepieces-signature";
|
|
1089
|
+
declare const TANGLE_CATALOG_RUNTIME_SIGNATURE_HEADER = "x-tangle-catalog-signature";
|
|
1090
|
+
interface TangleCatalogRuntimeActionRequest {
|
|
1091
|
+
id: string;
|
|
1092
|
+
input: unknown;
|
|
1093
|
+
idempotencyKey?: string;
|
|
1094
|
+
dryRun?: boolean;
|
|
1095
|
+
metadata?: Record<string, unknown>;
|
|
1096
|
+
}
|
|
1097
|
+
interface TangleCatalogRuntimePiece {
|
|
1098
|
+
id: string;
|
|
1099
|
+
packageName?: string;
|
|
1100
|
+
version?: string;
|
|
1101
|
+
actionId: string;
|
|
1102
|
+
upstreamActionName?: string;
|
|
1103
|
+
}
|
|
1104
|
+
interface TangleCatalogHttpExecutorOptions {
|
|
1105
|
+
endpoint: string;
|
|
1106
|
+
path?: string;
|
|
1107
|
+
signatureHeader?: string;
|
|
1108
|
+
secret?: string;
|
|
1109
|
+
fetchImpl?: typeof fetch;
|
|
1110
|
+
headers?: Record<string, string>;
|
|
1111
|
+
timeoutMs?: number;
|
|
1112
|
+
requestId?: () => string;
|
|
1113
|
+
}
|
|
1114
|
+
interface TangleCatalogHttpExecutorInvocation extends Omit<ActivepiecesExecutorInvocation, 'catalogEntry' | 'piece'> {
|
|
1115
|
+
catalogEntry: unknown;
|
|
1116
|
+
piece: TangleCatalogRuntimePiece;
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* @deprecated Use the Tangle catalog runtime types. This name is kept only for
|
|
1120
|
+
* compatibility with the upstream catalog ingestion backend.
|
|
1121
|
+
*/
|
|
1122
|
+
interface ActivepiecesRuntimeRequest {
|
|
1123
|
+
version: 1;
|
|
1124
|
+
requestId: string;
|
|
1125
|
+
providerId: string;
|
|
1126
|
+
connection: IntegrationConnection;
|
|
1127
|
+
connector: Pick<IntegrationConnector, 'id' | 'title' | 'auth' | 'scopes' | 'metadata'>;
|
|
1128
|
+
piece: ActivepiecesExecutorInvocation['piece'];
|
|
1129
|
+
action: TangleCatalogRuntimeActionRequest;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* @deprecated Use `TangleCatalogHttpExecutorOptions`.
|
|
1133
|
+
*/
|
|
1134
|
+
type ActivepiecesHttpExecutorOptions = TangleCatalogHttpExecutorOptions;
|
|
1135
|
+
/**
|
|
1136
|
+
* @deprecated Use `createTangleCatalogHttpExecutor`.
|
|
1137
|
+
*/
|
|
1138
|
+
declare function createActivepiecesHttpExecutor(options: ActivepiecesHttpExecutorOptions): ActivepiecesExecutorProviderOptions['executeAction'];
|
|
1139
|
+
/**
|
|
1140
|
+
* @deprecated Use `buildTangleCatalogRuntimeRequest`.
|
|
1141
|
+
*/
|
|
1142
|
+
declare function buildActivepiecesRuntimeRequest(invocation: ActivepiecesExecutorInvocation, requestId?: string): ActivepiecesRuntimeRequest;
|
|
1143
|
+
/**
|
|
1144
|
+
* @deprecated Use `signTangleCatalogRuntimeRequest`.
|
|
1145
|
+
*/
|
|
1146
|
+
declare function signActivepiecesRuntimeRequest(serializedBody: string, secret: string): string;
|
|
1147
|
+
/**
|
|
1148
|
+
* @deprecated Use `verifyTangleCatalogRuntimeSignature`.
|
|
1149
|
+
*/
|
|
1150
|
+
declare function verifyActivepiecesRuntimeSignature(serializedBody: string, signature: string | null | undefined, secret: string): boolean;
|
|
1151
|
+
interface TangleCatalogRuntimeRequest {
|
|
1152
|
+
version: 1;
|
|
1153
|
+
requestId: string;
|
|
1154
|
+
providerId: string;
|
|
1155
|
+
connection: IntegrationConnection;
|
|
1156
|
+
connector: Pick<IntegrationConnector, 'id' | 'title' | 'auth' | 'scopes' | 'metadata'>;
|
|
1157
|
+
piece: TangleCatalogRuntimePiece;
|
|
1158
|
+
action: TangleCatalogRuntimeActionRequest;
|
|
1159
|
+
}
|
|
1160
|
+
declare function createTangleCatalogHttpExecutor(options: TangleCatalogHttpExecutorOptions): (invocation: TangleCatalogHttpExecutorInvocation) => Promise<IntegrationActionResult>;
|
|
1161
|
+
declare function buildTangleCatalogRuntimeRequest(invocation: TangleCatalogHttpExecutorInvocation, requestId?: string): TangleCatalogRuntimeRequest;
|
|
1162
|
+
declare const signTangleCatalogRuntimeRequest: typeof signActivepiecesRuntimeRequest;
|
|
1163
|
+
declare const verifyTangleCatalogRuntimeSignature: typeof verifyActivepiecesRuntimeSignature;
|
|
1164
|
+
|
|
1165
|
+
interface IntegrationCatalogFreshnessOptions {
|
|
1166
|
+
liveActivepieces?: boolean;
|
|
1167
|
+
minActivepiecesConnectors?: number;
|
|
1168
|
+
staleConnectorDelta?: number;
|
|
1169
|
+
fetchImpl?: typeof fetch;
|
|
1170
|
+
}
|
|
1171
|
+
interface IntegrationCatalogFreshnessResult {
|
|
1172
|
+
ok: boolean;
|
|
1173
|
+
generatedAt: string;
|
|
1174
|
+
local: {
|
|
1175
|
+
activepiecesEntries: number;
|
|
1176
|
+
activepiecesConnectors: number;
|
|
1177
|
+
activepiecesActions: number;
|
|
1178
|
+
activepiecesTriggers: number;
|
|
1179
|
+
executableActivepiecesConnectors: number;
|
|
1180
|
+
executableActivepiecesActions: number;
|
|
1181
|
+
executableActivepiecesTriggers: number;
|
|
1182
|
+
executableToolDefinitions: number;
|
|
1183
|
+
unsupportedExecutableConnectorIds: string[];
|
|
1184
|
+
registryEntries: number;
|
|
1185
|
+
registrySummary: IntegrationRegistrySummary;
|
|
1186
|
+
conflictSamples: IntegrationRegistryConflict[];
|
|
1187
|
+
};
|
|
1188
|
+
upstream?: {
|
|
1189
|
+
activepiecesPieces?: number;
|
|
1190
|
+
activepiecesDelta?: number;
|
|
1191
|
+
checkedUrl: string;
|
|
1192
|
+
warning?: string;
|
|
1193
|
+
};
|
|
1194
|
+
warnings: string[];
|
|
1195
|
+
}
|
|
1196
|
+
declare const ACTIVEPIECES_PUBLIC_CATALOG_URL = "https://www.activepieces.com/pieces";
|
|
1197
|
+
declare function extractActivepiecesPublicPieceCount(html: string): number | undefined;
|
|
1198
|
+
declare function auditIntegrationCatalogFreshness(options?: IntegrationCatalogFreshnessOptions): Promise<IntegrationCatalogFreshnessResult>;
|
|
1199
|
+
|
|
1200
|
+
declare const TANGLE_INTEGRATIONS_CATALOG_PROVIDER_ID = "tangle-catalog";
|
|
1201
|
+
declare const TANGLE_INTEGRATIONS_CATALOG_SOURCE = "tangle-integrations-catalog";
|
|
1202
|
+
type TangleIntegrationImplementationKind = 'native_adapter' | 'package_runtime';
|
|
1203
|
+
type TangleIntegrationContractStatus = 'contract_ready' | 'runtime_backed' | 'native_backed';
|
|
1204
|
+
interface TangleIntegrationCatalogEntry {
|
|
1205
|
+
id: string;
|
|
1206
|
+
title: string;
|
|
1207
|
+
description: string;
|
|
1208
|
+
category: IntegrationConnector['category'];
|
|
1209
|
+
auth: IntegrationConnector['auth'];
|
|
1210
|
+
authFields?: ActivepiecesCatalogEntry['authFields'];
|
|
1211
|
+
domains: string[];
|
|
1212
|
+
actions: Array<{
|
|
1213
|
+
id: string;
|
|
1214
|
+
title: string;
|
|
1215
|
+
risk: IntegrationConnector['actions'][number]['risk'];
|
|
1216
|
+
upstreamName?: string;
|
|
1217
|
+
}>;
|
|
1218
|
+
triggers: Array<{
|
|
1219
|
+
id: string;
|
|
1220
|
+
title: string;
|
|
1221
|
+
upstreamName?: string;
|
|
1222
|
+
}>;
|
|
1223
|
+
}
|
|
1224
|
+
interface TangleIntegrationContract {
|
|
1225
|
+
id: string;
|
|
1226
|
+
title: string;
|
|
1227
|
+
description: string;
|
|
1228
|
+
category: IntegrationConnector['category'];
|
|
1229
|
+
auth: IntegrationConnector['auth'];
|
|
1230
|
+
authFields: NonNullable<ActivepiecesCatalogEntry['authFields']>;
|
|
1231
|
+
actions: Array<{
|
|
1232
|
+
id: string;
|
|
1233
|
+
title: string;
|
|
1234
|
+
risk: IntegrationConnector['actions'][number]['risk'];
|
|
1235
|
+
upstreamName: string;
|
|
1236
|
+
}>;
|
|
1237
|
+
triggers: Array<{
|
|
1238
|
+
id: string;
|
|
1239
|
+
title: string;
|
|
1240
|
+
upstreamName: string;
|
|
1241
|
+
}>;
|
|
1242
|
+
implementation: {
|
|
1243
|
+
kind: TangleIntegrationImplementationKind;
|
|
1244
|
+
runtimePackage?: string;
|
|
1245
|
+
version?: string;
|
|
1246
|
+
};
|
|
1247
|
+
status: TangleIntegrationContractStatus;
|
|
1248
|
+
quality: {
|
|
1249
|
+
tangleContract: true;
|
|
1250
|
+
authFieldsMapped: boolean;
|
|
1251
|
+
actionNamesMapped: boolean;
|
|
1252
|
+
triggerNamesMapped: boolean;
|
|
1253
|
+
runtimePackageMapped: boolean;
|
|
1254
|
+
nativeAdapter: boolean;
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
interface TangleCatalogRuntimePackageManifestOptions {
|
|
1258
|
+
name?: string;
|
|
1259
|
+
includeAgentIntegrationsPackage?: boolean;
|
|
1260
|
+
agentIntegrationsVersion?: string;
|
|
1261
|
+
additionalDependencies?: Record<string, string>;
|
|
1262
|
+
}
|
|
1263
|
+
interface TangleCatalogRuntimePackageManifest {
|
|
1264
|
+
name: string;
|
|
1265
|
+
private: true;
|
|
1266
|
+
type: 'module';
|
|
1267
|
+
dependencies: Record<string, string>;
|
|
1268
|
+
tangle: {
|
|
1269
|
+
integrationContracts: number;
|
|
1270
|
+
packageRuntimeBackends: number;
|
|
1271
|
+
generatedFrom: typeof TANGLE_INTEGRATIONS_CATALOG_SOURCE;
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
interface TangleCatalogExecutorInvocation {
|
|
1275
|
+
connection: IntegrationConnection;
|
|
1276
|
+
request: IntegrationActionRequest;
|
|
1277
|
+
connector: IntegrationConnector;
|
|
1278
|
+
catalogEntry: TangleIntegrationCatalogEntry;
|
|
1279
|
+
piece: {
|
|
1280
|
+
id: string;
|
|
1281
|
+
packageName?: string;
|
|
1282
|
+
version?: string;
|
|
1283
|
+
actionId: string;
|
|
1284
|
+
upstreamActionName?: string;
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
interface TangleCatalogTriggerInvocation {
|
|
1288
|
+
connection: IntegrationConnection;
|
|
1289
|
+
connector: IntegrationConnector;
|
|
1290
|
+
catalogEntry: TangleIntegrationCatalogEntry;
|
|
1291
|
+
trigger: NonNullable<IntegrationConnector['triggers']>[number];
|
|
1292
|
+
targetUrl?: string;
|
|
1293
|
+
piece: {
|
|
1294
|
+
id: string;
|
|
1295
|
+
packageName?: string;
|
|
1296
|
+
version?: string;
|
|
1297
|
+
triggerId: string;
|
|
1298
|
+
upstreamTriggerName?: string;
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
interface TangleCatalogExecutorProviderOptions {
|
|
1302
|
+
id?: string;
|
|
1303
|
+
connectors?: IntegrationConnector[];
|
|
1304
|
+
startAuth?: (request: StartAuthRequest) => Promise<StartAuthResult> | StartAuthResult;
|
|
1305
|
+
completeAuth?: (request: CompleteAuthRequest) => Promise<IntegrationConnection> | IntegrationConnection;
|
|
1306
|
+
executeAction: (invocation: TangleCatalogExecutorInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
1307
|
+
subscribeTrigger?: (invocation: TangleCatalogTriggerInvocation) => Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
|
|
1308
|
+
unsubscribeTrigger?: (subscriptionId: string) => Promise<void> | void;
|
|
1309
|
+
normalizeTriggerEvent?: (raw: unknown) => Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
|
|
1310
|
+
}
|
|
1311
|
+
type TangleIntegrationCatalogFreshnessOptions = IntegrationCatalogFreshnessOptions;
|
|
1312
|
+
interface TangleIntegrationCatalogFreshnessResult {
|
|
1313
|
+
ok: boolean;
|
|
1314
|
+
generatedAt: string;
|
|
1315
|
+
local: {
|
|
1316
|
+
catalogEntries: number;
|
|
1317
|
+
catalogConnectors: number;
|
|
1318
|
+
catalogActions: number;
|
|
1319
|
+
catalogTriggers: number;
|
|
1320
|
+
executableCatalogConnectors: number;
|
|
1321
|
+
executableCatalogActions: number;
|
|
1322
|
+
executableCatalogTriggers: number;
|
|
1323
|
+
executableToolDefinitions: number;
|
|
1324
|
+
unsupportedExecutableConnectorIds: string[];
|
|
1325
|
+
registryEntries: number;
|
|
1326
|
+
registrySummary: Awaited<ReturnType<typeof auditIntegrationCatalogFreshness>>['local']['registrySummary'];
|
|
1327
|
+
conflictSamples: Awaited<ReturnType<typeof auditIntegrationCatalogFreshness>>['local']['conflictSamples'];
|
|
1328
|
+
};
|
|
1329
|
+
upstream?: {
|
|
1330
|
+
externalEntries?: number;
|
|
1331
|
+
externalDelta?: number;
|
|
1332
|
+
checkedUrl: string;
|
|
1333
|
+
warning?: string;
|
|
1334
|
+
};
|
|
1335
|
+
warnings: string[];
|
|
1336
|
+
}
|
|
1337
|
+
declare function listTangleIntegrationCatalogEntries(): TangleIntegrationCatalogEntry[];
|
|
1338
|
+
declare function listTangleIntegrationContracts(): TangleIntegrationContract[];
|
|
1339
|
+
declare function listTangleIntegrationCatalogRuntimePackages(): Array<{
|
|
1340
|
+
connectorId: string;
|
|
1341
|
+
packageName: string;
|
|
1342
|
+
version?: string;
|
|
1343
|
+
}>;
|
|
1344
|
+
declare function buildTangleCatalogRuntimePackageManifest(options?: TangleCatalogRuntimePackageManifestOptions): TangleCatalogRuntimePackageManifest;
|
|
1345
|
+
declare function renderTangleCatalogRuntimePnpmAddCommand(options?: {
|
|
1346
|
+
includeAgentIntegrationsPackage?: boolean;
|
|
1347
|
+
agentIntegrationsVersion?: string;
|
|
1348
|
+
}): string;
|
|
1349
|
+
declare function buildTangleIntegrationCatalogConnectors(options?: {
|
|
1350
|
+
providerId?: string;
|
|
1351
|
+
includeCatalogActions?: boolean;
|
|
1352
|
+
executable?: boolean;
|
|
1353
|
+
}): IntegrationConnector[];
|
|
1354
|
+
declare function createTangleCatalogExecutorProvider(options: TangleCatalogExecutorProviderOptions): IntegrationProvider;
|
|
1355
|
+
declare const extractExternalCatalogPublicCount: typeof extractActivepiecesPublicPieceCount;
|
|
1356
|
+
declare function auditTangleIntegrationCatalogFreshness(options?: TangleIntegrationCatalogFreshnessOptions): Promise<TangleIntegrationCatalogFreshnessResult>;
|
|
1357
|
+
|
|
1358
|
+
interface TangleCatalogRuntimeInvocation {
|
|
1359
|
+
request: TangleCatalogRuntimeRequest;
|
|
1360
|
+
connection: IntegrationConnection;
|
|
1361
|
+
connector: IntegrationConnector;
|
|
1362
|
+
action: IntegrationConnectorAction;
|
|
1363
|
+
}
|
|
1364
|
+
interface TangleCatalogRuntimeHandlerOptions {
|
|
1365
|
+
secret?: string;
|
|
1366
|
+
requireSignature?: boolean;
|
|
1367
|
+
signatureHeader?: string;
|
|
1368
|
+
connectors?: IntegrationConnector[];
|
|
1369
|
+
maxBodyBytes?: number;
|
|
1370
|
+
executeAction: (invocation: TangleCatalogRuntimeInvocation) => Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
1371
|
+
}
|
|
1372
|
+
interface TangleCatalogInstalledPackageExecutorOptions {
|
|
1373
|
+
moduleLoader?: (packageName: string) => Promise<unknown> | unknown;
|
|
1374
|
+
actionAliases?: Record<string, Record<string, string>>;
|
|
1375
|
+
allowFuzzyActionMatch?: boolean;
|
|
1376
|
+
resolveAuth?: (connection: IntegrationConnection) => Promise<unknown> | unknown;
|
|
1377
|
+
beforeRun?: (invocation: TangleCatalogRuntimeInvocation) => Promise<void> | void;
|
|
1378
|
+
}
|
|
1379
|
+
interface TangleCatalogAuthResolverOptions {
|
|
1380
|
+
secrets: IntegrationSecretStore;
|
|
1381
|
+
mapCredentials?: (input: {
|
|
1382
|
+
connection: IntegrationConnection;
|
|
1383
|
+
credentials: ConnectorCredentials;
|
|
1384
|
+
connectorId: string;
|
|
1385
|
+
}) => unknown;
|
|
1386
|
+
}
|
|
1387
|
+
interface TangleCatalogHttpAuthResolverOptions {
|
|
1388
|
+
endpoint: string;
|
|
1389
|
+
secret: string;
|
|
1390
|
+
path?: string;
|
|
1391
|
+
timeoutMs?: number;
|
|
1392
|
+
fetchImpl?: typeof fetch;
|
|
1393
|
+
headers?: Record<string, string>;
|
|
1394
|
+
requestId?: () => string;
|
|
1395
|
+
}
|
|
1396
|
+
interface TangleCatalogHttpAuthResolverRequest {
|
|
1397
|
+
version: 1;
|
|
1398
|
+
requestId: string;
|
|
1399
|
+
providerId: string;
|
|
1400
|
+
connectorId: string;
|
|
1401
|
+
connectionId: string;
|
|
1402
|
+
secretRef?: IntegrationConnection['secretRef'];
|
|
1403
|
+
}
|
|
1404
|
+
interface TangleCatalogRuntimeModuleAction {
|
|
1405
|
+
name?: string;
|
|
1406
|
+
displayName?: string;
|
|
1407
|
+
run?: (context: {
|
|
1408
|
+
auth: unknown;
|
|
1409
|
+
propsValue: unknown;
|
|
1410
|
+
input: unknown;
|
|
1411
|
+
connection: IntegrationConnection;
|
|
1412
|
+
request: TangleCatalogRuntimeRequest;
|
|
1413
|
+
}) => Promise<unknown> | unknown;
|
|
1414
|
+
}
|
|
1415
|
+
interface TangleCatalogRuntimeHttpRequest {
|
|
1416
|
+
body: string | Uint8Array | TangleCatalogRuntimeRequest;
|
|
1417
|
+
headers?: Headers | Record<string, string | string[] | undefined>;
|
|
1418
|
+
}
|
|
1419
|
+
interface TangleCatalogRuntimeHttpResponse {
|
|
1420
|
+
status: number;
|
|
1421
|
+
headers: Record<string, string>;
|
|
1422
|
+
body: IntegrationActionResult | {
|
|
1423
|
+
ok: false;
|
|
1424
|
+
action: string;
|
|
1425
|
+
output: {
|
|
1426
|
+
code: string;
|
|
1427
|
+
message: string;
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
interface TangleCatalogRuntimePackageCoverageRow {
|
|
1432
|
+
connectorId: string;
|
|
1433
|
+
packageName: string;
|
|
1434
|
+
packageInstalled: boolean;
|
|
1435
|
+
packageLoads: boolean;
|
|
1436
|
+
pieceExportFound: boolean;
|
|
1437
|
+
actionMappingsVerified: number;
|
|
1438
|
+
actionMappingsTotal: number;
|
|
1439
|
+
triggerMappingsFound: number;
|
|
1440
|
+
triggerMappingsTotal: number;
|
|
1441
|
+
triggerHostingSupported: boolean;
|
|
1442
|
+
error?: string;
|
|
1443
|
+
}
|
|
1444
|
+
interface TangleCatalogRuntimePackageCoverageOptions {
|
|
1445
|
+
connectorIds?: string[];
|
|
1446
|
+
moduleLoader?: (packageName: string) => Promise<unknown> | unknown;
|
|
1447
|
+
}
|
|
1448
|
+
declare function createTangleCatalogRuntimeHandler(options: TangleCatalogRuntimeHandlerOptions): (input: TangleCatalogRuntimeHttpRequest) => Promise<TangleCatalogRuntimeHttpResponse>;
|
|
1449
|
+
declare function createTangleCatalogInstalledPackageExecutor(options?: TangleCatalogInstalledPackageExecutorOptions): TangleCatalogRuntimeHandlerOptions['executeAction'];
|
|
1450
|
+
declare function auditTangleCatalogRuntimePackages(options?: TangleCatalogRuntimePackageCoverageOptions): Promise<TangleCatalogRuntimePackageCoverageRow[]>;
|
|
1451
|
+
declare function createTangleCatalogCredentialAuthResolver(options: TangleCatalogAuthResolverOptions): (connection: IntegrationConnection) => Promise<unknown>;
|
|
1452
|
+
declare function createTangleCatalogHttpAuthResolver(options: TangleCatalogHttpAuthResolverOptions): (connection: IntegrationConnection) => Promise<unknown>;
|
|
1453
|
+
declare function tangleCatalogAuthValue(credentials: ConnectorCredentials): unknown;
|
|
1454
|
+
|
|
1455
|
+
interface TangleCatalogRuntimeNodeServerOptions {
|
|
1456
|
+
secret: string;
|
|
1457
|
+
host?: string;
|
|
1458
|
+
port?: number;
|
|
1459
|
+
path?: string;
|
|
1460
|
+
maxBodyBytes?: number;
|
|
1461
|
+
requireSignature?: boolean;
|
|
1462
|
+
authResolver?: false | TangleCatalogHttpAuthResolverOptions;
|
|
1463
|
+
executor?: Omit<TangleCatalogInstalledPackageExecutorOptions, 'resolveAuth'> & {
|
|
1464
|
+
resolveAuth?: TangleCatalogInstalledPackageExecutorOptions['resolveAuth'];
|
|
1465
|
+
};
|
|
1466
|
+
onLog?: (event: {
|
|
1467
|
+
level: 'info' | 'warn' | 'error';
|
|
1468
|
+
message: string;
|
|
1469
|
+
metadata?: Record<string, unknown>;
|
|
1470
|
+
}) => void;
|
|
1471
|
+
}
|
|
1472
|
+
interface StartedTangleCatalogRuntimeNodeServer {
|
|
1473
|
+
server: Server;
|
|
1474
|
+
url: string;
|
|
1475
|
+
close: () => Promise<void>;
|
|
1476
|
+
}
|
|
1477
|
+
declare function createTangleCatalogRuntimeNodeRequestListener(options: TangleCatalogRuntimeNodeServerOptions): (request: IncomingMessage, response: ServerResponse) => Promise<void>;
|
|
1478
|
+
declare function startTangleCatalogRuntimeNodeServer(options: TangleCatalogRuntimeNodeServerOptions): Promise<StartedTangleCatalogRuntimeNodeServer>;
|
|
1479
|
+
|
|
1480
|
+
type IntegrationCoveragePriority = 'tier_0' | 'tier_1' | 'tier_2' | 'long_tail';
|
|
1481
|
+
interface IntegrationCoverageSpec {
|
|
1482
|
+
id: string;
|
|
1483
|
+
title: string;
|
|
1484
|
+
category: IntegrationConnectorCategory;
|
|
1485
|
+
auth: IntegrationConnector['auth'];
|
|
1486
|
+
priority: IntegrationCoveragePriority;
|
|
1487
|
+
providerKinds: IntegrationProviderKind[];
|
|
1488
|
+
domains: string[];
|
|
1489
|
+
actionPack: IntegrationActionPack;
|
|
1490
|
+
scopes?: string[];
|
|
1491
|
+
}
|
|
1492
|
+
type IntegrationActionPack = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'project' | 'support' | 'marketing' | 'sales' | 'commerce' | 'finance' | 'hr' | 'dev' | 'ai' | 'analytics' | 'workflow' | 'webhook';
|
|
1493
|
+
declare function listIntegrationCoverageSpecs(): IntegrationCoverageSpec[];
|
|
1494
|
+
declare function buildIntegrationCoverageConnectors(options?: {
|
|
1495
|
+
providerId?: string;
|
|
1496
|
+
priorities?: IntegrationCoveragePriority[];
|
|
1497
|
+
categories?: IntegrationConnectorCategory[];
|
|
1498
|
+
actionPacks?: IntegrationActionPack[];
|
|
1499
|
+
}): IntegrationConnector[];
|
|
1500
|
+
declare function integrationCoverageChecklistMarkdown(): string;
|
|
1501
|
+
|
|
1502
|
+
type IntegrationAuthMode = 'oauth2' | 'api_key' | 'hmac' | 'none' | 'custom';
|
|
1503
|
+
type IntegrationSpecStatus = 'catalog' | 'executable' | 'deprecated';
|
|
1504
|
+
type IntegrationFamilyId = 'google' | 'microsoft-graph' | 'atlassian' | 'salesforce' | 'hubspot' | 'slack' | 'notion' | 'standard-oauth2' | 'api-key' | 'hmac' | 'none';
|
|
1505
|
+
type NormalizedPermission = `${string}.read` | `${string}.write` | `${string}.delete` | `${string}.admin`;
|
|
1506
|
+
interface IntegrationSpec {
|
|
1507
|
+
kind: string;
|
|
1508
|
+
title: string;
|
|
1509
|
+
category: IntegrationConnectorCategory;
|
|
1510
|
+
status: IntegrationSpecStatus;
|
|
1511
|
+
family: IntegrationFamilyId;
|
|
1512
|
+
auth: IntegrationAuthSpec;
|
|
1513
|
+
permissions: PermissionDescriptor[];
|
|
1514
|
+
actions: IntegrationConnectorAction[];
|
|
1515
|
+
triggers?: IntegrationConnectorTrigger[];
|
|
1516
|
+
setup: IntegrationSetupSpec;
|
|
1517
|
+
lifecycle?: IntegrationLifecycleSpec;
|
|
1518
|
+
plannerHints?: IntegrationPlannerHints;
|
|
1519
|
+
metadata?: Record<string, unknown>;
|
|
1520
|
+
}
|
|
1521
|
+
type IntegrationAuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | HmacAuthSpec | NoneAuthSpec | CustomAuthSpec;
|
|
1522
|
+
interface OAuth2AuthSpec {
|
|
1523
|
+
mode: 'oauth2';
|
|
1524
|
+
authorizationUrl: string;
|
|
1525
|
+
tokenUrl: string;
|
|
1526
|
+
clientIdEnv?: string;
|
|
1527
|
+
clientSecretEnv?: string;
|
|
1528
|
+
scopes: ScopeDescriptor[];
|
|
1529
|
+
extraAuthParams?: Record<string, string>;
|
|
1530
|
+
redirectUriTemplate: string;
|
|
1531
|
+
pkce?: 'required' | 'supported' | 'unsupported';
|
|
1532
|
+
}
|
|
1533
|
+
interface ApiKeyAuthSpec {
|
|
1534
|
+
mode: 'api_key';
|
|
1535
|
+
credential: CredentialFieldSpec;
|
|
1536
|
+
placement?: 'bearer' | 'header' | 'query' | 'basic';
|
|
1537
|
+
}
|
|
1538
|
+
interface HmacAuthSpec {
|
|
1539
|
+
mode: 'hmac';
|
|
1540
|
+
credential: CredentialFieldSpec;
|
|
1541
|
+
signatureHeader?: string;
|
|
1542
|
+
}
|
|
1543
|
+
interface NoneAuthSpec {
|
|
1544
|
+
mode: 'none';
|
|
1545
|
+
}
|
|
1546
|
+
interface CustomAuthSpec {
|
|
1547
|
+
mode: 'custom';
|
|
1548
|
+
description: string;
|
|
1549
|
+
}
|
|
1550
|
+
interface ScopeDescriptor {
|
|
1551
|
+
normalized: NormalizedPermission;
|
|
1552
|
+
providerScope: string;
|
|
1553
|
+
title: string;
|
|
1554
|
+
reason: string;
|
|
1555
|
+
risk: IntegrationActionRisk;
|
|
1556
|
+
dataClass: IntegrationDataClass;
|
|
1557
|
+
}
|
|
1558
|
+
interface PermissionDescriptor {
|
|
1559
|
+
normalized: NormalizedPermission;
|
|
1560
|
+
providerScopes: string[];
|
|
1561
|
+
title: string;
|
|
1562
|
+
risk: IntegrationActionRisk;
|
|
1563
|
+
dataClass: IntegrationDataClass;
|
|
1564
|
+
reason: string;
|
|
1565
|
+
}
|
|
1566
|
+
interface CredentialFieldSpec {
|
|
1567
|
+
label: string;
|
|
1568
|
+
description: string;
|
|
1569
|
+
env?: string;
|
|
1570
|
+
example?: string;
|
|
1571
|
+
regex?: string;
|
|
1572
|
+
secret: boolean;
|
|
1573
|
+
}
|
|
1574
|
+
interface ConsoleStep {
|
|
1575
|
+
id: string;
|
|
1576
|
+
title: string;
|
|
1577
|
+
detail: string;
|
|
1578
|
+
copyValue?: string;
|
|
1579
|
+
}
|
|
1580
|
+
interface Quirk {
|
|
1581
|
+
id: string;
|
|
1582
|
+
severity: 'info' | 'warning' | 'critical';
|
|
1583
|
+
message: string;
|
|
1584
|
+
}
|
|
1585
|
+
interface PostSetupCheck {
|
|
1586
|
+
id: string;
|
|
1587
|
+
title: string;
|
|
1588
|
+
detail: string;
|
|
1589
|
+
}
|
|
1590
|
+
interface HealthcheckSpec {
|
|
1591
|
+
id: string;
|
|
1592
|
+
level: 'client_config' | 'connection' | 'webhook' | 'static';
|
|
1593
|
+
method?: 'GET' | 'POST';
|
|
1594
|
+
url?: string;
|
|
1595
|
+
expectedStatus?: number[];
|
|
1596
|
+
description: string;
|
|
1597
|
+
}
|
|
1598
|
+
interface IntegrationSetupSpec {
|
|
1599
|
+
consoleUrl?: string;
|
|
1600
|
+
consoleSteps: ConsoleStep[];
|
|
1601
|
+
credentialFields: CredentialFieldSpec[];
|
|
1602
|
+
redirectUriTemplate?: string;
|
|
1603
|
+
knownQuirks?: Quirk[];
|
|
1604
|
+
postSetup?: PostSetupCheck[];
|
|
1605
|
+
healthcheck?: HealthcheckSpec;
|
|
1606
|
+
}
|
|
1607
|
+
interface IntegrationLifecycleSpec {
|
|
1608
|
+
supportsRefresh: boolean;
|
|
1609
|
+
supportsRevoke: boolean;
|
|
1610
|
+
supportsIncrementalAuth: boolean;
|
|
1611
|
+
recommendedHealthcheckIntervalHours?: number;
|
|
1612
|
+
freshnessSloMinutes?: number;
|
|
1613
|
+
}
|
|
1614
|
+
interface IntegrationPlannerHints {
|
|
1615
|
+
useFor: string[];
|
|
1616
|
+
avoidFor?: string[];
|
|
1617
|
+
dataFreshness: 'realtime' | 'near_realtime' | 'eventual' | 'manual';
|
|
1618
|
+
writeRisk: 'low' | 'medium' | 'high';
|
|
1619
|
+
}
|
|
1620
|
+
interface IntegrationFamilySpec {
|
|
1621
|
+
id: IntegrationFamilyId;
|
|
1622
|
+
title: string;
|
|
1623
|
+
authMode: IntegrationAuthMode;
|
|
1624
|
+
consoleUrl?: string;
|
|
1625
|
+
authorizationUrl?: string;
|
|
1626
|
+
tokenUrl?: string;
|
|
1627
|
+
redirectUriTemplate?: string;
|
|
1628
|
+
credentialFields: CredentialFieldSpec[];
|
|
1629
|
+
consoleSteps: ConsoleStep[];
|
|
1630
|
+
knownQuirks?: Quirk[];
|
|
1631
|
+
lifecycle: IntegrationLifecycleSpec;
|
|
1632
|
+
}
|
|
1633
|
+
interface IntegrationSpecValidationIssue {
|
|
1634
|
+
path: string;
|
|
1635
|
+
message: string;
|
|
1636
|
+
}
|
|
1637
|
+
interface IntegrationSpecValidationResult {
|
|
1638
|
+
ok: boolean;
|
|
1639
|
+
issues: IntegrationSpecValidationIssue[];
|
|
1640
|
+
}
|
|
1641
|
+
interface RenderSpecOptions {
|
|
1642
|
+
host: string;
|
|
1643
|
+
callbackPath?: string;
|
|
1644
|
+
}
|
|
1645
|
+
interface RenderedConsoleStep extends ConsoleStep {
|
|
1646
|
+
detail: string;
|
|
1647
|
+
copyValue?: string;
|
|
1648
|
+
}
|
|
1649
|
+
interface CredentialValidationInput {
|
|
1650
|
+
field: CredentialFieldSpec;
|
|
1651
|
+
value: string;
|
|
1652
|
+
}
|
|
1653
|
+
interface CredentialValidationResult {
|
|
1654
|
+
ok: boolean;
|
|
1655
|
+
field: string;
|
|
1656
|
+
message?: string;
|
|
1657
|
+
}
|
|
1658
|
+
interface HealthcheckPlan {
|
|
1659
|
+
kind: string;
|
|
1660
|
+
healthcheck: HealthcheckSpec;
|
|
1661
|
+
requires: Array<'client_id' | 'client_secret' | 'api_key' | 'hmac_secret' | 'connection_credentials'>;
|
|
1662
|
+
message: string;
|
|
1663
|
+
}
|
|
1664
|
+
declare function specAuthToConnectorAuth(auth: IntegrationAuthSpec): IntegrationConnector['auth'];
|
|
1665
|
+
|
|
1666
|
+
declare const INTEGRATION_FAMILIES: Record<IntegrationFamilyId, IntegrationFamilySpec>;
|
|
1667
|
+
declare function getIntegrationFamily(id: IntegrationFamilyId): IntegrationFamilySpec;
|
|
1668
|
+
|
|
1669
|
+
declare function listIntegrationSpecs(): IntegrationSpec[];
|
|
1670
|
+
declare function getIntegrationSpec(kind: string): IntegrationSpec | undefined;
|
|
1671
|
+
declare function listExecutableIntegrationSpecs(): IntegrationSpec[];
|
|
1672
|
+
declare function integrationSpecToConnector(spec: IntegrationSpec, providerId?: string): IntegrationConnector;
|
|
1673
|
+
|
|
1674
|
+
declare function renderConsoleSteps(spec: IntegrationSpec, options: RenderSpecOptions): RenderedConsoleStep[];
|
|
1675
|
+
declare function renderRunbookMarkdown(spec: IntegrationSpec, options: RenderSpecOptions): string;
|
|
1676
|
+
declare function renderAgentToolDescription(spec: IntegrationSpec): string;
|
|
1677
|
+
declare function buildHealthcheckPlan(spec: IntegrationSpec): HealthcheckPlan;
|
|
1678
|
+
declare function consoleStepsToText(steps: ConsoleStep[]): string;
|
|
1679
|
+
|
|
1680
|
+
declare function validateIntegrationSpec(spec: IntegrationSpec): IntegrationSpecValidationResult;
|
|
1681
|
+
declare function assertValidIntegrationSpec(spec: IntegrationSpec): void;
|
|
1682
|
+
declare function validateCredentialFormat(field: CredentialFieldSpec, value: string): CredentialValidationResult;
|
|
1683
|
+
declare function validateCredentialSet(spec: IntegrationSpec, values: Record<string, string>): CredentialValidationResult[];
|
|
1684
|
+
|
|
1685
|
+
type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'tangle_catalog' | 'executor' | 'custom';
|
|
1686
|
+
type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
|
|
1687
|
+
type IntegrationActionRisk = 'read' | 'write' | 'destructive';
|
|
1688
|
+
type IntegrationDataClass = 'public' | 'internal' | 'private' | 'sensitive' | 'secret';
|
|
1689
|
+
interface IntegrationActor {
|
|
1690
|
+
type: 'user' | 'team' | 'app' | 'agent' | 'sandbox' | 'system';
|
|
1691
|
+
id: string;
|
|
1692
|
+
}
|
|
1693
|
+
interface IntegrationConnectorAction {
|
|
1694
|
+
id: string;
|
|
1695
|
+
title: string;
|
|
1696
|
+
risk: IntegrationActionRisk;
|
|
1697
|
+
requiredScopes: string[];
|
|
1698
|
+
dataClass: IntegrationDataClass;
|
|
1699
|
+
description?: string;
|
|
1700
|
+
approvalRequired?: boolean;
|
|
1701
|
+
inputSchema?: unknown;
|
|
1702
|
+
outputSchema?: unknown;
|
|
1703
|
+
}
|
|
1704
|
+
interface IntegrationConnectorTrigger {
|
|
1705
|
+
id: string;
|
|
1706
|
+
title: string;
|
|
1707
|
+
requiredScopes: string[];
|
|
1708
|
+
dataClass: IntegrationDataClass;
|
|
1709
|
+
description?: string;
|
|
1710
|
+
payloadSchema?: unknown;
|
|
1711
|
+
}
|
|
1712
|
+
interface IntegrationConnector {
|
|
1713
|
+
id: string;
|
|
1714
|
+
providerId: string;
|
|
1715
|
+
title: string;
|
|
1716
|
+
category: IntegrationConnectorCategory;
|
|
1717
|
+
auth: 'oauth2' | 'api_key' | 'none' | 'custom';
|
|
1718
|
+
scopes: string[];
|
|
1719
|
+
actions: IntegrationConnectorAction[];
|
|
1720
|
+
triggers?: IntegrationConnectorTrigger[];
|
|
1721
|
+
metadata?: Record<string, unknown>;
|
|
1722
|
+
}
|
|
1723
|
+
interface SecretRef {
|
|
1724
|
+
provider: string;
|
|
1725
|
+
id: string;
|
|
1726
|
+
label?: string;
|
|
1727
|
+
}
|
|
1728
|
+
interface IntegrationConnection {
|
|
1729
|
+
id: string;
|
|
1730
|
+
owner: IntegrationActor;
|
|
1731
|
+
providerId: string;
|
|
1732
|
+
connectorId: string;
|
|
1733
|
+
status: 'pending' | 'active' | 'expired' | 'revoked' | 'error';
|
|
1734
|
+
grantedScopes: string[];
|
|
1735
|
+
account?: {
|
|
1736
|
+
id?: string;
|
|
1737
|
+
email?: string;
|
|
1738
|
+
displayName?: string;
|
|
1739
|
+
};
|
|
1740
|
+
secretRef?: SecretRef;
|
|
1741
|
+
createdAt: string;
|
|
1742
|
+
updatedAt: string;
|
|
1743
|
+
expiresAt?: string;
|
|
1744
|
+
lastUsedAt?: string;
|
|
1745
|
+
metadata?: Record<string, unknown>;
|
|
1746
|
+
}
|
|
1747
|
+
interface StartAuthRequest {
|
|
1748
|
+
connectorId: string;
|
|
1749
|
+
owner: IntegrationActor;
|
|
1750
|
+
requestedScopes: string[];
|
|
1751
|
+
redirectUri: string;
|
|
1752
|
+
state?: string;
|
|
1753
|
+
metadata?: Record<string, unknown>;
|
|
1754
|
+
}
|
|
1755
|
+
interface StartAuthResult {
|
|
1756
|
+
providerId: string;
|
|
1757
|
+
connectorId: string;
|
|
1758
|
+
authUrl: string;
|
|
1759
|
+
state: string;
|
|
1760
|
+
expiresAt?: string;
|
|
1761
|
+
metadata?: Record<string, unknown>;
|
|
1762
|
+
}
|
|
1763
|
+
interface CompleteAuthRequest {
|
|
1764
|
+
connectorId: string;
|
|
1765
|
+
owner: IntegrationActor;
|
|
1766
|
+
code?: string;
|
|
1767
|
+
state: string;
|
|
1768
|
+
redirectUri: string;
|
|
1769
|
+
metadata?: Record<string, unknown>;
|
|
1770
|
+
}
|
|
1771
|
+
interface IntegrationActionRequest {
|
|
1772
|
+
connectionId: string;
|
|
1773
|
+
action: string;
|
|
1774
|
+
input?: unknown;
|
|
1775
|
+
idempotencyKey?: string;
|
|
1776
|
+
dryRun?: boolean;
|
|
1777
|
+
metadata?: Record<string, unknown>;
|
|
1778
|
+
}
|
|
1779
|
+
interface IntegrationActionResult<T = unknown> {
|
|
1780
|
+
ok: boolean;
|
|
1781
|
+
action: string;
|
|
1782
|
+
output?: T;
|
|
1783
|
+
externalId?: string;
|
|
1784
|
+
warnings?: string[];
|
|
1785
|
+
metadata?: Record<string, unknown>;
|
|
1786
|
+
}
|
|
1787
|
+
interface IntegrationTriggerSubscription {
|
|
1788
|
+
id: string;
|
|
1789
|
+
connectionId: string;
|
|
1790
|
+
trigger: string;
|
|
1791
|
+
targetUrl?: string;
|
|
1792
|
+
status: 'active' | 'paused' | 'error';
|
|
1793
|
+
createdAt: string;
|
|
1794
|
+
metadata?: Record<string, unknown>;
|
|
1795
|
+
}
|
|
1796
|
+
interface IntegrationTriggerEvent<T = unknown> {
|
|
1797
|
+
id: string;
|
|
1798
|
+
providerId: string;
|
|
1799
|
+
connectorId: string;
|
|
1800
|
+
connectionId: string;
|
|
1801
|
+
trigger: string;
|
|
1802
|
+
occurredAt: string;
|
|
1803
|
+
payload: T;
|
|
1804
|
+
metadata?: Record<string, unknown>;
|
|
1805
|
+
}
|
|
1806
|
+
interface IntegrationProvider {
|
|
1807
|
+
id: string;
|
|
1808
|
+
kind: IntegrationProviderKind;
|
|
1809
|
+
listConnectors(): Promise<IntegrationConnector[]> | IntegrationConnector[];
|
|
1810
|
+
startAuth?(request: StartAuthRequest): Promise<StartAuthResult> | StartAuthResult;
|
|
1811
|
+
completeAuth?(request: CompleteAuthRequest): Promise<IntegrationConnection> | IntegrationConnection;
|
|
1812
|
+
invokeAction(connection: IntegrationConnection, request: IntegrationActionRequest): Promise<IntegrationActionResult> | IntegrationActionResult;
|
|
1813
|
+
subscribeTrigger?(connection: IntegrationConnection, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription> | IntegrationTriggerSubscription;
|
|
1814
|
+
unsubscribeTrigger?(subscriptionId: string): Promise<void> | void;
|
|
1815
|
+
normalizeTriggerEvent?(raw: unknown): Promise<IntegrationTriggerEvent> | IntegrationTriggerEvent;
|
|
1816
|
+
}
|
|
1817
|
+
interface IntegrationConnectionStore {
|
|
1818
|
+
get(connectionId: string): Promise<IntegrationConnection | undefined> | IntegrationConnection | undefined;
|
|
1819
|
+
put(connection: IntegrationConnection): Promise<void> | void;
|
|
1820
|
+
listByOwner(owner: IntegrationActor): Promise<IntegrationConnection[]> | IntegrationConnection[];
|
|
1821
|
+
delete?(connectionId: string): Promise<void> | void;
|
|
1822
|
+
}
|
|
1823
|
+
interface IssueCapabilityRequest {
|
|
1824
|
+
subject: IntegrationActor;
|
|
1825
|
+
connectionId: string;
|
|
1826
|
+
scopes: string[];
|
|
1827
|
+
allowedActions: string[];
|
|
1828
|
+
ttlMs: number;
|
|
1829
|
+
metadata?: Record<string, unknown>;
|
|
1830
|
+
}
|
|
1831
|
+
interface IntegrationCapability {
|
|
1832
|
+
id: string;
|
|
1833
|
+
subject: IntegrationActor;
|
|
1834
|
+
connectionId: string;
|
|
1835
|
+
scopes: string[];
|
|
1836
|
+
allowedActions: string[];
|
|
1837
|
+
issuedAt: string;
|
|
1838
|
+
expiresAt: string;
|
|
1839
|
+
metadata?: Record<string, unknown>;
|
|
1840
|
+
}
|
|
1841
|
+
interface IssuedIntegrationCapability {
|
|
1842
|
+
capability: IntegrationCapability;
|
|
1843
|
+
token: string;
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Wraps every action invocation with cross-cutting discipline (idempotency,
|
|
1847
|
+
* conflict detection, rate-limiting, audit logging). Optional. When set on
|
|
1848
|
+
* the hub, runs BEFORE provider.invokeAction; can short-circuit (return a
|
|
1849
|
+
* result directly) or pass through (call `proceed()` to invoke the provider).
|
|
1850
|
+
*
|
|
1851
|
+
* Why this hook exists: production deployments need conflict-resolution
|
|
1852
|
+
* guarantees that span every provider, gateway, and webhook receiver. The
|
|
1853
|
+
* canonical implementation is a "MutationGuard" that:
|
|
1854
|
+
* 1. Short-circuits on a known idempotency key (returns recorded response).
|
|
1855
|
+
* 2. Refuses same-key-different-args (drift detection).
|
|
1856
|
+
* 3. Wraps `proceed()` and audit-logs the outcome.
|
|
1857
|
+
* 4. Translates upstream conflict signals into a structured result with
|
|
1858
|
+
* alternatives the agent can act on.
|
|
1859
|
+
*
|
|
1860
|
+
* Implementations live in consumers (every product has different
|
|
1861
|
+
* persistence + telemetry needs); this interface is the contract.
|
|
1862
|
+
*/
|
|
1863
|
+
interface IntegrationActionGuard {
|
|
1864
|
+
/** Wrap an invokeAction call. Implementations MUST call `proceed()` to
|
|
1865
|
+
* invoke the underlying provider unless they're returning a cached or
|
|
1866
|
+
* short-circuited result.
|
|
1867
|
+
*
|
|
1868
|
+
* @param ctx connection + request the hub is about to dispatch
|
|
1869
|
+
* @param proceed call to invoke the wrapped provider; returns the
|
|
1870
|
+
* underlying IntegrationActionResult
|
|
1871
|
+
* @returns the result the hub should return to the caller
|
|
1872
|
+
*/
|
|
1873
|
+
invokeAction(ctx: IntegrationGuardContext, proceed: () => Promise<IntegrationActionResult>): Promise<IntegrationActionResult>;
|
|
1874
|
+
}
|
|
1875
|
+
interface IntegrationGuardContext {
|
|
1876
|
+
connection: IntegrationConnection;
|
|
1877
|
+
request: IntegrationActionRequest;
|
|
1878
|
+
/** The action descriptor from the connector manifest, if discovered. */
|
|
1879
|
+
action?: IntegrationConnectorAction;
|
|
1880
|
+
}
|
|
1881
|
+
type IntegrationPolicyDecision = {
|
|
1882
|
+
decision: 'allow';
|
|
1883
|
+
reason: string;
|
|
1884
|
+
metadata?: Record<string, unknown>;
|
|
1885
|
+
} | {
|
|
1886
|
+
decision: 'require_approval';
|
|
1887
|
+
reason: string;
|
|
1888
|
+
approval: IntegrationApprovalRequest;
|
|
1889
|
+
metadata?: Record<string, unknown>;
|
|
1890
|
+
} | {
|
|
1891
|
+
decision: 'deny';
|
|
1892
|
+
reason: string;
|
|
1893
|
+
metadata?: Record<string, unknown>;
|
|
1894
|
+
};
|
|
1895
|
+
interface IntegrationApprovalRequest {
|
|
1896
|
+
id: string;
|
|
1897
|
+
connectionId: string;
|
|
1898
|
+
providerId: string;
|
|
1899
|
+
connectorId: string;
|
|
1900
|
+
action: string;
|
|
1901
|
+
actor: IntegrationActor;
|
|
1902
|
+
risk: IntegrationActionRisk;
|
|
1903
|
+
dataClass: IntegrationDataClass;
|
|
1904
|
+
reason: string;
|
|
1905
|
+
requestedAt: string;
|
|
1906
|
+
inputPreview?: unknown;
|
|
1907
|
+
metadata?: Record<string, unknown>;
|
|
1908
|
+
}
|
|
1909
|
+
interface IntegrationPolicyEngine {
|
|
1910
|
+
decide(ctx: IntegrationGuardContext & {
|
|
1911
|
+
subject: IntegrationActor;
|
|
1912
|
+
}): Promise<IntegrationPolicyDecision> | IntegrationPolicyDecision;
|
|
1913
|
+
}
|
|
1914
|
+
interface IntegrationHubOptions {
|
|
1915
|
+
providers: IntegrationProvider[];
|
|
1916
|
+
store: IntegrationConnectionStore;
|
|
1917
|
+
capabilitySecret: string;
|
|
1918
|
+
/** Optional cross-cutting guard. If provided, every invokeAction call
|
|
1919
|
+
* passes through it before reaching the provider. See {@link IntegrationActionGuard}. */
|
|
1920
|
+
guard?: IntegrationActionGuard;
|
|
1921
|
+
/** Optional policy engine. Runs after capability/scope checks and before
|
|
1922
|
+
* provider invocation. Use it to pause writes, deny destructive actions,
|
|
1923
|
+
* or apply tenant-specific allow rules. */
|
|
1924
|
+
policy?: IntegrationPolicyEngine;
|
|
1925
|
+
now?: () => Date;
|
|
1926
|
+
}
|
|
1927
|
+
interface HttpIntegrationProviderOptions {
|
|
1928
|
+
id: string;
|
|
1929
|
+
kind?: IntegrationProviderKind;
|
|
1930
|
+
connectors: IntegrationConnector[];
|
|
1931
|
+
baseUrl: string;
|
|
1932
|
+
bearer?: string;
|
|
1933
|
+
fetchImpl?: typeof fetch;
|
|
1934
|
+
}
|
|
1935
|
+
interface InvokeWithCapabilityRequest extends Omit<IntegrationActionRequest, 'connectionId'> {
|
|
1936
|
+
connectionId?: never;
|
|
1937
|
+
}
|
|
1938
|
+
declare class IntegrationError extends Error {
|
|
1939
|
+
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';
|
|
1940
|
+
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');
|
|
1941
|
+
}
|
|
1942
|
+
declare class InMemoryConnectionStore implements IntegrationConnectionStore {
|
|
1943
|
+
private readonly connections;
|
|
1944
|
+
get(connectionId: string): IntegrationConnection | undefined;
|
|
1945
|
+
put(connection: IntegrationConnection): void;
|
|
1946
|
+
listByOwner(owner: IntegrationActor): IntegrationConnection[];
|
|
1947
|
+
delete(connectionId: string): void;
|
|
1948
|
+
}
|
|
1949
|
+
declare class IntegrationHub {
|
|
1950
|
+
private readonly providers;
|
|
1951
|
+
private readonly store;
|
|
1952
|
+
private readonly capabilitySecret;
|
|
1953
|
+
private readonly guard;
|
|
1954
|
+
private readonly policy;
|
|
1955
|
+
private readonly now;
|
|
1956
|
+
constructor(options: IntegrationHubOptions);
|
|
1957
|
+
listConnectors(): Promise<IntegrationConnector[]>;
|
|
1958
|
+
listRegistry(options?: ComposeIntegrationRegistryOptions): Promise<IntegrationRegistry>;
|
|
1959
|
+
startAuth(providerId: string, request: StartAuthRequest): Promise<StartAuthResult>;
|
|
1960
|
+
completeAuth(providerId: string, request: CompleteAuthRequest): Promise<IntegrationConnection>;
|
|
1961
|
+
upsertConnection(connection: IntegrationConnection): Promise<IntegrationConnection>;
|
|
1962
|
+
listConnections(owner: IntegrationActor): Promise<IntegrationConnection[]>;
|
|
1963
|
+
issueCapability(request: IssueCapabilityRequest): Promise<IssuedIntegrationCapability>;
|
|
1964
|
+
verifyCapability(token: string): IntegrationCapability;
|
|
1965
|
+
invokeWithCapability(token: string, request: InvokeWithCapabilityRequest): Promise<IntegrationActionResult>;
|
|
1966
|
+
subscribeTrigger(connectionId: string, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription>;
|
|
1967
|
+
private requireProvider;
|
|
1968
|
+
private requireConnector;
|
|
1969
|
+
private requireConnection;
|
|
1970
|
+
private assertConnectionActive;
|
|
1971
|
+
}
|
|
1972
|
+
declare function sanitizeConnection(connection: IntegrationConnection): Record<string, unknown>;
|
|
1973
|
+
declare function createMockIntegrationProvider(options?: {
|
|
1974
|
+
id?: string;
|
|
1975
|
+
connectors?: IntegrationConnector[];
|
|
1976
|
+
onInvoke?: (connection: IntegrationConnection, request: IntegrationActionRequest) => IntegrationActionResult | Promise<IntegrationActionResult>;
|
|
1977
|
+
}): IntegrationProvider;
|
|
1978
|
+
declare function createHttpIntegrationProvider(options: HttpIntegrationProviderOptions): IntegrationProvider;
|
|
1979
|
+
declare function signCapability(capability: IntegrationCapability, secret: string): string;
|
|
1980
|
+
declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
|
|
1981
|
+
|
|
1982
|
+
export { INTEGRATION_FAMILIES as $, type TangleCatalogRuntimeHandlerOptions as A, type TangleCatalogRuntimeHttpRequest as B, type TangleCatalogRuntimeHttpResponse as C, type ComposeIntegrationRegistryOptions, type TangleCatalogRuntimeInvocation as D, type TangleCatalogRuntimeModuleAction as E, type TangleCatalogRuntimePackageCoverageOptions as F, type TangleCatalogRuntimePackageCoverageRow as G, auditTangleCatalogRuntimePackages as H, type IntegrationToolDefinition as I, type IntegrationCatalogSource, type IntegrationRegistry, type IntegrationRegistryConflict, type IntegrationRegistryEntry, type IntegrationRegistrySourceRef, type IntegrationRegistrySummary, type IntegrationSupportTier, createTangleCatalogCredentialAuthResolver as J, createTangleCatalogHttpAuthResolver as K, createTangleCatalogInstalledPackageExecutor as L, type McpToolDefinition as M, createTangleCatalogRuntimeHandler as N, signTangleCatalogRuntimeRequest as O, tangleCatalogAuthValue as P, verifyTangleCatalogRuntimeSignature as Q, type ApiKeyAuthSpec as R, type ConsoleStep as S, TANGLE_CATALOG_RUNTIME_SIGNATURE_HEADER as T, type CredentialFieldSpec as U, type CredentialValidationInput as V, type CredentialValidationResult as W, type CustomAuthSpec as X, type HealthcheckPlan as Y, type HealthcheckSpec as Z, type HmacAuthSpec as _, type IntegrationToolSearchFilters as a, type HttpIntegrationProviderOptions as a$, type IntegrationAuthMode as a0, type IntegrationAuthSpec as a1, type IntegrationFamilyId as a2, type IntegrationFamilySpec as a3, type IntegrationLifecycleSpec as a4, type IntegrationPlannerHints as a5, type IntegrationSetupSpec as a6, type IntegrationSpec as a7, type IntegrationSpecStatus as a8, type IntegrationSpecValidationIssue as a9, ACTIVEPIECES_PUBLIC_CATALOG_URL as aA, ACTIVEPIECES_RUNTIME_SIGNATURE_HEADER as aB, type ActivepiecesCatalogAuthField as aC, type ActivepiecesCatalogEntry as aD, type ActivepiecesExecutorInvocation as aE, type ActivepiecesExecutorProviderOptions as aF, type ActivepiecesHttpExecutorOptions as aG, type ActivepiecesPieceOverride as aH, type ActivepiecesRuntimeRequest as aI, ApprovalBackedPolicyEngine as aJ, type ApprovalBackedPolicyOptions as aK, CANONICAL_INTEGRATION_ACTIONS as aL, type CanonicalIntegrationActionId as aM, type CanonicalLaunchConnectorOptions as aN, type CatalogExecutorInvocation as aO, type CatalogExecutorProviderOptions as aP, type CompleteAuthRequest as aQ, type ConnectionCredentialResolverOptions as aR, type ConnectorAdapterProviderOptions as aS, type ConsentSummary as aT, DEFAULT_INTEGRATION_BRIDGE_ENV as aU, DefaultIntegrationActionGuard as aV, type GatewayCatalogAction as aW, type GatewayCatalogEntry as aX, type GatewayCatalogProviderOptions as aY, type GatewayCatalogTrigger as aZ, type GraphqlOperationSpec as a_, type IntegrationSpecValidationResult as aa, type NoneAuthSpec as ab, type NormalizedPermission as ac, type OAuth2AuthSpec as ad, type PermissionDescriptor as ae, type PostSetupCheck as af, type Quirk as ag, type RenderSpecOptions as ah, type RenderedConsoleStep as ai, type ScopeDescriptor as aj, assertValidIntegrationSpec as ak, buildHealthcheckPlan as al, consoleStepsToText as am, getIntegrationFamily as an, getIntegrationSpec as ao, integrationSpecToConnector as ap, listExecutableIntegrationSpecs as aq, listIntegrationSpecs as ar, renderAgentToolDescription as as, renderConsoleSteps as at, renderRunbookMarkdown as au, specAuthToConnectorAuth as av, validateCredentialFormat as aw, validateCredentialSet as ax, validateIntegrationSpec as ay, ACTIVEPIECES_OVERRIDES as az, type IntegrationToolSearchResult as b, type IntegrationRateLimiter as b$, type ImportCatalogOptions as b0, InMemoryConnectionStore as b1, InMemoryIntegrationApprovalStore as b2, InMemoryIntegrationAuditStore as b3, InMemoryIntegrationEventStore as b4, InMemoryIntegrationHealthcheckStore as b5, InMemoryIntegrationIdempotencyStore as b6, InMemoryIntegrationSecretStore as b7, InMemoryIntegrationWorkflowStore as b8, type InferIntegrationRequirementsOptions as b9, type IntegrationConnectorAction as bA, type IntegrationConnectorCategory as bB, type IntegrationConnectorTrigger as bC, type IntegrationCoveragePriority as bD, type IntegrationCoverageSpec as bE, type IntegrationDataClass as bF, IntegrationError as bG, type IntegrationErrorCode as bH, type IntegrationEventStore as bI, type IntegrationGuardContext as bJ, type IntegrationHealthcheckCheck as bK, type IntegrationHealthcheckResult as bL, type IntegrationHealthcheckStatus as bM, type IntegrationHealthcheckStore as bN, IntegrationHub as bO, type IntegrationHubOptions as bP, type IntegrationIdempotencyRecord as bQ, type IntegrationIdempotencyStore as bR, type IntegrationInvocationEnvelope as bS, type IntegrationInvocationEnvelopeValidationOptions as bT, type IntegrationPolicyDecision as bU, type IntegrationPolicyEffect as bV, type IntegrationPolicyEngine as bW, type IntegrationPolicyRule as bX, type IntegrationProvider as bY, type IntegrationProviderKind as bZ, type IntegrationRateLimitDecision as b_, type InstalledIntegrationWorkflow as ba, type IntegrationActionGuard as bb, type IntegrationActionPack as bc, type IntegrationActionRequest as bd, type IntegrationActionResult as be, type IntegrationActionRisk as bf, type IntegrationActor as bg, type IntegrationApprovalFilter as bh, type IntegrationApprovalRecord as bi, type IntegrationApprovalRequest as bj, type IntegrationApprovalResolution as bk, type IntegrationApprovalStatus as bl, type IntegrationApprovalStore as bm, type IntegrationAuditEvent as bn, type IntegrationAuditEventType as bo, type IntegrationAuditFilter as bp, type IntegrationAuditSink as bq, type IntegrationAuditStore as br, type IntegrationBridgePayload as bs, type IntegrationBridgeToolBinding as bt, type IntegrationCapability as bu, buildDefaultIntegrationRegistry, type IntegrationCatalogFreshnessOptions as bv, type IntegrationCatalogFreshnessResult as bw, type IntegrationConnection as bx, type IntegrationConnectionStore as by, type IntegrationConnector as bz, buildIntegrationToolCatalog as c, auditIntegrationCatalogFreshness as c$, IntegrationRuntimeError as c0, IntegrationSandboxHost as c1, type IntegrationSandboxHostHub as c2, type IntegrationSandboxHostOptions as c3, type IntegrationSecretStore as c4, type IntegrationTriggerEvent as c5, type IntegrationTriggerSubscription as c6, type IntegrationUserAction as c7, type IntegrationWebhookReceiverResult as c8, type IntegrationWorkflowDefinition as c9, type StaticIntegrationPolicyOptions as cA, type StoredIntegrationEvent as cB, TANGLE_INTEGRATIONS_CATALOG_PROVIDER_ID as cC, TANGLE_INTEGRATIONS_CATALOG_SOURCE as cD, type TangleCatalogExecutorInvocation as cE, type TangleCatalogExecutorProviderOptions as cF, type TangleCatalogHttpExecutorInvocation as cG, type TangleCatalogHttpExecutorOptions as cH, type TangleCatalogRuntimeActionRequest as cI, type TangleCatalogRuntimeNodeServerOptions as cJ, type TangleCatalogRuntimePackageManifest as cK, type TangleCatalogRuntimePackageManifestOptions as cL, type TangleCatalogRuntimePiece as cM, type TangleCatalogRuntimeRequest as cN, type TangleCatalogTriggerInvocation as cO, type TangleIntegrationCatalogEntry as cP, type TangleIntegrationCatalogFreshnessOptions as cQ, type TangleIntegrationCatalogFreshnessResult as cR, type TangleIntegrationContract as cS, type TangleIntegrationContractStatus as cT, type TangleIntegrationImplementationKind as cU, type TangleIntegrationInvokeInput as cV, type TangleIntegrationInvokeResult as cW, TangleIntegrationsClient as cX, type TangleIntegrationsClientOptions as cY, adapterManifestsToConnectors as cZ, assertValidIntegrationManifest as c_, IntegrationWorkflowRuntime as ca, canonicalConnectorId, type IntegrationWorkflowRuntimeHub as cb, type IntegrationWorkflowRuntimeOptions as cc, type IntegrationWorkflowStore as cd, type InvokeWithCapabilityRequest as ce, type IssueCapabilityRequest as cf, type IssuedIntegrationCapability as cg, type ManifestValidationIssue as ch, type ManifestValidationResult as ci, type McpCatalog as cj, type McpCatalogTool as ck, type MissingRequirementExplanation as cl, type NormalizedIntegrationError as cm, type NormalizedIntegrationResult as cn, type OpenApiDocument as co, composeIntegrationRegistry, type OpenApiOperation as cp, PROVIDER_PASSTHROUGH_ACTION as cq, type PlatformIntegrationPolicyPresetOptions as cr, type ProviderHttpRequestInput as cs, type ProviderPassthroughPolicy as ct, type RenderConsentOptions as cu, type SecretRef as cv, type StartAuthRequest as cw, type StartAuthResult as cx, type StartedTangleCatalogRuntimeNodeServer as cy, StaticIntegrationPolicyEngine as cz, InMemoryIntegrationGrantStore as d, redactIntegrationBridgePayload as d$, auditTangleIntegrationCatalogFreshness as d0, buildActivepiecesConnectors as d1, buildActivepiecesRuntimeRequest as d2, buildApprovalRequest as d3, buildCanonicalLaunchConnectors as d4, buildIntegrationBridgeEnvironment as d5, buildIntegrationBridgePayload as d6, buildIntegrationCoverageConnectors as d7, buildIntegrationInvocationEnvelope as d8, buildTangleCatalogRuntimePackageManifest as d9, decodeIntegrationBridgePayload as dA, dispatchIntegrationInvocation as dB, encodeIntegrationBridgePayload as dC, explainMissingRequirements as dD, extractActivepiecesPublicPieceCount as dE, extractExternalCatalogPublicCount as dF, getActivepiecesOverride as dG, healthcheckRequest as dH, importGraphqlConnector as dI, importMcpConnector as dJ, importOpenApiConnector as dK, inferIntegrationManifestFromTools as dL, integrationCoverageChecklistMarkdown as dM, invocationRequestFromEnvelope as dN, listActivepiecesCatalogEntries as dO, listIntegrationCoverageSpecs as dP, listTangleIntegrationCatalogEntries as dQ, listTangleIntegrationCatalogRuntimePackages as dR, listTangleIntegrationContracts as dS, manifestToConnector as dT, normalizeGatewayCatalog as dU, normalizeIntegrationError as dV, normalizeIntegrationResult as dW, parseIntegrationBridgeEnvironment as dX, receiveIntegrationWebhook as dY, redactApprovalRequest as dZ, redactCapability as d_, buildTangleCatalogRuntimeRequest as da, buildTangleIntegrationCatalogConnectors as db, calendarExercisePlannerManifest as dc, canonicalActionConnectorId as dd, createActivepiecesExecutorProvider as de, createActivepiecesHttpExecutor as df, createApprovalBackedPolicyEngine as dg, createAuditingActionGuard as dh, createCatalogExecutorProvider as di, createConnectionCredentialResolver as dj, createConnectorAdapterCatalogSource as dk, createConnectorAdapterProvider as dl, createCredentialBackedAdapterProvider as dm, createDefaultIntegrationActionGuard as dn, 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, type IntegrationCapabilityBinding as e, redactInvocationEnvelope as e0, renderApprovalCopy as e1, renderConsentSummary as e2, renderTangleCatalogRuntimePnpmAddCommand as e3, resolveConnectionCredentials as e4, resolveIntegrationApproval as e5, revokeConnection as e6, runIntegrationHealthcheck as e7, runIntegrationHealthchecks as e8, sanitizeAuditConnection as e9, sanitizeConnection as ea, signActivepiecesRuntimeRequest as eb, signCapability as ec, startTangleCatalogRuntimeNodeServer as ed, statusForCode as ee, storedEventToTriggerEvent as ef, validateIntegrationInvocationEnvelope as eg, validateIntegrationManifest as eh, validateProviderPassthroughRequest as ei, verifyActivepiecesRuntimeSignature as ej, verifyCapabilityToken as ek, type IntegrationGrant as f, type IntegrationGrantStore as g, type IntegrationManifest as h, integrationToolName as i, inferIntegrationSupportTier, type IntegrationManifestResolution as j, type IntegrationRequirement as k, type IntegrationRequirementMode as l, type IntegrationRequirementResolution as m, type IntegrationRequirementStatus as n, IntegrationRuntime as o, parseIntegrationToolName as p, type IntegrationRuntimeHub as q, type IntegrationRuntimeOptions as r, searchIntegrationTools as s, summarizeIntegrationRegistry, toMcpTools as t, type IntegrationSandboxBundle as u, createIntegrationRuntime as v, type TangleCatalogAuthResolverOptions as w, type TangleCatalogHttpAuthResolverOptions as x, type TangleCatalogHttpAuthResolverRequest as y, type TangleCatalogInstalledPackageExecutorOptions as z };
|