@uipath/agent-tool 1.201.0 → 1.202.0-preview.136
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/agent-tool-OK5DK57D-hw5d866f.js +11 -0
- package/dist/{de-5KVP66U6-f7knj511.js → de-5KVP66U6-1bnf4zt5.js} +52 -52
- package/dist/{en-4KXU7N7B-66fntxa2.js → en-X3S6IZ5J-nhkg6pwn.js} +54 -60
- package/dist/{es-MX-XAVLOQW3-9b3cp9n8.js → es-MX-XAVLOQW3-q00km2y7.js} +52 -52
- package/dist/{es-VFPNVMP5-thm0z9sr.js → es-VFPNVMP5-bx2c337j.js} +52 -52
- package/dist/executor-tool.js +5 -13
- package/dist/{fr-E5MDO4EG-exvrs7ge.js → fr-E5MDO4EG-c3mkty2t.js} +52 -52
- package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
- package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
- package/dist/{index-26bymy67.js → index-vhhz1bs5.js} +160 -88
- package/dist/index.js +7 -17
- package/dist/{ja-DPO5PPLO-s2a7j3nj.js → ja-DPO5PPLO-mysfmznx.js} +52 -52
- package/dist/{js-yaml-cggj6w7q.js → js-yaml-87cdx6bm.js} +27 -19
- package/dist/{ko-ITOPNIYI-qz39kamf.js → ko-ITOPNIYI-hmxd2asd.js} +52 -52
- package/dist/{packager-tool-h5zqhhbj.js → packager-tool-0srzfhdr.js} +1089 -690
- package/dist/{packager-tool-wckvcay0.js → packager-tool-1yh8g550.js} +9 -7
- package/dist/{packager-tool-tq9q9m77.js → packager-tool-a42jnpy5.js} +3 -9
- package/dist/{packager-tool-kwp8tznh.js → packager-tool-g8yfc7ef.js} +9227 -6826
- package/dist/{packager-tool-1zt6rezn.js → packager-tool-hwy2sxr3.js} +858 -1171
- package/dist/{packager-tool-v02mthyt.js → packager-tool-vkv0j95b.js} +637 -637
- package/dist/packager-tool-y80gnt72.js +9753 -0
- package/dist/packager-tool.js +5 -6
- package/dist/{pt-BR-BXURWX4W-dqr4dnf9.js → pt-BR-BXURWX4W-bwfcwhk1.js} +52 -52
- package/dist/{pt-YI4VE4YQ-v7gjeg82.js → pt-YI4VE4YQ-wdkn2dcf.js} +52 -52
- package/dist/{ro-RKXZUG7Z-cm3xn3fj.js → ro-RKXZUG7Z-nndrrsq7.js} +52 -52
- package/dist/{ru-WBLQ5B2U-awt245ky.js → ru-WBLQ5B2U-8r3c7v6d.js} +1 -1
- package/dist/tool.js +9 -19
- package/dist/{tr-AA6O2WSR-ga1xnymp.js → tr-AA6O2WSR-86ba4bdf.js} +52 -52
- package/dist/{zh-CN-R2KLHXQV-wttmznep.js → zh-CN-R2KLHXQV-agqr45ds.js} +52 -52
- package/dist/{zh-TW-RJGCQANM-gqn0aca0.js → zh-TW-RJGCQANM-w0x3qc1p.js} +52 -52
- package/package.json +2 -2
- package/dist/agent-project-service-j4pgc7gk.js +0 -12
- package/dist/agent-tool-OK5DK57D-zenkdkdp.js +0 -12
- package/dist/browser-strategy-16yagjhr.js +0 -99
- package/dist/index-byw2z4xp.js +0 -141
- package/dist/index-k00qjyec.js +0 -2933
- package/dist/index-p50kx6jv.js +0 -48756
- package/dist/index-rqfxg3fq.js +0 -15
- package/dist/index-t82tsh16.js +0 -53
- package/dist/index.umd.min-drpc57vn.js +0 -7814
- package/dist/integration-tool-service-n214kzdn.js +0 -297
- package/dist/is-client-a1hbz77f.js +0 -124
- package/dist/node-strategy-1r3qegaf.js +0 -350
- package/dist/packager-tool-0gctz400.js +0 -17
- package/dist/packager-tool-4fge2k9c.js +0 -419
- package/dist/packager-tool-5xdkh3vm.js +0 -2573
- package/dist/packager-tool-8xv16pb3.js +0 -20663
- package/dist/packager-tool-bpegrcj1.js +0 -5336
- package/dist/packager-tool-gkvdytpj.js +0 -5085
- package/dist/packager-tool-nsrs2tm5.js +0 -114
- package/dist/packager-tool-q42rrs00.js +0 -12
- package/dist/packager-tool-qa9gftnj.js +0 -31
- package/dist/packager-tool-wzknj3dr.js +0 -394
- package/dist/packager-tool-yv3rvyas.js +0 -239
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/@uipath/tool-agent/dist/chunk-UWHPEJIJ.js
|
|
2
|
-
var BindingsConstants = {
|
|
3
|
-
ProcessResource: "process",
|
|
4
|
-
ConnectionResource: "connection",
|
|
5
|
-
IndexResource: "index",
|
|
6
|
-
McpResource: "mcpServer",
|
|
7
|
-
MemorySpaceResource: "memorySpace",
|
|
8
|
-
AppResource: "app",
|
|
9
|
-
AssetResource: "asset",
|
|
10
|
-
BucketResource: "bucket",
|
|
11
|
-
IxpResource: "ixp",
|
|
12
|
-
DataFabricEntityResource: "entity",
|
|
13
|
-
RemoteA2aAgentResource: "remoteA2aAgent",
|
|
14
|
-
VsEscalationType: 1,
|
|
15
|
-
BindingsModelVersion: "2.0",
|
|
16
|
-
BindingsValueNameKey: "name",
|
|
17
|
-
BindingsValueVersionKey: "version",
|
|
18
|
-
BindingsValueConnectionIdKey: "connectionId",
|
|
19
|
-
BindingsValueProcessNameDisplayName: "Process name",
|
|
20
|
-
BindingsValueConnectionIdDisplayName: "Connection ID",
|
|
21
|
-
BindingsValueByomConnectionIdDisplayName: "Model connection ID",
|
|
22
|
-
BindingsValueIndexNameDisplayName: "Index Name",
|
|
23
|
-
BindingsValueSlugDisplayName: "Slug",
|
|
24
|
-
BindingsValueMemoryNameDisplayName: "Memory name",
|
|
25
|
-
BindingsValueAppNameDisplayName: "App name",
|
|
26
|
-
BindingsValueAssetNameDisplayName: "Asset Name",
|
|
27
|
-
BindingsValueBucketNameDisplayName: "Storage Bucket Name",
|
|
28
|
-
BindingsValueIxpProjectNameDisplayName: "IXP project name",
|
|
29
|
-
BindingsValueIxpProjectVersionDisplayName: "IXP project version",
|
|
30
|
-
BindingsValueDataFabricEntityNameDisplayName: "Entity name",
|
|
31
|
-
BindingsValueFolderPathKey: "folderPath",
|
|
32
|
-
BindingsValueFolderPathDisplayName: "Folder path",
|
|
33
|
-
BindingsMetadataSubTypeKey: "subType",
|
|
34
|
-
BindingsMetadataConnectorKey: "connector",
|
|
35
|
-
BindingsMetadataUseConnectionServiceKey: "useConnectionService",
|
|
36
|
-
BindingsMetadataVersionKey: "bindingsVersion",
|
|
37
|
-
BindingsMetadataSolutionsSupport: "solutionsSupport",
|
|
38
|
-
BindingsMetadataAgentSubType: "agent",
|
|
39
|
-
BindingsMetadataProcessSubType: "process",
|
|
40
|
-
BindingsMetadataApiWorkflowSubType: "api",
|
|
41
|
-
BindingsMetadataAgenticProcessSubType: "processOrchestration",
|
|
42
|
-
BindingsMetadataFlowSubType: "flow",
|
|
43
|
-
BindingsMetadataFunctionSubType: "function",
|
|
44
|
-
BindingsMetadataVersion: "2.2",
|
|
45
|
-
BindingsMetadataTrue: "true"
|
|
46
|
-
};
|
|
47
|
-
var ASSET_RECIPIENT_TYPES = /* @__PURE__ */ new Set([4, 6]);
|
|
48
|
-
var SOLUTION_FOLDER_SENTINEL = "solution_folder";
|
|
49
|
-
function isAssetRecipientType(type) {
|
|
50
|
-
return ASSET_RECIPIENT_TYPES.has(type);
|
|
51
|
-
}
|
|
52
|
-
function createBindingValue(defaultValue, displayName) {
|
|
53
|
-
return { defaultValue, isExpression: false, displayName };
|
|
54
|
-
}
|
|
55
|
-
function defaultMetadata() {
|
|
56
|
-
return {
|
|
57
|
-
[BindingsConstants.BindingsMetadataVersionKey]: BindingsConstants.BindingsMetadataVersion,
|
|
58
|
-
[BindingsConstants.BindingsMetadataSolutionsSupport]: BindingsConstants.BindingsMetadataTrue
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function resolveFolderPathBindingValue(raw) {
|
|
62
|
-
if (!raw || raw === SOLUTION_FOLDER_SENTINEL)
|
|
63
|
-
return;
|
|
64
|
-
return raw;
|
|
65
|
-
}
|
|
66
|
-
function addFolderPathToValue(value, raw) {
|
|
67
|
-
const resolved = resolveFolderPathBindingValue(raw);
|
|
68
|
-
if (resolved === undefined)
|
|
69
|
-
return;
|
|
70
|
-
value[BindingsConstants.BindingsValueFolderPathKey] = createBindingValue(resolved, BindingsConstants.BindingsValueFolderPathDisplayName);
|
|
71
|
-
}
|
|
72
|
-
function createProcessBinding(processName, subType, rawFolderPath) {
|
|
73
|
-
const value = {
|
|
74
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(processName, BindingsConstants.BindingsValueProcessNameDisplayName)
|
|
75
|
-
};
|
|
76
|
-
addFolderPathToValue(value, rawFolderPath);
|
|
77
|
-
return {
|
|
78
|
-
resource: BindingsConstants.ProcessResource,
|
|
79
|
-
key: processName,
|
|
80
|
-
value,
|
|
81
|
-
metadata: {
|
|
82
|
-
[BindingsConstants.BindingsMetadataSubTypeKey]: subType,
|
|
83
|
-
...defaultMetadata()
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function createConnectionBinding(connectionId, connectorKey, displayName) {
|
|
88
|
-
return {
|
|
89
|
-
resource: BindingsConstants.ConnectionResource,
|
|
90
|
-
key: connectionId,
|
|
91
|
-
value: {
|
|
92
|
-
[BindingsConstants.BindingsValueConnectionIdKey]: createBindingValue(connectionId, displayName)
|
|
93
|
-
},
|
|
94
|
-
metadata: {
|
|
95
|
-
[BindingsConstants.BindingsMetadataConnectorKey]: connectorKey,
|
|
96
|
-
[BindingsConstants.BindingsMetadataUseConnectionServiceKey]: BindingsConstants.BindingsMetadataTrue,
|
|
97
|
-
...defaultMetadata()
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function createIndexBinding(indexName, rawFolderPath) {
|
|
102
|
-
const value = {
|
|
103
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(indexName, BindingsConstants.BindingsValueIndexNameDisplayName)
|
|
104
|
-
};
|
|
105
|
-
addFolderPathToValue(value, rawFolderPath);
|
|
106
|
-
return {
|
|
107
|
-
resource: BindingsConstants.IndexResource,
|
|
108
|
-
key: indexName,
|
|
109
|
-
value,
|
|
110
|
-
metadata: defaultMetadata()
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function createAppBinding(appName, rawFolderPath) {
|
|
114
|
-
const value = {
|
|
115
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(appName, BindingsConstants.BindingsValueAppNameDisplayName)
|
|
116
|
-
};
|
|
117
|
-
addFolderPathToValue(value, rawFolderPath);
|
|
118
|
-
return {
|
|
119
|
-
resource: BindingsConstants.AppResource,
|
|
120
|
-
key: appName,
|
|
121
|
-
value,
|
|
122
|
-
metadata: defaultMetadata()
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function createAssetBinding(assetName, rawFolderPath) {
|
|
126
|
-
const value = {
|
|
127
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(assetName, BindingsConstants.BindingsValueAssetNameDisplayName)
|
|
128
|
-
};
|
|
129
|
-
addFolderPathToValue(value, rawFolderPath);
|
|
130
|
-
return {
|
|
131
|
-
resource: BindingsConstants.AssetResource,
|
|
132
|
-
key: assetName,
|
|
133
|
-
value,
|
|
134
|
-
metadata: defaultMetadata()
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function createBucketBinding(bucketName, rawFolderPath) {
|
|
138
|
-
const value = {
|
|
139
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(bucketName, BindingsConstants.BindingsValueBucketNameDisplayName)
|
|
140
|
-
};
|
|
141
|
-
addFolderPathToValue(value, rawFolderPath);
|
|
142
|
-
return {
|
|
143
|
-
resource: BindingsConstants.BucketResource,
|
|
144
|
-
key: bucketName,
|
|
145
|
-
value,
|
|
146
|
-
metadata: defaultMetadata()
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function generateAgentSettingsBindings(agent) {
|
|
150
|
-
if (agent.type !== "lowCode")
|
|
151
|
-
return [];
|
|
152
|
-
const byom = agent.settings.byomProperties;
|
|
153
|
-
if (!byom)
|
|
154
|
-
return [];
|
|
155
|
-
return [
|
|
156
|
-
createConnectionBinding(byom.connectionId, byom.connectorKey, BindingsConstants.BindingsValueByomConnectionIdDisplayName)
|
|
157
|
-
];
|
|
158
|
-
}
|
|
159
|
-
function generateAgentGuardrailBindings(agent) {
|
|
160
|
-
if (agent.type !== "lowCode" || !agent.guardrails)
|
|
161
|
-
return [];
|
|
162
|
-
const bindings = [];
|
|
163
|
-
for (const guardrail of agent.guardrails) {
|
|
164
|
-
if (guardrail.action?.$actionType === "escalate") {
|
|
165
|
-
const { action } = guardrail;
|
|
166
|
-
const appName = action.app?.name;
|
|
167
|
-
if (appName) {
|
|
168
|
-
bindings.push(createAppBinding(appName, action.app?.folderName));
|
|
169
|
-
}
|
|
170
|
-
const recipient = action.recipient;
|
|
171
|
-
if (recipient && isAssetRecipientType(recipient.type) && "assetName" in recipient && recipient.assetName) {
|
|
172
|
-
bindings.push(createAssetBinding(recipient.assetName, "folderPath" in recipient ? recipient.folderPath : undefined));
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return bindings;
|
|
177
|
-
}
|
|
178
|
-
function generateAgentBindings(agent) {
|
|
179
|
-
return [...generateAgentSettingsBindings(agent), ...generateAgentGuardrailBindings(agent)];
|
|
180
|
-
}
|
|
181
|
-
function generateFeatureBindings(feature) {
|
|
182
|
-
if (feature.$featureType === "memorySpace") {
|
|
183
|
-
const value = {
|
|
184
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(feature.memorySpaceName, BindingsConstants.BindingsValueMemoryNameDisplayName)
|
|
185
|
-
};
|
|
186
|
-
addFolderPathToValue(value, feature.folderPath);
|
|
187
|
-
return [
|
|
188
|
-
{
|
|
189
|
-
resource: BindingsConstants.MemorySpaceResource,
|
|
190
|
-
key: feature.memorySpaceName,
|
|
191
|
-
value,
|
|
192
|
-
metadata: defaultMetadata()
|
|
193
|
-
}
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
return [];
|
|
197
|
-
}
|
|
198
|
-
function createProcessToolBinding(tool, subType) {
|
|
199
|
-
return [createProcessBinding(tool.properties.processName, subType, tool.properties.folderPath)];
|
|
200
|
-
}
|
|
201
|
-
function createIntegrationToolBindings(tool) {
|
|
202
|
-
return [
|
|
203
|
-
createConnectionBinding(tool.properties.connection.id, tool.properties.connection.connector.key, BindingsConstants.BindingsValueConnectionIdDisplayName)
|
|
204
|
-
];
|
|
205
|
-
}
|
|
206
|
-
function createIxpToolBindings(tool) {
|
|
207
|
-
return [
|
|
208
|
-
{
|
|
209
|
-
resource: BindingsConstants.IxpResource,
|
|
210
|
-
key: tool.properties.projectName,
|
|
211
|
-
value: {
|
|
212
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(tool.properties.projectName, BindingsConstants.BindingsValueIxpProjectNameDisplayName),
|
|
213
|
-
[BindingsConstants.BindingsValueVersionKey]: createBindingValue(tool.properties.versionTag, BindingsConstants.BindingsValueIxpProjectVersionDisplayName)
|
|
214
|
-
},
|
|
215
|
-
metadata: {
|
|
216
|
-
[BindingsConstants.BindingsMetadataVersionKey]: BindingsConstants.BindingsMetadataVersion
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
];
|
|
220
|
-
}
|
|
221
|
-
var DEFAULT_TOOL_BINDING_HANDLER_REGISTRY = {
|
|
222
|
-
process: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataProcessSubType),
|
|
223
|
-
agent: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataAgentSubType),
|
|
224
|
-
api: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataApiWorkflowSubType),
|
|
225
|
-
processOrchestration: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataAgenticProcessSubType),
|
|
226
|
-
flow: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataFlowSubType),
|
|
227
|
-
function: (tool) => createProcessToolBinding(tool, BindingsConstants.BindingsMetadataFunctionSubType),
|
|
228
|
-
integration: createIntegrationToolBindings,
|
|
229
|
-
ixp: createIxpToolBindings
|
|
230
|
-
};
|
|
231
|
-
function deepRagIndexName(tool) {
|
|
232
|
-
if (tool.type !== "internal")
|
|
233
|
-
return;
|
|
234
|
-
if (tool.properties.toolType !== "deep-rag")
|
|
235
|
-
return;
|
|
236
|
-
const { settings } = tool.properties;
|
|
237
|
-
if (!("indexName" in settings) || typeof settings.indexName !== "string" || settings.indexName.length === 0) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
return settings.indexName;
|
|
241
|
-
}
|
|
242
|
-
function generateFallbackToolBindings(tool) {
|
|
243
|
-
const indexName = deepRagIndexName(tool);
|
|
244
|
-
if (indexName) {
|
|
245
|
-
return [createIndexBinding(indexName)];
|
|
246
|
-
}
|
|
247
|
-
return [];
|
|
248
|
-
}
|
|
249
|
-
function unhandledBindingsType(_value) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
function resolveToolBindingsFromRegistry(tool, registry) {
|
|
253
|
-
switch (tool.type) {
|
|
254
|
-
case "process":
|
|
255
|
-
return registry.process?.(tool);
|
|
256
|
-
case "agent":
|
|
257
|
-
return registry.agent?.(tool);
|
|
258
|
-
case "api":
|
|
259
|
-
return registry.api?.(tool);
|
|
260
|
-
case "processOrchestration":
|
|
261
|
-
return registry.processOrchestration?.(tool);
|
|
262
|
-
case "flow":
|
|
263
|
-
return registry.flow?.(tool);
|
|
264
|
-
case "function":
|
|
265
|
-
return registry.function?.(tool);
|
|
266
|
-
case "integration":
|
|
267
|
-
return registry.integration?.(tool);
|
|
268
|
-
case "ixp":
|
|
269
|
-
return registry.ixp?.(tool);
|
|
270
|
-
case "internal":
|
|
271
|
-
return;
|
|
272
|
-
case "clientSide":
|
|
273
|
-
return registry.clientSide?.(tool);
|
|
274
|
-
default:
|
|
275
|
-
return unhandledBindingsType(tool);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function generateToolBindings(tool, registry = DEFAULT_TOOL_BINDING_HANDLER_REGISTRY) {
|
|
279
|
-
const bindings = resolveToolBindingsFromRegistry(tool, registry) ?? generateFallbackToolBindings(tool);
|
|
280
|
-
if (tool.guardrail?.policies) {
|
|
281
|
-
for (const policy of tool.guardrail.policies) {
|
|
282
|
-
if (policy.action?.$actionType === "escalate" && policy.action.app?.name) {
|
|
283
|
-
bindings.push(createAppBinding(policy.action.app.name, policy.action.app.folderName));
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return bindings;
|
|
288
|
-
}
|
|
289
|
-
function generateDataFabricEntitySetBindings(context) {
|
|
290
|
-
if (context.entitySet.length === 0) {
|
|
291
|
-
return [];
|
|
292
|
-
}
|
|
293
|
-
return context.entitySet.map((entity) => {
|
|
294
|
-
const value = {
|
|
295
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(entity.name, BindingsConstants.BindingsValueDataFabricEntityNameDisplayName)
|
|
296
|
-
};
|
|
297
|
-
addFolderPathToValue(value, entity.folderId);
|
|
298
|
-
return {
|
|
299
|
-
resource: BindingsConstants.DataFabricEntityResource,
|
|
300
|
-
key: entity.referenceKey ?? entity.id,
|
|
301
|
-
value,
|
|
302
|
-
metadata: {
|
|
303
|
-
...defaultMetadata(),
|
|
304
|
-
scope: "folder"
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
function generateContextBindings(context) {
|
|
310
|
-
if (context.contextType === "datafabricentityset") {
|
|
311
|
-
return generateDataFabricEntitySetBindings(context);
|
|
312
|
-
}
|
|
313
|
-
return [createIndexBinding(context.indexName, context.folderPath)];
|
|
314
|
-
}
|
|
315
|
-
function generateEscalationBindings(escalation) {
|
|
316
|
-
const bindings = [];
|
|
317
|
-
if (escalation.escalationType === BindingsConstants.VsEscalationType) {
|
|
318
|
-
const bucketName = escalation.vsEscalationProperties?.storageBucketName;
|
|
319
|
-
if (bucketName) {
|
|
320
|
-
bindings.push(createBucketBinding(bucketName, escalation.vsEscalationProperties?.storageBucketFolderPath));
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
for (const channel of escalation.channels ?? []) {
|
|
324
|
-
if (channel.type === "actionCenter") {
|
|
325
|
-
const appName = channel.properties?.appName;
|
|
326
|
-
if (appName) {
|
|
327
|
-
bindings.push(createAppBinding(appName, channel.properties?.folderName));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
for (const recipient of channel.recipients ?? []) {
|
|
331
|
-
if (isAssetRecipientType(recipient.type) && "assetName" in recipient && recipient.assetName) {
|
|
332
|
-
bindings.push(createAssetBinding(recipient.assetName, "folderPath" in recipient ? recipient.folderPath : undefined));
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return bindings;
|
|
338
|
-
}
|
|
339
|
-
function generateMcpBindings(mcp) {
|
|
340
|
-
const value = {
|
|
341
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(mcp.slug, BindingsConstants.BindingsValueSlugDisplayName)
|
|
342
|
-
};
|
|
343
|
-
addFolderPathToValue(value, mcp.folderPath);
|
|
344
|
-
return [
|
|
345
|
-
{
|
|
346
|
-
resource: BindingsConstants.McpResource,
|
|
347
|
-
key: mcp.slug,
|
|
348
|
-
value,
|
|
349
|
-
metadata: defaultMetadata()
|
|
350
|
-
}
|
|
351
|
-
];
|
|
352
|
-
}
|
|
353
|
-
function generateA2aBindings(a2a) {
|
|
354
|
-
const value = {
|
|
355
|
-
[BindingsConstants.BindingsValueNameKey]: createBindingValue(a2a.slug, BindingsConstants.BindingsValueSlugDisplayName)
|
|
356
|
-
};
|
|
357
|
-
addFolderPathToValue(value, a2a.folderPath);
|
|
358
|
-
return [
|
|
359
|
-
{
|
|
360
|
-
resource: BindingsConstants.RemoteA2aAgentResource,
|
|
361
|
-
key: a2a.slug,
|
|
362
|
-
value,
|
|
363
|
-
metadata: defaultMetadata()
|
|
364
|
-
}
|
|
365
|
-
];
|
|
366
|
-
}
|
|
367
|
-
var DEFAULT_RESOURCE_BINDING_HANDLER_REGISTRY = {
|
|
368
|
-
tool: (resource) => generateToolBindings(resource),
|
|
369
|
-
context: (resource) => generateContextBindings(resource),
|
|
370
|
-
escalation: (resource) => generateEscalationBindings(resource),
|
|
371
|
-
mcp: (resource) => generateMcpBindings(resource),
|
|
372
|
-
a2a: (resource) => generateA2aBindings(resource)
|
|
373
|
-
};
|
|
374
|
-
function resolveResourceBindingsFromRegistry(resource, registry) {
|
|
375
|
-
switch (resource.$resourceType) {
|
|
376
|
-
case "tool":
|
|
377
|
-
return registry.tool?.(resource);
|
|
378
|
-
case "context":
|
|
379
|
-
return registry.context?.(resource);
|
|
380
|
-
case "escalation":
|
|
381
|
-
return registry.escalation?.(resource);
|
|
382
|
-
case "mcp":
|
|
383
|
-
return registry.mcp?.(resource);
|
|
384
|
-
case "a2a":
|
|
385
|
-
return registry.a2a?.(resource);
|
|
386
|
-
default:
|
|
387
|
-
return unhandledBindingsType(resource);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
function generateResourceBindings(resource, registry = DEFAULT_RESOURCE_BINDING_HANDLER_REGISTRY) {
|
|
391
|
-
return resolveResourceBindingsFromRegistry(resource, registry) ?? [];
|
|
392
|
-
}
|
|
393
|
-
function generateBindings(agent, resources, features) {
|
|
394
|
-
const allBindings = [];
|
|
395
|
-
for (const resource of resources) {
|
|
396
|
-
allBindings.push(...generateResourceBindings(resource));
|
|
397
|
-
}
|
|
398
|
-
for (const feature of features) {
|
|
399
|
-
allBindings.push(...generateFeatureBindings(feature));
|
|
400
|
-
}
|
|
401
|
-
allBindings.push(...generateAgentBindings(agent));
|
|
402
|
-
const seen = /* @__PURE__ */ new Set;
|
|
403
|
-
const uniqueBindings = [];
|
|
404
|
-
for (const binding of allBindings) {
|
|
405
|
-
const key = `${binding.resource}_${binding.key}`;
|
|
406
|
-
if (!seen.has(key)) {
|
|
407
|
-
seen.add(key);
|
|
408
|
-
uniqueBindings.push(binding);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return {
|
|
412
|
-
version: BindingsConstants.BindingsModelVersion,
|
|
413
|
-
resources: uniqueBindings
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export { generateBindings };
|
|
418
|
-
|
|
419
|
-
//# debugId=45E9220E0E4BB6ED64756E2164756E21
|