@aws/nx-plugin 1.0.0-rc.50 → 1.0.0-rc.52
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/generators.json +7 -0
- package/migrations.json +5 -0
- package/package.json +1 -1
- package/src/internal/test-matrix/generator.d.ts +29 -0
- package/src/internal/test-matrix/generator.js +660 -0
- package/src/internal/test-matrix/generator.js.map +1 -0
- package/src/internal/test-matrix/schema.d.js +6 -0
- package/src/internal/test-matrix/schema.d.js.map +1 -0
- package/src/internal/test-matrix/schema.d.ts +12 -0
- package/src/internal/test-matrix/schema.json +21 -0
- package/src/migrations/latest/user-identity-waf-allow-localhost-callback/migration.d.ts +6 -0
- package/src/migrations/latest/user-identity-waf-allow-localhost-callback/migration.js +217 -0
- package/src/migrations/latest/user-identity-waf-allow-localhost-callback/migration.js.map +1 -0
- package/src/sdk/py.d.ts +2 -0
- package/src/sdk/py.js +1 -0
- package/src/sdk/py.js.map +1 -1
- package/src/sdk/ts.d.ts +2 -0
- package/src/sdk/ts.js +2 -0
- package/src/sdk/ts.js.map +1 -1
- package/src/sdk/utils/format.d.ts +1 -1
- package/src/sdk/utils/format.js.map +1 -1
- package/src/ts/rdb/generator.js +19 -1
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +66 -66
- package/src/ts/react-website/app/generator.js +10 -1
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +25 -3
- package/src/utils/format.d.ts +11 -1
- package/src/utils/format.js +25 -2
- package/src/utils/format.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +25 -3
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +25 -8
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ import { agentcoreGatewayGenerator } from "../../sdk/agentcore-gateway.js";
|
|
5
|
+
import { connectionGenerator } from "../../sdk/connection.js";
|
|
6
|
+
import { licenseGenerator } from "../../sdk/license.js";
|
|
7
|
+
import { pyAgentGenerator, pyApiGenerator, pyDynamoDBGenerator, pyLambdaFunctionGenerator, pyMcpServerGenerator, pyProjectGenerator, pyRdbGenerator } from "../../sdk/py.js";
|
|
8
|
+
import { terraformProjectGenerator } from "../../sdk/terraform.js";
|
|
9
|
+
import { tsAgentGenerator, tsApiGenerator, tsAstroDocsGenerator, tsDcrProxyGenerator, tsDynamoDBGenerator, tsInfraGenerator, tsLambdaFunctionGenerator, tsMcpServerGenerator, tsNxGeneratorGenerator, tsNxMigrationGenerator, tsNxPluginGenerator, tsProjectGenerator, tsRdbGenerator, tsWebsiteAuthGenerator, tsWebsiteGenerator } from "../../sdk/ts.js";
|
|
10
|
+
import { installDependencies } from "../../utils/install.js";
|
|
11
|
+
import { toSnakeCase } from "../../utils/names.js";
|
|
12
|
+
import { getNpmScope, getNpmScopePrefix } from "../../utils/npm-scope.js";
|
|
13
|
+
/**
|
|
14
|
+
* Scaffolds every generator, component and connection permutation the e2e tests
|
|
15
|
+
* cover, by composing the generators in-process on a single tree.
|
|
16
|
+
*
|
|
17
|
+
* This ships with the plugin so each released version carries the matrix of the
|
|
18
|
+
* generators *it* had. A test upgrading an old workspace scaffolds with the
|
|
19
|
+
* released version's own matrix and never has to reason about which generators
|
|
20
|
+
* existed when — driving the CLI from the test repo instead would couple the
|
|
21
|
+
* test to a generator list that only describes today's plugin.
|
|
22
|
+
*
|
|
23
|
+
* Hidden and undocumented: it exists for the e2e suite, not for users.
|
|
24
|
+
*
|
|
25
|
+
* Options are typed against each generator's schema, so adding a required option
|
|
26
|
+
* or changing an enum breaks the build here rather than silently reducing
|
|
27
|
+
* coverage.
|
|
28
|
+
*
|
|
29
|
+
* Projects are generated with `preferInstallDependencies: false` by default and
|
|
30
|
+
* the returned callback installs once. Nothing composed here reads the project
|
|
31
|
+
* graph (only `ts#sync` does, which is not part of the matrix), so no
|
|
32
|
+
* intermediate install is needed.
|
|
33
|
+
*/ export const internalTestMatrixGenerator = async (tree, options = {})=>{
|
|
34
|
+
const preferInstallDependencies = options.preferInstallDependencies ?? false;
|
|
35
|
+
const defaults = {
|
|
36
|
+
preferInstallDependencies
|
|
37
|
+
};
|
|
38
|
+
const projectDefaults = {
|
|
39
|
+
...defaults,
|
|
40
|
+
directory: 'packages'
|
|
41
|
+
};
|
|
42
|
+
// Fully-qualified project names, which differ per language: TypeScript
|
|
43
|
+
// projects are scope-prefixed, Python ones are dotted snake_case. Derived from
|
|
44
|
+
// the workspace rather than hardcoded, so the matrix works in any workspace.
|
|
45
|
+
const ts = (name)=>`${getNpmScopePrefix(tree)}${name}`;
|
|
46
|
+
const py = (name)=>`${toSnakeCase(getNpmScope(tree))}.${toSnakeCase(name)}`;
|
|
47
|
+
// The infrastructure project every other generator deploys into. Which
|
|
48
|
+
// generator owns it depends on the workspace's IaC provider, so the caller
|
|
49
|
+
// asks for the one matching the workspace it created.
|
|
50
|
+
if (options.infra === 'terraform') {
|
|
51
|
+
await terraformProjectGenerator(tree, {
|
|
52
|
+
name: 'infra',
|
|
53
|
+
type: 'application',
|
|
54
|
+
...projectDefaults
|
|
55
|
+
});
|
|
56
|
+
} else {
|
|
57
|
+
await tsInfraGenerator(tree, {
|
|
58
|
+
name: 'infra',
|
|
59
|
+
...projectDefaults
|
|
60
|
+
});
|
|
61
|
+
// A second CDK app with stage config, which only ts#infra offers.
|
|
62
|
+
await tsInfraGenerator(tree, {
|
|
63
|
+
name: 'infra-with-stages',
|
|
64
|
+
stageConfig: true,
|
|
65
|
+
...projectDefaults
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// Websites (with and without TanStack Router), a docs site, and auth on each.
|
|
69
|
+
await tsWebsiteGenerator(tree, {
|
|
70
|
+
name: 'website',
|
|
71
|
+
iac: 'inherit',
|
|
72
|
+
...projectDefaults
|
|
73
|
+
});
|
|
74
|
+
await tsWebsiteGenerator(tree, {
|
|
75
|
+
name: 'website-no-router',
|
|
76
|
+
tanstackRouter: false,
|
|
77
|
+
iac: 'inherit',
|
|
78
|
+
...projectDefaults
|
|
79
|
+
});
|
|
80
|
+
await tsAstroDocsGenerator(tree, {
|
|
81
|
+
name: 'docs-site',
|
|
82
|
+
...defaults
|
|
83
|
+
});
|
|
84
|
+
await tsWebsiteAuthGenerator(tree, {
|
|
85
|
+
project: ts('website'),
|
|
86
|
+
cognitoDomain: 'test',
|
|
87
|
+
allowSignup: true,
|
|
88
|
+
iac: 'inherit',
|
|
89
|
+
...defaults
|
|
90
|
+
});
|
|
91
|
+
await tsWebsiteAuthGenerator(tree, {
|
|
92
|
+
project: ts('website-no-router'),
|
|
93
|
+
cognitoDomain: 'test-no-router',
|
|
94
|
+
allowSignup: true,
|
|
95
|
+
iac: 'inherit',
|
|
96
|
+
...defaults
|
|
97
|
+
});
|
|
98
|
+
// tRPC APIs — REST + HTTP, with Cognito and custom auth.
|
|
99
|
+
const tsApis = [
|
|
100
|
+
{
|
|
101
|
+
name: 'my-api',
|
|
102
|
+
infra: 'rest-lambda',
|
|
103
|
+
auth: 'iam',
|
|
104
|
+
iac: 'inherit'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'my-api-http',
|
|
108
|
+
infra: 'http-lambda',
|
|
109
|
+
auth: 'iam',
|
|
110
|
+
iac: 'inherit'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'my-api-custom',
|
|
114
|
+
infra: 'rest-lambda',
|
|
115
|
+
auth: 'custom',
|
|
116
|
+
iac: 'inherit'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'my-api-custom-http',
|
|
120
|
+
infra: 'http-lambda',
|
|
121
|
+
auth: 'custom',
|
|
122
|
+
iac: 'inherit'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'my-smithy-api',
|
|
126
|
+
framework: 'smithy',
|
|
127
|
+
infra: 'rest-lambda',
|
|
128
|
+
auth: 'iam',
|
|
129
|
+
iac: 'inherit'
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
for (const api of tsApis){
|
|
133
|
+
await tsApiGenerator(tree, {
|
|
134
|
+
...api,
|
|
135
|
+
...projectDefaults
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Python FastAPI — REST + HTTP, with Cognito and custom auth.
|
|
139
|
+
const pyApis = [
|
|
140
|
+
{
|
|
141
|
+
name: 'py-api',
|
|
142
|
+
infra: 'rest-lambda',
|
|
143
|
+
auth: 'iam',
|
|
144
|
+
iac: 'inherit'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'py-api-http',
|
|
148
|
+
infra: 'http-lambda',
|
|
149
|
+
auth: 'iam',
|
|
150
|
+
iac: 'inherit'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'py-api-custom',
|
|
154
|
+
infra: 'rest-lambda',
|
|
155
|
+
auth: 'custom',
|
|
156
|
+
iac: 'inherit'
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'py-api-custom-http',
|
|
160
|
+
infra: 'http-lambda',
|
|
161
|
+
auth: 'custom',
|
|
162
|
+
iac: 'inherit'
|
|
163
|
+
}
|
|
164
|
+
];
|
|
165
|
+
for (const api of pyApis){
|
|
166
|
+
await pyApiGenerator(tree, {
|
|
167
|
+
...api,
|
|
168
|
+
...projectDefaults
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
// Library projects hosting the components below, each with a lambda function.
|
|
172
|
+
await pyProjectGenerator(tree, {
|
|
173
|
+
name: 'py-project',
|
|
174
|
+
type: 'application',
|
|
175
|
+
...projectDefaults
|
|
176
|
+
});
|
|
177
|
+
await tsProjectGenerator(tree, {
|
|
178
|
+
name: 'ts-project',
|
|
179
|
+
...projectDefaults
|
|
180
|
+
});
|
|
181
|
+
await pyLambdaFunctionGenerator(tree, {
|
|
182
|
+
project: py('py-project'),
|
|
183
|
+
name: 'my-function',
|
|
184
|
+
event: 'Any',
|
|
185
|
+
iac: 'inherit',
|
|
186
|
+
...defaults
|
|
187
|
+
});
|
|
188
|
+
await tsLambdaFunctionGenerator(tree, {
|
|
189
|
+
project: 'ts-project',
|
|
190
|
+
name: 'my-function',
|
|
191
|
+
event: 'Any',
|
|
192
|
+
iac: 'inherit',
|
|
193
|
+
...defaults
|
|
194
|
+
});
|
|
195
|
+
// MCP servers — uninfra'd and hosted on AgentCore.
|
|
196
|
+
await pyMcpServerGenerator(tree, {
|
|
197
|
+
project: 'py_project',
|
|
198
|
+
name: 'my-mcp-server',
|
|
199
|
+
infra: 'agentcore',
|
|
200
|
+
iac: 'inherit',
|
|
201
|
+
...defaults
|
|
202
|
+
});
|
|
203
|
+
await tsMcpServerGenerator(tree, {
|
|
204
|
+
project: 'ts-project',
|
|
205
|
+
name: 'my-mcp-server',
|
|
206
|
+
infra: 'none',
|
|
207
|
+
iac: 'inherit',
|
|
208
|
+
...defaults
|
|
209
|
+
});
|
|
210
|
+
await tsMcpServerGenerator(tree, {
|
|
211
|
+
project: 'ts-project',
|
|
212
|
+
name: 'hosted-mcp-server',
|
|
213
|
+
infra: 'agentcore',
|
|
214
|
+
iac: 'inherit',
|
|
215
|
+
...defaults
|
|
216
|
+
});
|
|
217
|
+
// OAuth DCR proxy for Cognito-authenticated MCP servers.
|
|
218
|
+
await tsDcrProxyGenerator(tree, {
|
|
219
|
+
name: 'my-dcr-proxy',
|
|
220
|
+
iac: 'inherit',
|
|
221
|
+
...projectDefaults
|
|
222
|
+
});
|
|
223
|
+
// TypeScript agents across every protocol and auth permutation. The unnamed
|
|
224
|
+
// one takes the generator's default name, which the connections below use.
|
|
225
|
+
const tsAgents = [
|
|
226
|
+
{
|
|
227
|
+
project: 'ts-project',
|
|
228
|
+
name: 'my-ts-agent',
|
|
229
|
+
infra: 'none',
|
|
230
|
+
iac: 'inherit'
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
project: 'ts-project',
|
|
234
|
+
infra: 'agentcore',
|
|
235
|
+
iac: 'inherit'
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
project: 'ts-project',
|
|
239
|
+
name: 'my-ts-a2a-agent',
|
|
240
|
+
protocol: 'a2a',
|
|
241
|
+
infra: 'agentcore',
|
|
242
|
+
iac: 'inherit'
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
project: 'ts-project',
|
|
246
|
+
name: 'my-ts-a2a-agent-cognito',
|
|
247
|
+
protocol: 'a2a',
|
|
248
|
+
auth: 'cognito',
|
|
249
|
+
infra: 'agentcore',
|
|
250
|
+
iac: 'inherit'
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
project: 'ts-project',
|
|
254
|
+
name: 'my-ts-agui-agent',
|
|
255
|
+
protocol: 'ag-ui',
|
|
256
|
+
infra: 'agentcore',
|
|
257
|
+
iac: 'inherit'
|
|
258
|
+
}
|
|
259
|
+
];
|
|
260
|
+
for (const agent of tsAgents){
|
|
261
|
+
await tsAgentGenerator(tree, {
|
|
262
|
+
...agent,
|
|
263
|
+
...defaults
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
// Python agents: Strands across every protocol, plus LangChain in its own
|
|
267
|
+
// project — langchain's dependency closure would push the zip-bundled Lambda
|
|
268
|
+
// in py-project past its unzipped size limit.
|
|
269
|
+
const pyAgents = [
|
|
270
|
+
{
|
|
271
|
+
project: 'py_project',
|
|
272
|
+
name: 'my-agent',
|
|
273
|
+
infra: 'agentcore',
|
|
274
|
+
iac: 'inherit'
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
project: 'py_project',
|
|
278
|
+
name: 'my-py-a2a-agent',
|
|
279
|
+
protocol: 'a2a',
|
|
280
|
+
infra: 'agentcore',
|
|
281
|
+
iac: 'inherit'
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
project: 'py_project',
|
|
285
|
+
name: 'my-py-a2a-agent-cognito',
|
|
286
|
+
protocol: 'a2a',
|
|
287
|
+
auth: 'cognito',
|
|
288
|
+
infra: 'agentcore',
|
|
289
|
+
iac: 'inherit'
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
project: 'py_project',
|
|
293
|
+
name: 'my-py-agui-agent',
|
|
294
|
+
protocol: 'ag-ui',
|
|
295
|
+
infra: 'agentcore',
|
|
296
|
+
iac: 'inherit'
|
|
297
|
+
}
|
|
298
|
+
];
|
|
299
|
+
for (const agent of pyAgents){
|
|
300
|
+
await pyAgentGenerator(tree, {
|
|
301
|
+
...agent,
|
|
302
|
+
...defaults
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
await pyProjectGenerator(tree, {
|
|
306
|
+
name: 'py-langchain-project',
|
|
307
|
+
type: 'application',
|
|
308
|
+
...projectDefaults
|
|
309
|
+
});
|
|
310
|
+
const langchainAgents = [
|
|
311
|
+
{
|
|
312
|
+
project: 'py_langchain_project',
|
|
313
|
+
name: 'my-py-langchain-agent',
|
|
314
|
+
protocol: 'ag-ui',
|
|
315
|
+
iac: 'inherit'
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
project: 'py_langchain_project',
|
|
319
|
+
name: 'my-py-langchain-http-agent',
|
|
320
|
+
protocol: 'http',
|
|
321
|
+
iac: 'inherit'
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
project: 'py_langchain_project',
|
|
325
|
+
name: 'my-py-langchain-a2a-agent',
|
|
326
|
+
protocol: 'a2a',
|
|
327
|
+
iac: 'inherit'
|
|
328
|
+
}
|
|
329
|
+
];
|
|
330
|
+
for (const agent of langchainAgents){
|
|
331
|
+
await pyAgentGenerator(tree, {
|
|
332
|
+
...agent,
|
|
333
|
+
framework: 'langchain',
|
|
334
|
+
infra: 'agentcore',
|
|
335
|
+
...defaults
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
// AgentCore gateways, including a parent fronting the first (chained).
|
|
339
|
+
await agentcoreGatewayGenerator(tree, {
|
|
340
|
+
name: 'my-gateway',
|
|
341
|
+
iac: 'inherit',
|
|
342
|
+
...projectDefaults
|
|
343
|
+
});
|
|
344
|
+
await agentcoreGatewayGenerator(tree, {
|
|
345
|
+
name: 'parent-gateway',
|
|
346
|
+
iac: 'inherit',
|
|
347
|
+
...projectDefaults
|
|
348
|
+
});
|
|
349
|
+
// Databases — DynamoDB, plus Aurora across both engines and ORMs.
|
|
350
|
+
await tsDynamoDBGenerator(tree, {
|
|
351
|
+
name: 'my-table',
|
|
352
|
+
framework: 'electrodb',
|
|
353
|
+
infra: 'dynamodb',
|
|
354
|
+
iac: 'inherit',
|
|
355
|
+
...projectDefaults
|
|
356
|
+
});
|
|
357
|
+
await pyDynamoDBGenerator(tree, {
|
|
358
|
+
name: 'my-py-table',
|
|
359
|
+
framework: 'pynamodb',
|
|
360
|
+
infra: 'dynamodb',
|
|
361
|
+
iac: 'inherit',
|
|
362
|
+
...projectDefaults
|
|
363
|
+
});
|
|
364
|
+
const tsRdbs = [
|
|
365
|
+
{
|
|
366
|
+
name: 'postgres-db',
|
|
367
|
+
infra: 'aurora',
|
|
368
|
+
engine: 'postgres',
|
|
369
|
+
framework: 'prisma',
|
|
370
|
+
iac: 'inherit'
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'my-sql-db',
|
|
374
|
+
infra: 'aurora',
|
|
375
|
+
engine: 'mysql',
|
|
376
|
+
framework: 'prisma',
|
|
377
|
+
iac: 'inherit'
|
|
378
|
+
}
|
|
379
|
+
];
|
|
380
|
+
for (const rdb of tsRdbs){
|
|
381
|
+
await tsRdbGenerator(tree, {
|
|
382
|
+
...rdb,
|
|
383
|
+
...projectDefaults
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
const pyRdbs = [
|
|
387
|
+
{
|
|
388
|
+
name: 'py-postgres-db',
|
|
389
|
+
infra: 'aurora',
|
|
390
|
+
engine: 'postgres',
|
|
391
|
+
framework: 'sqlmodel',
|
|
392
|
+
iac: 'inherit'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'py-mysql-db',
|
|
396
|
+
infra: 'aurora',
|
|
397
|
+
engine: 'mysql',
|
|
398
|
+
framework: 'sqlmodel',
|
|
399
|
+
iac: 'inherit'
|
|
400
|
+
}
|
|
401
|
+
];
|
|
402
|
+
for (const rdb of pyRdbs){
|
|
403
|
+
await pyRdbGenerator(tree, {
|
|
404
|
+
...rdb,
|
|
405
|
+
...projectDefaults
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
// Every connection edge the matrix covers.
|
|
409
|
+
const connections = [
|
|
410
|
+
// Website -> API
|
|
411
|
+
{
|
|
412
|
+
sourceProject: ts('website'),
|
|
413
|
+
targetProject: ts('my-api')
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
sourceProject: ts('website-no-router'),
|
|
417
|
+
targetProject: ts('my-api')
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
sourceProject: 'website',
|
|
421
|
+
targetProject: 'py_api'
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
sourceProject: 'website',
|
|
425
|
+
targetProject: 'my-smithy-api'
|
|
426
|
+
},
|
|
427
|
+
// Agent -> MCP server
|
|
428
|
+
{
|
|
429
|
+
sourceProject: 'ts-project',
|
|
430
|
+
sourceComponent: 'agent',
|
|
431
|
+
targetProject: 'ts-project',
|
|
432
|
+
targetComponent: 'hosted-mcp-server'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
sourceProject: 'ts-project',
|
|
436
|
+
sourceComponent: 'my-ts-agui-agent',
|
|
437
|
+
targetProject: 'ts-project',
|
|
438
|
+
targetComponent: 'hosted-mcp-server'
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
sourceProject: 'ts-project',
|
|
442
|
+
sourceComponent: 'agent',
|
|
443
|
+
targetProject: 'py_project',
|
|
444
|
+
targetComponent: 'my-mcp-server'
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
sourceProject: 'py_project',
|
|
448
|
+
sourceComponent: 'my-agent',
|
|
449
|
+
targetProject: 'py_project',
|
|
450
|
+
targetComponent: 'my-mcp-server'
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
sourceProject: 'py_langchain_project',
|
|
454
|
+
sourceComponent: 'my-py-langchain-agent',
|
|
455
|
+
targetProject: 'py_project',
|
|
456
|
+
targetComponent: 'my-mcp-server'
|
|
457
|
+
},
|
|
458
|
+
// HTTP agent <-> A2A agent
|
|
459
|
+
{
|
|
460
|
+
sourceProject: 'ts-project',
|
|
461
|
+
sourceComponent: 'agent',
|
|
462
|
+
targetProject: 'ts-project',
|
|
463
|
+
targetComponent: 'my-ts-a2a-agent'
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
sourceProject: 'ts-project',
|
|
467
|
+
sourceComponent: 'agent',
|
|
468
|
+
targetProject: 'py_project',
|
|
469
|
+
targetComponent: 'my-py-a2a-agent'
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
sourceProject: 'py_project',
|
|
473
|
+
sourceComponent: 'my-agent',
|
|
474
|
+
targetProject: 'ts-project',
|
|
475
|
+
targetComponent: 'my-ts-a2a-agent'
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
sourceProject: 'py_project',
|
|
479
|
+
sourceComponent: 'my-agent',
|
|
480
|
+
targetProject: 'py_project',
|
|
481
|
+
targetComponent: 'my-py-a2a-agent'
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
sourceProject: 'py_langchain_project',
|
|
485
|
+
sourceComponent: 'my-py-langchain-agent',
|
|
486
|
+
targetProject: 'py_project',
|
|
487
|
+
targetComponent: 'my-py-a2a-agent'
|
|
488
|
+
},
|
|
489
|
+
// Agent -> gateway, gateway -> MCP server, gateway -> gateway
|
|
490
|
+
{
|
|
491
|
+
sourceProject: 'ts-project',
|
|
492
|
+
sourceComponent: 'agent',
|
|
493
|
+
targetProject: ts('my-gateway')
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
sourceProject: 'py_project',
|
|
497
|
+
sourceComponent: 'my-agent',
|
|
498
|
+
targetProject: ts('my-gateway')
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
sourceProject: 'py_langchain_project',
|
|
502
|
+
sourceComponent: 'my-py-langchain-agent',
|
|
503
|
+
targetProject: ts('my-gateway')
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
sourceProject: ts('my-gateway'),
|
|
507
|
+
targetProject: 'ts-project',
|
|
508
|
+
targetComponent: 'hosted-mcp-server'
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
sourceProject: ts('my-gateway'),
|
|
512
|
+
targetProject: 'py_project',
|
|
513
|
+
targetComponent: 'my-mcp-server'
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
sourceProject: ts('parent-gateway'),
|
|
517
|
+
targetProject: ts('my-gateway')
|
|
518
|
+
},
|
|
519
|
+
// Website -> agent
|
|
520
|
+
{
|
|
521
|
+
sourceProject: ts('website'),
|
|
522
|
+
targetProject: 'ts-project',
|
|
523
|
+
targetComponent: 'agent'
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
sourceProject: ts('website'),
|
|
527
|
+
targetProject: 'ts-project',
|
|
528
|
+
targetComponent: 'my-ts-agui-agent'
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
sourceProject: ts('website'),
|
|
532
|
+
targetProject: 'py_project',
|
|
533
|
+
targetComponent: 'my-agent'
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
sourceProject: ts('website'),
|
|
537
|
+
targetProject: 'py_project',
|
|
538
|
+
targetComponent: 'my-py-agui-agent'
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
sourceProject: ts('website'),
|
|
542
|
+
targetProject: 'py_langchain_project',
|
|
543
|
+
targetComponent: 'my-py-langchain-agent'
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
sourceProject: ts('website'),
|
|
547
|
+
targetProject: 'py_langchain_project',
|
|
548
|
+
targetComponent: 'my-py-langchain-http-agent'
|
|
549
|
+
},
|
|
550
|
+
// DynamoDB
|
|
551
|
+
{
|
|
552
|
+
sourceProject: 'my-api',
|
|
553
|
+
targetProject: ts('my-table')
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
sourceProject: 'my-smithy-api',
|
|
557
|
+
targetProject: ts('my-table')
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
sourceProject: 'ts-project',
|
|
561
|
+
sourceComponent: 'my-ts-agent',
|
|
562
|
+
targetProject: ts('my-table')
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
sourceProject: 'ts-project',
|
|
566
|
+
sourceComponent: 'my-mcp-server',
|
|
567
|
+
targetProject: ts('my-table')
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
sourceProject: 'py_api',
|
|
571
|
+
targetProject: 'my_py_table'
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
sourceProject: 'py_project',
|
|
575
|
+
sourceComponent: 'my-agent',
|
|
576
|
+
targetProject: 'my_py_table'
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
sourceProject: 'py_project',
|
|
580
|
+
sourceComponent: 'my-mcp-server',
|
|
581
|
+
targetProject: 'my_py_table'
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
sourceProject: 'py_langchain_project',
|
|
585
|
+
sourceComponent: 'my-py-langchain-http-agent',
|
|
586
|
+
targetProject: 'my_py_table'
|
|
587
|
+
},
|
|
588
|
+
// Relational databases
|
|
589
|
+
{
|
|
590
|
+
sourceProject: 'py_api',
|
|
591
|
+
targetProject: 'py_postgres_db'
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
sourceProject: 'py_project',
|
|
595
|
+
sourceComponent: 'my-agent',
|
|
596
|
+
targetProject: 'py_postgres_db'
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
sourceProject: 'py_project',
|
|
600
|
+
sourceComponent: 'my-mcp-server',
|
|
601
|
+
targetProject: 'py_postgres_db'
|
|
602
|
+
}
|
|
603
|
+
];
|
|
604
|
+
for (const connection of connections){
|
|
605
|
+
await connectionGenerator(tree, {
|
|
606
|
+
...connection,
|
|
607
|
+
...defaults
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
// Licensing, then an Nx plugin with a custom generator.
|
|
611
|
+
await licenseGenerator(tree, {
|
|
612
|
+
license: 'Apache-2.0',
|
|
613
|
+
copyrightHolder: 'Amazon.com, Inc. or its affiliates',
|
|
614
|
+
...defaults
|
|
615
|
+
});
|
|
616
|
+
await tsNxPluginGenerator(tree, {
|
|
617
|
+
...projectDefaults,
|
|
618
|
+
name: 'plugin',
|
|
619
|
+
directory: 'tools'
|
|
620
|
+
});
|
|
621
|
+
await tsNxGeneratorGenerator(tree, {
|
|
622
|
+
project: ts('plugin'),
|
|
623
|
+
name: 'my#generator',
|
|
624
|
+
...defaults
|
|
625
|
+
});
|
|
626
|
+
// A migration of each kind, so the scaffolded codemods compile and the
|
|
627
|
+
// plugin's migrations.json (created by the first run) registers all three.
|
|
628
|
+
const migrations = [
|
|
629
|
+
{
|
|
630
|
+
name: 'rename-foo-target',
|
|
631
|
+
description: 'Rename the foo target to bar'
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'migrate-custom-handlers',
|
|
635
|
+
description: 'Update custom handlers for the new API',
|
|
636
|
+
kind: 'agentic'
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: 'upgrade-framework',
|
|
640
|
+
description: 'Upgrade the framework and reconcile call sites',
|
|
641
|
+
kind: 'hybrid'
|
|
642
|
+
}
|
|
643
|
+
];
|
|
644
|
+
for (const migration of migrations){
|
|
645
|
+
await tsNxMigrationGenerator(tree, {
|
|
646
|
+
...migration,
|
|
647
|
+
project: ts('plugin'),
|
|
648
|
+
...defaults
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
return ()=>installDependencies(tree, preferInstallDependencies, {
|
|
652
|
+
languages: [
|
|
653
|
+
'typescript',
|
|
654
|
+
'python'
|
|
655
|
+
]
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
export default internalTestMatrixGenerator;
|
|
659
|
+
|
|
660
|
+
//# sourceMappingURL=generator.js.map
|