mulesoft-anypoint-cli-agent-fabric-plugin 1.0.9 → 1.0.11
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/commands/agent-network/project/build.d.ts +0 -4
- package/dist/commands/agent-network/project/build.js +22 -139
- package/dist/commands/agent-network/project/build.js.map +1 -1
- package/dist/commands/agent-network/project/create.js +32 -25
- package/dist/commands/agent-network/project/create.js.map +1 -1
- package/dist/commands/agent-network/project/deploy.d.ts +2 -36
- package/dist/commands/agent-network/project/deploy.js +117 -506
- package/dist/commands/agent-network/project/deploy.js.map +1 -1
- package/dist/commands/agent-network/project/publish.d.ts +0 -1
- package/dist/commands/agent-network/project/publish.js +26 -94
- package/dist/commands/agent-network/project/publish.js.map +1 -1
- package/dist/commands/agent-network/setup/dependencies.js +2 -1
- package/dist/commands/agent-network/setup/dependencies.js.map +1 -1
- package/dist/commands/agent-network/setup/gateways.js +23 -19
- package/dist/commands/agent-network/setup/gateways.js.map +1 -1
- package/dist/errors/base-error.d.ts +10 -0
- package/dist/errors/base-error.js +42 -13
- package/dist/errors/base-error.js.map +1 -1
- package/dist/errors/error-factory.d.ts +20 -6
- package/dist/errors/error-factory.js +128 -32
- package/dist/errors/error-factory.js.map +1 -1
- package/dist/helpers/connection-id.d.ts +1 -0
- package/dist/helpers/connection-id.js +8 -0
- package/dist/helpers/connection-id.js.map +1 -0
- package/dist/helpers/dependency-manager.js +1 -6
- package/dist/helpers/dependency-manager.js.map +1 -1
- package/dist/helpers/policy-helper.d.ts +66 -3
- package/dist/helpers/policy-helper.js +152 -11
- package/dist/helpers/policy-helper.js.map +1 -1
- package/dist/helpers/project/api-project-dependency-fetcher.d.ts +3 -0
- package/dist/helpers/project/api-project-dependency-fetcher.js +17 -7
- package/dist/helpers/project/api-project-dependency-fetcher.js.map +1 -1
- package/dist/helpers/project/templates.js +2 -1
- package/dist/helpers/project/templates.js.map +1 -1
- package/dist/helpers/request-utils.d.ts +3 -0
- package/dist/helpers/request-utils.js +11 -0
- package/dist/helpers/request-utils.js.map +1 -0
- package/dist/helpers/types.d.ts +1 -1
- package/dist/helpers/utils.d.ts +17 -18
- package/dist/helpers/utils.js +73 -27
- package/dist/helpers/utils.js.map +1 -1
- package/dist/types/agent-network.d.ts +90 -61
- package/dist/types/agent-network.js +6 -1
- package/dist/types/agent-network.js.map +1 -1
- package/dist/types/types.d.ts +64 -4
- package/dist/utils/builders/agent-builder.d.ts +11 -0
- package/dist/utils/builders/agent-builder.js +79 -0
- package/dist/utils/builders/agent-builder.js.map +1 -0
- package/dist/utils/builders/broker-builder.d.ts +22 -0
- package/dist/utils/builders/broker-builder.js +292 -0
- package/dist/utils/builders/broker-builder.js.map +1 -0
- package/dist/utils/builders/builder.d.ts +9 -0
- package/dist/utils/builders/builder.js +110 -0
- package/dist/utils/builders/builder.js.map +1 -0
- package/dist/utils/builders/connections-builder.d.ts +25 -0
- package/dist/utils/builders/connections-builder.js +233 -0
- package/dist/utils/builders/connections-builder.js.map +1 -0
- package/dist/utils/builders/llm-builder.d.ts +12 -0
- package/dist/utils/builders/llm-builder.js +64 -0
- package/dist/utils/builders/llm-builder.js.map +1 -0
- package/dist/utils/builders/mcp-builder.d.ts +12 -0
- package/dist/utils/builders/mcp-builder.js +48 -0
- package/dist/utils/builders/mcp-builder.js.map +1 -0
- package/dist/utils/builders/network-builder.d.ts +13 -0
- package/dist/utils/builders/network-builder.js +77 -0
- package/dist/utils/builders/network-builder.js.map +1 -0
- package/dist/utils/builders/path.d.ts +12 -0
- package/dist/utils/builders/path.js +35 -0
- package/dist/utils/builders/path.js.map +1 -0
- package/dist/utils/builders/policies-factory.d.ts +8 -0
- package/dist/utils/builders/policies-factory.js +255 -0
- package/dist/utils/builders/policies-factory.js.map +1 -0
- package/dist/utils/builders/project-builder-impl.d.ts +233 -0
- package/dist/utils/builders/project-builder-impl.js +552 -0
- package/dist/utils/builders/project-builder-impl.js.map +1 -0
- package/dist/utils/builders/project-builder.d.ts +313 -0
- package/dist/utils/builders/project-builder.js +76 -0
- package/dist/utils/builders/project-builder.js.map +1 -0
- package/dist/utils/builders/space-serializer.d.ts +18 -0
- package/dist/utils/builders/space-serializer.js +239 -0
- package/dist/utils/builders/space-serializer.js.map +1 -0
- package/dist/utils/constants.d.ts +3 -1
- package/dist/utils/constants.js +6 -3
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/exchange.d.ts +7 -1
- package/dist/utils/exchange.js +90 -2
- package/dist/utils/exchange.js.map +1 -1
- package/dist/utils/facets/abstract-facet.d.ts +34 -0
- package/dist/utils/facets/abstract-facet.js +50 -0
- package/dist/utils/facets/abstract-facet.js.map +1 -0
- package/dist/utils/facets/api-instance-facet.d.ts +16 -0
- package/dist/utils/facets/api-instance-facet.js +274 -0
- package/dist/utils/facets/api-instance-facet.js.map +1 -0
- package/dist/utils/facets/asset-facet.d.ts +11 -0
- package/dist/utils/facets/asset-facet.js +151 -0
- package/dist/utils/facets/asset-facet.js.map +1 -0
- package/dist/utils/facets/connection-facet.d.ts +16 -0
- package/dist/utils/facets/connection-facet.js +277 -0
- package/dist/utils/facets/connection-facet.js.map +1 -0
- package/dist/utils/facets/deployment-helpers.d.ts +2 -0
- package/dist/utils/facets/deployment-helpers.js +44 -0
- package/dist/utils/facets/deployment-helpers.js.map +1 -0
- package/dist/utils/facets/facets.d.ts +7 -0
- package/dist/utils/facets/facets.js +55 -0
- package/dist/utils/facets/facets.js.map +1 -0
- package/dist/utils/facets/mule-application-facet.d.ts +20 -0
- package/dist/utils/facets/mule-application-facet.js +282 -0
- package/dist/utils/facets/mule-application-facet.js.map +1 -0
- package/dist/utils/files.d.ts +1 -1
- package/dist/utils/files.js +9 -16
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/gateway.d.ts +4 -0
- package/dist/utils/gateway.js +32 -0
- package/dist/utils/gateway.js.map +1 -1
- package/dist/utils/logger.d.ts +15 -0
- package/dist/utils/logger.js +46 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/promise/promiseCreator.d.ts +8 -0
- package/dist/utils/promise/promiseCreator.js +19 -0
- package/dist/utils/promise/promiseCreator.js.map +1 -0
- package/dist/utils/uris.d.ts +1 -0
- package/dist/utils/uris.js +12 -3
- package/dist/utils/uris.js.map +1 -1
- package/dist/utils/variables.d.ts +15 -4
- package/dist/utils/variables.js +102 -0
- package/dist/utils/variables.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/api-instance-builder.d.ts +0 -28
- package/dist/utils/api-instance-builder.js +0 -467
- package/dist/utils/api-instance-builder.js.map +0 -1
- package/dist/utils/asset-builder.d.ts +0 -28
- package/dist/utils/asset-builder.js +0 -248
- package/dist/utils/asset-builder.js.map +0 -1
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentNetworkApiInstanceBuilder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
6
|
-
const js_yaml_1 = require("js-yaml");
|
|
7
|
-
const error_factory_1 = require("../errors/error-factory");
|
|
8
|
-
const utils_1 = require("../helpers/utils");
|
|
9
|
-
const agent_network_1 = require("../types/agent-network");
|
|
10
|
-
const constants_1 = require("./constants");
|
|
11
|
-
const policy_helper_1 = require("../helpers/policy-helper");
|
|
12
|
-
/**
|
|
13
|
-
* Builds the API Instances (ingress and egress) declared in the agent network
|
|
14
|
-
*/
|
|
15
|
-
class AgentNetworkApiInstanceBuilder {
|
|
16
|
-
constructor(projectHome, yamlPath, descriptor, propertyMap, mulesoftOrg) {
|
|
17
|
-
this.descriptor = descriptor;
|
|
18
|
-
this.an = (0, js_yaml_1.load)(fs.readFileSync(yamlPath, constants_1.UTF8));
|
|
19
|
-
this.mulesoftOrg = mulesoftOrg;
|
|
20
|
-
this.propertyMap = propertyMap;
|
|
21
|
-
this.projectHome = projectHome;
|
|
22
|
-
}
|
|
23
|
-
sourceUrn() {
|
|
24
|
-
return `urn:gav:${this.descriptor.groupId}:${this.descriptor.assetId}:${this.descriptor.version}`;
|
|
25
|
-
}
|
|
26
|
-
requiredConnections() {
|
|
27
|
-
const result = [];
|
|
28
|
-
for (const broker of Object.values(this.an.brokers || {})) {
|
|
29
|
-
for (const link of (broker.spec.links || [])) {
|
|
30
|
-
result.push({ asset: (0, agent_network_1.resolveReference)(link.agent.ref, this.descriptor), type: 'a2a' });
|
|
31
|
-
}
|
|
32
|
-
for (const tool of (broker.spec.tools || [])) {
|
|
33
|
-
result.push({ asset: (0, agent_network_1.resolveReference)(tool.mcp.ref, this.descriptor), type: 'mcp' });
|
|
34
|
-
}
|
|
35
|
-
broker.spec.llm && result.push({ asset: (0, agent_network_1.resolveReference)(broker.spec.llm.ref, this.descriptor), type: 'llm' });
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
hasBrokers() {
|
|
40
|
-
return this.an.brokers ? Object.keys(this.an.brokers).length > 0 : false;
|
|
41
|
-
}
|
|
42
|
-
ingress(muleBaseUrl) {
|
|
43
|
-
var _a;
|
|
44
|
-
const result = [];
|
|
45
|
-
for (const [brokerName, broker] of Object.entries(this.an.brokers || {})) {
|
|
46
|
-
const customPolicies = ((_a = broker.spec.policies) === null || _a === void 0 ? void 0 : _a.map(policy => {
|
|
47
|
-
return {
|
|
48
|
-
policyRef: (0, agent_network_1.resolveReference)(policy.ref, this.descriptor),
|
|
49
|
-
configuration: policy.configuration,
|
|
50
|
-
};
|
|
51
|
-
})) || [];
|
|
52
|
-
result.push({
|
|
53
|
-
id: brokerName,
|
|
54
|
-
type: 'a2a',
|
|
55
|
-
label: `[Broker] ${brokerName}`,
|
|
56
|
-
description: broker.card.description || '',
|
|
57
|
-
asset: {
|
|
58
|
-
groupId: this.descriptor.groupId,
|
|
59
|
-
assetId: brokerName,
|
|
60
|
-
version: this.descriptor.version,
|
|
61
|
-
},
|
|
62
|
-
endpointPath: `${brokerName}`,
|
|
63
|
-
upstreamUrl: `${muleBaseUrl}/${brokerName}`,
|
|
64
|
-
metadata: {
|
|
65
|
-
connectionId: `${this.descriptor.groupId}:${this.descriptor.assetId}`,
|
|
66
|
-
source: this.sourceUrn(),
|
|
67
|
-
protectionDirection: 'ingress',
|
|
68
|
-
},
|
|
69
|
-
inboundPolicies: async (apiId) => [
|
|
70
|
-
await this.createAgentCardPolicy(),
|
|
71
|
-
await this.createTracingPolicy(`[Agent] ${brokerName}`, apiId, 'a2a'),
|
|
72
|
-
await this.createAPIDInjectionPolicy(apiId),
|
|
73
|
-
...customPolicies,
|
|
74
|
-
],
|
|
75
|
-
outboundPolicies: async (_apiId) => [],
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
async createAPIDInjectionPolicy(apiId) {
|
|
81
|
-
const policyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.HEADER_INJECTION_POLICY_NAME, constants_1.HEADER_INJECTION_POLICY_MINOR_VERSION);
|
|
82
|
-
return {
|
|
83
|
-
policyRef: {
|
|
84
|
-
groupId: this.mulesoftOrg,
|
|
85
|
-
assetId: constants_1.HEADER_INJECTION_POLICY_NAME,
|
|
86
|
-
version: policyVersion,
|
|
87
|
-
},
|
|
88
|
-
configuration: {
|
|
89
|
-
inboundHeaders: [
|
|
90
|
-
{
|
|
91
|
-
key: constants_1.API_INSTANCE_ID_HEADER_NAME,
|
|
92
|
-
value: apiId,
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
outboundHeaders: [],
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
egress() {
|
|
100
|
-
var _a;
|
|
101
|
-
const result = [];
|
|
102
|
-
// Deployment logic for the agent network connection
|
|
103
|
-
for (const [connectionName, connectionTemplate] of Object.entries(this.an.connections || {})) {
|
|
104
|
-
// go through all the values of connectionTemplate and run replacePlaceholders
|
|
105
|
-
const connection = recursivelyReplacePlaceholders(connectionTemplate, this.propertyMap);
|
|
106
|
-
const customPolicies = ((_a = connection.spec.policies) === null || _a === void 0 ? void 0 : _a.map(policy => {
|
|
107
|
-
return {
|
|
108
|
-
policyRef: (0, agent_network_1.resolveReference)(policy.ref, this.descriptor),
|
|
109
|
-
configuration: policy.configuration,
|
|
110
|
-
};
|
|
111
|
-
})) || [];
|
|
112
|
-
switch (connection.kind) {
|
|
113
|
-
case 'agent': {
|
|
114
|
-
const agentConnection = connection;
|
|
115
|
-
const agentRef = (0, agent_network_1.resolveReference)(connection.ref, this.descriptor);
|
|
116
|
-
const label = `[Agent] ${agentRef.assetId}`;
|
|
117
|
-
// Handle agent connection deployment
|
|
118
|
-
result.push({
|
|
119
|
-
id: `${agentRef.assetId}-${connectionName}`,
|
|
120
|
-
label: label,
|
|
121
|
-
description: connection.description || '',
|
|
122
|
-
type: 'a2a',
|
|
123
|
-
asset: agentRef,
|
|
124
|
-
tags: [constants_1.EGRESS_TAG],
|
|
125
|
-
endpointPath: `${agentRef.groupId}/${agentRef.assetId}/${connectionName}`,
|
|
126
|
-
upstreamUrl: connection.spec.url,
|
|
127
|
-
metadata: {
|
|
128
|
-
connectionId: `${agentRef.groupId}:${agentRef.assetId}:${connectionName}`,
|
|
129
|
-
source: this.sourceUrn(),
|
|
130
|
-
protectionDirection: 'egress',
|
|
131
|
-
},
|
|
132
|
-
inboundPolicies: async (apiId) => [
|
|
133
|
-
await this.createAgentCardPolicy(),
|
|
134
|
-
await this.createTracingPolicy(label, apiId, 'a2a'),
|
|
135
|
-
await this.createConnectionPolicy(),
|
|
136
|
-
...customPolicies,
|
|
137
|
-
],
|
|
138
|
-
outboundPolicies: async (_apiId) => {
|
|
139
|
-
if (agentConnection.spec.authentication) {
|
|
140
|
-
const agentAuthentication = agentConnection.spec.authentication;
|
|
141
|
-
return this.createAuthenticationPolicy(agentAuthentication);
|
|
142
|
-
}
|
|
143
|
-
return [];
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
case 'mcp': {
|
|
149
|
-
// Handle mcp connection deployment
|
|
150
|
-
const mcpRef = (0, agent_network_1.resolveReference)(connection.ref, this.descriptor);
|
|
151
|
-
const mcpLabel = `[MCP Server] ${mcpRef.assetId}`;
|
|
152
|
-
const mcpConnection = connection;
|
|
153
|
-
// Handle agent connection deployment
|
|
154
|
-
result.push({
|
|
155
|
-
id: `${mcpRef.assetId}-${connectionName}`,
|
|
156
|
-
type: 'mcp',
|
|
157
|
-
label: mcpLabel,
|
|
158
|
-
tags: [constants_1.EGRESS_TAG],
|
|
159
|
-
description: connection.description || '',
|
|
160
|
-
asset: mcpRef,
|
|
161
|
-
endpointPath: `${mcpRef.groupId}/${mcpRef.assetId}/${connectionName}`,
|
|
162
|
-
upstreamUrl: connection.spec.url,
|
|
163
|
-
metadata: {
|
|
164
|
-
connectionId: `${mcpRef.groupId}:${mcpRef.assetId}:${connectionName}`,
|
|
165
|
-
source: this.sourceUrn(),
|
|
166
|
-
protectionDirection: 'egress',
|
|
167
|
-
},
|
|
168
|
-
inboundPolicies: async (apiId) => [
|
|
169
|
-
await this.createMCPSupportPolicy(),
|
|
170
|
-
await this.createTracingPolicy(mcpLabel, apiId, 'mcp'),
|
|
171
|
-
await this.createConnectionPolicy(),
|
|
172
|
-
...customPolicies,
|
|
173
|
-
],
|
|
174
|
-
outboundPolicies: async (_apiId) => {
|
|
175
|
-
if (mcpConnection.spec.authentication) {
|
|
176
|
-
const mcpAuthentication = mcpConnection.spec.authentication;
|
|
177
|
-
return this.createAuthenticationPolicy(mcpAuthentication);
|
|
178
|
-
}
|
|
179
|
-
return [];
|
|
180
|
-
},
|
|
181
|
-
});
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
case 'llm': {
|
|
185
|
-
// Handle llm connection deployment
|
|
186
|
-
const llmRef = (0, agent_network_1.resolveReference)(connection.ref, this.descriptor);
|
|
187
|
-
const llmLabel = `[LLM] ${llmRef.assetId}`;
|
|
188
|
-
// Handle llm connection deployment
|
|
189
|
-
result.push({
|
|
190
|
-
id: `${llmRef.assetId}-${connectionName}`,
|
|
191
|
-
label: llmLabel,
|
|
192
|
-
tags: [constants_1.EGRESS_TAG],
|
|
193
|
-
description: connection.description || '',
|
|
194
|
-
type: 'llm',
|
|
195
|
-
asset: llmRef,
|
|
196
|
-
endpointPath: `${llmRef.groupId}/${llmRef.assetId}/${connectionName}`,
|
|
197
|
-
upstreamUrl: connection.spec.url,
|
|
198
|
-
metadata: {
|
|
199
|
-
connectionId: `${llmRef.groupId}:${llmRef.assetId}:${connectionName}`,
|
|
200
|
-
source: this.sourceUrn(),
|
|
201
|
-
protectionDirection: 'egress',
|
|
202
|
-
},
|
|
203
|
-
inboundPolicies: async (apiId) => [
|
|
204
|
-
await this.createTracingPolicy(llmLabel, apiId, 'llm'),
|
|
205
|
-
await this.createConnectionPolicy(),
|
|
206
|
-
...customPolicies,
|
|
207
|
-
],
|
|
208
|
-
outboundPolicies: async (_apiId) => [
|
|
209
|
-
await this.createTranscodingPolicy(connection, llmRef),
|
|
210
|
-
],
|
|
211
|
-
});
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
}
|
|
218
|
-
async createConnectionPolicy() {
|
|
219
|
-
const policyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.TELEMETRY_POLICY_NAME, constants_1.TELEMETRY_POLICY_MINOR_VERSION);
|
|
220
|
-
return {
|
|
221
|
-
policyRef: {
|
|
222
|
-
groupId: this.mulesoftOrg,
|
|
223
|
-
assetId: constants_1.TELEMETRY_POLICY_NAME,
|
|
224
|
-
version: policyVersion,
|
|
225
|
-
},
|
|
226
|
-
configuration: {
|
|
227
|
-
sourceAgentId: `#[attributes.headers['${constants_1.API_INSTANCE_ID_HEADER_NAME}']]`,
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
async createTranscodingPolicy(connection, llmRef) {
|
|
232
|
-
const llmMetadataFilePath = (0, utils_1.resolveAssetFile)(this.projectHome, constants_1.LLM_ASSET_TYPE, llmRef, constants_1.LLM_METADATA_FILE, this.descriptor);
|
|
233
|
-
if (llmMetadataFilePath === null) {
|
|
234
|
-
throw error_factory_1.ErrorFactory.unableToResolve(llmRef);
|
|
235
|
-
}
|
|
236
|
-
const llmMetadata = (0, utils_1.safeJsonFileParse)(llmMetadataFilePath).jsonObject;
|
|
237
|
-
let policyRef = llmMetadata.policyRef;
|
|
238
|
-
if (!policyRef) {
|
|
239
|
-
const resolvedPolicyRef = await policy_helper_1.PolicyHelper.resolveDefaultPolicyByPlatform(llmMetadata.platform, this.mulesoftOrg);
|
|
240
|
-
if (!resolvedPolicyRef) {
|
|
241
|
-
throw error_factory_1.ErrorFactory.noTranscodingFoundFor(llmMetadata.platform);
|
|
242
|
-
}
|
|
243
|
-
policyRef = resolvedPolicyRef;
|
|
244
|
-
}
|
|
245
|
-
return {
|
|
246
|
-
policyRef: {
|
|
247
|
-
groupId: policyRef.groupId,
|
|
248
|
-
assetId: policyRef.assetId,
|
|
249
|
-
version: policyRef.version,
|
|
250
|
-
},
|
|
251
|
-
configuration: connection.spec.configuration,
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
async createAuthenticationPolicy(authentication) {
|
|
255
|
-
switch (authentication.kind) {
|
|
256
|
-
// go over every supported authentication
|
|
257
|
-
case 'apikey-client-credentials': {
|
|
258
|
-
const apiKeyClientPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.API_KEY_POLICY_NAME, constants_1.API_KEY_POLICY_MINOR_VERSION);
|
|
259
|
-
return [{
|
|
260
|
-
policyRef: {
|
|
261
|
-
groupId: this.mulesoftOrg,
|
|
262
|
-
assetId: constants_1.API_KEY_POLICY_NAME,
|
|
263
|
-
version: apiKeyClientPolicyVersion,
|
|
264
|
-
},
|
|
265
|
-
configuration: {
|
|
266
|
-
authType: 'clientCredentials',
|
|
267
|
-
overwrite: true,
|
|
268
|
-
clientId: authentication.clientId.value,
|
|
269
|
-
clientSecret: authentication.clientSecret.value,
|
|
270
|
-
customClientIdHeader: authentication.clientId.name || 'client_id',
|
|
271
|
-
customClientSecretHeader: authentication.clientSecret.name || 'client_secret',
|
|
272
|
-
},
|
|
273
|
-
}];
|
|
274
|
-
}
|
|
275
|
-
case 'basic': {
|
|
276
|
-
const basicAuthPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.BASIC_AUTH_POLICY_NAME, constants_1.BASIC_AUTH_POLICY_MINOR_VERSION);
|
|
277
|
-
return [{
|
|
278
|
-
policyRef: {
|
|
279
|
-
groupId: this.mulesoftOrg,
|
|
280
|
-
assetId: constants_1.BASIC_AUTH_POLICY_NAME,
|
|
281
|
-
version: basicAuthPolicyVersion,
|
|
282
|
-
},
|
|
283
|
-
configuration: {
|
|
284
|
-
username: authentication.username,
|
|
285
|
-
password: authentication.password,
|
|
286
|
-
overwrite: true,
|
|
287
|
-
customHeader: authentication.headerName || 'Authorization',
|
|
288
|
-
},
|
|
289
|
-
}];
|
|
290
|
-
}
|
|
291
|
-
case 'oauth2-client-credentials': {
|
|
292
|
-
const oauthPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.OAUTH_POLICY_NAME, constants_1.OAUTH_POLICY_MINOR_VERSION);
|
|
293
|
-
const tokenRequestBodyFormat = authentication.token.bodyEncoding === 'json' ? 'json' : 'urlEncoded';
|
|
294
|
-
return [{
|
|
295
|
-
policyRef: {
|
|
296
|
-
groupId: this.mulesoftOrg,
|
|
297
|
-
assetId: constants_1.OAUTH_POLICY_NAME,
|
|
298
|
-
version: oauthPolicyVersion,
|
|
299
|
-
},
|
|
300
|
-
configuration: {
|
|
301
|
-
overwrite: true,
|
|
302
|
-
oauthService: authentication.token.url,
|
|
303
|
-
grantType: 'clientCredentials',
|
|
304
|
-
scope: authentication.scopes || [],
|
|
305
|
-
tokenFetchTimeout: authentication.token.timeout || 10,
|
|
306
|
-
tokenRequestBodyFormat: tokenRequestBodyFormat,
|
|
307
|
-
clientId: authentication.clientId,
|
|
308
|
-
clientSecret: authentication.clientSecret,
|
|
309
|
-
allowRequestWithoutCredential: false,
|
|
310
|
-
credentialLocation: 'body',
|
|
311
|
-
cachingTtl: 0,
|
|
312
|
-
},
|
|
313
|
-
}];
|
|
314
|
-
}
|
|
315
|
-
case 'apiKey': {
|
|
316
|
-
const apiKeyPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.API_KEY_POLICY_NAME, constants_1.API_KEY_POLICY_MINOR_VERSION);
|
|
317
|
-
return [{
|
|
318
|
-
policyRef: {
|
|
319
|
-
groupId: this.mulesoftOrg,
|
|
320
|
-
assetId: constants_1.API_KEY_POLICY_NAME,
|
|
321
|
-
version: apiKeyPolicyVersion,
|
|
322
|
-
},
|
|
323
|
-
configuration: {
|
|
324
|
-
authType: 'apiKey',
|
|
325
|
-
overwrite: true,
|
|
326
|
-
apiKey: authentication.apiKey,
|
|
327
|
-
customHeader: authentication.headerName || 'Authentication',
|
|
328
|
-
},
|
|
329
|
-
}];
|
|
330
|
-
}
|
|
331
|
-
case 'oauth2-obo': {
|
|
332
|
-
const oauth2OboPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.OAUTH2_OBO_POLICY_NAME, constants_1.OAUTH2_OBO_POLICY_MINOR_VERSION);
|
|
333
|
-
const config = {
|
|
334
|
-
flow: authentication.flow,
|
|
335
|
-
clientId: authentication.clientId,
|
|
336
|
-
clientSecret: authentication.clientSecret,
|
|
337
|
-
tokenEndpoint: authentication.tokenEndpoint,
|
|
338
|
-
timeout: authentication.timeout || 10000,
|
|
339
|
-
cibaEnabled: authentication.cibaEnabled || false,
|
|
340
|
-
};
|
|
341
|
-
//Add CIBA specific fields
|
|
342
|
-
if (authentication.cibaEnabled) {
|
|
343
|
-
config.cibaEndpoint = authentication.cibaEndpoint;
|
|
344
|
-
config.loginHntClaim = authentication.cibaLoginHintClaim || "email";
|
|
345
|
-
if (authentication.cibaBindingMessage !== "") {
|
|
346
|
-
config.bindingMessage = authentication.cibaBindingMessage;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
// Add flow-specific fields
|
|
350
|
-
if (authentication.flow === 'oauth2-token-exchange') {
|
|
351
|
-
config.targetType = authentication.targetType || 'audience';
|
|
352
|
-
config.targetValue = authentication.targetValue;
|
|
353
|
-
}
|
|
354
|
-
if (authentication.scope) {
|
|
355
|
-
config.scope = authentication.scope;
|
|
356
|
-
}
|
|
357
|
-
return [{
|
|
358
|
-
policyRef: {
|
|
359
|
-
groupId: this.mulesoftOrg,
|
|
360
|
-
assetId: constants_1.OAUTH2_OBO_POLICY_NAME,
|
|
361
|
-
version: oauth2OboPolicyVersion,
|
|
362
|
-
},
|
|
363
|
-
configuration: config,
|
|
364
|
-
}];
|
|
365
|
-
}
|
|
366
|
-
case 'in-task-authorization-code': {
|
|
367
|
-
const intaskAuthPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.INTASK_AUTH_POLICY_NAME, constants_1.INTASK_AUTH_POLICY_MINOR_VERSION);
|
|
368
|
-
return [{
|
|
369
|
-
policyRef: {
|
|
370
|
-
groupId: this.mulesoftOrg,
|
|
371
|
-
assetId: constants_1.INTASK_AUTH_POLICY_NAME,
|
|
372
|
-
version: intaskAuthPolicyVersion,
|
|
373
|
-
},
|
|
374
|
-
configuration: {
|
|
375
|
-
secondaryAuthProvider: authentication.secondaryAuthProvider || '',
|
|
376
|
-
authorizationEndpoint: authentication.authorizationEndpoint,
|
|
377
|
-
tokenEndpoint: authentication.tokenEndpoint,
|
|
378
|
-
scopes: authentication.scopes,
|
|
379
|
-
redirectUri: authentication.redirectUri,
|
|
380
|
-
responseType: authentication.responseType || 'code',
|
|
381
|
-
codeChallengeMethod: authentication.codeChallengeMethod || 'S256',
|
|
382
|
-
tokenAudience: authentication.tokenAudience || '',
|
|
383
|
-
bodyEncoding: authentication.bodyEncoding || 'form',
|
|
384
|
-
tokenTimeout: authentication.tokenTimeout || 300,
|
|
385
|
-
challengeResponseStatusCode: authentication.challengeResponseStatusCode || 200,
|
|
386
|
-
},
|
|
387
|
-
}];
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
async createMCPSupportPolicy() {
|
|
392
|
-
const policyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.MCP_SUPPORT_POLICY_NAME, constants_1.MCP_SUPPORT_POLICY_MINOR_VERSION);
|
|
393
|
-
return {
|
|
394
|
-
policyRef: {
|
|
395
|
-
groupId: this.mulesoftOrg,
|
|
396
|
-
assetId: constants_1.MCP_SUPPORT_POLICY_NAME,
|
|
397
|
-
version: policyVersion,
|
|
398
|
-
},
|
|
399
|
-
configuration: {},
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
async createAgentCardPolicy() {
|
|
403
|
-
const policyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.A2A_CARD_POLICY_NAME, constants_1.A2A_CARD_POLICY_MINOR_VERSION);
|
|
404
|
-
return {
|
|
405
|
-
policyRef: {
|
|
406
|
-
groupId: this.mulesoftOrg,
|
|
407
|
-
assetId: constants_1.A2A_CARD_POLICY_NAME,
|
|
408
|
-
version: policyVersion,
|
|
409
|
-
},
|
|
410
|
-
configuration: {
|
|
411
|
-
cardPath: '/.well-known/agent-card.json',
|
|
412
|
-
},
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
async createTracingPolicy(apiName, instanceId, apiType) {
|
|
416
|
-
const tracingPolicyVersion = await policy_helper_1.PolicyHelper.fetchPolicyPatchVersion(this.mulesoftOrg, constants_1.TRACING_POLICY_NAME, constants_1.TRACING_POLICY_MINOR_VERSION);
|
|
417
|
-
return {
|
|
418
|
-
policyRef: {
|
|
419
|
-
groupId: this.mulesoftOrg,
|
|
420
|
-
assetId: constants_1.TRACING_POLICY_NAME,
|
|
421
|
-
version: tracingPolicyVersion,
|
|
422
|
-
},
|
|
423
|
-
configuration: {
|
|
424
|
-
spanName: apiName,
|
|
425
|
-
sampling: { client: 100, random: 100, overall: 100 },
|
|
426
|
-
labels: [
|
|
427
|
-
{ type: 'literal', name: 'mulesoft.api.instance.id', defaultValue: instanceId },
|
|
428
|
-
{ type: 'literal', name: 'mulesoft.api.type', defaultValue: apiType },
|
|
429
|
-
],
|
|
430
|
-
},
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
exports.AgentNetworkApiInstanceBuilder = AgentNetworkApiInstanceBuilder;
|
|
435
|
-
/**
|
|
436
|
-
* Recursively traverses all values in an object or array and applies replacePlaceholder to each simple value (string, number, boolean).
|
|
437
|
-
* @param obj The object or array to process
|
|
438
|
-
* @param collectedVariables The variable of the properties
|
|
439
|
-
* @returns A new object or array with placeholders replaced
|
|
440
|
-
*/
|
|
441
|
-
function recursivelyReplacePlaceholders(obj, collectedVariables) {
|
|
442
|
-
if (Array.isArray(obj)) {
|
|
443
|
-
return obj.map(item => recursivelyReplacePlaceholders(item, collectedVariables));
|
|
444
|
-
}
|
|
445
|
-
if (obj !== null && typeof obj === 'object') {
|
|
446
|
-
const result = {};
|
|
447
|
-
for (const key of Object.keys(obj)) {
|
|
448
|
-
result[key] = recursivelyReplacePlaceholders(obj[key], collectedVariables);
|
|
449
|
-
}
|
|
450
|
-
return result;
|
|
451
|
-
}
|
|
452
|
-
// Simple value (string, number, boolean, etc.)
|
|
453
|
-
if (typeof obj !== 'string') {
|
|
454
|
-
return obj;
|
|
455
|
-
}
|
|
456
|
-
return replacePlaceholders(obj, collectedVariables);
|
|
457
|
-
}
|
|
458
|
-
function replacePlaceholders(input, collectedVariables) {
|
|
459
|
-
const allVariables = { ...collectedVariables.properties, ...collectedVariables.securedProperties };
|
|
460
|
-
return input.replace(/\${([^}]+)}/g, (_, varName) => {
|
|
461
|
-
if (varName in allVariables) {
|
|
462
|
-
return allVariables[varName];
|
|
463
|
-
}
|
|
464
|
-
throw error_factory_1.ErrorFactory.variableNotFound(varName);
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
//# sourceMappingURL=api-instance-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-instance-builder.js","sourceRoot":"","sources":["../../src/utils/api-instance-builder.ts"],"names":[],"mappings":";;;;AAAA,qDAA8B;AAC9B,qCAA4B;AAC5B,2DAAoD;AACpD,4CAAoE;AAEpE,0DAA2L;AAC3L,2CAqBoB;AACpB,4DAAqD;AAErD;;GAEG;AACH,MAAa,8BAA8B;IAOzC,YAAY,WAAmB,EAAE,QAAgB,EAAE,UAA8B,EAAE,WAAuB,EAAE,WAAmB;QAC7H,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,EAAE,GAAG,IAAA,cAAI,EAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,gBAAI,CAAC,CAAiB,CAAA;QAC/D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;IAEO,SAAS;QACf,OAAO,WAAW,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAA;IACnG,CAAC;IAEM,mBAAmB;QACxB,MAAM,MAAM,GAAwC,EAAE,CAAA;QAEtD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,EAA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types/agent-network';
|
|
3
|
-
/**
|
|
4
|
-
* Builds all the assets that are represented in this agent network
|
|
5
|
-
*/
|
|
6
|
-
export declare class AgentNetworkAssetBuilder {
|
|
7
|
-
descriptor: ExchangeDescriptor;
|
|
8
|
-
an: AgentNetwork;
|
|
9
|
-
yamlPath: string;
|
|
10
|
-
muleAppDir: string;
|
|
11
|
-
mulesoftOrg: string;
|
|
12
|
-
constructor(yamlPath: string, muleAppDir: string, descriptor: ExchangeDescriptor, mulesoftOrg: string);
|
|
13
|
-
hasBrokers(): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Builds the assets in the specified directory.
|
|
16
|
-
* The assets are build in the form of ${targetPath}/${assetType}/${assetId}/
|
|
17
|
-
*
|
|
18
|
-
* @param targetPath The path where the assets are going to be created
|
|
19
|
-
*/
|
|
20
|
-
buildAssets(targetPath: string): Promise<void>;
|
|
21
|
-
private buildMuleApp;
|
|
22
|
-
private buildAgentNetwork;
|
|
23
|
-
private buildLLMs;
|
|
24
|
-
private sourceUrn;
|
|
25
|
-
private buildBrokers;
|
|
26
|
-
private buildMcps;
|
|
27
|
-
private buildAgents;
|
|
28
|
-
}
|