@tangle-network/agent-integrations 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,908 @@
1
+ /**
2
+ * Connector primitives — the contract a concrete first-party integration
3
+ * (Google Calendar, HubSpot, Stripe, ...) implements. Lower level than the
4
+ * hub-side `IntegrationProvider` interface from `../index.ts`: a single
5
+ * `IntegrationProvider` typically wraps several connectors (e.g., a
6
+ * "first-party" provider that lists all your shipped connectors as a
7
+ * single catalog).
8
+ *
9
+ * Layering:
10
+ *
11
+ * IntegrationHub — vendor-neutral facade (../index.ts)
12
+ * ↓
13
+ * IntegrationProvider — one per vendor (Nango/Composio/first-party)
14
+ * ↓
15
+ * ConnectorAdapter (this file) — one per integration (Google Calendar, ...)
16
+ * ↓
17
+ * upstream HTTP API — vendor SDK / fetch / OAuth
18
+ *
19
+ * Three load-bearing decisions encoded here:
20
+ *
21
+ * 1. Capabilities are typed (`read` vs `mutation`). Every mutation MUST
22
+ * declare a CAS strategy. Conflict resolution is the SDK's job, not the
23
+ * connector's. `validateConnectorManifest()` rejects unsafe manifests
24
+ * before a connector is registered.
25
+ *
26
+ * 2. ConsistencyModel pins what the rest of the system can assume:
27
+ * authoritative → the source IS the truth (Calendar, payments)
28
+ * cache → we mirror with TTL and may serve stale (price list)
29
+ * advisory → informational only (FAQ doc)
30
+ * Agent planners can (and should) refuse to promise outcomes based on
31
+ * `cache`/`advisory` data without a live `authoritative` confirmation.
32
+ *
33
+ * 3. Capabilities surface to the calling agent's tool registry by
34
+ * transformation, not by hand-wiring. Adding a connector automatically
35
+ * expands the agent's toolbelt for that specific user without touching
36
+ * the prompt or runner.
37
+ */
38
+ /** Minimal JSON-schema shape used for capability arg validation. We
39
+ * intentionally don't pull `@types/json-schema` — most consumers already
40
+ * declare parameters as `Record<string, unknown>` and the
41
+ * shape is whatever the LLM SDK's structured-output expects. Keep the
42
+ * contract loose at the boundary; tighten via runtime zod where needed. */
43
+ type CapabilityParameterSchema = Record<string, unknown>;
44
+ /** What the rest of the system is allowed to assume about freshness. */
45
+ type ConsistencyModel = 'authoritative' | 'cache' | 'advisory';
46
+ /** Capability classes. `read` is safe to retry; `mutation` must go through
47
+ * MutationGuard (CAS + idempotency). `subscribe` is reserved for future
48
+ * push-driven sources (webhook callbacks) and is not yet wired. */
49
+ type CapabilityClass = 'read' | 'mutation' | 'subscribe';
50
+ /** Compare-and-swap strategy a mutation uses to detect conflicts. */
51
+ type CASStrategy =
52
+ /** Upstream returns an etag/sequence on read, accepts If-Match on write
53
+ * (Google Calendar, GitHub, GDocs revision_id). The connector returns
54
+ * 412 / Precondition Failed on conflict; the SDK maps to ResourceContention. */
55
+ 'etag-if-match'
56
+ /** Upstream guarantees exactly-once-per-key (Stripe, idempotent webhooks).
57
+ * The SDK passes the idempotency key through; no etag check. */
58
+ | 'native-idempotency'
59
+ /** No upstream concurrency control. Connector MUST do read-then-write
60
+ * and verify nothing changed in-between (best-effort). Suitable only
61
+ * for low-contention single-user resources; rejected for any
62
+ * consistencyModel='authoritative' write that may race. */
63
+ | 'optimistic-read-verify'
64
+ /** Source is not contended (e.g. logging, telemetry). Mutations are
65
+ * fire-and-forget. Marks the capability as not eligible for
66
+ * authoritative writes. */
67
+ | 'none';
68
+ interface CapabilityRead {
69
+ name: string;
70
+ class: 'read';
71
+ description: string;
72
+ /** JSON-schema for the tool args the agent passes when invoking. */
73
+ parameters: CapabilityParameterSchema;
74
+ /** Optional: declare which scopes (per the connector manifest) this
75
+ * capability requires. The capability is hidden from the agent's
76
+ * tool registry if the user's grant didn't include them. */
77
+ requiredScopes?: string[];
78
+ }
79
+ interface CapabilityMutation {
80
+ name: string;
81
+ class: 'mutation';
82
+ description: string;
83
+ parameters: CapabilityParameterSchema;
84
+ /** Mandatory: how does the connector guarantee at-most-once + conflict-detect? */
85
+ cas: CASStrategy;
86
+ /** True for capabilities that affect resources outside the calling user
87
+ * (e.g. booking against a shared calendar, charging a card). The agent's
88
+ * planner treats these specially: requires explicit caller confirmation
89
+ * before the call. */
90
+ externalEffect: boolean;
91
+ requiredScopes?: string[];
92
+ }
93
+ type Capability = CapabilityRead | CapabilityMutation;
94
+ /** OAuth2 scope catalog the user has granted us, plus arbitrary metadata
95
+ * the connector pinned at connect-time (calendar id, sheet id, webhook
96
+ * url, …). `metadata` MUST NOT contain secrets — those go in the
97
+ * encrypted credentials envelope. */
98
+ interface DataSourceMetadata {
99
+ scopes: string[];
100
+ [key: string]: unknown;
101
+ }
102
+ /** A connected, authenticated, ready-to-call data source for a project.
103
+ * Persistence shape mirrors the product's connection/source row but normalized — the
104
+ * encrypted credentials envelope is decrypted at hand-out time and held
105
+ * in memory only for the duration of the call. */
106
+ interface ResolvedDataSource {
107
+ id: string;
108
+ projectId: string;
109
+ publishedAgentId: string | null;
110
+ kind: string;
111
+ label: string;
112
+ consistencyModel: ConsistencyModel;
113
+ scopes: string[];
114
+ metadata: Record<string, unknown>;
115
+ /** Unwrapped credentials handed to the connector at call-time. Never
116
+ * persisted in this shape; never logged. */
117
+ credentials: ConnectorCredentials;
118
+ status: 'active' | 'revoked' | 'error';
119
+ }
120
+ /** Discriminated union of credential shapes. Connectors that need new
121
+ * shapes extend this union — `kind` is sealed via the tagged pattern so
122
+ * TypeScript catches an exhaustiveness gap at compile time. */
123
+ type ConnectorCredentials = {
124
+ kind: 'oauth2';
125
+ accessToken: string;
126
+ refreshToken?: string;
127
+ expiresAt?: number;
128
+ } | {
129
+ kind: 'api-key';
130
+ apiKey: string;
131
+ } | {
132
+ kind: 'hmac';
133
+ secret: string;
134
+ } | {
135
+ kind: 'none';
136
+ };
137
+ /** Result of a read capability invocation. */
138
+ interface CapabilityReadResult {
139
+ /** Free-form payload — the connector's data shape. The agent receives
140
+ * this as the tool result; planners consume it via JSON-shape contract
141
+ * declared in the capability's `parameters` (output schema). */
142
+ data: unknown;
143
+ /** Optional etag/sequence the caller can reuse for a subsequent CAS
144
+ * mutation. */
145
+ etag?: string;
146
+ /** When this read happened (UTC ms since epoch). */
147
+ fetchedAt: number;
148
+ }
149
+ /** Result of a mutation capability invocation. Either committed (with the
150
+ * resulting etag/sequence so the caller can chain mutations), or
151
+ * contended (the upstream rejected with a state mismatch — the agent
152
+ * should re-read and retry, or surface alternatives to the caller). */
153
+ type CapabilityMutationResult = {
154
+ status: 'committed';
155
+ data: unknown;
156
+ etagAfter?: string;
157
+ committedAt: number;
158
+ /** True iff this commit was returned from the idempotency store
159
+ * rather than executed against upstream. The caller can use this
160
+ * to suppress confirmation messages on retry. */
161
+ idempotentReplay: boolean;
162
+ } | {
163
+ status: 'conflict';
164
+ /** Best-effort alternative options the upstream surfaced (e.g.,
165
+ * next-available calendar slots after a booking conflict). */
166
+ alternatives: unknown[];
167
+ /** The current authoritative state, if the connector could re-read
168
+ * cheaply. */
169
+ currentState?: unknown;
170
+ message: string;
171
+ } | {
172
+ status: 'rate-limited';
173
+ /** Wall-clock ms the caller should wait before retrying. The SDK
174
+ * computes this from the bucket's refill schedule so the agent
175
+ * doesn't have to guess. */
176
+ retryAfterMs: number;
177
+ message: string;
178
+ };
179
+ /** Inputs the SDK passes into the connector's executeRead / executeMutation. */
180
+ interface ConnectorInvocation {
181
+ source: ResolvedDataSource;
182
+ capabilityName: string;
183
+ args: Record<string, unknown>;
184
+ /** Idempotency key the caller (or the SDK's defaulting policy) supplied.
185
+ * Always present at the connector boundary — the SDK manufactures one
186
+ * if the agent didn't pass one. */
187
+ idempotencyKey: string;
188
+ /** Optional caller-supplied etag the connector should send as If-Match. */
189
+ expectedEtag?: string;
190
+ /** Product/session id (if any) for forensic logging. */
191
+ callSessionId?: string;
192
+ }
193
+ /** A single inbound event extracted from a push payload. The webhook
194
+ * receiver persists one `InboundEvent` row per entry the connector returns. */
195
+ interface InboundEvent {
196
+ eventType: string;
197
+ providerEventId?: string;
198
+ payload: Record<string, unknown>;
199
+ }
200
+ /** Adapter response from an inbound-webhook dispatch. The receiver persists
201
+ * every `events[]` entry, then either honors the connector's `response`
202
+ * override (Slack `url_verification` echo, provider-specific 2xx body) or
203
+ * defaults to `{status: 200, body: {received: true, count: events.length}}`. */
204
+ interface EventHandlerResult {
205
+ events: InboundEvent[];
206
+ /** Optional: how to respond to the provider. Stripe wants 200 within
207
+ * 30s; Slack wants the challenge param echoed. */
208
+ response?: {
209
+ status: number;
210
+ body: unknown;
211
+ headers?: Record<string, string>;
212
+ };
213
+ }
214
+ /**
215
+ * Connector adapter — one per integration kind. Stateless. The SDK holds
216
+ * the persistence + crypto + mutation-guard concerns; the adapter only
217
+ * knows how to talk to its upstream.
218
+ */
219
+ interface ConnectorAdapter {
220
+ /** Manifest entry the registry uses to render UI + validate args. */
221
+ manifest: ConnectorManifest;
222
+ /** Read invocation. Required when manifest.capabilities contains reads.
223
+ * Should return whatever shape the capability declared
224
+ * in its parameters output schema. */
225
+ executeRead?(inv: ConnectorInvocation): Promise<CapabilityReadResult>;
226
+ /** Mutation invocation. Required when manifest.capabilities contains mutations.
227
+ * Throws ResourceContention on a CAS miss; throws
228
+ * any other Error for upstream failures. The MutationGuard wraps this
229
+ * with idempotency-key short-circuit + audit logging — adapters do
230
+ * NOT manage their own dedup. */
231
+ executeMutation?(inv: ConnectorInvocation): Promise<CapabilityMutationResult>;
232
+ /** Inbound webhook signature verifier. Called BEFORE handleInboundEvent.
233
+ * MUST use constant-time comparison (`crypto.timingSafeEqual`) for any
234
+ * HMAC check. The receiver returns 401 on `valid=false` without invoking
235
+ * handleInboundEvent. Optional: connectors that don't accept push events
236
+ * omit this method and the receiver returns 405 for the kind. */
237
+ verifySignature?(input: {
238
+ rawBody: string;
239
+ headers: Record<string, string | string[] | undefined>;
240
+ source: ResolvedDataSource;
241
+ }): {
242
+ valid: boolean;
243
+ reason?: string;
244
+ };
245
+ /** Inbound webhook dispatch. Called AFTER verifySignature passes. The
246
+ * adapter parses the provider payload and emits zero-or-more
247
+ * `InboundEvent` rows; the receiver persists them as one row each (modulo
248
+ * the (dataSourceId, providerEventId) dedup unique). The optional
249
+ * `response` overrides the receiver's default 200 (Slack `url_verification`
250
+ * needs to echo the challenge in the body to pass Slack's app-config check). */
251
+ handleInboundEvent?(input: {
252
+ source: ResolvedDataSource;
253
+ rawBody: string;
254
+ headers: Record<string, string | string[] | undefined>;
255
+ }): Promise<EventHandlerResult>;
256
+ /** OAuth callback handler — exchanges the auth code for tokens, returns
257
+ * the credentials envelope + scopes + metadata. Only present for
258
+ * oauth2-style adapters. */
259
+ exchangeOAuth?(input: {
260
+ code: string;
261
+ state: string;
262
+ codeVerifier: string;
263
+ redirectUri: string;
264
+ }): Promise<{
265
+ credentials: ConnectorCredentials;
266
+ scopes: string[];
267
+ metadata: Record<string, unknown>;
268
+ }>;
269
+ /** Refresh access token. Only required for oauth2 adapters with
270
+ * short-lived access tokens. */
271
+ refreshToken?(input: ConnectorCredentials): Promise<ConnectorCredentials>;
272
+ /** Health check — invoked when the user clicks "Test connection" in the
273
+ * UI. Should perform the cheapest possible read that proves the grant
274
+ * is still valid. Returns `{ok: false, reason}` rather than throwing
275
+ * for the common case (token expired, scope missing). */
276
+ test(source: ResolvedDataSource): Promise<{
277
+ ok: true;
278
+ } | {
279
+ ok: false;
280
+ reason: string;
281
+ }>;
282
+ }
283
+ /** Static manifest a connector module exports. Drives the UI catalog,
284
+ * scope display, capability discovery for the agent's tool registry. */
285
+ interface ConnectorManifest {
286
+ /** Stable kind id used as the foreign key in DataSource.kind. */
287
+ kind: string;
288
+ /** Human label shown in the UI catalog. */
289
+ displayName: string;
290
+ /** One-paragraph description shown next to the connect button. */
291
+ description: string;
292
+ /** Auth shape this connector requires. */
293
+ auth: AuthSpec;
294
+ /** Capability catalog — the agent's tool registry derives ToolDefinition
295
+ * entries from this list at request time. */
296
+ capabilities: Capability[];
297
+ /** ConsistencyModel default for this kind — overridable per DataSource
298
+ * if a particular instance is special (e.g., a user marks a sheet as
299
+ * `cache` because they refresh it nightly). */
300
+ defaultConsistencyModel: ConsistencyModel;
301
+ /** Connector category for UI grouping. */
302
+ category: 'calendar' | 'spreadsheet' | 'crm' | 'doc' | 'webhook' | 'storage' | 'comms' | 'commerce' | 'other';
303
+ /** Optional icon URL or named icon. */
304
+ icon?: string;
305
+ /** Optional per-kind rate-limit budget. The SDK enforces it inside
306
+ * `executeGuardedMutation` and the read path of `/invoke`. Omit to
307
+ * leave the connector unrestricted. */
308
+ rateLimit?: RateLimitSpec;
309
+ }
310
+ /** Token-bucket budget the SDK enforces against the connector's upstream.
311
+ * We meter on OUR side rather than letting the upstream reject so a
312
+ * chatty agent can't burn quota that's shared across customers (almost
313
+ * every OAuth client is). */
314
+ interface RateLimitSpec {
315
+ /** Max requests per window. */
316
+ requests: number;
317
+ /** Window in ms. */
318
+ windowMs: number;
319
+ /** Whether to apply across all DataSources sharing the same OAuth
320
+ * client (true; default), or per-DataSource (false). The former
321
+ * matches how upstreams meter (per-app), so almost always pick true. */
322
+ scope?: 'oauth-client' | 'data-source';
323
+ }
324
+ type AuthSpec = {
325
+ kind: 'oauth2';
326
+ /** Authorization endpoint URL. */
327
+ authorizationUrl: string;
328
+ /** Token endpoint URL. */
329
+ tokenUrl: string;
330
+ /** Scopes requested in the authorization grant. The user UI shows
331
+ * these so the customer knows what's being shared. */
332
+ scopes: string[];
333
+ /** Whether the connector supports incremental authorization (Google
334
+ * does; many don't). */
335
+ incremental?: boolean;
336
+ /** Env-var name holding the OAuth client_id. */
337
+ clientIdEnv: string;
338
+ /** Env-var name holding the OAuth client_secret. */
339
+ clientSecretEnv: string;
340
+ /** Optional extra params attached to the authorization URL (e.g.,
341
+ * Google's `access_type=offline&prompt=consent` to obtain refresh
342
+ * tokens). */
343
+ extraAuthParams?: Record<string, string>;
344
+ } | {
345
+ kind: 'api-key';
346
+ /** UI hint shown when collecting the key. */
347
+ hint: string;
348
+ } | {
349
+ kind: 'hmac';
350
+ } | {
351
+ kind: 'none';
352
+ };
353
+ /** Thrown by `executeMutation` when upstream rejects on CAS — caught and
354
+ * rewrapped by MutationGuard. */
355
+ declare class ResourceContention extends Error {
356
+ readonly alternatives: unknown[];
357
+ readonly currentState?: unknown | undefined;
358
+ readonly name = "ResourceContention";
359
+ constructor(message: string, alternatives?: unknown[], currentState?: unknown | undefined);
360
+ }
361
+ /** Thrown when the connector finds the user's grant has been revoked or
362
+ * the access token is no longer valid AND refresh failed. Surfaces to
363
+ * the UI as "Reconnect required". */
364
+ declare class CredentialsExpired extends Error {
365
+ readonly dataSourceId: string;
366
+ readonly name = "CredentialsExpired";
367
+ constructor(message: string, dataSourceId: string);
368
+ }
369
+ interface ConnectorManifestValidationIssue {
370
+ path: string;
371
+ message: string;
372
+ }
373
+ interface ConnectorManifestValidationResult {
374
+ ok: boolean;
375
+ issues: ConnectorManifestValidationIssue[];
376
+ }
377
+ /** Validate the static connector manifest before a provider registers it.
378
+ * This catches the expensive mistakes early: duplicate capability names,
379
+ * mutation capabilities without CAS, authoritative fire-and-forget writes,
380
+ * and invalid rate-limit specs. */
381
+ declare function validateConnectorManifest(manifest: ConnectorManifest): ConnectorManifestValidationResult;
382
+ declare function assertValidConnectorManifest(manifest: ConnectorManifest): void;
383
+
384
+ /**
385
+ * Generic OAuth2 helper used by every oauth-shaped connector (Google
386
+ * Calendar, Sheets, Drive, HubSpot, Salesforce, Zoom, ...).
387
+ *
388
+ * Everything PKCE-aware. Opaque-state CSRF guard. Refresh-token aware.
389
+ * No connector-specific logic lives here — adapters hand a `clientId`,
390
+ * `clientSecret`, `tokenUrl`, optional `extraAuthParams` and the rest is
391
+ * mechanical.
392
+ *
393
+ * State and code_verifier are kept in a short-TTL flow store keyed by the
394
+ * opaque `state` we round-trip through the provider. The default store is
395
+ * in-memory for local/dev and tests. Production deployments should inject a
396
+ * durable store backed by KV/Redis/D1/etc. so callbacks can land on any worker.
397
+ */
398
+ interface PendingOAuthFlow {
399
+ /** code_verifier for PKCE. */
400
+ codeVerifier: string;
401
+ /** Opaque-state value also returned in the OAuth redirect. */
402
+ state: string;
403
+ /** Project the user is connecting under. */
404
+ projectId: string;
405
+ /** Connector kind (e.g. 'google-calendar'). */
406
+ kind: string;
407
+ /** Operator-supplied label that becomes DataSource.label. */
408
+ label: string;
409
+ /** When we drop the entry. */
410
+ expiresAt: number;
411
+ /** The redirectUri we used in the start step — must match exactly on
412
+ * the callback exchange. */
413
+ redirectUri: string;
414
+ }
415
+ interface OAuthFlowStore {
416
+ put(state: string, flow: PendingOAuthFlow): Promise<void> | void;
417
+ consume(state: string): Promise<PendingOAuthFlow | undefined> | PendingOAuthFlow | undefined;
418
+ sweep?(now: number): Promise<void> | void;
419
+ clear?(): Promise<void> | void;
420
+ }
421
+ declare class InMemoryOAuthFlowStore implements OAuthFlowStore {
422
+ private readonly pendingFlows;
423
+ put(state: string, flow: PendingOAuthFlow): void;
424
+ consume(state: string): PendingOAuthFlow | undefined;
425
+ sweep(now: number): void;
426
+ clear(): void;
427
+ }
428
+ interface StartOAuthInput {
429
+ projectId: string;
430
+ kind: string;
431
+ label: string;
432
+ authorizationUrl: string;
433
+ scopes: string[];
434
+ clientId: string;
435
+ redirectUri: string;
436
+ /** Optional extra query params; Google needs `access_type=offline` and
437
+ * `prompt=consent` to issue refresh tokens reliably. */
438
+ extraAuthParams?: Record<string, string>;
439
+ /** Optional flow store. Use a durable store in distributed production
440
+ * runtimes; omitted means local in-memory storage. */
441
+ store?: OAuthFlowStore;
442
+ /** Override clock for tests. */
443
+ now?: number;
444
+ }
445
+ interface StartOAuthOutput {
446
+ /** URL the SPA should redirect the user to. */
447
+ authorizationUrl: string;
448
+ /** State token — caller stashes this in localStorage to verify on
449
+ * callback. */
450
+ state: string;
451
+ }
452
+ /** Build the authorization URL + state. SPA navigates the user there;
453
+ * user consents; provider redirects back to redirectUri with `code` +
454
+ * `state`. The caller's callback then invokes `consumePendingFlow`. */
455
+ declare function startOAuthFlow(input: StartOAuthInput): StartOAuthOutput;
456
+ /** Look up + remove the pending flow record. Throws if state is unknown
457
+ * or expired (CSRF guard / replay protection). */
458
+ declare function consumePendingFlow(state: string, store?: OAuthFlowStore): Promise<PendingOAuthFlow>;
459
+ interface ExchangeCodeInput {
460
+ tokenUrl: string;
461
+ clientId: string;
462
+ clientSecret: string;
463
+ code: string;
464
+ codeVerifier: string;
465
+ redirectUri: string;
466
+ }
467
+ interface OAuthTokens {
468
+ accessToken: string;
469
+ refreshToken?: string;
470
+ expiresIn?: number;
471
+ scope?: string;
472
+ tokenType?: string;
473
+ }
474
+ /** POST authorization code → token endpoint. Provider-agnostic; if a
475
+ * provider returns a non-standard JSON shape, the adapter wraps this
476
+ * call rather than reaching into the helper. */
477
+ declare function exchangeAuthorizationCode(input: ExchangeCodeInput): Promise<OAuthTokens>;
478
+ interface RefreshInput {
479
+ tokenUrl: string;
480
+ clientId: string;
481
+ clientSecret: string;
482
+ refreshToken: string;
483
+ }
484
+ /** Refresh an access token. Returns the new tokens — the connector layer
485
+ * is responsible for re-encrypting + persisting the envelope. */
486
+ declare function refreshAccessToken(input: RefreshInput): Promise<OAuthTokens>;
487
+ /** Test-only — drop pending flows between unit-test runs. */
488
+ declare function _resetPendingFlowsForTests(): void;
489
+
490
+ /**
491
+ * Inbound webhook signature verifiers — provider-specific HMAC schemes.
492
+ *
493
+ * Each signature scheme is a pure function:
494
+ * (rawBody: string, headers, secret, now?) → boolean
495
+ *
496
+ * Constant-time comparison via `crypto.timingSafeEqual`. Timestamps are
497
+ * checked against a configurable tolerance to bound replay risk; the default
498
+ * mirrors the upstream provider's documented window (Stripe: 5 min, Slack: 5 min).
499
+ *
500
+ * These verifiers are the building blocks for any inbound-webhook receiver
501
+ * (a route + a `verify` call + a per-event handler). They live in this
502
+ * package so every consumer of the integration substrate gets correct
503
+ * verification — not just one product reimplementing it.
504
+ */
505
+ /** Default replay-protection window. Providers commonly use 5 minutes. */
506
+ declare const DEFAULT_SIGNATURE_TOLERANCE_SECONDS: number;
507
+ interface ParsedStripeSignatureHeader {
508
+ t: number;
509
+ sigs: string[];
510
+ }
511
+ declare function parseStripeSignatureHeader(header: string): ParsedStripeSignatureHeader | null;
512
+ interface StripeVerifyOptions {
513
+ /** Replay-protection window in seconds. Default 300. */
514
+ toleranceSeconds?: number;
515
+ /** Override `now()` for tests. UTC seconds. */
516
+ now?: number;
517
+ }
518
+ /** Verify a Stripe webhook signature against the raw request body. */
519
+ declare function verifyStripeSignature(rawBody: string, signatureHeader: string, secret: string, options?: StripeVerifyOptions): boolean;
520
+ interface SlackVerifyOptions {
521
+ toleranceSeconds?: number;
522
+ now?: number;
523
+ }
524
+ declare function verifySlackSignature(rawBody: string, signatureHeader: string, timestampHeader: string, secret: string, options?: SlackVerifyOptions): boolean;
525
+ interface GenericHmacVerifyOptions {
526
+ /** sha256 (default) | sha1 | sha512 — matches the algorithm the receiver
527
+ * computed at sign time. */
528
+ algorithm?: 'sha256' | 'sha1' | 'sha512';
529
+ /** Optional prefix the receiver prepends to the signature in the header
530
+ * (e.g., `'sha256='`). Stripped before constant-time comparison. */
531
+ signaturePrefix?: string;
532
+ /** Lowercase comparison (most providers emit hex-lowercase). Default true. */
533
+ lowercaseHex?: boolean;
534
+ }
535
+ declare function verifyHmacSignature(rawBody: string, signatureHeader: string, secret: string, options?: GenericHmacVerifyOptions): boolean;
536
+ declare function firstHeader(headers: Record<string, string | string[] | undefined>, name: string): string | undefined;
537
+
538
+ /**
539
+ * Google Calendar connector — CAS reference implementation.
540
+ *
541
+ * Scopes: `https://www.googleapis.com/auth/calendar` covers list/insert/
542
+ * patch on the user's calendars. We could split read/write but for v1 the
543
+ * single scope keeps the consent screen simple; an operator who wants
544
+ * read-only-Calendar can pick a different `kind` later (`google-calendar-readonly`).
545
+ *
546
+ * The two capabilities the agent actually needs:
547
+ *
548
+ * list_availability(calendarId, timeMin, timeMax)
549
+ * → {busy: [{start, end}], events: [{id, etag, start, end, summary}]}
550
+ * Read; no CAS. Cheap (events.list).
551
+ *
552
+ * book_slot(calendarId, start, end, summary, attendees?)
553
+ * → {eventId, etag}
554
+ * Mutation. CAS by Calendar's own conflict-detection: we re-list
555
+ * events for the requested window inside the same call, and if any
556
+ * OVERLAP exists we return `conflict` with the next-3 free slots
557
+ * mined from the user's freebusy, instead of inserting.
558
+ *
559
+ * Why pre-flight read-then-insert rather than relying on If-Match:
560
+ * `events.insert` doesn't take If-Match (you can't precondition an
561
+ * insert against a non-existent resource). Calendar's own
562
+ * `freebusy.query` is the canonical conflict signal. The whole flow is:
563
+ *
564
+ * 1. freebusy.query for [start, end] on this calendarId
565
+ * 2. if busy → emit ResourceContention with next-3 free slots
566
+ * (computed by walking forward in 30-min steps until 3 free
567
+ * windows of (end-start) duration found)
568
+ * 3. else events.insert with idempotency-key as `requestId` (a Calendar
569
+ * API feature that gives us per-key dedup at upstream)
570
+ *
571
+ * Step 3's `requestId` parameter means a retry of the same idempotency
572
+ * key on the same calendar will return the original event rather than
573
+ * creating a duplicate, which composes correctly with our MutationGuard's
574
+ * idempotency record (which short-circuits before ever hitting upstream
575
+ * on the second call). Defense-in-depth.
576
+ */
577
+
578
+ /** OAuth client config the factory closes over. Caller resolves these
579
+ * at construction time (env, DB, secret manager — package doesn't care). */
580
+ interface GoogleCalendarOptions {
581
+ clientId: string;
582
+ clientSecret: string;
583
+ }
584
+ declare function googleCalendar(opts: GoogleCalendarOptions): ConnectorAdapter;
585
+
586
+ /**
587
+ * Google Sheets connector — live KB source + writable rows.
588
+ *
589
+ * The flagship for the "agent reads from a live spreadsheet" UX. The
590
+ * customer points the connection at a Sheet (spreadsheetId + sheetName +
591
+ * headerRow). We expose:
592
+ *
593
+ * list_rows(filter?, limit?)
594
+ * → {rows: [{...header→cell}], nextCursor?}
595
+ * Cheap; just spreadsheets.values.get with the configured range.
596
+ *
597
+ * query_rows(predicate)
598
+ * → same shape as list_rows but with a structured filter (k=v pairs
599
+ * ANDed together). Simple and explainable; no SQL.
600
+ *
601
+ * update_row(rowKey, patch)
602
+ * → {row: {...header→cell}, updatedRange}
603
+ * Mutation. CAS via Sheets' spreadsheets.values.update + a
604
+ * pre-flight read of the row's revisionId-equivalent hash. Sheets
605
+ * doesn't expose a per-row etag, so we synthesize one — see
606
+ * `rowFingerprint`. If the fingerprint doesn't match what the agent
607
+ * last read, we surface ResourceContention with the current row in
608
+ * `currentState`.
609
+ *
610
+ * KB binding: when a Sheet is `consistencyModel: 'cache'` (the default
611
+ * for spreadsheets — they're slow-moving), the system also indexes the
612
+ * rows as KB chunks. The KB build pipeline calls `list_rows` and emits
613
+ * one markdown page per row; on a connector-level "refresh" event the
614
+ * agent's KB rebuilds.
615
+ */
616
+
617
+ /** OAuth client config the factory closes over. Caller resolves these
618
+ * at construction time (env, DB, secret manager — package doesn't care). */
619
+ interface GoogleSheetsOptions {
620
+ clientId: string;
621
+ clientSecret: string;
622
+ }
623
+ declare function googleSheets(opts: GoogleSheetsOptions): ConnectorAdapter;
624
+
625
+ /**
626
+ * Microsoft Graph Calendar connector — the Outlook half of the
627
+ * voice-agent's "book me a slot" surface.
628
+ *
629
+ * Mirrors the Google Calendar pattern almost line-for-line, with two
630
+ * upstream-specific quirks worth calling out:
631
+ *
632
+ * 1. Graph exposes `@odata.etag` on every event resource AND honors
633
+ * `If-Match` on `events.patch` / `events.delete`. So unlike Calendar
634
+ * (insert can't be preconditioned against a non-existent resource),
635
+ * we DO get real etag CAS for updates after the booking. We still
636
+ * use the freebusy pre-flight for the create path, because the
637
+ * "two callers grab the same slot" race happens before any event
638
+ * exists.
639
+ *
640
+ * 2. `getSchedule` is the Graph equivalent of `freeBusy.query`. Same
641
+ * shape: send `[start, end]` plus the calendar's email/UPN, get
642
+ * back a `scheduleItems` list of busy windows.
643
+ *
644
+ * Why the same flow ports cleanly: the conflict mode is identical
645
+ * ("did someone else grab this slot between read and write?"). The
646
+ * mechanism — pre-flight read + idempotent insert — composes regardless
647
+ * of whether upstream gives us a request-id dedup feature. Graph does
648
+ * not have a `requestId` analogue on `events.create`, so we rely
649
+ * exclusively on MutationGuard's idempotency-key short-circuit ABOVE
650
+ * the connector. That layer prevents duplicate inserts on retry.
651
+ */
652
+
653
+ /** OAuth client config the factory closes over. Caller resolves these
654
+ * at construction time (env, DB, secret manager — package doesn't care). */
655
+ interface MicrosoftCalendarOptions {
656
+ clientId: string;
657
+ clientSecret: string;
658
+ }
659
+ declare function microsoftCalendar(opts: MicrosoftCalendarOptions): ConnectorAdapter;
660
+
661
+ /**
662
+ * HubSpot CRM connector — three load-bearing capabilities, picked to
663
+ * cover the voice-agent's CRM hot path without trying to swallow all of
664
+ * HubSpot's surface in v1.
665
+ *
666
+ * find_contact(email)
667
+ * → {contact: {id, properties}} | {found: false}
668
+ * POST /crm/v3/objects/contacts/search with an email-equality filter.
669
+ * Cheap, idempotent, no CAS needed (read).
670
+ *
671
+ * upsert_contact(email, properties)
672
+ * → {contactId, created}
673
+ * Mutation. CAS strategy = native-idempotency, BUT: HubSpot's
674
+ * `idempotencyKey` query param is ONLY available on the v3 *batch*
675
+ * endpoints (`/crm/v3/objects/contacts/batch/upsert`). The
676
+ * single-record endpoints don't honor it. We use the batch endpoint
677
+ * with a single-element array to get native idempotency on retry.
678
+ *
679
+ * create_note(contactId, body)
680
+ * → {noteId}
681
+ * Mutation that logs a note engagement on a contact and associates
682
+ * it. Notes are append-only — there's no conflict to detect — so we
683
+ * use native-idempotency via the same batch trick on
684
+ * `/crm/v3/objects/notes/batch/create`.
685
+ *
686
+ * Why three and not thirty: the agent's leverage on HubSpot is
687
+ * "remember who I just spoke to". `find_contact` lets the agent address
688
+ * a returning caller by name; `upsert_contact` captures a new one
689
+ * without duplicates; `create_note` writes the call's outcome as a CRM
690
+ * activity. Anything beyond these (deals, tickets, lists) lives in
691
+ * Tier-2 specific kinds — keeping the manifest tight keeps the agent's
692
+ * tool registry comprehensible.
693
+ */
694
+
695
+ /** OAuth client config the factory closes over. Caller resolves these
696
+ * at construction time (env, DB, secret manager — package doesn't care). */
697
+ interface HubSpotOptions {
698
+ clientId: string;
699
+ clientSecret: string;
700
+ }
701
+ declare function hubspot(opts: HubSpotOptions): ConnectorAdapter;
702
+
703
+ /**
704
+ * Slack connector — bot-token OAuth, three messaging-oriented capabilities.
705
+ *
706
+ * post_message(channel, text|blocks) → mutation; cas: 'none'
707
+ * lookup_user(email) → read
708
+ * list_channels(types?, limit?) → read
709
+ *
710
+ * Why `cas: 'none'` is acceptable here (and only here in this batch):
711
+ * Slack messages are advisory — we set
712
+ * `defaultConsistencyModel: 'advisory'`. The registry validator allows
713
+ * `cas: 'none'` only on non-authoritative connectors precisely so that
714
+ * append-only messaging surfaces don't have to invent fake CAS theatre.
715
+ * The agent's planner already treats `advisory` data as informational
716
+ * and does not promise outcomes based on its post results without
717
+ * a separate authoritative confirm. MutationGuard's idempotency-key
718
+ * dedup remains in force above the connector — a retry of the same
719
+ * post_message call will short-circuit before reaching Slack.
720
+ *
721
+ * Auth: standard OAuth2. Slack's `/oauth.v2.access` returns a bot
722
+ * `access_token` (`xoxb-…`) but does NOT return a refresh_token unless
723
+ * the app has rotated tokens enabled. Bot tokens are long-lived by
724
+ * default; we surface refreshToken handling but treat its absence as
725
+ * normal rather than an error.
726
+ */
727
+
728
+ /** OAuth client config the factory closes over. Caller resolves these
729
+ * at construction time (env, DB, secret manager — package doesn't care). */
730
+ interface SlackOptions {
731
+ clientId: string;
732
+ clientSecret: string;
733
+ }
734
+ declare function slack(opts: SlackOptions): ConnectorAdapter;
735
+
736
+ /**
737
+ * Notion database connector — query + page-level CRUD against a single
738
+ * connected database.
739
+ *
740
+ * query_database(filter?, pageSize?) → read
741
+ * create_page(properties) → mutation; cas: 'native-idempotency'
742
+ * update_page(pageId, properties) → mutation; cas: 'etag-if-match'
743
+ *
744
+ * CAS quirks worth flagging:
745
+ *
746
+ * 1. Notion added support for the `Idempotency-Key` HTTP header on
747
+ * mutating requests. We forward our SDK's idempotency key on
748
+ * create_page, which gives at-most-once semantics under the same
749
+ * key for ~24h. MutationGuard's record short-circuits above us;
750
+ * Notion's dedup is the second line of defense.
751
+ *
752
+ * 2. Notion does NOT expose a per-page etag the way Graph does. The
753
+ * canonical drift signal is `last_edited_time` (RFC3339). Our
754
+ * `update_page` capability accepts an `expectedLastEditedTime` arg;
755
+ * if supplied, we GET the page first and compare. Mismatch →
756
+ * ResourceContention with the current page state. Conflict-free
757
+ * callers can omit the field (last-write-wins, the Notion default).
758
+ *
759
+ * Auth: standard OAuth2. Notion's token endpoint follows RFC 6749 with
760
+ * one twist — the workspace_id and bot_id come back in the response and
761
+ * we stash them in `metadata` so the agent can address resources by
762
+ * workspace where useful.
763
+ */
764
+
765
+ /** OAuth client config the factory closes over. Caller resolves these
766
+ * at construction time (env, DB, secret manager — package doesn't care). */
767
+ interface NotionDatabaseOptions {
768
+ clientId: string;
769
+ clientSecret: string;
770
+ }
771
+ declare function notionDatabase(opts: NotionDatabaseOptions): ConnectorAdapter;
772
+
773
+ /**
774
+ * Twilio SMS connector — outbound texts + recent-message lookup. The
775
+ * agent's "send the caller a confirmation link" surface.
776
+ *
777
+ * Auth: HTTP Basic (Account SID + Auth Token). Twilio's API key auth
778
+ * also supports SID/Secret pairs; we accept either by treating the
779
+ * stored apiKey envelope as `accountSid:authToken` (or
780
+ * `accountSid:keySid:secret`) — the connector parses it at call time.
781
+ *
782
+ * send_sms(to, body)
783
+ * Mutation. CAS = native-idempotency. Twilio added the
784
+ * `Idempotency-Key` HTTP header to POST /Messages in 2024 — same
785
+ * key + same args within 24h returns the original Message resource
786
+ * instead of sending a second SMS. MutationGuard's record short-
787
+ * circuits before us; Twilio's own dedup is defense-in-depth.
788
+ *
789
+ * lookup_number(phoneNumber)
790
+ * Read. Hits /v1/PhoneNumbers/{e164} on Lookup API. Confirms the
791
+ * number is real, returns carrier info if the caller has Lookup
792
+ * enabled on their account.
793
+ *
794
+ * find_recent_messages(toOrFrom?, limit?)
795
+ * Read. Returns the most recent Messages on the account, optionally
796
+ * filtered by To/From. Useful for "did the confirmation actually
797
+ * send?" introspection inside an agent run.
798
+ */
799
+
800
+ declare const twilioSmsConnector: ConnectorAdapter;
801
+
802
+ /**
803
+ * Stripe pack connector — single connector kind packing 3 capabilities,
804
+ * validating the "connector pack" concept (one auth handshake, multiple
805
+ * related capabilities) without exploding the registry into
806
+ * `stripe-customers`, `stripe-checkout`, `stripe-invoices` triplets.
807
+ *
808
+ * find_customer(email) → read; CAS n/a
809
+ * create_invoice(customerId, items) → mutation; cas: 'native-idempotency'
810
+ * create_checkout_session(...) → mutation; cas: 'native-idempotency'
811
+ *
812
+ * Auth: API key (Stripe restricted key). Operator pastes the key into
813
+ * the Connections UI. We never see their account password / OAuth flow;
814
+ * Stripe restricted keys are the customer's responsibility (they pick
815
+ * which permissions the key carries). The kind exposes a webhook URL
816
+ * post-connect for the operator to paste into the Stripe dashboard —
817
+ * we'll wire the receiver to P-3's inbound webhook surface in a later
818
+ * commit. That URL is returned in `metadata.webhookUrl` so the UI can
819
+ * render it.
820
+ *
821
+ * Why this is the textbook example of `cas: 'native-idempotency'`:
822
+ * Stripe's `Idempotency-Key` HTTP header is THE reference implementation
823
+ * of native idempotency. Same key + same args within 24h returns the
824
+ * stored response (Stripe's words, not ours). Same key + different args
825
+ * → 400 with `idempotency_error`. We forward the SDK's idempotency key
826
+ * directly. MutationGuard short-circuits before us on retry; Stripe's
827
+ * own dedup is the second line of defense.
828
+ */
829
+
830
+ declare const stripePackConnector: ConnectorAdapter;
831
+
832
+ /**
833
+ * Universal webhook connector — the long-tail escape hatch.
834
+ *
835
+ * The user declares a target URL + a JSON-schema for the request body
836
+ * the agent should send, plus an optional shared secret. We sign every
837
+ * outbound POST with HMAC-SHA256 over `timestamp.body` and forward the
838
+ * agent's idempotency key as a header. The receiving system enforces
839
+ * its own idempotency.
840
+ *
841
+ * One adapter, two capabilities. Both arity-1 — `body` is whatever JSON
842
+ * the agent's planner constructs from the operator-defined schema (which
843
+ * lives in DataSource.metadata.requestSchema). The agent's planner reads
844
+ * that schema at request time and constructs valid args.
845
+ *
846
+ * Why one connector covers 50 systems badly and 1 system well: the agent
847
+ * gets a generic "send_event" tool that doesn't *know* what the upstream
848
+ * does with the payload. That's fine for fire-and-forget event posting
849
+ * (Zapier-style); it's wrong for booking against a calendar where you
850
+ * need conflict-resolution. So webhook's `post_event` capability is
851
+ * marked `cas: 'native-idempotency'` (we forward the key — the receiver
852
+ * MUST honor it) and `defaultConsistencyModel: 'advisory'`. Anyone
853
+ * needing real CAS uses a kind-specific connector (Calendar, Sheets, ...).
854
+ */
855
+
856
+ declare const webhookConnector: ConnectorAdapter;
857
+
858
+ /**
859
+ * Stripe inbound-webhook receiver — push-only side of a Stripe connector.
860
+ *
861
+ * The full Stripe connector (charges/customers/invoices read+mutation) is
862
+ * tracked in INTEGRATIONS.md as separate `stripe-customers` / `stripe-invoices`
863
+ * rows. This adapter only ships the inbound surface today: receive a push,
864
+ * verify the signature, persist one `InboundEvent` per Stripe event so the
865
+ * agent's runtime can react (e.g. payment_failed → outbound dunning call).
866
+ *
867
+ * Why a dedicated `kind: 'stripe'` rather than reusing the billing webhook
868
+ * at /api/billing/stripe-webhook: that route is hard-coded for OUR Stripe
869
+ * account (Builder subscription state). This connector is for the customer's
870
+ * OWN Stripe account — they paste their `whsec_*` and we listen on a
871
+ * per-DataSource URL, /api/webhooks/inbound/stripe/:dataSourceId.
872
+ *
873
+ * Signature scheme: Stripe's `t=<unix>,v1=<hmac>` header. HMAC is
874
+ * sha256(`${t}.${rawBody}`) keyed by the customer's webhook secret. We use
875
+ * `timingSafeEqual` to defeat timing oracles and bound timestamp skew at
876
+ * 5 minutes (Stripe's recommendation) to thwart replay against captured
877
+ * signatures.
878
+ */
879
+
880
+ declare const stripeWebhookReceiverConnector: ConnectorAdapter;
881
+
882
+ /**
883
+ * Slack Events API inbound receiver.
884
+ *
885
+ * Slack sends two distinct request shapes to the same webhook URL:
886
+ *
887
+ * 1. `url_verification` — a one-off handshake during app-config. The body
888
+ * contains a `challenge` string we MUST echo back as the response body
889
+ * (Slack's app-config UI fails the URL otherwise). No InboundEvent is
890
+ * persisted for this — it's an infrastructure ping, not a user event.
891
+ *
892
+ * 2. `event_callback` — every actual workspace event (message posted,
893
+ * reaction added, channel created, …). We persist one InboundEvent
894
+ * keyed by `event_id` so a Slack retry (Slack retries 3 times on any
895
+ * non-2xx) is deduped at the unique constraint, not after we've
896
+ * double-processed.
897
+ *
898
+ * Signature scheme: `v0=<hmac(sha256, "v0:<timestamp>:<rawBody>")>` keyed by
899
+ * the app's signing secret. Header `X-Slack-Request-Timestamp` carries the
900
+ * timestamp; we reject anything older than 5 minutes (Slack's recommendation)
901
+ * to bound replay risk.
902
+ */
903
+
904
+ declare const slackEventsConnector: ConnectorAdapter;
905
+
1
906
  type IntegrationProviderKind = 'first_party' | 'nango' | 'pipedream' | 'zapier' | 'activepieces' | 'executor' | 'custom';
2
907
  type IntegrationConnectorCategory = 'email' | 'calendar' | 'chat' | 'crm' | 'storage' | 'docs' | 'database' | 'webhook' | 'workflow' | 'internal' | 'other';
3
908
  type IntegrationActionRisk = 'read' | 'write' | 'destructive';
@@ -256,4 +1161,4 @@ declare function createHttpIntegrationProvider(options: HttpIntegrationProviderO
256
1161
  declare function signCapability(capability: IntegrationCapability, secret: string): string;
257
1162
  declare function verifyCapabilityToken(token: string, secret: string): IntegrationCapability;
258
1163
 
259
- export { type CompleteAuthRequest, type HttpIntegrationProviderOptions, InMemoryConnectionStore, type IntegrationActionGuard, type IntegrationActionRequest, type IntegrationActionResult, type IntegrationActionRisk, type IntegrationActor, type IntegrationCapability, type IntegrationConnection, type IntegrationConnectionStore, type IntegrationConnector, type IntegrationConnectorAction, type IntegrationConnectorCategory, type IntegrationConnectorTrigger, type IntegrationDataClass, IntegrationError, type IntegrationGuardContext, IntegrationHub, type IntegrationHubOptions, type IntegrationProvider, type IntegrationProviderKind, type IntegrationTriggerEvent, type IntegrationTriggerSubscription, type InvokeWithCapabilityRequest, type IssueCapabilityRequest, type IssuedIntegrationCapability, type SecretRef, type StartAuthRequest, type StartAuthResult, createHttpIntegrationProvider, createMockIntegrationProvider, sanitizeConnection, signCapability, verifyCapabilityToken };
1164
+ export { type AuthSpec, type CASStrategy, type Capability, type CapabilityClass, type CapabilityMutation, type CapabilityMutationResult, type CapabilityParameterSchema, type CapabilityRead, type CapabilityReadResult, type CompleteAuthRequest, type ConnectorAdapter, type ConnectorCredentials, type ConnectorInvocation, type ConnectorManifest, type ConnectorManifestValidationIssue, type ConnectorManifestValidationResult, type ConsistencyModel, CredentialsExpired, DEFAULT_SIGNATURE_TOLERANCE_SECONDS, type DataSourceMetadata, type EventHandlerResult, type ExchangeCodeInput, type GenericHmacVerifyOptions, type GoogleCalendarOptions, type GoogleSheetsOptions, type HttpIntegrationProviderOptions, type HubSpotOptions, InMemoryConnectionStore, InMemoryOAuthFlowStore, type InboundEvent, type IntegrationActionGuard, type IntegrationActionRequest, type IntegrationActionResult, type IntegrationActionRisk, type IntegrationActor, type IntegrationCapability, type IntegrationConnection, type IntegrationConnectionStore, type IntegrationConnector, type IntegrationConnectorAction, type IntegrationConnectorCategory, type IntegrationConnectorTrigger, type IntegrationDataClass, IntegrationError, type IntegrationGuardContext, IntegrationHub, type IntegrationHubOptions, type IntegrationProvider, type IntegrationProviderKind, type IntegrationTriggerEvent, type IntegrationTriggerSubscription, type InvokeWithCapabilityRequest, type IssueCapabilityRequest, type IssuedIntegrationCapability, type MicrosoftCalendarOptions, type NotionDatabaseOptions, type OAuthFlowStore, type OAuthTokens, type ParsedStripeSignatureHeader, type PendingOAuthFlow, type RateLimitSpec, type RefreshInput, type ResolvedDataSource, ResourceContention, type SecretRef, type SlackOptions, type SlackVerifyOptions, type StartAuthRequest, type StartAuthResult, type StartOAuthInput, type StartOAuthOutput, type StripeVerifyOptions, _resetPendingFlowsForTests, assertValidConnectorManifest, consumePendingFlow, createHttpIntegrationProvider, createMockIntegrationProvider, exchangeAuthorizationCode, firstHeader, googleCalendar, googleSheets, hubspot, microsoftCalendar, notionDatabase, parseStripeSignatureHeader, refreshAccessToken, sanitizeConnection, signCapability, slack, slackEventsConnector, startOAuthFlow, stripePackConnector, stripeWebhookReceiverConnector, twilioSmsConnector, validateConnectorManifest, verifyCapabilityToken, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, webhookConnector };