@tangle-network/agent-integrations 0.53.49 → 0.53.51
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/catalog.d.ts +2 -2
- package/dist/catalog.js +8 -8
- package/dist/{chunk-H5UCSRF4.js → chunk-BYTP5QJQ.js} +718 -763
- package/dist/{chunk-H5UCSRF4.js.map → chunk-BYTP5QJQ.js.map} +1 -1
- package/dist/{chunk-5UCHLQ3D.js → chunk-CJ6SZNMU.js} +18 -6
- package/dist/chunk-CJ6SZNMU.js.map +1 -0
- package/dist/{chunk-ZZA4HOBE.js → chunk-LIY4A33C.js} +2 -2
- package/dist/{chunk-W72KPXXX.js → chunk-P4YUWB77.js} +30 -1
- package/dist/chunk-P4YUWB77.js.map +1 -0
- package/dist/{chunk-GUZA3U6T.js → chunk-R4KVF4KT.js} +104 -27
- package/dist/chunk-R4KVF4KT.js.map +1 -0
- package/dist/{chunk-UI3U62H6.js → chunk-RBCF44OD.js} +2 -2
- package/dist/{chunk-ZSXRS7D7.js → chunk-VV73V64K.js} +10 -6
- package/dist/chunk-VV73V64K.js.map +1 -0
- package/dist/{chunk-KBYYTHXQ.js → chunk-W2FFWDJ7.js} +2 -2
- package/dist/connect/index.d.ts +2 -2
- package/dist/connect/index.js +2 -2
- package/dist/connectors/adapters/index.d.ts +8 -11
- package/dist/connectors/adapters/index.js +2 -2
- package/dist/connectors/index.d.ts +25 -12
- package/dist/connectors/index.js +13 -3
- package/dist/{consumer-DrLnbqYt.d.ts → consumer-48BUPeUQ.d.ts} +1 -1
- package/dist/consumer.d.ts +3 -3
- package/dist/consumer.js +2 -2
- package/dist/{core-types-D26cY5tD.d.ts → core-types-BR9Gv6hE.d.ts} +1 -1
- package/dist/coverage-catalog.d.ts +2 -2
- package/dist/{importers-CQKts3pm.d.ts → importers-0vMRe5jJ.d.ts} +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +18 -8
- package/dist/mcp.d.ts +3 -3
- package/dist/mcp.js +8 -8
- package/dist/middleware/index.d.ts +2 -2
- package/dist/middleware/index.js +2 -2
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +8 -8
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +8 -8
- package/dist/specs.d.ts +9 -2
- package/dist/specs.js +4 -4
- package/dist/{tangle-id-BCOVbWrP.d.ts → tangle-id-BRtXszIF.d.ts} +1 -1
- package/dist/{types-DpKn0frG.d.ts → types-Hy58Fb8T.d.ts} +17 -1
- package/docs/integration-execution-matrix.json +36 -91
- package/package.json +1 -1
- package/dist/chunk-5UCHLQ3D.js.map +0 -1
- package/dist/chunk-GUZA3U6T.js.map +0 -1
- package/dist/chunk-W72KPXXX.js.map +0 -1
- package/dist/chunk-ZSXRS7D7.js.map +0 -1
- /package/dist/{chunk-ZZA4HOBE.js.map → chunk-LIY4A33C.js.map} +0 -0
- /package/dist/{chunk-UI3U62H6.js.map → chunk-RBCF44OD.js.map} +0 -0
- /package/dist/{chunk-KBYYTHXQ.js.map → chunk-W2FFWDJ7.js.map} +0 -0
package/dist/specs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as IntegrationActionRisk, g as IntegrationDataClass, d as IntegrationConnectorCategory, e as IntegrationConnectorAction, G as IntegrationConnectorTrigger, b as IntegrationConnector } from './core-types-
|
|
2
|
-
import { O as OAuth2TokenClientAuthMethod } from './types-
|
|
1
|
+
import { f as IntegrationActionRisk, g as IntegrationDataClass, d as IntegrationConnectorCategory, e as IntegrationConnectorAction, G as IntegrationConnectorTrigger, b as IntegrationConnector } from './core-types-BR9Gv6hE.js';
|
|
2
|
+
import { O as OAuth2TokenClientAuthMethod, p as OAuth2UrlTemplateMetadataSpec } from './types-Hy58Fb8T.js';
|
|
3
3
|
|
|
4
4
|
type IntegrationAuthMode = 'oauth2' | 'api_key' | 'hmac' | 'none' | 'custom';
|
|
5
5
|
type IntegrationSpecStatus = 'catalog' | 'executable' | 'deprecated';
|
|
@@ -23,6 +23,8 @@ interface IntegrationSpec {
|
|
|
23
23
|
type IntegrationAuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | HmacAuthSpec | NoneAuthSpec | CustomAuthSpec;
|
|
24
24
|
interface OAuth2AuthSpec {
|
|
25
25
|
mode: 'oauth2';
|
|
26
|
+
/** OAuth grant the connection runtime must drive. */
|
|
27
|
+
grantType?: 'authorization_code' | 'client_credentials';
|
|
26
28
|
/** Authorization endpoint the connect flow sends the user to.
|
|
27
29
|
*
|
|
28
30
|
* UNDEFINED when no shipped adapter and no family default supplies one —
|
|
@@ -47,6 +49,9 @@ interface OAuth2AuthSpec {
|
|
|
47
49
|
tokenClientAuthMethod?: OAuth2TokenClientAuthMethod;
|
|
48
50
|
scopes: ScopeDescriptor[];
|
|
49
51
|
extraAuthParams?: Record<string, string>;
|
|
52
|
+
/** Rules for connection metadata that replaces complete provider roots in
|
|
53
|
+
* authorizationUrl or tokenUrl templates. */
|
|
54
|
+
urlTemplateMetadata?: Readonly<Record<string, OAuth2UrlTemplateMetadataSpec>>;
|
|
50
55
|
redirectUriTemplate: string;
|
|
51
56
|
pkce?: 'required' | 'supported' | 'unsupported';
|
|
52
57
|
}
|
|
@@ -195,6 +200,7 @@ declare function getIntegrationSpec(kind: string): IntegrationSpec | undefined;
|
|
|
195
200
|
interface ConnectorAuthSpec {
|
|
196
201
|
kind: string;
|
|
197
202
|
authKind: 'oauth2' | 'api_key' | 'none' | 'custom';
|
|
203
|
+
grantType?: 'authorization_code' | 'client_credentials';
|
|
198
204
|
/** Provider scopes to request in the authorization grant. Empty for
|
|
199
205
|
* api_key / none / custom. */
|
|
200
206
|
requestedScopes: string[];
|
|
@@ -212,6 +218,7 @@ interface ConnectorAuthSpec {
|
|
|
212
218
|
tokenClientSecretParam?: string;
|
|
213
219
|
tokenClientAuthMethod?: OAuth2TokenClientAuthMethod;
|
|
214
220
|
extraAuthParams?: Record<string, string>;
|
|
221
|
+
urlTemplateMetadata?: Readonly<Record<string, OAuth2UrlTemplateMetadataSpec>>;
|
|
215
222
|
}
|
|
216
223
|
declare function resolveConnectorAuthSpec(kind: string): ConnectorAuthSpec | undefined;
|
|
217
224
|
declare function listExecutableIntegrationSpecs(): IntegrationSpec[];
|
package/dist/specs.js
CHANGED
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
validateCredentialFormat,
|
|
17
17
|
validateCredentialSet,
|
|
18
18
|
validateIntegrationSpec
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VV73V64K.js";
|
|
20
20
|
import "./chunk-TKEVCGAI.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-CJ6SZNMU.js";
|
|
22
|
+
import "./chunk-BYTP5QJQ.js";
|
|
23
23
|
import "./chunk-XC54EOUQ.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-P4YUWB77.js";
|
|
25
25
|
import "./chunk-PZ5AY32C.js";
|
|
26
26
|
export {
|
|
27
27
|
INTEGRATION_FAMILIES,
|
|
@@ -354,6 +354,17 @@ type TokenMetadataSource = string | {
|
|
|
354
354
|
* otherwise default to `client_secret_post`, which sends both values in the
|
|
355
355
|
* form body. `client_secret_basic` sends an HTTP Basic header instead. */
|
|
356
356
|
type OAuth2TokenClientAuthMethod = 'none' | 'client_secret_post' | 'client_secret_basic';
|
|
357
|
+
interface OAuth2UrlTemplateMetadataSpec {
|
|
358
|
+
/** A complete HTTPS provider base URL, substituted for a URL template
|
|
359
|
+
* placeholder such as `{accountUrl}`. */
|
|
360
|
+
kind: 'base-url';
|
|
361
|
+
/** Exact provider roots accepted for finite regional endpoint sets. */
|
|
362
|
+
allowedBaseUrls?: readonly string[];
|
|
363
|
+
/** HTTPS hostname suffixes accepted for tenant-specific provider roots. */
|
|
364
|
+
allowedBaseUrlSuffixes?: readonly string[];
|
|
365
|
+
/** Permit a caller-selected public HTTPS root for self-hosted providers. */
|
|
366
|
+
requirePublicHttps?: boolean;
|
|
367
|
+
}
|
|
357
368
|
type OAuth2AuthSpec = {
|
|
358
369
|
kind: 'oauth2';
|
|
359
370
|
/** OAuth2 grant type. Defaults to `'authorization_code'` (the interactive
|
|
@@ -399,6 +410,11 @@ type OAuth2AuthSpec = {
|
|
|
399
410
|
* Google's `access_type=offline&prompt=consent` to obtain refresh
|
|
400
411
|
* tokens). */
|
|
401
412
|
extraAuthParams?: Record<string, string>;
|
|
413
|
+
/** Rules for metadata placeholders that represent complete provider roots.
|
|
414
|
+
* Placeholders without a rule remain single DNS labels. This distinction
|
|
415
|
+
* prevents tenant metadata from redirecting client credentials unless the
|
|
416
|
+
* connector explicitly declares the allowed provider host policy. */
|
|
417
|
+
urlTemplateMetadata?: Readonly<Record<string, OAuth2UrlTemplateMetadataSpec>>;
|
|
402
418
|
/** Non-secret headers sent to the token endpoint. Use this for provider
|
|
403
419
|
* identification headers such as Reddit's required User-Agent. The runtime
|
|
404
420
|
* always owns Authorization and Content-Type. */
|
|
@@ -521,4 +537,4 @@ interface ConnectorManifestValidationResult {
|
|
|
521
537
|
declare function validateConnectorManifest(manifest: ConnectorManifest): ConnectorManifestValidationResult;
|
|
522
538
|
declare function assertValidConnectorManifest(manifest: ConnectorManifest): void;
|
|
523
539
|
|
|
524
|
-
export { type AuthSpec as A, type ConnectorAdapter as C, type DataSourceMetadata as D, type EventHandlerResult as E, type InboundEvent as I, type OAuth2TokenClientAuthMethod as O, ProviderConfigError as P, type ResolvedDataSource as R, type TokenMetadataSource as T, type ConnectorCredentials as a, type CASStrategy as b, type Capability as c, type CapabilityClass as d, type CapabilityMutation as e, type CapabilityMutationResult as f, type CapabilityParameterSchema as g, type CapabilityRead as h, type CapabilityReadResult as i, type ConnectorInvocation as j, type ConnectorManifest as k, type ConnectorManifestValidationIssue as l, type ConnectorManifestValidationResult as m, type ConsistencyModel as n, CredentialsExpired as o, type
|
|
540
|
+
export { type AuthSpec as A, type ConnectorAdapter as C, type DataSourceMetadata as D, type EventHandlerResult as E, type InboundEvent as I, type OAuth2TokenClientAuthMethod as O, ProviderConfigError as P, type ResolvedDataSource as R, type TokenMetadataSource as T, type ConnectorCredentials as a, type CASStrategy as b, type Capability as c, type CapabilityClass as d, type CapabilityMutation as e, type CapabilityMutationResult as f, type CapabilityParameterSchema as g, type CapabilityRead as h, type CapabilityReadResult as i, type ConnectorInvocation as j, type ConnectorManifest as k, type ConnectorManifestValidationIssue as l, type ConnectorManifestValidationResult as m, type ConsistencyModel as n, CredentialsExpired as o, type OAuth2UrlTemplateMetadataSpec as p, type ProviderHttpErrorInit as q, ProviderRateLimited as r, type ProviderRateLimitedInit as s, type RateLimitSpec as t, ResourceContention as u, assertValidConnectorManifest as v, validateConnectorManifest as w };
|
|
@@ -60203,8 +60203,8 @@
|
|
|
60203
60203
|
"catalogAuth": null,
|
|
60204
60204
|
"setupAuth": {
|
|
60205
60205
|
"mode": "oauth2",
|
|
60206
|
-
"
|
|
60207
|
-
"tokenUrl": "
|
|
60206
|
+
"grantType": "client_credentials",
|
|
60207
|
+
"tokenUrl": "{restEndpoint}/identity/oauth/token",
|
|
60208
60208
|
"clientIdEnv": "MARKETO_OAUTH_CLIENT_ID",
|
|
60209
60209
|
"clientSecretEnv": "MARKETO_OAUTH_CLIENT_SECRET",
|
|
60210
60210
|
"scopeSeparator": " ",
|
|
@@ -60213,8 +60213,16 @@
|
|
|
60213
60213
|
"tokenClientSecretParam": "client_secret",
|
|
60214
60214
|
"tokenClientAuthMethod": "client_secret_post",
|
|
60215
60215
|
"scopes": [],
|
|
60216
|
+
"urlTemplateMetadata": {
|
|
60217
|
+
"restEndpoint": {
|
|
60218
|
+
"kind": "base-url",
|
|
60219
|
+
"allowedBaseUrlSuffixes": [
|
|
60220
|
+
".mktorest.com"
|
|
60221
|
+
]
|
|
60222
|
+
}
|
|
60223
|
+
},
|
|
60216
60224
|
"redirectUriTemplate": "https://{host}/api/integrations/oauth/marketo/callback",
|
|
60217
|
-
"pkce": "
|
|
60225
|
+
"pkce": "unsupported"
|
|
60218
60226
|
},
|
|
60219
60227
|
"runtimePackage": null,
|
|
60220
60228
|
"actionCount": 11,
|
|
@@ -67980,7 +67988,7 @@
|
|
|
67980
67988
|
"authorizationClientIdParam": "client_id",
|
|
67981
67989
|
"tokenClientIdParam": "client_id",
|
|
67982
67990
|
"tokenClientSecretParam": "client_secret",
|
|
67983
|
-
"tokenClientAuthMethod": "
|
|
67991
|
+
"tokenClientAuthMethod": "client_secret_basic",
|
|
67984
67992
|
"scopes": [],
|
|
67985
67993
|
"extraAuthParams": {
|
|
67986
67994
|
"owner": "user"
|
|
@@ -70532,84 +70540,13 @@
|
|
|
70532
70540
|
"category": "workflow",
|
|
70533
70541
|
"catalogAuth": null,
|
|
70534
70542
|
"setupAuth": {
|
|
70535
|
-
"mode": "
|
|
70536
|
-
"
|
|
70537
|
-
|
|
70538
|
-
|
|
70539
|
-
|
|
70540
|
-
|
|
70541
|
-
"
|
|
70542
|
-
"tokenClientIdParam": "client_id",
|
|
70543
|
-
"tokenClientSecretParam": "client_secret",
|
|
70544
|
-
"tokenClientAuthMethod": "client_secret_post",
|
|
70545
|
-
"scopes": [
|
|
70546
|
-
{
|
|
70547
|
-
"normalized": "project.read",
|
|
70548
|
-
"providerScope": "alert.read",
|
|
70549
|
-
"title": "Opsgenie read",
|
|
70550
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70551
|
-
"risk": "read",
|
|
70552
|
-
"dataClass": "private"
|
|
70553
|
-
},
|
|
70554
|
-
{
|
|
70555
|
-
"normalized": "project.write",
|
|
70556
|
-
"providerScope": "alert.write",
|
|
70557
|
-
"title": "Opsgenie write",
|
|
70558
|
-
"reason": "Create or update Opsgenie resources after policy approval.",
|
|
70559
|
-
"risk": "write",
|
|
70560
|
-
"dataClass": "private"
|
|
70561
|
-
},
|
|
70562
|
-
{
|
|
70563
|
-
"normalized": "project.read",
|
|
70564
|
-
"providerScope": "incident.read",
|
|
70565
|
-
"title": "Opsgenie read",
|
|
70566
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70567
|
-
"risk": "read",
|
|
70568
|
-
"dataClass": "private"
|
|
70569
|
-
},
|
|
70570
|
-
{
|
|
70571
|
-
"normalized": "project.write",
|
|
70572
|
-
"providerScope": "incident.write",
|
|
70573
|
-
"title": "Opsgenie write",
|
|
70574
|
-
"reason": "Create or update Opsgenie resources after policy approval.",
|
|
70575
|
-
"risk": "write",
|
|
70576
|
-
"dataClass": "private"
|
|
70577
|
-
},
|
|
70578
|
-
{
|
|
70579
|
-
"normalized": "project.read",
|
|
70580
|
-
"providerScope": "schedule.read",
|
|
70581
|
-
"title": "Opsgenie read",
|
|
70582
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70583
|
-
"risk": "read",
|
|
70584
|
-
"dataClass": "private"
|
|
70585
|
-
},
|
|
70586
|
-
{
|
|
70587
|
-
"normalized": "project.read",
|
|
70588
|
-
"providerScope": "oncall.read",
|
|
70589
|
-
"title": "Opsgenie read",
|
|
70590
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70591
|
-
"risk": "read",
|
|
70592
|
-
"dataClass": "private"
|
|
70593
|
-
},
|
|
70594
|
-
{
|
|
70595
|
-
"normalized": "project.read",
|
|
70596
|
-
"providerScope": "team.read",
|
|
70597
|
-
"title": "Opsgenie read",
|
|
70598
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70599
|
-
"risk": "read",
|
|
70600
|
-
"dataClass": "private"
|
|
70601
|
-
},
|
|
70602
|
-
{
|
|
70603
|
-
"normalized": "project.read",
|
|
70604
|
-
"providerScope": "user.read",
|
|
70605
|
-
"title": "Opsgenie read",
|
|
70606
|
-
"reason": "Read Opsgenie data for user-authorized agent workflows.",
|
|
70607
|
-
"risk": "read",
|
|
70608
|
-
"dataClass": "private"
|
|
70609
|
-
}
|
|
70610
|
-
],
|
|
70611
|
-
"redirectUriTemplate": "https://{host}/api/integrations/oauth/opsgenie/callback",
|
|
70612
|
-
"pkce": "required"
|
|
70543
|
+
"mode": "api_key",
|
|
70544
|
+
"credential": {
|
|
70545
|
+
"label": "opsgenie API key",
|
|
70546
|
+
"description": "Opsgenie API key with access to the selected alert, incident, schedule, team, and user operations.",
|
|
70547
|
+
"secret": true
|
|
70548
|
+
},
|
|
70549
|
+
"placement": "bearer"
|
|
70613
70550
|
},
|
|
70614
70551
|
"runtimePackage": null,
|
|
70615
70552
|
"actionCount": 21,
|
|
@@ -89483,8 +89420,8 @@
|
|
|
89483
89420
|
"catalogAuth": "oauth2",
|
|
89484
89421
|
"setupAuth": {
|
|
89485
89422
|
"mode": "oauth2",
|
|
89486
|
-
"authorizationUrl": "
|
|
89487
|
-
"tokenUrl": "
|
|
89423
|
+
"authorizationUrl": "{accountUrl}/oauth/authorize",
|
|
89424
|
+
"tokenUrl": "{accountUrl}/oauth/token-request",
|
|
89488
89425
|
"clientIdEnv": "SNOWFLAKE_OAUTH_CLIENT_ID",
|
|
89489
89426
|
"clientSecretEnv": "SNOWFLAKE_OAUTH_CLIENT_SECRET",
|
|
89490
89427
|
"scopeSeparator": " ",
|
|
@@ -89494,16 +89431,24 @@
|
|
|
89494
89431
|
"tokenClientAuthMethod": "client_secret_post",
|
|
89495
89432
|
"scopes": [
|
|
89496
89433
|
{
|
|
89497
|
-
"normalized": "database.
|
|
89498
|
-
"providerScope": "
|
|
89499
|
-
"title": "Snowflake
|
|
89500
|
-
"reason": "
|
|
89501
|
-
"risk": "
|
|
89434
|
+
"normalized": "database.read",
|
|
89435
|
+
"providerScope": "refresh_token",
|
|
89436
|
+
"title": "Snowflake read",
|
|
89437
|
+
"reason": "Read Snowflake data for user-authorized agent workflows.",
|
|
89438
|
+
"risk": "read",
|
|
89502
89439
|
"dataClass": "private"
|
|
89503
89440
|
}
|
|
89504
89441
|
],
|
|
89442
|
+
"urlTemplateMetadata": {
|
|
89443
|
+
"accountUrl": {
|
|
89444
|
+
"kind": "base-url",
|
|
89445
|
+
"allowedBaseUrlSuffixes": [
|
|
89446
|
+
".snowflakecomputing.com"
|
|
89447
|
+
]
|
|
89448
|
+
}
|
|
89449
|
+
},
|
|
89505
89450
|
"redirectUriTemplate": "https://{host}/api/integrations/oauth/snowflake/callback",
|
|
89506
|
-
"pkce": "
|
|
89451
|
+
"pkce": "supported"
|
|
89507
89452
|
},
|
|
89508
89453
|
"authFields": [
|
|
89509
89454
|
{
|
|
@@ -98648,7 +98593,7 @@
|
|
|
98648
98593
|
"authorizationClientIdParam": "client_id",
|
|
98649
98594
|
"tokenClientIdParam": "client_id",
|
|
98650
98595
|
"tokenClientSecretParam": "client_secret",
|
|
98651
|
-
"tokenClientAuthMethod": "
|
|
98596
|
+
"tokenClientAuthMethod": "client_secret_basic",
|
|
98652
98597
|
"scopes": [
|
|
98653
98598
|
{
|
|
98654
98599
|
"normalized": "marketing.read",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-integrations",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.51",
|
|
4
4
|
"description": "Vendor-neutral integration contracts and runtime helpers for sandbox and agent apps.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-integrations#readme",
|
|
6
6
|
"repository": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connectors/bundled-manifests.ts"],"sourcesContent":["import {\n CONNECTOR_ADAPTER_FACTORIES,\n type ConnectorAdapterFactoryDefinition,\n} from './adapters/factories.js'\nimport * as bundledAdapters from './adapters/index.js'\nimport type { ConnectorAdapter, ConnectorManifest } from './types.js'\n\n/**\n * The bundled adapter registry — the single source of truth for \"which\n * connectors does this package actually implement, and how do they really\n * authenticate\".\n *\n * This exists because the answer was previously maintained by hand in two\n * places that drifted apart: `specs/registry.ts` carried an 18-name\n * `EXECUTABLE_KINDS` set while the package shipped 530 adapters, and the\n * platform kept its own private `collectBundledAdapters()` copy. A catalog\n * that describes connectors must derive from the connectors, never restate\n * them — restating is what let QuickBooks and Xero advertise a\n * `https://example.invalid/...` authorization URL behind a live Connect\n * button.\n *\n * Manifests are static data. Factory-style adapters need client credentials\n * to *execute*, but their manifest (auth endpoints, scopes, capability list)\n * is fixed at definition time, so we instantiate them with clearly-marked\n * placeholder options purely to read that static shape. The placeholders are\n * never used to make a request — {@link listBundledAdapterManifests} returns\n * manifests, not adapters.\n */\n\n/** Placeholder marker for factory options resolved only to read a manifest. */\nconst MANIFEST_PROBE_PREFIX = 'tangle-adapter-metadata-'\n\nfunction isConnectorAdapter(value: unknown): value is ConnectorAdapter {\n if (!value || typeof value !== 'object') return false\n const manifest = (value as { manifest?: unknown }).manifest\n if (!manifest || typeof manifest !== 'object') return false\n return typeof (manifest as { kind?: unknown }).kind === 'string'\n}\n\nfunction manifestFromFactory(\n definition: ConnectorAdapterFactoryDefinition,\n): ConnectorManifest | undefined {\n const probeOptions = Object.fromEntries(\n Object.keys(definition.envMap).map((name) => [name, `${MANIFEST_PROBE_PREFIX}${name}`]),\n )\n try {\n return definition.factory(probeOptions).manifest\n } catch {\n // A factory that cannot be constructed from placeholder options cannot\n // contribute a manifest. Skipping is correct: it means the adapter is not\n // describable without real credentials, so the catalog must not claim it.\n return undefined\n }\n}\n\nlet cachedManifests: ConnectorManifest[] | undefined\nlet cachedByKind: Map<string, ConnectorManifest> | undefined\n\n/**\n * Direct adapter instances that public catalog and action hosts may register.\n *\n * Factory adapters are intentionally absent: their construction requires\n * product-owned OAuth configuration. Inbound-only adapters remain available\n * as named exports for webhook hosts, but never compete with action adapters\n * for a public connector kind.\n */\nexport function listBundledConnectorAdapters(): ConnectorAdapter[] {\n const byKind = new Map<string, ConnectorAdapter>()\n const exportByKind = new Map<string, string>()\n for (const [exportName, value] of Object.entries(bundledAdapters)) {\n if (!isConnectorAdapter(value) || value.inboundOnly) continue\n const kind = value.manifest.kind\n const existingExport = exportByKind.get(kind)\n if (existingExport) {\n throw new Error(\n `Duplicate public connector adapter kind \"${kind}\" exported by \"${existingExport}\" and \"${exportName}\".`,\n )\n }\n exportByKind.set(kind, exportName)\n byKind.set(kind, value)\n }\n return [...byKind.values()]\n}\n\nfunction buildRegistry(): Map<string, ConnectorManifest> {\n const byKind = new Map<string, ConnectorManifest>()\n for (const adapter of listBundledConnectorAdapters()) {\n byKind.set(adapter.manifest.kind, adapter.manifest)\n }\n for (const definition of CONNECTOR_ADAPTER_FACTORIES) {\n if (byKind.has(definition.kind)) continue\n const manifest = manifestFromFactory(definition)\n if (manifest) byKind.set(manifest.kind, manifest)\n }\n return byKind\n}\n\nfunction registry(): Map<string, ConnectorManifest> {\n if (!cachedByKind) cachedByKind = buildRegistry()\n return cachedByKind\n}\n\n/** Every connector manifest this package bundles, sorted by kind. */\nexport function listBundledAdapterManifests(): ConnectorManifest[] {\n if (!cachedManifests) {\n cachedManifests = [...registry().values()].sort((a, b) => a.kind.localeCompare(b.kind))\n }\n return cachedManifests\n}\n\n/** The bundled manifest for `kind`, or undefined when nothing implements it. */\nexport function getBundledAdapterManifest(kind: string): ConnectorManifest | undefined {\n return registry().get(kind)\n}\n\n/** Whether this package ships a real, executable adapter for `kind`. */\nexport function hasBundledAdapter(kind: string): boolean {\n return registry().has(kind)\n}\n\n/** Kinds this package implements. */\nexport function listBundledAdapterKinds(): string[] {\n return listBundledAdapterManifests().map((manifest) => manifest.kind)\n}\n\n/**\n * How a bundled connector really authenticates.\n *\n * `oauth2_client_credentials` is called out separately because it IS a\n * connectable mode but has no user-facing authorize step — a caller that\n * treats \"oauth2 without an authorizationUrl\" as broken would wrongly condemn\n * these machine-to-machine providers.\n */\nexport type BundledAuthMode =\n | 'oauth2'\n | 'oauth2_client_credentials'\n | 'api_key'\n | 'hmac'\n | 'none'\n\n/** The auth mode a connect flow would actually drive for this manifest,\n * resolving `one_of` through its declared `preferred` mode. */\nexport function bundledAuthMode(manifest: ConnectorManifest): BundledAuthMode | undefined {\n const auth = manifest.auth\n const effective =\n auth.kind === 'one_of'\n ? (auth.options.find((option) => option.kind === auth.preferred) ?? auth.options[0])\n : auth\n switch (effective.kind) {\n case 'oauth2':\n return effective.grantType === 'client_credentials' ? 'oauth2_client_credentials' : 'oauth2'\n case 'api-key':\n return 'api_key'\n case 'hmac':\n return 'hmac'\n case 'none':\n return 'none'\n default:\n return undefined\n }\n}\n\n/** The setup hint an api-key connector shows when collecting its credential. */\nexport function bundledApiKeyHint(manifest: ConnectorManifest): string | undefined {\n const auth = manifest.auth\n const candidates = auth.kind === 'one_of' ? auth.options : [auth]\n for (const candidate of candidates) {\n if (candidate.kind === 'api-key') return candidate.hint\n }\n return undefined\n}\n\n/** The authorization-code OAuth2 branch of a manifest's auth spec, if it has\n * one. `one_of` manifests are resolved through their `preferred` mode, which\n * is the mode a connect flow would actually drive. Returns undefined for\n * api-key/hmac/none connectors and for `client_credentials` OAuth (which has\n * no user-facing authorize step). */\nexport function bundledOAuth2Auth(manifest: ConnectorManifest):\n | {\n authorizationUrl: string\n tokenUrl: string\n scopes: string[]\n clientIdEnv: string\n clientSecretEnv?: string\n scopeSeparator: ' ' | ','\n pkce?: 'required' | 'supported' | 'unsupported'\n authorizationClientIdParam: string\n tokenClientIdParam: string\n tokenClientSecretParam: string\n tokenClientAuthMethod: 'none' | 'client_secret_post' | 'client_secret_basic'\n extraAuthParams?: Record<string, string>\n tokenRequestHeaders?: Record<string, string>\n }\n | undefined {\n const auth = manifest.auth\n const candidates =\n auth.kind === 'one_of'\n ? auth.options.filter((option) => option.kind === auth.preferred)\n : [auth]\n for (const candidate of candidates) {\n if (candidate.kind !== 'oauth2') continue\n if (candidate.grantType === 'client_credentials') continue\n if (!candidate.authorizationUrl) continue\n return {\n authorizationUrl: candidate.authorizationUrl,\n tokenUrl: candidate.tokenUrl,\n scopes: candidate.scopes,\n clientIdEnv: candidate.clientIdEnv,\n clientSecretEnv: candidate.clientSecretEnv,\n scopeSeparator: candidate.scopeSeparator ?? ' ',\n pkce: candidate.pkce,\n authorizationClientIdParam: candidate.authorizationClientIdParam ?? 'client_id',\n tokenClientIdParam: candidate.tokenClientIdParam ?? 'client_id',\n tokenClientSecretParam: candidate.tokenClientSecretParam ?? 'client_secret',\n tokenClientAuthMethod: candidate.tokenClientAuthMethod ?? 'client_secret_post',\n extraAuthParams: candidate.extraAuthParams,\n tokenRequestHeaders: candidate.tokenRequestHeaders,\n }\n }\n return undefined\n}\n"],"mappings":";;;;;;AA8BA,IAAM,wBAAwB;AAE9B,SAAS,mBAAmB,OAA2C;AACrE,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM,WAAY,MAAiC;AACnD,MAAI,CAAC,YAAY,OAAO,aAAa,SAAU,QAAO;AACtD,SAAO,OAAQ,SAAgC,SAAS;AAC1D;AAEA,SAAS,oBACP,YAC+B;AAC/B,QAAM,eAAe,OAAO;AAAA,IAC1B,OAAO,KAAK,WAAW,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,qBAAqB,GAAG,IAAI,EAAE,CAAC;AAAA,EACxF;AACA,MAAI;AACF,WAAO,WAAW,QAAQ,YAAY,EAAE;AAAA,EAC1C,QAAQ;AAIN,WAAO;AAAA,EACT;AACF;AAEA,IAAI;AACJ,IAAI;AAUG,SAAS,+BAAmD;AACjE,QAAM,SAAS,oBAAI,IAA8B;AACjD,QAAM,eAAe,oBAAI,IAAoB;AAC7C,aAAW,CAAC,YAAY,KAAK,KAAK,OAAO,QAAQ,gBAAe,GAAG;AACjE,QAAI,CAAC,mBAAmB,KAAK,KAAK,MAAM,YAAa;AACrD,UAAM,OAAO,MAAM,SAAS;AAC5B,UAAM,iBAAiB,aAAa,IAAI,IAAI;AAC5C,QAAI,gBAAgB;AAClB,YAAM,IAAI;AAAA,QACR,4CAA4C,IAAI,kBAAkB,cAAc,UAAU,UAAU;AAAA,MACtG;AAAA,IACF;AACA,iBAAa,IAAI,MAAM,UAAU;AACjC,WAAO,IAAI,MAAM,KAAK;AAAA,EACxB;AACA,SAAO,CAAC,GAAG,OAAO,OAAO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