@tangle-network/agent-integrations 0.58.0 → 0.59.1
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 +31 -0
- package/dist/{adapters-ediOgE75.js → adapters-DQ0JJ-aG.js} +6 -283
- package/dist/{adapters-ediOgE75.js.map → adapters-DQ0JJ-aG.js.map} +1 -1
- package/dist/catalog-CFvKzwVj.js +201 -0
- package/dist/catalog-CFvKzwVj.js.map +1 -0
- package/dist/catalog.js +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connectors/adapters/index.js +1 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +2 -1
- package/dist/connectors/oauth.d.ts +2 -0
- package/dist/connectors/oauth.js +282 -0
- package/dist/connectors/oauth.js.map +1 -0
- package/dist/{consumer-BC6pCUzI.d.ts → consumer-zHtoJixe.d.ts} +5 -37
- package/dist/{consumer-BC6pCUzI.d.ts.map → consumer-zHtoJixe.d.ts.map} +1 -1
- package/dist/consumer.d.ts +1 -1
- package/dist/hub-0Od2lgun.d.ts +38 -0
- package/dist/hub-0Od2lgun.d.ts.map +1 -0
- package/dist/hub-D13zPQGr.js +1004 -0
- package/dist/hub-D13zPQGr.js.map +1 -0
- package/dist/hub.d.ts +2 -0
- package/dist/hub.js +2 -0
- package/dist/index-BQXENE9p.d.ts +130 -0
- package/dist/index-BQXENE9p.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +15 -11
- package/dist/internal/bundled-manifest-runtime.js +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -1
- package/dist/mcp.js.map +1 -1
- package/dist/middleware/index.js +1 -1
- package/dist/oauth-C5pa5j3O.d.ts +136 -0
- package/dist/oauth-C5pa5j3O.d.ts.map +1 -0
- package/dist/registry-core-BZo69C37.js +186 -0
- package/dist/registry-core-BZo69C37.js.map +1 -0
- package/dist/registry.js +2 -2
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.js +114 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/{src-Bd4KMI-J.js → src-wcW1OCA7.js} +84922 -86026
- package/dist/src-wcW1OCA7.js.map +1 -0
- package/dist/stripe/index.js +1 -1
- package/dist/tangle-search/index.d.ts +37 -1
- package/dist/tangle-search/index.d.ts.map +1 -1
- package/dist/tangle-search/index.js +81 -1
- package/dist/tangle-search/index.js.map +1 -1
- package/dist/webhooks/index.js +1 -1
- package/docs/host-search-and-phone.md +28 -1
- package/package.json +17 -2
- package/dist/catalog-CBd0zbdD.js +0 -383
- package/dist/catalog-CBd0zbdD.js.map +0 -1
- package/dist/index-j2QziJA5.d.ts +0 -263
- package/dist/index-j2QziJA5.d.ts.map +0 -1
- package/dist/src-Bd4KMI-J.js.map +0 -1
package/dist/catalog-CBd0zbdD.js
DELETED
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import { t as INTEGRATION_KIND_ALIASES } from "./integration-kind-aliases-DeUJgBWP.js";
|
|
2
|
-
//#region src/registry-core.ts
|
|
3
|
-
const DEFAULT_ALIASES = INTEGRATION_KIND_ALIASES;
|
|
4
|
-
const DEFAULT_SOURCE_PRECEDENCE = {
|
|
5
|
-
"first-party": 500,
|
|
6
|
-
spec: 400,
|
|
7
|
-
gateway: 300,
|
|
8
|
-
"tangle-catalog": 100,
|
|
9
|
-
activepieces: 100,
|
|
10
|
-
coverage: 50
|
|
11
|
-
};
|
|
12
|
-
const SUPPORT_RANK = {
|
|
13
|
-
catalogOnly: 0,
|
|
14
|
-
setupReady: 1,
|
|
15
|
-
gatewayExecutable: 2,
|
|
16
|
-
firstPartyExecutable: 3,
|
|
17
|
-
sandboxExecutable: 4
|
|
18
|
-
};
|
|
19
|
-
function composeIntegrationRegistry(sources, options = {}) {
|
|
20
|
-
const aliases = {
|
|
21
|
-
...DEFAULT_ALIASES,
|
|
22
|
-
...options.aliases ?? {}
|
|
23
|
-
};
|
|
24
|
-
const precedence = {
|
|
25
|
-
...DEFAULT_SOURCE_PRECEDENCE,
|
|
26
|
-
...options.sourcePrecedence ?? {}
|
|
27
|
-
};
|
|
28
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
29
|
-
for (const source of sources) for (const connector of source.connectors) {
|
|
30
|
-
const canonicalId = canonicalConnectorId(connector.id, aliases);
|
|
31
|
-
const candidates = grouped.get(canonicalId) ?? [];
|
|
32
|
-
candidates.push({
|
|
33
|
-
source,
|
|
34
|
-
connector,
|
|
35
|
-
supportTier: inferIntegrationSupportTier(connector)
|
|
36
|
-
});
|
|
37
|
-
grouped.set(canonicalId, candidates);
|
|
38
|
-
}
|
|
39
|
-
const entries = [...grouped.entries()].map(([canonicalId, candidates]) => registryEntry(canonicalId, candidates, precedence, aliases)).sort((a, b) => a.canonicalId.localeCompare(b.canonicalId));
|
|
40
|
-
const byId = /* @__PURE__ */ new Map();
|
|
41
|
-
for (const entry of entries) {
|
|
42
|
-
byId.set(entry.canonicalId, entry);
|
|
43
|
-
for (const alias of entry.aliases) byId.set(alias, entry);
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
entries,
|
|
47
|
-
connectors: entries.map((entry) => entry.connector),
|
|
48
|
-
byId
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function summarizeIntegrationRegistry(registry) {
|
|
52
|
-
const bySupportTier = {
|
|
53
|
-
catalogOnly: 0,
|
|
54
|
-
setupReady: 0,
|
|
55
|
-
gatewayExecutable: 0,
|
|
56
|
-
firstPartyExecutable: 0,
|
|
57
|
-
sandboxExecutable: 0
|
|
58
|
-
};
|
|
59
|
-
for (const entry of registry.entries) bySupportTier[entry.supportTier] += 1;
|
|
60
|
-
return {
|
|
61
|
-
totalEntries: registry.entries.length,
|
|
62
|
-
totalSources: registry.entries.reduce((sum, entry) => sum + entry.sources.length, 0),
|
|
63
|
-
toolBindableEntries: registry.entries.filter((entry) => entry.connector.actions.length > 0).length,
|
|
64
|
-
conflictEntries: registry.entries.filter((entry) => entry.conflicts.length > 0).length,
|
|
65
|
-
bySupportTier
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function canonicalConnectorId(id, aliases = DEFAULT_ALIASES) {
|
|
69
|
-
let current = slug(id);
|
|
70
|
-
const seen = /* @__PURE__ */ new Set();
|
|
71
|
-
while (aliases[current] && !seen.has(current)) {
|
|
72
|
-
seen.add(current);
|
|
73
|
-
current = aliases[current];
|
|
74
|
-
}
|
|
75
|
-
return current;
|
|
76
|
-
}
|
|
77
|
-
function inferIntegrationSupportTier(connector) {
|
|
78
|
-
const metadata = connector.metadata ?? {};
|
|
79
|
-
const explicit = metadata.supportTier;
|
|
80
|
-
if (isSupportTier(explicit)) return explicit;
|
|
81
|
-
if (metadata.sandboxExecutable === true) return "sandboxExecutable";
|
|
82
|
-
if (metadata.source === "first-party-adapter" || connector.providerId === "first-party") return "firstPartyExecutable";
|
|
83
|
-
if (metadata.source === "gateway-catalog" && metadata.executable === true) return "gatewayExecutable";
|
|
84
|
-
if (metadata.source === "integration-spec") return "setupReady";
|
|
85
|
-
if (metadata.source === "coverage-catalog" || metadata.source === "activepieces-community" || metadata.source === "tangle-integrations-catalog" || metadata.catalogOnly === true) return "catalogOnly";
|
|
86
|
-
if (connector.actions.length > 0) return "gatewayExecutable";
|
|
87
|
-
return "catalogOnly";
|
|
88
|
-
}
|
|
89
|
-
function registryEntry(canonicalId, candidates, precedence, aliases) {
|
|
90
|
-
const ordered = [...candidates].sort((a, b) => compareCandidates(a, b, precedence));
|
|
91
|
-
const primary = ordered[0];
|
|
92
|
-
const actions = mergeActions(ordered);
|
|
93
|
-
const triggers = mergeTriggers(ordered);
|
|
94
|
-
const scopes = unique$1(toolBindableCandidates(ordered).flatMap((candidate) => candidate.connector.scopes ?? []));
|
|
95
|
-
const supportTier = ordered.reduce((best, candidate) => SUPPORT_RANK[candidate.supportTier] > SUPPORT_RANK[best] ? candidate.supportTier : best, primary.supportTier);
|
|
96
|
-
const aliasesForEntry = unique$1([...ordered.map((candidate) => candidate.connector.id), ...Object.entries(aliases).filter(([, target]) => canonicalConnectorId(target, aliases) === canonicalId).map(([alias]) => alias)].map(slug).filter((id) => id && id !== canonicalId)).sort();
|
|
97
|
-
const sources = ordered.map((candidate) => ({
|
|
98
|
-
sourceId: candidate.source.id,
|
|
99
|
-
providerId: candidate.connector.providerId,
|
|
100
|
-
connectorId: candidate.connector.id,
|
|
101
|
-
supportTier: candidate.supportTier,
|
|
102
|
-
actionCount: candidate.connector.actions.length,
|
|
103
|
-
triggerCount: candidate.connector.triggers?.length ?? 0
|
|
104
|
-
}));
|
|
105
|
-
const conflicts = conflictDiagnostics(ordered);
|
|
106
|
-
return {
|
|
107
|
-
canonicalId,
|
|
108
|
-
aliases: aliasesForEntry,
|
|
109
|
-
supportTier,
|
|
110
|
-
sources,
|
|
111
|
-
conflicts,
|
|
112
|
-
connector: {
|
|
113
|
-
...primary.connector,
|
|
114
|
-
id: canonicalId,
|
|
115
|
-
scopes,
|
|
116
|
-
actions,
|
|
117
|
-
triggers,
|
|
118
|
-
metadata: {
|
|
119
|
-
...primary.connector.metadata ?? {},
|
|
120
|
-
registry: {
|
|
121
|
-
canonicalId,
|
|
122
|
-
aliases: aliasesForEntry,
|
|
123
|
-
supportTier,
|
|
124
|
-
sources,
|
|
125
|
-
conflicts,
|
|
126
|
-
toolBindable: actions.length > 0,
|
|
127
|
-
catalogOnlyActionCount: ordered.filter((candidate) => candidate.supportTier === "catalogOnly").reduce((sum, candidate) => sum + catalogActionCount(candidate.connector), 0)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
function compareCandidates(a, b, precedence) {
|
|
134
|
-
return SUPPORT_RANK[b.supportTier] - SUPPORT_RANK[a.supportTier] || (b.source.precedence ?? precedence[b.source.id] ?? 0) - (a.source.precedence ?? precedence[a.source.id] ?? 0) || b.connector.actions.length - a.connector.actions.length || a.connector.id.localeCompare(b.connector.id);
|
|
135
|
-
}
|
|
136
|
-
function mergeActions(candidates) {
|
|
137
|
-
const out = /* @__PURE__ */ new Map();
|
|
138
|
-
for (const candidate of toolBindableCandidates(candidates)) for (const action of candidate.connector.actions) if (!out.has(action.id)) out.set(action.id, action);
|
|
139
|
-
return [...out.values()];
|
|
140
|
-
}
|
|
141
|
-
function mergeTriggers(candidates) {
|
|
142
|
-
const out = /* @__PURE__ */ new Map();
|
|
143
|
-
for (const candidate of toolBindableCandidates(candidates)) for (const trigger of candidate.connector.triggers ?? []) if (!out.has(trigger.id)) out.set(trigger.id, trigger);
|
|
144
|
-
return out.size > 0 ? [...out.values()] : void 0;
|
|
145
|
-
}
|
|
146
|
-
function toolBindableCandidates(candidates) {
|
|
147
|
-
const bindable = candidates.filter((candidate) => candidate.supportTier !== "catalogOnly");
|
|
148
|
-
if (bindable.length === 0) return [];
|
|
149
|
-
const maxRank = Math.max(...bindable.map((candidate) => SUPPORT_RANK[candidate.supportTier]));
|
|
150
|
-
return bindable.filter((candidate) => SUPPORT_RANK[candidate.supportTier] === maxRank);
|
|
151
|
-
}
|
|
152
|
-
function catalogActionCount(connector) {
|
|
153
|
-
const value = connector.metadata?.catalogActionCount;
|
|
154
|
-
return typeof value === "number" ? value : connector.actions.length;
|
|
155
|
-
}
|
|
156
|
-
function conflictDiagnostics(candidates) {
|
|
157
|
-
return [conflictFor("auth", candidates.map((candidate) => ({
|
|
158
|
-
value: candidate.connector.auth,
|
|
159
|
-
sourceId: candidate.source.id,
|
|
160
|
-
connectorId: candidate.connector.id
|
|
161
|
-
}))), conflictFor("category", candidates.map((candidate) => ({
|
|
162
|
-
value: candidate.connector.category,
|
|
163
|
-
sourceId: candidate.source.id,
|
|
164
|
-
connectorId: candidate.connector.id
|
|
165
|
-
})))].filter((conflict) => Boolean(conflict));
|
|
166
|
-
}
|
|
167
|
-
function conflictFor(field, values) {
|
|
168
|
-
if (new Set(values.map((entry) => entry.value)).size <= 1) return void 0;
|
|
169
|
-
return {
|
|
170
|
-
field,
|
|
171
|
-
values
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function isSupportTier(value) {
|
|
175
|
-
return value === "catalogOnly" || value === "setupReady" || value === "gatewayExecutable" || value === "firstPartyExecutable" || value === "sandboxExecutable";
|
|
176
|
-
}
|
|
177
|
-
function slug(value) {
|
|
178
|
-
return value.trim().toLowerCase().replace(/&/g, "and").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
179
|
-
}
|
|
180
|
-
function unique$1(values) {
|
|
181
|
-
return [...new Set(values)];
|
|
182
|
-
}
|
|
183
|
-
//#endregion
|
|
184
|
-
//#region src/base64.ts
|
|
185
|
-
function encodeUtf8Base64Url(value) {
|
|
186
|
-
const bytes = new TextEncoder().encode(value);
|
|
187
|
-
let binary = "";
|
|
188
|
-
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
189
|
-
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
190
|
-
}
|
|
191
|
-
function decodeUtf8Base64Url(value) {
|
|
192
|
-
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
193
|
-
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
|
194
|
-
const binary = atob(padded);
|
|
195
|
-
const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
196
|
-
return new TextDecoder().decode(bytes);
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region src/catalog.ts
|
|
200
|
-
const riskRank = {
|
|
201
|
-
read: 0,
|
|
202
|
-
write: 1,
|
|
203
|
-
destructive: 2
|
|
204
|
-
};
|
|
205
|
-
function integrationToolName(providerId, connectorId, actionId) {
|
|
206
|
-
return `int_${encodeToolPart(providerId)}_${encodeToolPart(connectorId)}_${encodeToolPart(actionId)}`;
|
|
207
|
-
}
|
|
208
|
-
function parseIntegrationToolName(name) {
|
|
209
|
-
const parts = name.split("_");
|
|
210
|
-
if (parts.length !== 4 || parts[0] !== "int") throw new Error(`Invalid integration tool name: ${name}`);
|
|
211
|
-
return {
|
|
212
|
-
providerId: decodeToolPart(parts[1]),
|
|
213
|
-
connectorId: decodeToolPart(parts[2]),
|
|
214
|
-
actionId: decodeToolPart(parts[3])
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function buildIntegrationToolCatalog(connectors) {
|
|
218
|
-
const tools = [];
|
|
219
|
-
for (const connector of connectors) for (const action of connector.actions) tools.push(flattenIntegrationToolDefinition(connector, action));
|
|
220
|
-
return tools;
|
|
221
|
-
}
|
|
222
|
-
/** Flatten a single (connector, action) pair into the tool descriptor the
|
|
223
|
-
* catalog exposes. The inverse of {@link parseIntegrationToolName} +
|
|
224
|
-
* {@link integrationToolName}: every tool name round-trips back to exactly
|
|
225
|
-
* this shape via {@link describeIntegrationTool}. */
|
|
226
|
-
function flattenIntegrationToolDefinition(connector, action) {
|
|
227
|
-
const tags = unique([
|
|
228
|
-
connector.id,
|
|
229
|
-
connector.providerId,
|
|
230
|
-
connector.title,
|
|
231
|
-
connector.category,
|
|
232
|
-
action.id,
|
|
233
|
-
action.title,
|
|
234
|
-
action.risk,
|
|
235
|
-
action.dataClass,
|
|
236
|
-
...connector.scopes ?? [],
|
|
237
|
-
...action.requiredScopes ?? []
|
|
238
|
-
].flatMap(tokenize));
|
|
239
|
-
return {
|
|
240
|
-
name: integrationToolName(connector.providerId, connector.id, action.id),
|
|
241
|
-
title: `${connector.title}: ${action.title}`,
|
|
242
|
-
description: action.description ?? `${action.risk} action ${action.id} on ${connector.title}`,
|
|
243
|
-
providerId: connector.providerId,
|
|
244
|
-
connectorId: connector.id,
|
|
245
|
-
connectorTitle: connector.title,
|
|
246
|
-
category: connector.category,
|
|
247
|
-
action,
|
|
248
|
-
risk: action.risk,
|
|
249
|
-
dataClass: action.dataClass,
|
|
250
|
-
requiredScopes: action.requiredScopes,
|
|
251
|
-
inputSchema: action.inputSchema,
|
|
252
|
-
outputSchema: action.outputSchema,
|
|
253
|
-
tags,
|
|
254
|
-
supportTier: toolSupportTier(connector),
|
|
255
|
-
runnable: toolRunnable(connector)
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
/** Resolve a single tool's full descriptor from an opaque
|
|
259
|
-
* `int_<provider>_<connector>_<action>` name against a composed registry.
|
|
260
|
-
* Returns undefined when the name is malformed, the connector is unknown,
|
|
261
|
-
* or the action is not defined by that connector. Powers `/tools/describe`
|
|
262
|
-
* without callers re-implementing parse → byId → action → flatten. */
|
|
263
|
-
function describeIntegrationTool(registry, toolName) {
|
|
264
|
-
let parsed;
|
|
265
|
-
try {
|
|
266
|
-
parsed = parseIntegrationToolName(toolName);
|
|
267
|
-
} catch {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
const entry = registry.byId.get(parsed.connectorId);
|
|
271
|
-
if (!entry) return void 0;
|
|
272
|
-
const action = entry.connector.actions.find((candidate) => candidate.id === parsed.actionId);
|
|
273
|
-
if (!action) return void 0;
|
|
274
|
-
return flattenIntegrationToolDefinition(entry.connector, action);
|
|
275
|
-
}
|
|
276
|
-
function buildIntegrationCatalogView(input) {
|
|
277
|
-
const runtimeTools = buildIntegrationToolCatalog(input.executableRegistry?.connectors ?? input.discoveryRegistry.connectors.filter((connector) => toolRunnable(connector)));
|
|
278
|
-
const discoveryTools = buildIntegrationToolCatalog(input.discoveryRegistry.connectors);
|
|
279
|
-
return {
|
|
280
|
-
connectors: input.discoveryRegistry.connectors,
|
|
281
|
-
conflicts: input.discoveryRegistry.entries.flatMap((entry) => entry.conflicts),
|
|
282
|
-
summary: summarizeIntegrationRegistry(input.discoveryRegistry),
|
|
283
|
-
tools: runtimeTools,
|
|
284
|
-
runtimeTools,
|
|
285
|
-
discoveryTools
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function searchIntegrationTools(catalog, query, filters = {}) {
|
|
289
|
-
const terms = tokenize(query);
|
|
290
|
-
return catalog.filter((tool) => {
|
|
291
|
-
if (filters.providerId && tool.providerId !== filters.providerId) return false;
|
|
292
|
-
if (filters.connectorId && tool.connectorId !== filters.connectorId) return false;
|
|
293
|
-
if (filters.category && tool.category !== filters.category) return false;
|
|
294
|
-
if (filters.dataClass && tool.dataClass !== filters.dataClass) return false;
|
|
295
|
-
if (filters.maxRisk && riskRank[tool.risk] > riskRank[filters.maxRisk]) return false;
|
|
296
|
-
return true;
|
|
297
|
-
}).map((tool) => scoreTool(tool, terms)).filter((result) => terms.length === 0 || result.score > 0).sort((a, b) => b.score - a.score || a.tool.name.localeCompare(b.tool.name)).slice(0, filters.limit ?? 20);
|
|
298
|
-
}
|
|
299
|
-
function toMcpTools(tools) {
|
|
300
|
-
return tools.map((tool) => ({
|
|
301
|
-
name: tool.name,
|
|
302
|
-
description: `${tool.title}. ${tool.description}`,
|
|
303
|
-
inputSchema: tool.inputSchema ?? {
|
|
304
|
-
type: "object",
|
|
305
|
-
additionalProperties: true,
|
|
306
|
-
properties: {}
|
|
307
|
-
}
|
|
308
|
-
}));
|
|
309
|
-
}
|
|
310
|
-
function scoreTool(tool, terms) {
|
|
311
|
-
if (terms.length === 0) return {
|
|
312
|
-
tool,
|
|
313
|
-
score: 1,
|
|
314
|
-
matched: []
|
|
315
|
-
};
|
|
316
|
-
const haystack = new Set(tool.tags);
|
|
317
|
-
const identity = new Set([
|
|
318
|
-
tool.connectorId,
|
|
319
|
-
tool.connectorTitle,
|
|
320
|
-
tool.providerId
|
|
321
|
-
].flatMap(tokenize));
|
|
322
|
-
const matched = [];
|
|
323
|
-
let score = 0;
|
|
324
|
-
for (const term of terms) {
|
|
325
|
-
if (identity.has(term)) {
|
|
326
|
-
matched.push(term);
|
|
327
|
-
score += 6;
|
|
328
|
-
continue;
|
|
329
|
-
}
|
|
330
|
-
if (haystack.has(term)) {
|
|
331
|
-
matched.push(term);
|
|
332
|
-
score += 4;
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
if (tool.tags.some((tag) => tag.includes(term))) {
|
|
336
|
-
matched.push(term);
|
|
337
|
-
score += 1;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
if (tool.risk === "read") score += .25;
|
|
341
|
-
return {
|
|
342
|
-
tool,
|
|
343
|
-
score,
|
|
344
|
-
matched: unique(matched)
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
function tokenize(value) {
|
|
348
|
-
return value.toLowerCase().split(/[^a-z0-9]+/g).map((part) => part.trim()).filter(Boolean);
|
|
349
|
-
}
|
|
350
|
-
function encodeToolPart(value) {
|
|
351
|
-
return encodeUtf8Base64Url(value).replace(/_/g, ".");
|
|
352
|
-
}
|
|
353
|
-
function decodeToolPart(value) {
|
|
354
|
-
return decodeUtf8Base64Url(value.replace(/\./g, "_"));
|
|
355
|
-
}
|
|
356
|
-
function unique(values) {
|
|
357
|
-
return [...new Set(values)];
|
|
358
|
-
}
|
|
359
|
-
function toolSupportTier(connector) {
|
|
360
|
-
const registry = connector.metadata?.registry;
|
|
361
|
-
if (registry && typeof registry === "object" && !Array.isArray(registry)) {
|
|
362
|
-
const supportTier = registry.supportTier;
|
|
363
|
-
return isIntegrationSupportTier(supportTier) ? supportTier : void 0;
|
|
364
|
-
}
|
|
365
|
-
const supportTier = connector.metadata?.supportTier;
|
|
366
|
-
return isIntegrationSupportTier(supportTier) ? supportTier : void 0;
|
|
367
|
-
}
|
|
368
|
-
function toolRunnable(connector) {
|
|
369
|
-
const registry = connector.metadata?.registry;
|
|
370
|
-
if (registry && typeof registry === "object" && !Array.isArray(registry)) {
|
|
371
|
-
const toolBindable = registry.toolBindable;
|
|
372
|
-
if (typeof toolBindable === "boolean") return toolBindable;
|
|
373
|
-
}
|
|
374
|
-
const tier = toolSupportTier(connector);
|
|
375
|
-
return tier === "gatewayExecutable" || tier === "firstPartyExecutable" || tier === "sandboxExecutable";
|
|
376
|
-
}
|
|
377
|
-
function isIntegrationSupportTier(value) {
|
|
378
|
-
return value === "catalogOnly" || value === "setupReady" || value === "gatewayExecutable" || value === "firstPartyExecutable" || value === "sandboxExecutable";
|
|
379
|
-
}
|
|
380
|
-
//#endregion
|
|
381
|
-
export { integrationToolName as a, toMcpTools as c, inferIntegrationSupportTier as d, summarizeIntegrationRegistry as f, flattenIntegrationToolDefinition as i, canonicalConnectorId as l, buildIntegrationToolCatalog as n, parseIntegrationToolName as o, describeIntegrationTool as r, searchIntegrationTools as s, buildIntegrationCatalogView as t, composeIntegrationRegistry as u };
|
|
382
|
-
|
|
383
|
-
//# sourceMappingURL=catalog-CBd0zbdD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-CBd0zbdD.js","names":["unique"],"sources":["../src/registry-core.ts","../src/base64.ts","../src/catalog.ts"],"sourcesContent":["import type {\n IntegrationCatalogSource,\n IntegrationConnector,\n IntegrationConnectorAction,\n IntegrationConnectorTrigger,\n} from './core-types.js'\nimport { INTEGRATION_KIND_ALIASES } from './integration-kind-aliases.js'\n\nexport type IntegrationSupportTier =\n | 'catalogOnly'\n | 'setupReady'\n | 'gatewayExecutable'\n | 'firstPartyExecutable'\n | 'sandboxExecutable'\n\nexport interface IntegrationRegistrySourceRef {\n sourceId: string\n providerId: string\n connectorId: string\n supportTier: IntegrationSupportTier\n actionCount: number\n triggerCount: number\n}\n\nexport interface IntegrationRegistryConflict {\n field: 'auth' | 'category'\n values: Array<{\n value: string\n sourceId: string\n connectorId: string\n }>\n}\n\nexport interface IntegrationRegistryEntry {\n canonicalId: string\n connector: IntegrationConnector\n aliases: string[]\n supportTier: IntegrationSupportTier\n sources: IntegrationRegistrySourceRef[]\n conflicts: IntegrationRegistryConflict[]\n}\n\nexport interface IntegrationRegistry {\n entries: IntegrationRegistryEntry[]\n connectors: IntegrationConnector[]\n byId: Map<string, IntegrationRegistryEntry>\n}\n\nexport interface IntegrationRegistrySummary {\n totalEntries: number\n totalSources: number\n toolBindableEntries: number\n conflictEntries: number\n bySupportTier: Record<IntegrationSupportTier, number>\n}\n\nexport interface ComposeIntegrationRegistryOptions {\n aliases?: Record<string, string>\n sourcePrecedence?: Record<string, number>\n}\n\nconst DEFAULT_ALIASES = INTEGRATION_KIND_ALIASES\n\nconst DEFAULT_SOURCE_PRECEDENCE: Record<string, number> = {\n 'first-party': 500,\n spec: 400,\n gateway: 300,\n 'tangle-catalog': 100,\n activepieces: 100,\n coverage: 50,\n}\n\nconst SUPPORT_RANK: Record<IntegrationSupportTier, number> = {\n catalogOnly: 0,\n setupReady: 1,\n gatewayExecutable: 2,\n firstPartyExecutable: 3,\n sandboxExecutable: 4,\n}\n\nexport function composeIntegrationRegistry(\n sources: IntegrationCatalogSource[],\n options: ComposeIntegrationRegistryOptions = {},\n): IntegrationRegistry {\n const aliases = { ...DEFAULT_ALIASES, ...(options.aliases ?? {}) }\n const precedence = { ...DEFAULT_SOURCE_PRECEDENCE, ...(options.sourcePrecedence ?? {}) }\n const grouped = new Map<string, Candidate[]>()\n\n for (const source of sources) {\n for (const connector of source.connectors) {\n const canonicalId = canonicalConnectorId(connector.id, aliases)\n const candidates = grouped.get(canonicalId) ?? []\n candidates.push({\n source,\n connector,\n supportTier: inferIntegrationSupportTier(connector),\n })\n grouped.set(canonicalId, candidates)\n }\n }\n\n const entries = [...grouped.entries()]\n .map(([canonicalId, candidates]) => registryEntry(canonicalId, candidates, precedence, aliases))\n .sort((a, b) => a.canonicalId.localeCompare(b.canonicalId))\n const byId = new Map<string, IntegrationRegistryEntry>()\n for (const entry of entries) {\n byId.set(entry.canonicalId, entry)\n for (const alias of entry.aliases) byId.set(alias, entry)\n }\n return {\n entries,\n connectors: entries.map((entry) => entry.connector),\n byId,\n }\n}\n\nexport function summarizeIntegrationRegistry(registry: IntegrationRegistry): IntegrationRegistrySummary {\n const bySupportTier = {\n catalogOnly: 0,\n setupReady: 0,\n gatewayExecutable: 0,\n firstPartyExecutable: 0,\n sandboxExecutable: 0,\n } satisfies Record<IntegrationSupportTier, number>\n for (const entry of registry.entries) bySupportTier[entry.supportTier] += 1\n return {\n totalEntries: registry.entries.length,\n totalSources: registry.entries.reduce((sum, entry) => sum + entry.sources.length, 0),\n toolBindableEntries: registry.entries.filter((entry) => entry.connector.actions.length > 0).length,\n conflictEntries: registry.entries.filter((entry) => entry.conflicts.length > 0).length,\n bySupportTier,\n }\n}\n\nexport function canonicalConnectorId(id: string, aliases: Record<string, string> = DEFAULT_ALIASES): string {\n const normalized = slug(id)\n let current = normalized\n const seen = new Set<string>()\n while (aliases[current] && !seen.has(current)) {\n seen.add(current)\n current = aliases[current]\n }\n return current\n}\n\nexport function inferIntegrationSupportTier(connector: IntegrationConnector): IntegrationSupportTier {\n const metadata = connector.metadata ?? {}\n const explicit = metadata.supportTier\n if (isSupportTier(explicit)) return explicit\n if (metadata.sandboxExecutable === true) return 'sandboxExecutable'\n if (metadata.source === 'first-party-adapter' || connector.providerId === 'first-party') return 'firstPartyExecutable'\n if (metadata.source === 'gateway-catalog' && metadata.executable === true) return 'gatewayExecutable'\n if (metadata.source === 'integration-spec') return 'setupReady'\n if (\n metadata.source === 'coverage-catalog'\n || metadata.source === 'activepieces-community'\n || metadata.source === 'tangle-integrations-catalog'\n || metadata.catalogOnly === true\n ) return 'catalogOnly'\n if (connector.actions.length > 0) return 'gatewayExecutable'\n return 'catalogOnly'\n}\n\nfunction registryEntry(\n canonicalId: string,\n candidates: Candidate[],\n precedence: Record<string, number>,\n aliases: Record<string, string>,\n): IntegrationRegistryEntry {\n const ordered = [...candidates].sort((a, b) => compareCandidates(a, b, precedence))\n const primary = ordered[0]!\n const actions = mergeActions(ordered)\n const triggers = mergeTriggers(ordered)\n const scopes = unique(toolBindableCandidates(ordered).flatMap((candidate) => candidate.connector.scopes ?? []))\n const supportTier = ordered.reduce<IntegrationSupportTier>(\n (best, candidate) => SUPPORT_RANK[candidate.supportTier] > SUPPORT_RANK[best] ? candidate.supportTier : best,\n primary.supportTier,\n )\n const aliasesForEntry = unique([\n ...ordered.map((candidate) => candidate.connector.id),\n ...Object.entries(aliases)\n .filter(([, target]) => canonicalConnectorId(target, aliases) === canonicalId)\n .map(([alias]) => alias),\n ].map(slug).filter((id) => id && id !== canonicalId)).sort()\n const sources = ordered.map((candidate): IntegrationRegistrySourceRef => ({\n sourceId: candidate.source.id,\n providerId: candidate.connector.providerId,\n connectorId: candidate.connector.id,\n supportTier: candidate.supportTier,\n actionCount: candidate.connector.actions.length,\n triggerCount: candidate.connector.triggers?.length ?? 0,\n }))\n const conflicts = conflictDiagnostics(ordered)\n\n return {\n canonicalId,\n aliases: aliasesForEntry,\n supportTier,\n sources,\n conflicts,\n connector: {\n ...primary.connector,\n id: canonicalId,\n scopes,\n actions,\n triggers,\n metadata: {\n ...(primary.connector.metadata ?? {}),\n registry: {\n canonicalId,\n aliases: aliasesForEntry,\n supportTier,\n sources,\n conflicts,\n toolBindable: actions.length > 0,\n catalogOnlyActionCount: ordered\n .filter((candidate) => candidate.supportTier === 'catalogOnly')\n .reduce((sum, candidate) => sum + catalogActionCount(candidate.connector), 0),\n },\n },\n },\n }\n}\n\nfunction compareCandidates(a: Candidate, b: Candidate, precedence: Record<string, number>): number {\n return SUPPORT_RANK[b.supportTier] - SUPPORT_RANK[a.supportTier]\n || (b.source.precedence ?? precedence[b.source.id] ?? 0) - (a.source.precedence ?? precedence[a.source.id] ?? 0)\n || b.connector.actions.length - a.connector.actions.length\n || a.connector.id.localeCompare(b.connector.id)\n}\n\nfunction mergeActions(candidates: Candidate[]): IntegrationConnectorAction[] {\n const out = new Map<string, IntegrationConnectorAction>()\n for (const candidate of toolBindableCandidates(candidates)) {\n for (const action of candidate.connector.actions) {\n if (!out.has(action.id)) out.set(action.id, action)\n }\n }\n return [...out.values()]\n}\n\nfunction mergeTriggers(candidates: Candidate[]): IntegrationConnectorTrigger[] | undefined {\n const out = new Map<string, IntegrationConnectorTrigger>()\n for (const candidate of toolBindableCandidates(candidates)) {\n for (const trigger of candidate.connector.triggers ?? []) {\n if (!out.has(trigger.id)) out.set(trigger.id, trigger)\n }\n }\n return out.size > 0 ? [...out.values()] : undefined\n}\n\nfunction toolBindableCandidates(candidates: Candidate[]): Candidate[] {\n const bindable = candidates.filter((candidate) => candidate.supportTier !== 'catalogOnly')\n if (bindable.length === 0) return []\n const maxRank = Math.max(...bindable.map((candidate) => SUPPORT_RANK[candidate.supportTier]))\n return bindable.filter((candidate) => SUPPORT_RANK[candidate.supportTier] === maxRank)\n}\n\nfunction catalogActionCount(connector: IntegrationConnector): number {\n const value = connector.metadata?.catalogActionCount\n return typeof value === 'number' ? value : connector.actions.length\n}\n\nfunction conflictDiagnostics(candidates: Candidate[]): IntegrationRegistryConflict[] {\n return [\n conflictFor('auth', candidates.map((candidate) => ({\n value: candidate.connector.auth,\n sourceId: candidate.source.id,\n connectorId: candidate.connector.id,\n }))),\n conflictFor('category', candidates.map((candidate) => ({\n value: candidate.connector.category,\n sourceId: candidate.source.id,\n connectorId: candidate.connector.id,\n }))),\n ].filter((conflict): conflict is IntegrationRegistryConflict => Boolean(conflict))\n}\n\nfunction conflictFor(\n field: IntegrationRegistryConflict['field'],\n values: IntegrationRegistryConflict['values'],\n): IntegrationRegistryConflict | undefined {\n const uniqueValues = new Set(values.map((entry) => entry.value))\n if (uniqueValues.size <= 1) return undefined\n return { field, values }\n}\n\nfunction isSupportTier(value: unknown): value is IntegrationSupportTier {\n return value === 'catalogOnly'\n || value === 'setupReady'\n || value === 'gatewayExecutable'\n || value === 'firstPartyExecutable'\n || value === 'sandboxExecutable'\n}\n\nfunction slug(value: string): string {\n return value.trim().toLowerCase()\n .replace(/&/g, 'and')\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\nfunction unique<T>(values: T[]): T[] {\n return [...new Set(values)]\n}\n\ninterface Candidate {\n source: IntegrationCatalogSource\n connector: IntegrationConnector\n supportTier: IntegrationSupportTier\n}\n","export function encodeUtf8Base64Url(value: string): string {\n const bytes = new TextEncoder().encode(value)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return btoa(binary)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/g, '')\n}\n\nexport function decodeUtf8Base64Url(value: string): string {\n const normalized = value.replace(/-/g, '+').replace(/_/g, '/')\n const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=')\n const binary = atob(padded)\n const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0))\n return new TextDecoder().decode(bytes)\n}\n","import type {\n IntegrationConnector,\n IntegrationConnectorAction,\n IntegrationConnectorCategory,\n IntegrationActionRisk,\n IntegrationDataClass,\n} from './core-types.js'\nimport {\n summarizeIntegrationRegistry,\n type IntegrationRegistry,\n type IntegrationRegistrySummary,\n type IntegrationSupportTier,\n} from './registry-core.js'\nimport { decodeUtf8Base64Url, encodeUtf8Base64Url } from './base64.js'\n\nexport interface IntegrationToolDefinition {\n name: string\n title: string\n description: string\n providerId: string\n connectorId: string\n connectorTitle: string\n category: IntegrationConnectorCategory\n action: IntegrationConnectorAction\n risk: IntegrationActionRisk\n dataClass: IntegrationDataClass\n requiredScopes: string[]\n inputSchema?: unknown\n outputSchema?: unknown\n tags: string[]\n supportTier?: IntegrationSupportTier\n runnable?: boolean\n}\n\nexport interface IntegrationCatalogView {\n connectors: IntegrationConnector[]\n conflicts: IntegrationRegistry['entries'][number]['conflicts']\n summary: IntegrationRegistrySummary\n tools: IntegrationToolDefinition[]\n runtimeTools: IntegrationToolDefinition[]\n discoveryTools: IntegrationToolDefinition[]\n}\n\nexport interface IntegrationToolSearchFilters {\n providerId?: string\n connectorId?: string\n category?: IntegrationConnectorCategory\n maxRisk?: IntegrationActionRisk\n dataClass?: IntegrationDataClass\n limit?: number\n}\n\nexport interface IntegrationToolSearchResult {\n tool: IntegrationToolDefinition\n score: number\n matched: string[]\n}\n\nexport interface McpToolDefinition {\n name: string\n description: string\n inputSchema: unknown\n}\n\nconst riskRank: Record<IntegrationActionRisk, number> = {\n read: 0,\n write: 1,\n destructive: 2,\n}\n\nexport function integrationToolName(providerId: string, connectorId: string, actionId: string): string {\n return `int_${encodeToolPart(providerId)}_${encodeToolPart(connectorId)}_${encodeToolPart(actionId)}`\n}\n\nexport function parseIntegrationToolName(name: string): { providerId: string; connectorId: string; actionId: string } {\n const parts = name.split('_')\n if (parts.length !== 4 || parts[0] !== 'int') {\n throw new Error(`Invalid integration tool name: ${name}`)\n }\n return {\n providerId: decodeToolPart(parts[1]),\n connectorId: decodeToolPart(parts[2]),\n actionId: decodeToolPart(parts[3]),\n }\n}\n\nexport function buildIntegrationToolCatalog(connectors: IntegrationConnector[]): IntegrationToolDefinition[] {\n const tools: IntegrationToolDefinition[] = []\n for (const connector of connectors) {\n for (const action of connector.actions) {\n tools.push(flattenIntegrationToolDefinition(connector, action))\n }\n }\n return tools\n}\n\n/** Flatten a single (connector, action) pair into the tool descriptor the\n * catalog exposes. The inverse of {@link parseIntegrationToolName} +\n * {@link integrationToolName}: every tool name round-trips back to exactly\n * this shape via {@link describeIntegrationTool}. */\nexport function flattenIntegrationToolDefinition(\n connector: IntegrationConnector,\n action: IntegrationConnectorAction,\n): IntegrationToolDefinition {\n const tags = unique([\n connector.id,\n connector.providerId,\n connector.title,\n connector.category,\n action.id,\n action.title,\n action.risk,\n action.dataClass,\n ...(connector.scopes ?? []),\n ...(action.requiredScopes ?? []),\n ].flatMap(tokenize))\n return {\n name: integrationToolName(connector.providerId, connector.id, action.id),\n title: `${connector.title}: ${action.title}`,\n description: action.description ?? `${action.risk} action ${action.id} on ${connector.title}`,\n providerId: connector.providerId,\n connectorId: connector.id,\n connectorTitle: connector.title,\n category: connector.category,\n action,\n risk: action.risk,\n dataClass: action.dataClass,\n requiredScopes: action.requiredScopes,\n inputSchema: action.inputSchema,\n outputSchema: action.outputSchema,\n tags,\n supportTier: toolSupportTier(connector),\n runnable: toolRunnable(connector),\n }\n}\n\n/** Resolve a single tool's full descriptor from an opaque\n * `int_<provider>_<connector>_<action>` name against a composed registry.\n * Returns undefined when the name is malformed, the connector is unknown,\n * or the action is not defined by that connector. Powers `/tools/describe`\n * without callers re-implementing parse → byId → action → flatten. */\nexport function describeIntegrationTool(\n registry: IntegrationRegistry,\n toolName: string,\n): IntegrationToolDefinition | undefined {\n let parsed: ReturnType<typeof parseIntegrationToolName>\n try {\n parsed = parseIntegrationToolName(toolName)\n } catch {\n return undefined\n }\n const entry = registry.byId.get(parsed.connectorId)\n if (!entry) return undefined\n const action = entry.connector.actions.find((candidate) => candidate.id === parsed.actionId)\n if (!action) return undefined\n return flattenIntegrationToolDefinition(entry.connector, action)\n}\n\nexport function buildIntegrationCatalogView(input: {\n discoveryRegistry: IntegrationRegistry\n executableRegistry?: IntegrationRegistry\n}): IntegrationCatalogView {\n const runtimeConnectors =\n input.executableRegistry?.connectors ??\n input.discoveryRegistry.connectors.filter((connector) => toolRunnable(connector))\n const runtimeTools = buildIntegrationToolCatalog(runtimeConnectors)\n const discoveryTools = buildIntegrationToolCatalog(input.discoveryRegistry.connectors)\n return {\n connectors: input.discoveryRegistry.connectors,\n conflicts: input.discoveryRegistry.entries.flatMap((entry) => entry.conflicts),\n summary: summarizeIntegrationRegistry(input.discoveryRegistry),\n tools: runtimeTools,\n runtimeTools,\n discoveryTools,\n }\n}\n\nexport function searchIntegrationTools(\n catalog: IntegrationToolDefinition[],\n query: string,\n filters: IntegrationToolSearchFilters = {},\n): IntegrationToolSearchResult[] {\n const terms = tokenize(query)\n const filtered = catalog.filter((tool) => {\n if (filters.providerId && tool.providerId !== filters.providerId) return false\n if (filters.connectorId && tool.connectorId !== filters.connectorId) return false\n if (filters.category && tool.category !== filters.category) return false\n if (filters.dataClass && tool.dataClass !== filters.dataClass) return false\n if (filters.maxRisk && riskRank[tool.risk] > riskRank[filters.maxRisk]) return false\n return true\n })\n const scored = filtered.map((tool) => scoreTool(tool, terms))\n return scored\n .filter((result) => terms.length === 0 || result.score > 0)\n .sort((a, b) => b.score - a.score || a.tool.name.localeCompare(b.tool.name))\n .slice(0, filters.limit ?? 20)\n}\n\nexport function toMcpTools(tools: IntegrationToolDefinition[]): McpToolDefinition[] {\n return tools.map((tool) => ({\n name: tool.name,\n description: `${tool.title}. ${tool.description}`,\n inputSchema: tool.inputSchema ?? {\n type: 'object',\n additionalProperties: true,\n properties: {},\n },\n }))\n}\n\nfunction scoreTool(tool: IntegrationToolDefinition, terms: string[]): IntegrationToolSearchResult {\n if (terms.length === 0) return { tool, score: 1, matched: [] }\n const haystack = new Set(tool.tags)\n // Naming the connector is a stronger signal than matching a generic verb:\n // \"send a slack message\" is a request for Slack, not for whichever\n // connector happens to spell its capability `send_*`. Scored above a plain\n // tag hit so connector identity breaks that tie on meaning rather than on\n // alphabetical order.\n const identity = new Set(\n [tool.connectorId, tool.connectorTitle, tool.providerId].flatMap(tokenize),\n )\n const matched: string[] = []\n let score = 0\n for (const term of terms) {\n if (identity.has(term)) {\n matched.push(term)\n score += 6\n continue\n }\n if (haystack.has(term)) {\n matched.push(term)\n score += 4\n continue\n }\n if (tool.tags.some((tag) => tag.includes(term))) {\n matched.push(term)\n score += 1\n }\n }\n if (tool.risk === 'read') score += 0.25\n return { tool, score, matched: unique(matched) }\n}\n\nfunction tokenize(value: string): string[] {\n return value\n .toLowerCase()\n .split(/[^a-z0-9]+/g)\n .map((part) => part.trim())\n .filter(Boolean)\n}\n\nfunction encodeToolPart(value: string): string {\n return encodeUtf8Base64Url(value).replace(/_/g, '.')\n}\n\nfunction decodeToolPart(value: string): string {\n return decodeUtf8Base64Url(value.replace(/\\./g, '_'))\n}\n\nfunction unique<T>(values: T[]): T[] {\n return [...new Set(values)]\n}\n\nfunction toolSupportTier(connector: IntegrationConnector): IntegrationSupportTier | undefined {\n const registry = connector.metadata?.registry\n if (registry && typeof registry === 'object' && !Array.isArray(registry)) {\n const supportTier = (registry as { supportTier?: unknown }).supportTier\n return isIntegrationSupportTier(supportTier) ? supportTier : undefined\n }\n const supportTier = connector.metadata?.supportTier\n return isIntegrationSupportTier(supportTier) ? supportTier : undefined\n}\n\nfunction toolRunnable(connector: IntegrationConnector): boolean {\n const registry = connector.metadata?.registry\n if (registry && typeof registry === 'object' && !Array.isArray(registry)) {\n const toolBindable = (registry as { toolBindable?: unknown }).toolBindable\n if (typeof toolBindable === 'boolean') return toolBindable\n }\n const tier = toolSupportTier(connector)\n return tier === 'gatewayExecutable' || tier === 'firstPartyExecutable' || tier === 'sandboxExecutable'\n}\n\nfunction isIntegrationSupportTier(value: unknown): value is IntegrationSupportTier {\n return (\n value === 'catalogOnly' ||\n value === 'setupReady' ||\n value === 'gatewayExecutable' ||\n value === 'firstPartyExecutable' ||\n value === 'sandboxExecutable'\n )\n}\n"],"mappings":";;AA6DA,MAAM,kBAAkB;AAExB,MAAM,4BAAoD;CACxD,eAAe;CACf,MAAM;CACN,SAAS;CACT,kBAAkB;CAClB,cAAc;CACd,UAAU;AACZ;AAEA,MAAM,eAAuD;CAC3D,aAAa;CACb,YAAY;CACZ,mBAAmB;CACnB,sBAAsB;CACtB,mBAAmB;AACrB;AAEA,SAAgB,2BACd,SACA,UAA6C,CAAC,GACzB;CACrB,MAAM,UAAU;EAAE,GAAG;EAAiB,GAAI,QAAQ,WAAW,CAAC;CAAG;CACjE,MAAM,aAAa;EAAE,GAAG;EAA2B,GAAI,QAAQ,oBAAoB,CAAC;CAAG;CACvF,MAAM,0BAAU,IAAI,IAAyB;CAE7C,KAAK,MAAM,UAAU,SACnB,KAAK,MAAM,aAAa,OAAO,YAAY;EACzC,MAAM,cAAc,qBAAqB,UAAU,IAAI,OAAO;EAC9D,MAAM,aAAa,QAAQ,IAAI,WAAW,KAAK,CAAC;EAChD,WAAW,KAAK;GACd;GACA;GACA,aAAa,4BAA4B,SAAS;EACpD,CAAC;EACD,QAAQ,IAAI,aAAa,UAAU;CACrC;CAGF,MAAM,UAAU,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,CACnC,KAAK,CAAC,aAAa,gBAAgB,cAAc,aAAa,YAAY,YAAY,OAAO,CAAC,CAAC,CAC/F,MAAM,GAAG,MAAM,EAAE,YAAY,cAAc,EAAE,WAA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