@aws/nx-plugin 1.2.0 → 1.3.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.
Files changed (88) hide show
  1. package/LICENSE-THIRD-PARTY +107 -259
  2. package/README.md +1 -0
  3. package/generators.json +8 -0
  4. package/migrations.json +53 -10
  5. package/package.json +14 -14
  6. package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +1 -1
  7. package/src/greengrass/component/python/__snapshots__/generator.spec.ts.snap +8 -8
  8. package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
  9. package/src/internal/test-matrix/generator.js +6 -1
  10. package/src/internal/test-matrix/generator.js.map +1 -1
  11. package/src/migrations/latest/biome-markdown-yaml-formatter-off/metadata.json +3 -0
  12. package/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.d.ts +6 -0
  13. package/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.js +113 -0
  14. package/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.js.map +1 -0
  15. package/src/migrations/v1.0.15/0001-py-agent-pillow-override/migration.js.map +1 -0
  16. package/src/migrations/v1.1.1/0001-ts-agent-guardrails-synth-input/migration.js.map +1 -0
  17. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/metadata.json +3 -0
  18. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.d.ts +6 -0
  19. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.js +118 -0
  20. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.js.map +1 -0
  21. package/src/preset/__snapshots__/generator.spec.ts.snap +17 -5
  22. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
  23. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +7 -7
  24. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +4 -4
  25. package/src/py/agent/guardrails/__snapshots__/generator.spec.ts.snap +3813 -0
  26. package/src/py/agent/guardrails/files/langchain/guardrail.py.template +135 -0
  27. package/src/py/agent/guardrails/files/strands/guardrail.py.template +93 -0
  28. package/src/py/agent/guardrails/generator.d.ts +10 -0
  29. package/src/py/agent/guardrails/generator.js +175 -0
  30. package/src/py/agent/guardrails/generator.js.map +1 -0
  31. package/src/py/agent/guardrails/runtime-check/run_checks.py +250 -0
  32. package/src/py/agent/guardrails/schema.d.js +6 -0
  33. package/src/py/agent/guardrails/schema.d.js.map +1 -0
  34. package/src/py/agent/guardrails/schema.d.ts +9 -0
  35. package/src/py/agent/guardrails/schema.json +25 -0
  36. package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  37. package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
  38. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  39. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
  40. package/src/py/rdb/__snapshots__/generator.spec.ts.snap +4 -4
  41. package/src/sdk/py.d.ts +2 -0
  42. package/src/sdk/py.js +1 -0
  43. package/src/sdk/py.js.map +1 -1
  44. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +5 -5
  45. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +8 -8
  46. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
  47. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +3 -3
  48. package/src/ts/agent/guardrails/__snapshots__/generator.spec.ts.snap +57 -6
  49. package/src/ts/agent/guardrails/generator.js +2 -1
  50. package/src/ts/agent/guardrails/generator.js.map +1 -1
  51. package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +1 -1
  52. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  53. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  54. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
  55. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +4 -4
  56. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +53 -33
  57. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
  58. package/src/utils/format.d.ts +10 -0
  59. package/src/utils/format.js +11 -0
  60. package/src/utils/format.js.map +1 -1
  61. package/src/utils/guardrail-constructs/files/terraform/app/guardrails/__nameKebabCase__/__nameKebabCase__-guardrail.tf.template +18 -1
  62. package/src/utils/guardrail-constructs/guardrail-constructs.d.ts +5 -0
  63. package/src/utils/guardrail-constructs/guardrail-constructs.js +8 -0
  64. package/src/utils/guardrail-constructs/guardrail-constructs.js.map +1 -1
  65. package/src/utils/guardrail-constructs/guardrail-wiring.d.ts +7 -0
  66. package/src/utils/guardrail-constructs/guardrail-wiring.js +6 -5
  67. package/src/utils/guardrail-constructs/guardrail-wiring.js.map +1 -1
  68. package/src/utils/test/fake-aws/fake_aws.py +205 -0
  69. package/src/utils/test/python-dependencies.d.ts +6 -0
  70. package/src/utils/test/python-dependencies.js +19 -0
  71. package/src/utils/test/python-dependencies.js.map +1 -1
  72. package/src/utils/test/warm-python-cache.js +5 -1
  73. package/src/utils/test/warm-python-cache.js.map +1 -1
  74. package/src/utils/version-upgrade-migration/sync-vended-versions.d.ts +8 -0
  75. package/src/utils/version-upgrade-migration/sync-vended-versions.js +11 -2
  76. package/src/utils/version-upgrade-migration/sync-vended-versions.js.map +1 -1
  77. package/src/utils/versions.d.ts +71 -71
  78. package/src/utils/versions.js +68 -68
  79. package/src/utils/versions.js.map +1 -1
  80. package/src/migrations/latest/py-agent-pillow-override/migration.js.map +0 -1
  81. package/src/migrations/latest/ts-agent-guardrails-synth-input/migration.js.map +0 -1
  82. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/metadata.json +0 -0
  83. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/migration.d.ts +0 -0
  84. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/migration.js +0 -0
  85. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/metadata.json +0 -0
  86. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/migration.d.ts +0 -0
  87. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/migration.js +0 -0
  88. /package/src/{ts/agent/guardrails/files/agent → utils/guardrail-constructs/files/policy}/guardrail.json.template +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -36,21 +36,21 @@
36
36
  "node": "^22.13.0 || ^24.0.0 || >=26.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "nx": "23.3.0"
39
+ "nx": "23.3.1"
40
40
  },
41
41
  "dependencies": {
42
42
  "@apidevtools/swagger-parser": "12.1.0",
43
- "@astral-sh/ruff-wasm-nodejs": "0.17.1",
44
- "@biomejs/js-api": "6.0.0",
45
- "@biomejs/wasm-nodejs": "2.5.15",
43
+ "@astral-sh/ruff-wasm-nodejs": "0.17.2",
44
+ "@biomejs/js-api": "6.1.0",
45
+ "@biomejs/wasm-nodejs": "2.6.3",
46
46
  "@getgrit/gritql": "0.0.3",
47
47
  "@iarna/toml": "2.2.5",
48
- "@modelcontextprotocol/sdk": "1.32.1",
49
- "@nx/devkit": "23.3.0",
50
- "@nx/js": "23.3.0",
51
- "@nx/react": "23.3.0",
52
- "@nx/vite": "23.3.0",
53
- "@nxlv/python": "23.2.1",
48
+ "@modelcontextprotocol/sdk": "1.32.2",
49
+ "@nx/devkit": "23.3.1",
50
+ "@nx/js": "23.3.1",
51
+ "@nx/react": "23.3.1",
52
+ "@nx/vite": "23.3.1",
53
+ "@nxlv/python": "23.3.1",
54
54
  "@phenomnomnominal/tsquery": "6.2.0",
55
55
  "@types/estree": "1.0.9",
56
56
  "@types/js-yaml": "4.0.9",
@@ -78,9 +78,9 @@
78
78
  "spdx-satisfies": "6.0.0",
79
79
  "typescript": "6.0.3",
80
80
  "unified": "11.0.5",
81
- "unist-util-visit": "5.1.0",
82
- "vite": "8.3.4",
83
- "vitest": "5.0.4",
81
+ "unist-util-visit": "5.2.0",
82
+ "vite": "8.3.5",
83
+ "vitest": "5.0.5",
84
84
  "zod": "4.6.7"
85
85
  },
86
86
  "devDependencies": {
@@ -7,7 +7,7 @@ exports[`agentcore-gateway generator > protocol: http > omits protocol_type from
7
7
  required_providers {
8
8
  aws = {
9
9
  source = "hashicorp/aws"
10
- version = "6.69.1"
10
+ version = "6.70.0"
11
11
  }
12
12
  time = {
13
13
  source = "hashicorp/time"
@@ -217,11 +217,11 @@ def test_run_once_does_not_raise():
217
217
  - packages/common/*
218
218
  catalog:
219
219
  '@types/node': 26.6.5
220
- vite: 8.3.4
221
- vitest: 5.0.4
222
- '@vitest/coverage-v8': 5.0.4
220
+ vite: 8.3.5
221
+ vitest: 5.0.5
222
+ '@vitest/coverage-v8': 5.0.5
223
223
  jsdom: 29.1.1
224
- '@nx/vitest': 23.3.0
224
+ '@nx/vitest': 23.3.1
225
225
  js-yaml: 4.3.2
226
226
  '@types/js-yaml': 4.0.9
227
227
  tsx: 4.23.15
@@ -436,11 +436,11 @@ def test_run_once_does_not_raise():
436
436
  - packages/common/*
437
437
  catalog:
438
438
  '@types/node': 26.6.5
439
- vite: 8.3.4
440
- vitest: 5.0.4
441
- '@vitest/coverage-v8': 5.0.4
439
+ vite: 8.3.5
440
+ vitest: 5.0.5
441
+ '@vitest/coverage-v8': 5.0.5
442
442
  jsdom: 29.1.1
443
- '@nx/vitest': 23.3.0
443
+ '@nx/vitest': 23.3.1
444
444
  js-yaml: 4.3.2
445
445
  '@types/js-yaml': 4.0.9
446
446
  tsx: 4.23.15
@@ -50,7 +50,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
50
50
  "default",
51
51
  ],
52
52
  "options": {
53
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
53
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
54
54
  },
55
55
  "outputs": [
56
56
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -150,7 +150,7 @@ exports[`infra generator > should configure project.json with correct targets >
150
150
  "default",
151
151
  ],
152
152
  "options": {
153
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
153
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
154
154
  },
155
155
  "outputs": [
156
156
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -767,7 +767,7 @@ exports[`infra generator > should handle custom project names correctly > custom
767
767
  "default",
768
768
  ],
769
769
  "options": {
770
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
770
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
771
771
  },
772
772
  "outputs": [
773
773
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -6,7 +6,7 @@ import { agentcoreHarnessGenerator } from "../../sdk/agentcore-harness.js";
6
6
  import { connectionGenerator } from "../../sdk/connection.js";
7
7
  import { greengrassComponentGenerator } from "../../sdk/greengrass.js";
8
8
  import { licenseGenerator } from "../../sdk/license.js";
9
- import { pyAgentGenerator, pyApiGenerator, pyDynamoDBGenerator, pyLambdaFunctionGenerator, pyMcpServerGenerator, pyProjectGenerator, pyRdbGenerator } from "../../sdk/py.js";
9
+ import { pyAgentGenerator, pyAgentGuardrailsGenerator, pyApiGenerator, pyDynamoDBGenerator, pyLambdaFunctionGenerator, pyMcpServerGenerator, pyProjectGenerator, pyRdbGenerator } from "../../sdk/py.js";
10
10
  import { smithyProjectGenerator } from "../../sdk/smithy.js";
11
11
  import { terraformProjectGenerator } from "../../sdk/terraform.js";
12
12
  import { tsAgentGenerator, tsAgentGuardrailsGenerator, tsApiGenerator, tsDcrProxyGenerator, tsDocsGenerator, tsDynamoDBGenerator, tsInfraGenerator, tsLambdaFunctionGenerator, tsMcpServerGenerator, tsNxGeneratorGenerator, tsNxMigrationGenerator, tsNxPluginGenerator, tsProjectGenerator, tsRdbGenerator, tsWebsiteAuthGenerator, tsWebsiteGenerator } from "../../sdk/ts.js";
@@ -401,6 +401,11 @@ import { getNpmScope, getNpmScopePrefix } from "../../utils/npm-scope.js";
401
401
  ...defaults
402
402
  });
403
403
  }
404
+ // Guard the default Python agent, which has AgentCore infrastructure.
405
+ await pyAgentGuardrailsGenerator(tree, {
406
+ project: 'py_project',
407
+ agent: 'my-agent'
408
+ });
404
409
  await pyProjectGenerator(tree, {
405
410
  name: 'py-langchain-project',
406
411
  type: 'application',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/internal/test-matrix/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { GeneratorCallback, Tree } from '@nx/devkit';\nimport { agentcoreGatewayGenerator } from '../../sdk/agentcore-gateway.js';\nimport { agentcoreHarnessGenerator } from '../../sdk/agentcore-harness.js';\nimport {\n type ConnectionGeneratorSchema,\n connectionGenerator,\n} from '../../sdk/connection.js';\nimport { greengrassComponentGenerator } from '../../sdk/greengrass.js';\nimport { licenseGenerator } from '../../sdk/license.js';\nimport {\n type PyAgentGeneratorSchema,\n type PyApiGeneratorSchema,\n type PyRdbGeneratorSchema,\n pyAgentGenerator,\n pyApiGenerator,\n pyDynamoDBGenerator,\n pyLambdaFunctionGenerator,\n pyMcpServerGenerator,\n pyProjectGenerator,\n pyRdbGenerator,\n} from '../../sdk/py.js';\nimport { smithyProjectGenerator } from '../../sdk/smithy.js';\nimport { terraformProjectGenerator } from '../../sdk/terraform.js';\nimport {\n type TsAgentGeneratorSchema,\n type TsApiGeneratorSchema,\n type TsNxMigrationGeneratorSchema,\n type TsRdbGeneratorSchema,\n tsAgentGenerator,\n tsAgentGuardrailsGenerator,\n tsApiGenerator,\n tsDcrProxyGenerator,\n tsDocsGenerator,\n tsDynamoDBGenerator,\n tsInfraGenerator,\n tsLambdaFunctionGenerator,\n tsMcpServerGenerator,\n tsNxGeneratorGenerator,\n tsNxMigrationGenerator,\n tsNxPluginGenerator,\n tsProjectGenerator,\n tsRdbGenerator,\n tsWebsiteAuthGenerator,\n tsWebsiteGenerator,\n} from '../../sdk/ts.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { toSnakeCase } from '../../utils/names.js';\nimport { getNpmScope, getNpmScopePrefix } from '../../utils/npm-scope.js';\nimport type { InternalTestMatrixGeneratorSchema } from './schema';\n\n/**\n * Scaffolds every generator, component and connection permutation the e2e tests\n * cover, by composing the generators in-process on a single tree.\n *\n * This ships with the plugin so each released version carries the matrix of the\n * generators *it* had. A test upgrading an old workspace scaffolds with the\n * released version's own matrix and never has to reason about which generators\n * existed when — driving the CLI from the test repo instead would couple the\n * test to a generator list that only describes today's plugin.\n *\n * Hidden and undocumented: it exists for the e2e suite, not for users.\n *\n * Options are typed against each generator's schema, so adding a required option\n * or changing an enum breaks the build here rather than silently reducing\n * coverage.\n *\n * Projects are generated with `preferInstallDependencies: false` by default and\n * the returned callback installs once. Nothing composed here reads the project\n * graph (only `ts#sync` does, which is not part of the matrix), so no\n * intermediate install is needed.\n */\nexport const internalTestMatrixGenerator = async (\n tree: Tree,\n options: InternalTestMatrixGeneratorSchema = {},\n): Promise<GeneratorCallback> => {\n const preferInstallDependencies = options.preferInstallDependencies ?? false;\n const defaults = { preferInstallDependencies };\n const projectDefaults = { ...defaults, directory: 'packages' };\n // Fully-qualified project names, which differ per language: TypeScript\n // projects are scope-prefixed, Python ones are dotted snake_case. Derived from\n // the workspace rather than hardcoded, so the matrix works in any workspace.\n const ts = (name: string) => `${getNpmScopePrefix(tree)}${name}`;\n const py = (name: string) =>\n `${toSnakeCase(getNpmScope(tree))}.${toSnakeCase(name)}`;\n\n // The infrastructure project every other generator deploys into. Which\n // generator owns it depends on the workspace's IaC provider, so the caller\n // asks for the one matching the workspace it created.\n if (options.infra === 'terraform') {\n await terraformProjectGenerator(tree, {\n name: 'infra',\n type: 'application',\n ...projectDefaults,\n });\n } else {\n await tsInfraGenerator(tree, { name: 'infra', ...projectDefaults });\n // A second CDK app with stage config, which only ts#infra offers.\n await tsInfraGenerator(tree, {\n name: 'infra-with-stages',\n stageConfig: true,\n ...projectDefaults,\n });\n }\n\n // Websites (with and without TanStack Router), a docs site, and auth on each.\n await tsWebsiteGenerator(tree, {\n name: 'website',\n iac: 'inherit',\n ...projectDefaults,\n });\n await tsWebsiteGenerator(tree, {\n name: 'website-no-router',\n tanstackRouter: false,\n iac: 'inherit',\n ...projectDefaults,\n });\n await tsDocsGenerator(tree, { name: 'docs-site', ...defaults });\n await tsWebsiteAuthGenerator(tree, {\n project: ts('website'),\n cognitoDomain: 'test',\n allowSignup: true,\n iac: 'inherit',\n ...defaults,\n });\n await tsWebsiteAuthGenerator(tree, {\n project: ts('website-no-router'),\n cognitoDomain: 'test-no-router',\n allowSignup: true,\n iac: 'inherit',\n ...defaults,\n });\n\n // tRPC APIs — REST + HTTP, with Cognito and custom auth.\n const tsApis: TsApiGeneratorSchema[] = [\n { name: 'my-api', infra: 'rest-lambda', auth: 'iam', iac: 'inherit' },\n { name: 'my-api-http', infra: 'http-lambda', auth: 'iam', iac: 'inherit' },\n // The APIs above take the default `isolated` integration pattern; these\n // cover `shared`.\n {\n name: 'my-api-shared',\n infra: 'rest-lambda',\n auth: 'iam',\n integrationPattern: 'shared',\n iac: 'inherit',\n },\n {\n name: 'my-api-shared-http',\n infra: 'http-lambda',\n auth: 'iam',\n integrationPattern: 'shared',\n iac: 'inherit',\n },\n {\n name: 'my-api-custom',\n infra: 'rest-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'my-api-custom-http',\n infra: 'http-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'my-smithy-api',\n framework: 'smithy',\n infra: 'rest-lambda',\n auth: 'iam',\n iac: 'inherit',\n },\n ];\n for (const api of tsApis) {\n await tsApiGenerator(tree, { ...api, ...projectDefaults });\n }\n\n // A Smithy shape library; `my-smithy-api` covers consuming one.\n await smithyProjectGenerator(tree, {\n name: 'my-shapes',\n type: 'shapes',\n ...projectDefaults,\n });\n\n // Python FastAPI — REST + HTTP, with Cognito and custom auth.\n const pyApis: PyApiGeneratorSchema[] = [\n { name: 'py-api', infra: 'rest-lambda', auth: 'iam', iac: 'inherit' },\n { name: 'py-api-http', infra: 'http-lambda', auth: 'iam', iac: 'inherit' },\n {\n name: 'py-api-custom',\n infra: 'rest-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'py-api-custom-http',\n infra: 'http-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n ];\n for (const api of pyApis) {\n await pyApiGenerator(tree, { ...api, ...projectDefaults });\n }\n\n // Library projects hosting the components below, each with a lambda function.\n await pyProjectGenerator(tree, {\n name: 'py-project',\n type: 'application',\n ...projectDefaults,\n });\n await tsProjectGenerator(tree, { name: 'ts-project', ...projectDefaults });\n await pyLambdaFunctionGenerator(tree, {\n project: py('py-project'),\n name: 'my-function',\n event: 'Any',\n iac: 'inherit',\n ...defaults,\n });\n await tsLambdaFunctionGenerator(tree, {\n project: 'ts-project',\n name: 'my-function',\n event: 'Any',\n iac: 'inherit',\n ...defaults,\n });\n\n // Greengrass: the `AWS::GreengrassV2` resources exist in the\n // `hashicorp/awscc` Terraform provider (this workspace pins it), so both\n // `--iac cdk` and `--iac terraform` are exercised here via `iac: 'inherit'`.\n //\n // A component with publication infrastructure and an app wrapper in the\n // workspace's infrastructure project. Hosted on a dedicated project:\n // vendoring's `--only-binary :all:` refuses the source-built workspace\n // members other entries add to py-project, and one component per project is\n // the documented production default.\n await pyProjectGenerator(tree, {\n name: 'py-greengrass-project',\n type: 'application',\n ...projectDefaults,\n });\n await greengrassComponentGenerator(tree, {\n project: py('py-greengrass-project'),\n name: 'my-greengrass-component',\n language: 'python',\n platform: 'linux-amd64-arm64',\n gdkConfig: true,\n iac: 'inherit',\n ...defaults,\n });\n // The TypeScript component gets a dedicated host project for the same\n // reason: the shared `bundle` target this generator wires rebuilds every\n // bundled entrypoint in its project together, so hosting it alongside\n // `ts-project`'s Lambda function would couple this device-oriented\n // bundle's cache invalidation to an unrelated Lambda bundle's.\n await tsProjectGenerator(tree, {\n name: 'ts-greengrass-project',\n ...projectDefaults,\n });\n await greengrassComponentGenerator(tree, {\n project: 'ts-greengrass-project',\n name: 'my-ts-greengrass-component',\n language: 'typescript',\n ipc: true,\n componentVersion: '1.0.0',\n iac: 'inherit',\n ...defaults,\n });\n\n // MCP servers — uninfra'd and hosted on AgentCore.\n await pyMcpServerGenerator(tree, {\n project: 'py_project',\n name: 'my-mcp-server',\n infra: 'agentcore',\n iac: 'inherit',\n ...defaults,\n });\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'my-mcp-server',\n infra: 'none',\n iac: 'inherit',\n ...defaults,\n });\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'hosted-mcp-server',\n infra: 'agentcore',\n iac: 'inherit',\n ...defaults,\n });\n // Container-packaged variants, so both packagings are covered and a workspace\n // mixing them vends one copy of the shared runtime module.\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'ecr-mcp-server',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n ...defaults,\n });\n await pyMcpServerGenerator(tree, {\n project: 'py_project',\n name: 'ecr-mcp-server',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n ...defaults,\n });\n\n // OAuth DCR proxy for Cognito-authenticated MCP servers.\n await tsDcrProxyGenerator(tree, {\n name: 'my-dcr-proxy',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // TypeScript agents across every protocol and auth permutation. The unnamed\n // one takes the generator's default name, which the connections below use.\n const tsAgents: TsAgentGeneratorSchema[] = [\n {\n project: 'ts-project',\n name: 'my-ts-agent',\n infra: 'none',\n iac: 'inherit',\n },\n { project: 'ts-project', infra: 'agentcore', iac: 'inherit' },\n {\n project: 'ts-project',\n name: 'my-ts-ecr-agent',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-a2a-agent',\n protocol: 'a2a',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-a2a-agent-cognito',\n protocol: 'a2a',\n auth: 'cognito',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-agui-agent',\n protocol: 'ag-ui',\n infra: 'agentcore',\n iac: 'inherit',\n },\n ];\n for (const agent of tsAgents) {\n await tsAgentGenerator(tree, { ...agent, ...defaults });\n }\n // Guard the default agent, which has AgentCore infrastructure.\n await tsAgentGuardrailsGenerator(tree, {\n project: 'ts-project',\n agent: 'agent',\n });\n\n // Python agents: Strands across every protocol, plus LangChain in its own\n // project — langchain's dependency closure would push the zip-bundled Lambda\n // in py-project past its unzipped size limit.\n const pyAgents: PyAgentGeneratorSchema[] = [\n {\n project: 'py_project',\n name: 'my-agent',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-ecr-agent',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-a2a-agent',\n protocol: 'a2a',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-a2a-agent-cognito',\n protocol: 'a2a',\n auth: 'cognito',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-agui-agent',\n protocol: 'ag-ui',\n infra: 'agentcore',\n iac: 'inherit',\n },\n ];\n for (const agent of pyAgents) {\n await pyAgentGenerator(tree, { ...agent, ...defaults });\n }\n await pyProjectGenerator(tree, {\n name: 'py-langchain-project',\n type: 'application',\n ...projectDefaults,\n });\n const langchainAgents: PyAgentGeneratorSchema[] = [\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-agent',\n protocol: 'ag-ui',\n iac: 'inherit',\n },\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-http-agent',\n protocol: 'http',\n iac: 'inherit',\n },\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-a2a-agent',\n protocol: 'a2a',\n iac: 'inherit',\n },\n ];\n for (const agent of langchainAgents) {\n await pyAgentGenerator(tree, {\n ...agent,\n framework: 'langchain',\n infra: 'agentcore',\n ...defaults,\n });\n }\n\n // AgentCore gateways, including a parent fronting the first (chained), and\n // an http-protocol gateway fronting agent runtime targets.\n await agentcoreGatewayGenerator(tree, {\n name: 'my-gateway',\n iac: 'inherit',\n ...projectDefaults,\n });\n await agentcoreGatewayGenerator(tree, {\n name: 'parent-gateway',\n iac: 'inherit',\n ...projectDefaults,\n });\n await agentcoreGatewayGenerator(tree, {\n name: 'agent-gateway',\n protocol: 'http',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // AgentCore Harness — a standalone invocation project.\n await agentcoreHarnessGenerator(tree, {\n name: 'my-harness',\n infra: 'agentcore',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // Databases — DynamoDB, plus Aurora across both engines and ORMs.\n await tsDynamoDBGenerator(tree, {\n name: 'my-table',\n framework: 'electrodb',\n infra: 'dynamodb',\n iac: 'inherit',\n ...projectDefaults,\n });\n await pyDynamoDBGenerator(tree, {\n name: 'my-py-table',\n framework: 'pynamodb',\n infra: 'dynamodb',\n iac: 'inherit',\n ...projectDefaults,\n });\n const tsRdbs: TsRdbGeneratorSchema[] = [\n {\n name: 'postgres-db',\n infra: 'aurora',\n engine: 'postgres',\n framework: 'prisma',\n iac: 'inherit',\n },\n {\n name: 'my-sql-db',\n infra: 'aurora',\n engine: 'mysql',\n framework: 'prisma',\n iac: 'inherit',\n },\n ];\n for (const rdb of tsRdbs) {\n await tsRdbGenerator(tree, { ...rdb, ...projectDefaults });\n }\n const pyRdbs: PyRdbGeneratorSchema[] = [\n {\n name: 'py-postgres-db',\n infra: 'aurora',\n engine: 'postgres',\n framework: 'sqlmodel',\n iac: 'inherit',\n },\n {\n name: 'py-mysql-db',\n infra: 'aurora',\n engine: 'mysql',\n framework: 'sqlmodel',\n iac: 'inherit',\n },\n ];\n for (const rdb of pyRdbs) {\n await pyRdbGenerator(tree, { ...rdb, ...projectDefaults });\n }\n\n // Every connection edge the matrix covers.\n const connections: ConnectionGeneratorSchema[] = [\n // Website -> API\n { sourceProject: ts('website'), targetProject: ts('my-api') },\n { sourceProject: ts('website-no-router'), targetProject: ts('my-api') },\n { sourceProject: 'website', targetProject: 'py_api' },\n { sourceProject: 'website', targetProject: 'my-smithy-api' },\n // Agent -> MCP server\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-ts-agui-agent',\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n // HTTP agent <-> A2A agent\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n // Agent -> gateway, gateway -> MCP server, gateway -> gateway\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: ts('my-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: ts('my-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n { sourceProject: ts('parent-gateway'), targetProject: ts('my-gateway') },\n // Gateway -> agent (http gateway fronting agent runtime targets: every\n // supported protocol permutation), then website -> gateway.\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-agui-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-py-agui-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: ts('website-no-router'),\n targetProject: ts('agent-gateway'),\n },\n // Website -> agent\n {\n sourceProject: ts('website'),\n targetProject: 'ts-project',\n targetComponent: 'agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-agui-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_project',\n targetComponent: 'my-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_project',\n targetComponent: 'my-py-agui-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_langchain_project',\n targetComponent: 'my-py-langchain-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_langchain_project',\n targetComponent: 'my-py-langchain-http-agent',\n },\n // DynamoDB\n { sourceProject: 'my-api', targetProject: ts('my-table') },\n { sourceProject: 'my-smithy-api', targetProject: ts('my-table') },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-ts-agent',\n targetProject: ts('my-table'),\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-mcp-server',\n targetProject: ts('my-table'),\n },\n { sourceProject: 'py_api', targetProject: 'my_py_table' },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'my_py_table',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-mcp-server',\n targetProject: 'my_py_table',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-http-agent',\n targetProject: 'my_py_table',\n },\n // Relational databases\n { sourceProject: 'py_api', targetProject: 'py_postgres_db' },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_postgres_db',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-mcp-server',\n targetProject: 'py_postgres_db',\n },\n ];\n for (const connection of connections) {\n await connectionGenerator(tree, { ...connection, ...defaults });\n }\n\n // Licensing, then an Nx plugin with a custom generator.\n await licenseGenerator(tree, {\n license: 'Apache-2.0',\n copyrightHolder: 'Amazon.com, Inc. or its affiliates',\n ...defaults,\n });\n await tsNxPluginGenerator(tree, {\n ...projectDefaults,\n name: 'plugin',\n directory: 'tools',\n });\n await tsNxGeneratorGenerator(tree, {\n project: ts('plugin'),\n name: 'my#generator',\n ...defaults,\n });\n\n // A migration of each kind, so the scaffolded codemods compile and the\n // plugin's migrations.json (created by the first run) registers all three.\n const migrations: Omit<TsNxMigrationGeneratorSchema, 'project'>[] = [\n {\n name: 'rename-foo-target',\n description: 'Rename the foo target to bar',\n },\n {\n name: 'migrate-custom-handlers',\n description: 'Update custom handlers for the new API',\n kind: 'agentic',\n },\n {\n name: 'upgrade-framework',\n description: 'Upgrade the framework and reconcile call sites',\n kind: 'hybrid',\n },\n ];\n for (const migration of migrations) {\n await tsNxMigrationGenerator(tree, {\n ...migration,\n project: ts('plugin'),\n ...defaults,\n });\n }\n\n return () =>\n installDependencies(tree, preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default internalTestMatrixGenerator;\n"],"names":["agentcoreGatewayGenerator","agentcoreHarnessGenerator","connectionGenerator","greengrassComponentGenerator","licenseGenerator","pyAgentGenerator","pyApiGenerator","pyDynamoDBGenerator","pyLambdaFunctionGenerator","pyMcpServerGenerator","pyProjectGenerator","pyRdbGenerator","smithyProjectGenerator","terraformProjectGenerator","tsAgentGenerator","tsAgentGuardrailsGenerator","tsApiGenerator","tsDcrProxyGenerator","tsDocsGenerator","tsDynamoDBGenerator","tsInfraGenerator","tsLambdaFunctionGenerator","tsMcpServerGenerator","tsNxGeneratorGenerator","tsNxMigrationGenerator","tsNxPluginGenerator","tsProjectGenerator","tsRdbGenerator","tsWebsiteAuthGenerator","tsWebsiteGenerator","installDependencies","toSnakeCase","getNpmScope","getNpmScopePrefix","internalTestMatrixGenerator","tree","options","preferInstallDependencies","defaults","projectDefaults","directory","ts","name","py","infra","type","stageConfig","iac","tanstackRouter","project","cognitoDomain","allowSignup","tsApis","auth","integrationPattern","framework","api","pyApis","event","language","platform","gdkConfig","ipc","componentVersion","tsAgents","protocol","agent","pyAgents","langchainAgents","tsRdbs","engine","rdb","pyRdbs","connections","sourceProject","targetProject","sourceComponent","targetComponent","connection","license","copyrightHolder","migrations","description","kind","migration","languages"],"mappings":"AAAA;;;CAGC,GAED,SAASA,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAEEC,mBAAmB,QACd,0BAA0B;AACjC,SAASC,4BAA4B,QAAQ,0BAA0B;AACvE,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAIEC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,yBAAyB,EACzBC,oBAAoB,EACpBC,kBAAkB,EAClBC,cAAc,QACT,kBAAkB;AACzB,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,SAKEC,gBAAgB,EAChBC,0BAA0B,EAC1BC,cAAc,EACdC,mBAAmB,EACnBC,eAAe,EACfC,mBAAmB,EACnBC,gBAAgB,EAChBC,yBAAyB,EACzBC,oBAAoB,EACpBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,kBAAkB,EAClBC,cAAc,EACdC,sBAAsB,EACtBC,kBAAkB,QACb,kBAAkB;AACzB,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,2BAA2B;AAG1E;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMC,8BAA8B,OACzCC,MACAC,UAA6C,CAAC,CAAC;IAE/C,MAAMC,4BAA4BD,QAAQC,yBAAyB,IAAI;IACvE,MAAMC,WAAW;QAAED;IAA0B;IAC7C,MAAME,kBAAkB;QAAE,GAAGD,QAAQ;QAAEE,WAAW;IAAW;IAC7D,uEAAuE;IACvE,+EAA+E;IAC/E,6EAA6E;IAC7E,MAAMC,KAAK,CAACC,OAAiB,GAAGT,kBAAkBE,QAAQO,MAAM;IAChE,M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e;YACfE,iBAAiB;YACjBD,eAAe;YACfE,iBAAiB;QACnB;QACA,8DAA8D;QAC9D;YACEH,eAAe;YACfE,iBAAiB;YACjBD,eAAelC,GAAG;QACpB;QACA;YACEiC,eAAe;YACfE,iBAAiB;YACjBD,eAAelC,GAAG;QACpB;QACA;YACEiC,eAAe;YACfE,iBAAiB;YACjBD,eAAelC,GAAG;QACpB;QACA;YACEiC,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YAAEH,eAAejC,GAAG;YAAmBkC,eAAelC,GAAG;QAAc;QACvE,uEAAuE;QACvE,4DAA4D;QAC5D;YACEiC,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAelC,GAAG;QACpB;QACA,mBAAmB;QACnB;YACEiC,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA,WAAW;QACX;YAAEH,eAAe;YAAUC,eAAelC,GAAG;QAAY;QACzD;YAAEiC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AAME,2BAA2B;YACnDgD,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAenD,4BAA4B"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/internal/test-matrix/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { GeneratorCallback, Tree } from '@nx/devkit';\nimport { agentcoreGatewayGenerator } from '../../sdk/agentcore-gateway.js';\nimport { agentcoreHarnessGenerator } from '../../sdk/agentcore-harness.js';\nimport {\n type ConnectionGeneratorSchema,\n connectionGenerator,\n} from '../../sdk/connection.js';\nimport { greengrassComponentGenerator } from '../../sdk/greengrass.js';\nimport { licenseGenerator } from '../../sdk/license.js';\nimport {\n type PyAgentGeneratorSchema,\n type PyApiGeneratorSchema,\n type PyRdbGeneratorSchema,\n pyAgentGenerator,\n pyAgentGuardrailsGenerator,\n pyApiGenerator,\n pyDynamoDBGenerator,\n pyLambdaFunctionGenerator,\n pyMcpServerGenerator,\n pyProjectGenerator,\n pyRdbGenerator,\n} from '../../sdk/py.js';\nimport { smithyProjectGenerator } from '../../sdk/smithy.js';\nimport { terraformProjectGenerator } from '../../sdk/terraform.js';\nimport {\n type TsAgentGeneratorSchema,\n type TsApiGeneratorSchema,\n type TsNxMigrationGeneratorSchema,\n type TsRdbGeneratorSchema,\n tsAgentGenerator,\n tsAgentGuardrailsGenerator,\n tsApiGenerator,\n tsDcrProxyGenerator,\n tsDocsGenerator,\n tsDynamoDBGenerator,\n tsInfraGenerator,\n tsLambdaFunctionGenerator,\n tsMcpServerGenerator,\n tsNxGeneratorGenerator,\n tsNxMigrationGenerator,\n tsNxPluginGenerator,\n tsProjectGenerator,\n tsRdbGenerator,\n tsWebsiteAuthGenerator,\n tsWebsiteGenerator,\n} from '../../sdk/ts.js';\nimport { installDependencies } from '../../utils/install.js';\nimport { toSnakeCase } from '../../utils/names.js';\nimport { getNpmScope, getNpmScopePrefix } from '../../utils/npm-scope.js';\nimport type { InternalTestMatrixGeneratorSchema } from './schema';\n\n/**\n * Scaffolds every generator, component and connection permutation the e2e tests\n * cover, by composing the generators in-process on a single tree.\n *\n * This ships with the plugin so each released version carries the matrix of the\n * generators *it* had. A test upgrading an old workspace scaffolds with the\n * released version's own matrix and never has to reason about which generators\n * existed when — driving the CLI from the test repo instead would couple the\n * test to a generator list that only describes today's plugin.\n *\n * Hidden and undocumented: it exists for the e2e suite, not for users.\n *\n * Options are typed against each generator's schema, so adding a required option\n * or changing an enum breaks the build here rather than silently reducing\n * coverage.\n *\n * Projects are generated with `preferInstallDependencies: false` by default and\n * the returned callback installs once. Nothing composed here reads the project\n * graph (only `ts#sync` does, which is not part of the matrix), so no\n * intermediate install is needed.\n */\nexport const internalTestMatrixGenerator = async (\n tree: Tree,\n options: InternalTestMatrixGeneratorSchema = {},\n): Promise<GeneratorCallback> => {\n const preferInstallDependencies = options.preferInstallDependencies ?? false;\n const defaults = { preferInstallDependencies };\n const projectDefaults = { ...defaults, directory: 'packages' };\n // Fully-qualified project names, which differ per language: TypeScript\n // projects are scope-prefixed, Python ones are dotted snake_case. Derived from\n // the workspace rather than hardcoded, so the matrix works in any workspace.\n const ts = (name: string) => `${getNpmScopePrefix(tree)}${name}`;\n const py = (name: string) =>\n `${toSnakeCase(getNpmScope(tree))}.${toSnakeCase(name)}`;\n\n // The infrastructure project every other generator deploys into. Which\n // generator owns it depends on the workspace's IaC provider, so the caller\n // asks for the one matching the workspace it created.\n if (options.infra === 'terraform') {\n await terraformProjectGenerator(tree, {\n name: 'infra',\n type: 'application',\n ...projectDefaults,\n });\n } else {\n await tsInfraGenerator(tree, { name: 'infra', ...projectDefaults });\n // A second CDK app with stage config, which only ts#infra offers.\n await tsInfraGenerator(tree, {\n name: 'infra-with-stages',\n stageConfig: true,\n ...projectDefaults,\n });\n }\n\n // Websites (with and without TanStack Router), a docs site, and auth on each.\n await tsWebsiteGenerator(tree, {\n name: 'website',\n iac: 'inherit',\n ...projectDefaults,\n });\n await tsWebsiteGenerator(tree, {\n name: 'website-no-router',\n tanstackRouter: false,\n iac: 'inherit',\n ...projectDefaults,\n });\n await tsDocsGenerator(tree, { name: 'docs-site', ...defaults });\n await tsWebsiteAuthGenerator(tree, {\n project: ts('website'),\n cognitoDomain: 'test',\n allowSignup: true,\n iac: 'inherit',\n ...defaults,\n });\n await tsWebsiteAuthGenerator(tree, {\n project: ts('website-no-router'),\n cognitoDomain: 'test-no-router',\n allowSignup: true,\n iac: 'inherit',\n ...defaults,\n });\n\n // tRPC APIs — REST + HTTP, with Cognito and custom auth.\n const tsApis: TsApiGeneratorSchema[] = [\n { name: 'my-api', infra: 'rest-lambda', auth: 'iam', iac: 'inherit' },\n { name: 'my-api-http', infra: 'http-lambda', auth: 'iam', iac: 'inherit' },\n // The APIs above take the default `isolated` integration pattern; these\n // cover `shared`.\n {\n name: 'my-api-shared',\n infra: 'rest-lambda',\n auth: 'iam',\n integrationPattern: 'shared',\n iac: 'inherit',\n },\n {\n name: 'my-api-shared-http',\n infra: 'http-lambda',\n auth: 'iam',\n integrationPattern: 'shared',\n iac: 'inherit',\n },\n {\n name: 'my-api-custom',\n infra: 'rest-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'my-api-custom-http',\n infra: 'http-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'my-smithy-api',\n framework: 'smithy',\n infra: 'rest-lambda',\n auth: 'iam',\n iac: 'inherit',\n },\n ];\n for (const api of tsApis) {\n await tsApiGenerator(tree, { ...api, ...projectDefaults });\n }\n\n // A Smithy shape library; `my-smithy-api` covers consuming one.\n await smithyProjectGenerator(tree, {\n name: 'my-shapes',\n type: 'shapes',\n ...projectDefaults,\n });\n\n // Python FastAPI — REST + HTTP, with Cognito and custom auth.\n const pyApis: PyApiGeneratorSchema[] = [\n { name: 'py-api', infra: 'rest-lambda', auth: 'iam', iac: 'inherit' },\n { name: 'py-api-http', infra: 'http-lambda', auth: 'iam', iac: 'inherit' },\n {\n name: 'py-api-custom',\n infra: 'rest-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n {\n name: 'py-api-custom-http',\n infra: 'http-lambda',\n auth: 'custom',\n iac: 'inherit',\n },\n ];\n for (const api of pyApis) {\n await pyApiGenerator(tree, { ...api, ...projectDefaults });\n }\n\n // Library projects hosting the components below, each with a lambda function.\n await pyProjectGenerator(tree, {\n name: 'py-project',\n type: 'application',\n ...projectDefaults,\n });\n await tsProjectGenerator(tree, { name: 'ts-project', ...projectDefaults });\n await pyLambdaFunctionGenerator(tree, {\n project: py('py-project'),\n name: 'my-function',\n event: 'Any',\n iac: 'inherit',\n ...defaults,\n });\n await tsLambdaFunctionGenerator(tree, {\n project: 'ts-project',\n name: 'my-function',\n event: 'Any',\n iac: 'inherit',\n ...defaults,\n });\n\n // Greengrass: the `AWS::GreengrassV2` resources exist in the\n // `hashicorp/awscc` Terraform provider (this workspace pins it), so both\n // `--iac cdk` and `--iac terraform` are exercised here via `iac: 'inherit'`.\n //\n // A component with publication infrastructure and an app wrapper in the\n // workspace's infrastructure project. Hosted on a dedicated project:\n // vendoring's `--only-binary :all:` refuses the source-built workspace\n // members other entries add to py-project, and one component per project is\n // the documented production default.\n await pyProjectGenerator(tree, {\n name: 'py-greengrass-project',\n type: 'application',\n ...projectDefaults,\n });\n await greengrassComponentGenerator(tree, {\n project: py('py-greengrass-project'),\n name: 'my-greengrass-component',\n language: 'python',\n platform: 'linux-amd64-arm64',\n gdkConfig: true,\n iac: 'inherit',\n ...defaults,\n });\n // The TypeScript component gets a dedicated host project for the same\n // reason: the shared `bundle` target this generator wires rebuilds every\n // bundled entrypoint in its project together, so hosting it alongside\n // `ts-project`'s Lambda function would couple this device-oriented\n // bundle's cache invalidation to an unrelated Lambda bundle's.\n await tsProjectGenerator(tree, {\n name: 'ts-greengrass-project',\n ...projectDefaults,\n });\n await greengrassComponentGenerator(tree, {\n project: 'ts-greengrass-project',\n name: 'my-ts-greengrass-component',\n language: 'typescript',\n ipc: true,\n componentVersion: '1.0.0',\n iac: 'inherit',\n ...defaults,\n });\n\n // MCP servers — uninfra'd and hosted on AgentCore.\n await pyMcpServerGenerator(tree, {\n project: 'py_project',\n name: 'my-mcp-server',\n infra: 'agentcore',\n iac: 'inherit',\n ...defaults,\n });\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'my-mcp-server',\n infra: 'none',\n iac: 'inherit',\n ...defaults,\n });\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'hosted-mcp-server',\n infra: 'agentcore',\n iac: 'inherit',\n ...defaults,\n });\n // Container-packaged variants, so both packagings are covered and a workspace\n // mixing them vends one copy of the shared runtime module.\n await tsMcpServerGenerator(tree, {\n project: 'ts-project',\n name: 'ecr-mcp-server',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n ...defaults,\n });\n await pyMcpServerGenerator(tree, {\n project: 'py_project',\n name: 'ecr-mcp-server',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n ...defaults,\n });\n\n // OAuth DCR proxy for Cognito-authenticated MCP servers.\n await tsDcrProxyGenerator(tree, {\n name: 'my-dcr-proxy',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // TypeScript agents across every protocol and auth permutation. The unnamed\n // one takes the generator's default name, which the connections below use.\n const tsAgents: TsAgentGeneratorSchema[] = [\n {\n project: 'ts-project',\n name: 'my-ts-agent',\n infra: 'none',\n iac: 'inherit',\n },\n { project: 'ts-project', infra: 'agentcore', iac: 'inherit' },\n {\n project: 'ts-project',\n name: 'my-ts-ecr-agent',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-a2a-agent',\n protocol: 'a2a',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-a2a-agent-cognito',\n protocol: 'a2a',\n auth: 'cognito',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'ts-project',\n name: 'my-ts-agui-agent',\n protocol: 'ag-ui',\n infra: 'agentcore',\n iac: 'inherit',\n },\n ];\n for (const agent of tsAgents) {\n await tsAgentGenerator(tree, { ...agent, ...defaults });\n }\n // Guard the default agent, which has AgentCore infrastructure.\n await tsAgentGuardrailsGenerator(tree, {\n project: 'ts-project',\n agent: 'agent',\n });\n\n // Python agents: Strands across every protocol, plus LangChain in its own\n // project — langchain's dependency closure would push the zip-bundled Lambda\n // in py-project past its unzipped size limit.\n const pyAgents: PyAgentGeneratorSchema[] = [\n {\n project: 'py_project',\n name: 'my-agent',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-ecr-agent',\n infra: 'agentcore-ecr',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-a2a-agent',\n protocol: 'a2a',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-a2a-agent-cognito',\n protocol: 'a2a',\n auth: 'cognito',\n infra: 'agentcore',\n iac: 'inherit',\n },\n {\n project: 'py_project',\n name: 'my-py-agui-agent',\n protocol: 'ag-ui',\n infra: 'agentcore',\n iac: 'inherit',\n },\n ];\n for (const agent of pyAgents) {\n await pyAgentGenerator(tree, { ...agent, ...defaults });\n }\n // Guard the default Python agent, which has AgentCore infrastructure.\n await pyAgentGuardrailsGenerator(tree, {\n project: 'py_project',\n agent: 'my-agent',\n });\n await pyProjectGenerator(tree, {\n name: 'py-langchain-project',\n type: 'application',\n ...projectDefaults,\n });\n const langchainAgents: PyAgentGeneratorSchema[] = [\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-agent',\n protocol: 'ag-ui',\n iac: 'inherit',\n },\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-http-agent',\n protocol: 'http',\n iac: 'inherit',\n },\n {\n project: 'py_langchain_project',\n name: 'my-py-langchain-a2a-agent',\n protocol: 'a2a',\n iac: 'inherit',\n },\n ];\n for (const agent of langchainAgents) {\n await pyAgentGenerator(tree, {\n ...agent,\n framework: 'langchain',\n infra: 'agentcore',\n ...defaults,\n });\n }\n\n // AgentCore gateways, including a parent fronting the first (chained), and\n // an http-protocol gateway fronting agent runtime targets.\n await agentcoreGatewayGenerator(tree, {\n name: 'my-gateway',\n iac: 'inherit',\n ...projectDefaults,\n });\n await agentcoreGatewayGenerator(tree, {\n name: 'parent-gateway',\n iac: 'inherit',\n ...projectDefaults,\n });\n await agentcoreGatewayGenerator(tree, {\n name: 'agent-gateway',\n protocol: 'http',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // AgentCore Harness — a standalone invocation project.\n await agentcoreHarnessGenerator(tree, {\n name: 'my-harness',\n infra: 'agentcore',\n iac: 'inherit',\n ...projectDefaults,\n });\n\n // Databases — DynamoDB, plus Aurora across both engines and ORMs.\n await tsDynamoDBGenerator(tree, {\n name: 'my-table',\n framework: 'electrodb',\n infra: 'dynamodb',\n iac: 'inherit',\n ...projectDefaults,\n });\n await pyDynamoDBGenerator(tree, {\n name: 'my-py-table',\n framework: 'pynamodb',\n infra: 'dynamodb',\n iac: 'inherit',\n ...projectDefaults,\n });\n const tsRdbs: TsRdbGeneratorSchema[] = [\n {\n name: 'postgres-db',\n infra: 'aurora',\n engine: 'postgres',\n framework: 'prisma',\n iac: 'inherit',\n },\n {\n name: 'my-sql-db',\n infra: 'aurora',\n engine: 'mysql',\n framework: 'prisma',\n iac: 'inherit',\n },\n ];\n for (const rdb of tsRdbs) {\n await tsRdbGenerator(tree, { ...rdb, ...projectDefaults });\n }\n const pyRdbs: PyRdbGeneratorSchema[] = [\n {\n name: 'py-postgres-db',\n infra: 'aurora',\n engine: 'postgres',\n framework: 'sqlmodel',\n iac: 'inherit',\n },\n {\n name: 'py-mysql-db',\n infra: 'aurora',\n engine: 'mysql',\n framework: 'sqlmodel',\n iac: 'inherit',\n },\n ];\n for (const rdb of pyRdbs) {\n await pyRdbGenerator(tree, { ...rdb, ...projectDefaults });\n }\n\n // Every connection edge the matrix covers.\n const connections: ConnectionGeneratorSchema[] = [\n // Website -> API\n { sourceProject: ts('website'), targetProject: ts('my-api') },\n { sourceProject: ts('website-no-router'), targetProject: ts('my-api') },\n { sourceProject: 'website', targetProject: 'py_api' },\n { sourceProject: 'website', targetProject: 'my-smithy-api' },\n // Agent -> MCP server\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-ts-agui-agent',\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n // HTTP agent <-> A2A agent\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n // Agent -> gateway, gateway -> MCP server, gateway -> gateway\n {\n sourceProject: 'ts-project',\n sourceComponent: 'agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-agent',\n targetProject: ts('my-gateway'),\n },\n {\n sourceProject: ts('my-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'hosted-mcp-server',\n },\n {\n sourceProject: ts('my-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-mcp-server',\n },\n { sourceProject: ts('parent-gateway'), targetProject: ts('my-gateway') },\n // Gateway -> agent (http gateway fronting agent runtime targets: every\n // supported protocol permutation), then website -> gateway.\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-agui-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-a2a-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-py-agui-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-agent',\n },\n {\n sourceProject: ts('agent-gateway'),\n targetProject: 'py_project',\n targetComponent: 'my-py-a2a-agent',\n },\n {\n sourceProject: ts('website-no-router'),\n targetProject: ts('agent-gateway'),\n },\n // Website -> agent\n {\n sourceProject: ts('website'),\n targetProject: 'ts-project',\n targetComponent: 'agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'ts-project',\n targetComponent: 'my-ts-agui-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_project',\n targetComponent: 'my-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_project',\n targetComponent: 'my-py-agui-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_langchain_project',\n targetComponent: 'my-py-langchain-agent',\n },\n {\n sourceProject: ts('website'),\n targetProject: 'py_langchain_project',\n targetComponent: 'my-py-langchain-http-agent',\n },\n // DynamoDB\n { sourceProject: 'my-api', targetProject: ts('my-table') },\n { sourceProject: 'my-smithy-api', targetProject: ts('my-table') },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-ts-agent',\n targetProject: ts('my-table'),\n },\n {\n sourceProject: 'ts-project',\n sourceComponent: 'my-mcp-server',\n targetProject: ts('my-table'),\n },\n { sourceProject: 'py_api', targetProject: 'my_py_table' },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'my_py_table',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-mcp-server',\n targetProject: 'my_py_table',\n },\n {\n sourceProject: 'py_langchain_project',\n sourceComponent: 'my-py-langchain-http-agent',\n targetProject: 'my_py_table',\n },\n // Relational databases\n { sourceProject: 'py_api', targetProject: 'py_postgres_db' },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-agent',\n targetProject: 'py_postgres_db',\n },\n {\n sourceProject: 'py_project',\n sourceComponent: 'my-mcp-server',\n targetProject: 'py_postgres_db',\n },\n ];\n for (const connection of connections) {\n await connectionGenerator(tree, { ...connection, ...defaults });\n }\n\n // Licensing, then an Nx plugin with a custom generator.\n await licenseGenerator(tree, {\n license: 'Apache-2.0',\n copyrightHolder: 'Amazon.com, Inc. or its affiliates',\n ...defaults,\n });\n await tsNxPluginGenerator(tree, {\n ...projectDefaults,\n name: 'plugin',\n directory: 'tools',\n });\n await tsNxGeneratorGenerator(tree, {\n project: ts('plugin'),\n name: 'my#generator',\n ...defaults,\n });\n\n // A migration of each kind, so the scaffolded codemods compile and the\n // plugin's migrations.json (created by the first run) registers all three.\n const migrations: Omit<TsNxMigrationGeneratorSchema, 'project'>[] = [\n {\n name: 'rename-foo-target',\n description: 'Rename the foo target to bar',\n },\n {\n name: 'migrate-custom-handlers',\n description: 'Update custom handlers for the new API',\n kind: 'agentic',\n },\n {\n name: 'upgrade-framework',\n description: 'Upgrade the framework and reconcile call sites',\n kind: 'hybrid',\n },\n ];\n for (const migration of migrations) {\n await tsNxMigrationGenerator(tree, {\n ...migration,\n project: ts('plugin'),\n ...defaults,\n });\n }\n\n return () =>\n installDependencies(tree, preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default internalTestMatrixGenerator;\n"],"names":["agentcoreGatewayGenerator","agentcoreHarnessGenerator","connectionGenerator","greengrassComponentGenerator","licenseGenerator","pyAgentGenerator","pyAgentGuardrailsGenerator","pyApiGenerator","pyDynamoDBGenerator","pyLambdaFunctionGenerator","pyMcpServerGenerator","pyProjectGenerator","pyRdbGenerator","smithyProjectGenerator","terraformProjectGenerator","tsAgentGenerator","tsAgentGuardrailsGenerator","tsApiGenerator","tsDcrProxyGenerator","tsDocsGenerator","tsDynamoDBGenerator","tsInfraGenerator","tsLambdaFunctionGenerator","tsMcpServerGenerator","tsNxGeneratorGenerator","tsNxMigrationGenerator","tsNxPluginGenerator","tsProjectGenerator","tsRdbGenerator","tsWebsiteAuthGenerator","tsWebsiteGenerator","installDependencies","toSnakeCase","getNpmScope","getNpmScopePrefix","internalTestMatrixGenerator","tree","options","preferInstallDependencies","defaults","projectDefaults","directory","ts","name","py","infra","type","stageConfig","iac","tanstackRouter","project","cognitoDomain","allowSignup","tsApis","auth","integrationPattern","framework","api","pyApis","event","language","platform","gdkConfig","ipc","componentVersion","tsAgents","protocol","agent","pyAgents","langchainAgents","tsRdbs","engine","rdb","pyRdbs","connections","sourceProject","targetProject","sourceComponent","targetComponent","connection","license","copyrightHolder","migrations","description","kind","migration","languages"],"mappings":"AAAA;;;CAGC,GAED,SAASA,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAEEC,mBAAmB,QACd,0BAA0B;AACjC,SAASC,4BAA4B,QAAQ,0BAA0B;AACvE,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAIEC,gBAAgB,EAChBC,0BAA0B,EAC1BC,cAAc,EACdC,mBAAmB,EACnBC,yBAAyB,EACzBC,oBAAoB,EACpBC,kBAAkB,EAClBC,cAAc,QACT,kBAAkB;AACzB,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,yBAAyB,QAAQ,yBAAyB;AACnE,SAKEC,gBAAgB,EAChBC,0BA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C,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAelC,GAAG;QACpB;QACA,mBAAmB;QACnB;YACEiC,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA;YACEH,eAAejC,GAAG;YAClBkC,eAAe;YACfE,iBAAiB;QACnB;QACA,WAAW;QACX;YAAEH,eAAe;YAAUC,eAAelC,GAAG;QAAY;QACzD;YAAEiC,eAAe;YAAiBC,eAAelC,GAAG;QAAY;QAChE;YACEiC,eAAe;YACfE,iBAAiB;YACjBD,eAAelC,GAAG;QACpB;QACA;YACEiC,eAAe;YACfE,iBAAiB;YACjBD,eAAelC,GAAG;QACpB;QACA;YAAEiC,eAAe;YAAUC,eAAe;QAAc;QACxD;YACED,eAAe;YACfE,iBAAiB;YACjBD,eAAe;QACjB;QACA;YACED,eAAe;YACfE,iBAAiB;YACjBD,eAAe;QACjB;QACA;YACED,eAAe;YACfE,iBAAiB;YACjBD,eAAe;QACjB;QACA,uBAAuB;QACvB;YAAED,eAAe;YAAUC,eAAe;QAAiB;QAC3D;YACED,eAAe;YACfE,iBAAiB;YACjBD,eAAe;QACjB;QACA;YACED,eAAe;YACfE,iBAAiB;YACjBD,eAAe;QACjB;KACD;IACD,KAAK,MAAMG,cAAcL,YAAa;QACpC,MAAMxE,oBAAoBkC,MAAM;YAAE,GAAG2C,UAAU;YAAE,GAAGxC,QAAQ;QAAC;IAC/D;IAEA,wDAAwD;IACxD,MAAMnC,iBAAiBgC,MAAM;QAC3B4C,SAAS;QACTC,iBAAiB;QACjB,GAAG1C,QAAQ;IACb;IACA,MAAMb,oBAAoBU,MAAM;QAC9B,GAAGI,eAAe;QAClBG,MAAM;QACNF,WAAW;IACb;IACA,MAAMjB,uBAAuBY,MAAM;QACjCc,SAASR,GAAG;QACZC,MAAM;QACN,GAAGJ,QAAQ;IACb;IAEA,uEAAuE;IACvE,2EAA2E;IAC3E,MAAM2C,aAA8D;QAClE;YACEvC,MAAM;YACNwC,aAAa;QACf;QACA;YACExC,MAAM;YACNwC,aAAa;YACbC,MAAM;QACR;QACA;YACEzC,MAAM;YACNwC,aAAa;YACbC,MAAM;QACR;KACD;IACD,KAAK,MAAMC,aAAaH,WAAY;QAClC,MAAMzD,uBAAuBW,MAAM;YACjC,GAAGiD,SAAS;YACZnC,SAASR,GAAG;YACZ,GAAGH,QAAQ;QACb;IACF;IAEA,OAAO,IACLR,oBAAoBK,MAAME,2BAA2B;YACnDgD,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAenD,4BAA4B"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Turn off Biome 2.6's Markdown and YAML formatting in biome.json, which formats them by default"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getDependencyVersionFromPackageJson, readJson, writeJson } from "@nx/devkit";
5
+ import { gte, minVersion, validRange } from "semver";
6
+ import { formatFilesInSubtree } from "../../../utils/format.js";
7
+ import { ownedDependencies } from "../../../utils/version-upgrade-migration/owned-dependencies.js";
8
+ import { syncedTsVersion } from "../../../utils/version-upgrade-migration/sync-vended-versions.js";
9
+ /**
10
+ * Turn off Biome's Markdown and YAML formatting in `biome.json`.
11
+ *
12
+ * Biome 2.6 formats Markdown and YAML by default. The vended `format` target
13
+ * runs `biome format {projectRoot}`, so after the upgrade it fails on generated
14
+ * README.md files and the TypeScript Greengrass component's `recipe.yaml`, and
15
+ * `lint` and `build` stop with it.
16
+ *
17
+ * Guardrails:
18
+ * - A workspace without `biome.json` is left alone.
19
+ * - A top-level `markdown` or `yaml` key that is already present is the user's
20
+ * own setting and is kept as it is. Biome 2.5 rejects both keys, so one is
21
+ * only present when the user configured Biome 2.6 themselves.
22
+ * - Missing keys go right after `css`, where the generators place them, or at
23
+ * the end when there is no `css` section.
24
+ * - Idempotent: a second run finds both keys present and changes nothing.
25
+ * - Biome 2.5 rejects both keys and then fails every `format` and `lint`
26
+ * target, so they are added only when the workspace runs Biome 2.6 or later
27
+ * once `nx migrate` finishes. Otherwise `biome.json` is left as it is and a
28
+ * next step says what to add after moving to Biome 2.6.
29
+ */ const BIOME_CONFIG = 'biome.json';
30
+ const LANGUAGES = [
31
+ 'markdown',
32
+ 'yaml'
33
+ ];
34
+ const FORMATTER_OFF = {
35
+ formatter: {
36
+ enabled: false
37
+ }
38
+ };
39
+ const BIOME = '@biomejs/biome';
40
+ /** First Biome release that accepts the `markdown` and `yaml` keys. */ const MIN_BIOME_VERSION = '2.6.0';
41
+ /** Whether every version a semver range allows is Biome 2.6 or later. */ const allowsOnlyBiome26 = (specifier)=>{
42
+ if (typeof specifier !== 'string' || validRange(specifier) === null) {
43
+ return false;
44
+ }
45
+ const lowest = minVersion(specifier);
46
+ return lowest !== null && gte(lowest, MIN_BIOME_VERSION);
47
+ };
48
+ /**
49
+ * Whether the workspace runs Biome 2.6 or later once `nx migrate` finishes.
50
+ *
51
+ * The version sync runs after this migration in the same `nx migrate`, so the
52
+ * root `package.json` still holds the old Biome here. The check takes the lowest
53
+ * version the declared range (or the catalog entry it references) allows, then
54
+ * the version the sync will move Biome to. A tag, alias or missing declaration
55
+ * counts only when the sync moves it.
56
+ */ const runsBiome26AfterMigrate = async (tree)=>{
57
+ if (!tree.exists('package.json')) {
58
+ return false;
59
+ }
60
+ const { dependencies, devDependencies } = readJson(tree, 'package.json');
61
+ const declared = devDependencies?.[BIOME] ?? dependencies?.[BIOME];
62
+ if (declared === undefined) {
63
+ return false;
64
+ }
65
+ const resolved = getDependencyVersionFromPackageJson(tree, BIOME, 'package.json', [
66
+ 'devDependencies',
67
+ 'dependencies'
68
+ ]);
69
+ if (allowsOnlyBiome26(resolved)) {
70
+ return true;
71
+ }
72
+ return allowsOnlyBiome26(syncedTsVersion(tree, await ownedDependencies(tree), BIOME, declared));
73
+ };
74
+ const SKIPPED_NEXT_STEP = 'Biome stays below 2.6 in this workspace, and Biome 2.5 rejects the `markdown` and `yaml` keys, so biome.json was left as it is. ' + 'Biome 2.6 formats Markdown and YAML files by default. After you move `@biomejs/biome` to 2.6 or later, add ' + '`"markdown": { "formatter": { "enabled": false } }` and `"yaml": { "formatter": { "enabled": false } }` to biome.json, ' + 'or the `format` target fails on generated README.md and YAML files.';
75
+ export default async function migration(tree) {
76
+ if (!tree.exists(BIOME_CONFIG)) {
77
+ return {
78
+ nextSteps: []
79
+ };
80
+ }
81
+ const biome = readJson(tree, BIOME_CONFIG);
82
+ const missing = LANGUAGES.filter((language)=>biome[language] === undefined);
83
+ if (missing.length === 0) {
84
+ return {
85
+ nextSteps: []
86
+ };
87
+ }
88
+ if (!await runsBiome26AfterMigrate(tree)) {
89
+ return {
90
+ nextSteps: [
91
+ SKIPPED_NEXT_STEP
92
+ ]
93
+ };
94
+ }
95
+ const additions = Object.fromEntries(missing.map((language)=>[
96
+ language,
97
+ FORMATTER_OFF
98
+ ]));
99
+ const entries = Object.entries(biome);
100
+ const cssIndex = entries.findIndex(([key])=>key === 'css');
101
+ const insertAt = cssIndex === -1 ? entries.length : cssIndex + 1;
102
+ writeJson(tree, BIOME_CONFIG, Object.fromEntries([
103
+ ...entries.slice(0, insertAt),
104
+ ...Object.entries(additions),
105
+ ...entries.slice(insertAt)
106
+ ]));
107
+ await formatFilesInSubtree(tree);
108
+ return {
109
+ nextSteps: []
110
+ };
111
+ }
112
+
113
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getDependencyVersionFromPackageJson,\n type MigrationReturnObject,\n readJson,\n type Tree,\n writeJson,\n} from '@nx/devkit';\nimport { gte, minVersion, validRange } from 'semver';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { ownedDependencies } from '../../../utils/version-upgrade-migration/owned-dependencies.js';\nimport { syncedTsVersion } from '../../../utils/version-upgrade-migration/sync-vended-versions.js';\n\n/**\n * Turn off Biome's Markdown and YAML formatting in `biome.json`.\n *\n * Biome 2.6 formats Markdown and YAML by default. The vended `format` target\n * runs `biome format {projectRoot}`, so after the upgrade it fails on generated\n * README.md files and the TypeScript Greengrass component's `recipe.yaml`, and\n * `lint` and `build` stop with it.\n *\n * Guardrails:\n * - A workspace without `biome.json` is left alone.\n * - A top-level `markdown` or `yaml` key that is already present is the user's\n * own setting and is kept as it is. Biome 2.5 rejects both keys, so one is\n * only present when the user configured Biome 2.6 themselves.\n * - Missing keys go right after `css`, where the generators place them, or at\n * the end when there is no `css` section.\n * - Idempotent: a second run finds both keys present and changes nothing.\n * - Biome 2.5 rejects both keys and then fails every `format` and `lint`\n * target, so they are added only when the workspace runs Biome 2.6 or later\n * once `nx migrate` finishes. Otherwise `biome.json` is left as it is and a\n * next step says what to add after moving to Biome 2.6.\n */\n\nconst BIOME_CONFIG = 'biome.json';\n\nconst LANGUAGES = ['markdown', 'yaml'] as const;\n\nconst FORMATTER_OFF = { formatter: { enabled: false } };\n\nconst BIOME = '@biomejs/biome';\n\n/** First Biome release that accepts the `markdown` and `yaml` keys. */\nconst MIN_BIOME_VERSION = '2.6.0';\n\n/** Whether every version a semver range allows is Biome 2.6 or later. */\nconst allowsOnlyBiome26 = (specifier: unknown): boolean => {\n if (typeof specifier !== 'string' || validRange(specifier) === null) {\n return false;\n }\n const lowest = minVersion(specifier);\n return lowest !== null && gte(lowest, MIN_BIOME_VERSION);\n};\n\n/**\n * Whether the workspace runs Biome 2.6 or later once `nx migrate` finishes.\n *\n * The version sync runs after this migration in the same `nx migrate`, so the\n * root `package.json` still holds the old Biome here. The check takes the lowest\n * version the declared range (or the catalog entry it references) allows, then\n * the version the sync will move Biome to. A tag, alias or missing declaration\n * counts only when the sync moves it.\n */\nconst runsBiome26AfterMigrate = async (tree: Tree): Promise<boolean> => {\n if (!tree.exists('package.json')) {\n return false;\n }\n const { dependencies, devDependencies } = readJson(tree, 'package.json');\n const declared: unknown = devDependencies?.[BIOME] ?? dependencies?.[BIOME];\n if (declared === undefined) {\n return false;\n }\n const resolved = getDependencyVersionFromPackageJson(\n tree,\n BIOME,\n 'package.json',\n ['devDependencies', 'dependencies'],\n );\n if (allowsOnlyBiome26(resolved)) {\n return true;\n }\n return allowsOnlyBiome26(\n syncedTsVersion(tree, await ownedDependencies(tree), BIOME, declared),\n );\n};\n\nconst SKIPPED_NEXT_STEP =\n 'Biome stays below 2.6 in this workspace, and Biome 2.5 rejects the `markdown` and `yaml` keys, so biome.json was left as it is. ' +\n 'Biome 2.6 formats Markdown and YAML files by default. After you move `@biomejs/biome` to 2.6 or later, add ' +\n '`\"markdown\": { \"formatter\": { \"enabled\": false } }` and `\"yaml\": { \"formatter\": { \"enabled\": false } }` to biome.json, ' +\n 'or the `format` target fails on generated README.md and YAML files.';\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n if (!tree.exists(BIOME_CONFIG)) {\n return { nextSteps: [] };\n }\n\n const biome: Record<string, unknown> = readJson(tree, BIOME_CONFIG);\n const missing = LANGUAGES.filter((language) => biome[language] === undefined);\n if (missing.length === 0) {\n return { nextSteps: [] };\n }\n if (!(await runsBiome26AfterMigrate(tree))) {\n return { nextSteps: [SKIPPED_NEXT_STEP] };\n }\n\n const additions = Object.fromEntries(\n missing.map((language) => [language, FORMATTER_OFF]),\n );\n const entries = Object.entries(biome);\n const cssIndex = entries.findIndex(([key]) => key === 'css');\n const insertAt = cssIndex === -1 ? entries.length : cssIndex + 1;\n writeJson(\n tree,\n BIOME_CONFIG,\n Object.fromEntries([\n ...entries.slice(0, insertAt),\n ...Object.entries(additions),\n ...entries.slice(insertAt),\n ]),\n );\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps: [] };\n}\n"],"names":["getDependencyVersionFromPackageJson","readJson","writeJson","gte","minVersion","validRange","formatFilesInSubtree","ownedDependencies","syncedTsVersion","BIOME_CONFIG","LANGUAGES","FORMATTER_OFF","formatter","enabled","BIOME","MIN_BIOME_VERSION","allowsOnlyBiome26","specifier","lowest","runsBiome26AfterMigrate","tree","exists","dependencies","devDependencies","declared","undefined","resolved","SKIPPED_NEXT_STEP","migration","nextSteps","biome","missing","filter","language","length","additions","Object","fromEntries","map","entries","cssIndex","findIndex","key","insertAt","slice"],"mappings":"AAAA;;;CAGC,GACD,SACEA,mCAAmC,EAEnCC,QAAQ,EAERC,SAAS,QACJ,aAAa;AACpB,SAASC,GAAG,EAAEC,UAAU,EAAEC,UAAU,QAAQ,SAAS;AACrD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,iBAAiB,QAAQ,iEAAiE;AACnG,SAASC,eAAe,QAAQ,mEAAmE;AAEnG;;;;;;;;;;;;;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AAMV,wBAAwBC,OAAQ;QAC1C,OAAO;YAAES,WAAW;gBAACF;aAAkB;QAAC;IAC1C;IAEA,MAAMQ,YAAYC,OAAOC,WAAW,CAClCN,QAAQO,GAAG,CAAC,CAACL,WAAa;YAACA;YAAUtB;SAAc;IAErD,MAAM4B,UAAUH,OAAOG,OAAO,CAACT;IAC/B,MAAMU,WAAWD,QAAQE,SAAS,CAAC,CAAC,CAACC,IAAI,GAAKA,QAAQ;IACtD,MAAMC,WAAWH,aAAa,CAAC,IAAID,QAAQL,MAAM,GAAGM,WAAW;IAC/DtC,UACEkB,MACAX,cACA2B,OAAOC,WAAW,CAAC;WACdE,QAAQK,KAAK,CAAC,GAAGD;WACjBP,OAAOG,OAAO,CAACJ;WACfI,QAAQK,KAAK,CAACD;KAClB;IAGH,MAAMrC,qBAAqBc;IAE3B,OAAO;QAAES,WAAW,EAAE;IAAC;AACzB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/v1.0.15/0001-py-agent-pillow-override/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport type { UVPyprojectToml } from '../../../utils/nxlv-python.js';\nimport { addUvOverrideDependencies } from '../../../utils/py.js';\nimport { tryReadToml } from '../../../utils/toml.js';\n\n/**\n * Add the strands-agents-tools pillow override to the workspace root\n * pyproject.toml uv override-dependencies.\n *\n * strands-agents-tools caps pillow below the release that fixes its current\n * CVEs, and uv reads `[tool.uv] override-dependencies` only from the workspace\n * root, so the root carries the override (`PY_UV_OVERRIDES`). It applies when\n * any project's `[project].dependencies` names strands-agents-tools. A user\n * override for the same package is kept as written. `uv.lock` is left to the\n * user, as the version sync leaves it, so `nextSteps` asks for `uv sync` when\n * the root changes.\n */\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n if (tree.exists('pyproject.toml')) {\n const requirements = [...getProjects(tree).values()].flatMap(({ root }) => {\n const dependencies = (\n tryReadToml(tree, joinPathFragments(root, 'pyproject.toml')) as\n | UVPyprojectToml\n | undefined\n )?.project?.dependencies;\n return Array.isArray(dependencies) ? dependencies : [];\n });\n if (addUvOverrideDependencies(tree, requirements)) {\n nextSteps.push(\n 'The workspace root pyproject.toml now overrides a dependency of strands-agents-tools. Run `uv sync` to update uv.lock.',\n );\n }\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","formatFilesInSubtree","addUvOverrideDependencies","tryReadToml","migration","tree","nextSteps","exists","requirements","values","flatMap","root","dependencies","project","Array","isArray","push"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SAASC,WAAW,QAAQ,yBAAyB;AAErD;;;;;;;;;;;CAWC,GACD,eAAe,eAAeC,UAC5BC,IAAU;IAEV,MAAMC,YAAsB,EAAE;IAE9B,IAAID,KAAKE,MAAM,CAAC,mBAAmB;QACjC,MAAMC,eAAe;eAAIT,YAAYM,MAAMI,MAAM;SAAG,CAACC,OAAO,CAAC,CAAC,EAAEC,IAAI,EAAE;YACpE,MAAMC,eACJT,YAAYE,MAAML,kBAAkBW,MAAM,oBAGzCE,SAASD;YACZ,OAAOE,MAAMC,OAAO,CAACH,gBAAgBA,eAAe,EAAE;QACxD;QACA,IAAIV,0BAA0BG,MAAMG,eAAe;YACjDF,UAAUU,IAAI,CACZ;QAEJ;IACF;IAEA,MAAMf,qBAAqBI;IAE3B,OAAO;QAAEC;IAAU;AACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/v1.1.1/0001-ts-agent-guardrails-synth-input/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { TS_AGENT_GENERATOR_INFO } from '../../../ts/agent/generator.js';\nimport { TS_AGENT_GUARDRAILS_GENERATOR_INFO } from '../../../ts/agent/guardrails/generator.js';\nimport { addGuardrailPolicySynthInputs } from '../../../ts/agent/guardrails/synth-inputs.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport type { ComponentMetadata } from '../../../utils/nx.js';\n\n/**\n * Add each CDK-guarded TypeScript agent's guardrail.json to the `synth` inputs\n * of the CDK infrastructure projects.\n *\n * The CDK guardrail construct reads guardrail.json at synth time to build the\n * guardrail's rules and version description. The file belongs to the agent's\n * project and no task output the infrastructure's `synth` hashes includes it,\n * so without an explicit input a policy change is served from the Nx cache\n * and `deploy-ci` ships the stale template.\n *\n * Guarded agents are found from the `ts#agent#guardrails` components in\n * project metadata, each paired with the `ts#agent` component of the same\n * name, and kept when that agent's IaC is CDK. An infrastructure project\n * whose `synth` has no `inputs` array, or no `synth` target, is left\n * unchanged and reported via `nextSteps`.\n */\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const policyPaths: string[] = [];\n for (const project of getProjects(tree).values()) {\n const components: ComponentMetadata[] =\n (project.metadata as { components?: ComponentMetadata[] } | undefined)\n ?.components ?? [];\n for (const guardrail of components.filter(\n (c) => c.generator === TS_AGENT_GUARDRAILS_GENERATOR_INFO.id,\n )) {\n const agent = components.find(\n (c) =>\n c.generator === TS_AGENT_GENERATOR_INFO.id &&\n (c.name ?? 'agent') === guardrail.name,\n );\n if (agent?.iac === 'cdk') {\n policyPaths.push(\n joinPathFragments(project.root, guardrail.path, 'guardrail.json'),\n );\n }\n }\n }\n\n const nextSteps = addGuardrailPolicySynthInputs(tree, policyPaths);\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","TS_AGENT_GENERATOR_INFO","TS_AGENT_GUARDRAILS_GENERATOR_INFO","addGuardrailPolicySynthInputs","formatFilesInSubtree","migration","tree","policyPaths","project","values","components","metadata","guardrail","filter","c","generator","id","agent","find","name","iac","push","root","path","nextSteps"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,uBAAuB,QAAQ,iCAAiC;AACzE,SAASC,kCAAkC,QAAQ,4CAA4C;AAC/F,SAASC,6BAA6B,QAAQ,+CAA+C;AAC7F,SAASC,oBAAoB,QAAQ,2BAA2B;AAGhE;;;;;;;;;;;;;;;CAeC,GACD,eAAe,eAAeC,UAC5BC,IAAU;IAEV,MAAMC,cAAwB,EAAE;IAChC,KAAK,MAAMC,WAAWT,YAAYO,MAAMG,MAAM,GAAI;QAChD,MAAMC,aACJ,AAACF,QAAQG,QAAQ,EACbD,cAAc,EAAE;QACtB,KAAK,MAAME,aAAaF,WAAWG,MAAM,CACvC,CAACC,IAAMA,EAAEC,SAAS,KAAKb,mCAAmCc,EAAE,EAC3D;YACD,MAAMC,QAAQP,WAAWQ,IAAI,CAC3B,CAACJ,IACCA,EAAEC,SAAS,KAAKd,wBAAwBe,EAAE,IAC1C,AAACF,CAAAA,EAAEK,IAAI,IAAI,OAAM,MAAOP,UAAUO,IAAI;YAE1C,IAAIF,OAAOG,QAAQ,OAAO;gBACxBb,YAAYc,IAAI,CACdrB,kBAAkBQ,QAAQc,IAAI,EAAEV,UAAUW,IAAI,EAAE;YAEpD;QACF;IACF;IAEA,MAAMC,YAAYrB,8BAA8BG,MAAMC;IAEtD,MAAMH,qBAAqBE;IAE3B,OAAO;QAAEkB;IAAU;AACrB"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Keep a replaced guardrail version in each Terraform guardrail module of a TypeScript agent for 15 seconds after the runtime-config deployment, so agents' 5-second runtime-config cache never points at a deleted version"
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;