@aws/nx-plugin 1.0.0-rc.43 → 1.0.0-rc.45

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 (92) hide show
  1. package/LICENSE-THIRD-PARTY +121 -154
  2. package/generators.json +6 -0
  3. package/package.json +4 -4
  4. package/src/agentcore-gateway/files/cedar/policies/README.md +9 -0
  5. package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +15 -0
  6. package/src/agentcore-gateway/generator.js +12 -5
  7. package/src/agentcore-gateway/generator.js.map +1 -1
  8. package/src/agentcore-gateway/schema.d.js.map +1 -1
  9. package/src/agentcore-gateway/schema.d.ts +1 -1
  10. package/src/agentcore-gateway/schema.json +3 -2
  11. package/src/connection/generator.js +1 -1
  12. package/src/connection/generator.js.map +1 -1
  13. package/src/infra/app/__snapshots__/generator.spec.ts.snap +8 -8
  14. package/src/mcp-server/tools/general-guidance.js +1 -1
  15. package/src/mcp-server/tools/general-guidance.js.map +1 -1
  16. package/src/preset/__snapshots__/generator.spec.ts.snap +6 -3
  17. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
  18. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +6 -6
  19. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +2 -2
  20. package/src/py/agent/gateway-connection/generator.js +1 -1
  21. package/src/py/agent/gateway-connection/generator.js.map +1 -1
  22. package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +4 -8
  23. package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
  24. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  25. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
  26. package/src/py/rdb/__snapshots__/generator.spec.ts.snap +21 -5
  27. package/src/py/rdb/files/Dockerfile.create-db-user.template +4 -0
  28. package/src/py/rdb/files/Dockerfile.migration.template +4 -0
  29. package/src/sdk/ts.d.ts +2 -0
  30. package/src/sdk/ts.js +2 -0
  31. package/src/sdk/ts.js.map +1 -1
  32. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +7 -7
  33. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
  34. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +7 -3
  35. package/src/ts/agent/files/deploy/Dockerfile.template +5 -1
  36. package/src/ts/agent/gateway-connection/generator.js +1 -1
  37. package/src/ts/agent/gateway-connection/generator.js.map +1 -1
  38. package/src/ts/agent/generator.js +6 -0
  39. package/src/ts/agent/generator.js.map +1 -1
  40. package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +982 -0
  41. package/src/ts/dcr-proxy/generator.d.ts +10 -0
  42. package/src/ts/dcr-proxy/generator.js +98 -0
  43. package/src/ts/dcr-proxy/generator.js.map +1 -0
  44. package/src/ts/dcr-proxy/schema.d.js +6 -0
  45. package/src/ts/dcr-proxy/schema.d.js.map +1 -0
  46. package/src/ts/dcr-proxy/schema.d.ts +13 -0
  47. package/src/ts/dcr-proxy/schema.json +44 -0
  48. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +4 -8
  49. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  50. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
  51. package/src/ts/mcp-server/files/Dockerfile.template +5 -1
  52. package/src/ts/mcp-server/generator.js +1 -0
  53. package/src/ts/mcp-server/generator.js.map +1 -1
  54. package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +2 -2
  55. package/src/ts/nx-plugin/files/mcp-server/resources/GENERAL_GUIDANCE.md.template +1 -1
  56. package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +1 -1
  57. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +11 -4
  58. package/src/ts/rdb/files/Dockerfile.template +7 -0
  59. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +28 -28
  60. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
  61. package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +1 -0
  62. package/src/utils/agent-core-constructs/agent-core-constructs.js +2 -0
  63. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  64. package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +38 -3
  65. package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +13 -3
  66. package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +22 -1
  67. package/src/utils/commands.js +1 -1
  68. package/src/utils/commands.js.map +1 -1
  69. package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.d.ts +38 -0
  70. package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.js +93 -0
  71. package/src/utils/dcr-proxy-constructs/dcr-proxy-constructs.js.map +1 -0
  72. package/src/utils/dcr-proxy-constructs/files/cdk/app/dcr-proxies/__nameKebabCase__/__nameKebabCase__.ts.template +227 -0
  73. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/authorization-server-metadata.ts.template +39 -0
  74. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/authorize.ts.template +26 -0
  75. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/mcp-proxy.ts.template +89 -0
  76. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/protected-resource-metadata.ts.template +13 -0
  77. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/register.ts.template +70 -0
  78. package/src/utils/dcr-proxy-constructs/files/project/src/handlers/token.ts.template +75 -0
  79. package/src/utils/dcr-proxy-constructs/files/terraform/app/dcr-proxies/__nameKebabCase__/__nameKebabCase__.tf.template +410 -0
  80. package/src/utils/docker.d.ts +4 -3
  81. package/src/utils/docker.js +11 -7
  82. package/src/utils/docker.js.map +1 -1
  83. package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +1 -3
  84. package/src/utils/files/common/scripts/src/rdb/shared/start-container.ts.template +1 -3
  85. package/src/utils/format.d.ts +1 -1
  86. package/src/utils/format.js +3 -2
  87. package/src/utils/format.js.map +1 -1
  88. package/src/utils/init.js +4 -0
  89. package/src/utils/init.js.map +1 -1
  90. package/src/utils/versions.d.ts +53 -51
  91. package/src/utils/versions.js +53 -49
  92. package/src/utils/versions.js.map +1 -1
@@ -4883,6 +4883,57 @@ SOFTWARE.
4883
4883
 
4884
4884
  ---
4885
4885
 
4886
+ The following software may be included in this product: @node-rs/xxhash (1.7.6)
4887
+ This software contains the following license and notice below:
4888
+
4889
+ MIT License
4890
+
4891
+ Copyright (c) 2020-present LongYinan
4892
+
4893
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4894
+ of this software and associated documentation files (the "Software"), to deal
4895
+ in the Software without restriction, including without limitation the rights
4896
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
4897
+ copies of the Software, and to permit persons to whom the Software is
4898
+ furnished to do so, subject to the following conditions:
4899
+
4900
+ The above copyright notice and this permission notice shall be included in all
4901
+ copies or substantial portions of the Software.
4902
+
4903
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4904
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4905
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4906
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4907
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
4908
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
4909
+ SOFTWARE.
4910
+
4911
+ ---
4912
+
4913
+ The following software may be included in this product: @node-rs/xxhash-linux-x64-gnu (1.7.6)
4914
+ This software contains the following license and notice below:
4915
+
4916
+ MIT License
4917
+
4918
+ Copyright (c) LongYinan
4919
+
4920
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4921
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
4922
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
4923
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
4924
+ following conditions:
4925
+
4926
+ The above copyright notice and this permission notice shall be included in all copies or substantial
4927
+ portions of the Software.
4928
+
4929
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
4930
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
4931
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
4932
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
4933
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
4934
+
4935
+ ---
4936
+
4886
4937
  The following software may be included in this product: @nodelib/fs.scandir (2.1.5)
4887
4938
  This software contains the following license and notice below:
4888
4939
 
@@ -5256,7 +5307,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5256
5307
 
5257
5308
  ---
5258
5309
 
5259
- The following software may be included in this product: @nxlv/python (22.2.1)
5310
+ The following software may be included in this product: @nxlv/python (22.2.2)
5260
5311
  This software contains the following license and notice below:
5261
5312
 
5262
5313
  MIT License
@@ -6245,7 +6296,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
6245
6296
 
6246
6297
  ---
6247
6298
 
6248
- The following software may be included in this product: @swc-node/core (1.14.1)
6299
+ The following software may be included in this product: @swc-node/core (1.15.0)
6249
6300
  This software contains the following license and notice below:
6250
6301
 
6251
6302
  MIT License
@@ -6272,7 +6323,7 @@ SOFTWARE.
6272
6323
 
6273
6324
  ---
6274
6325
 
6275
- The following software may be included in this product: @swc-node/register (1.11.1)
6326
+ The following software may be included in this product: @swc-node/register (1.12.1)
6276
6327
  This software contains the following license and notice below:
6277
6328
 
6278
6329
  MIT License
@@ -7281,7 +7332,7 @@ SOFTWARE.
7281
7332
 
7282
7333
  ---
7283
7334
 
7284
- The following software may be included in this product: @verdaccio/hooks (8.0.3)
7335
+ The following software may be included in this product: @verdaccio/hooks (8.0.4)
7285
7336
  This software contains the following license and notice below:
7286
7337
 
7287
7338
  MIT License
@@ -7605,7 +7656,7 @@ SOFTWARE.
7605
7656
 
7606
7657
  ---
7607
7658
 
7608
- The following software may be included in this product: @verdaccio/ui-theme (9.0.0-next-9.20)
7659
+ The following software may be included in this product: @verdaccio/ui-theme (9.0.0-next-9.21)
7609
7660
  This software contains the following license and notice below:
7610
7661
 
7611
7662
  MIT License
@@ -9878,35 +9929,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
9878
9929
 
9879
9930
  ---
9880
9931
 
9881
- The following software may be included in this product: body-parser (1.20.3)
9882
- This software contains the following license and notice below:
9883
-
9884
- (The MIT License)
9885
-
9886
- Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
9887
- Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
9888
-
9889
- Permission is hereby granted, free of charge, to any person obtaining
9890
- a copy of this software and associated documentation files (the
9891
- 'Software'), to deal in the Software without restriction, including
9892
- without limitation the rights to use, copy, modify, merge, publish,
9893
- distribute, sublicense, and/or sell copies of the Software, and to
9894
- permit persons to whom the Software is furnished to do so, subject to
9895
- the following conditions:
9896
-
9897
- The above copyright notice and this permission notice shall be
9898
- included in all copies or substantial portions of the Software.
9899
-
9900
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
9901
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9902
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9903
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
9904
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
9905
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
9906
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9907
-
9908
- ---
9909
-
9910
9932
  The following software may be included in this product: body-parser (1.20.5)
9911
9933
  This software contains the following license and notice below:
9912
9934
 
@@ -22258,6 +22280,32 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22258
22280
 
22259
22281
  ---
22260
22282
 
22283
+ The following software may be included in this product: postcss (8.5.19)
22284
+ This software contains the following license and notice below:
22285
+
22286
+ The MIT License (MIT)
22287
+
22288
+ Copyright 2013 Andrey Sitnik <andrey@sitnik.es>
22289
+
22290
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
22291
+ this software and associated documentation files (the "Software"), to deal in
22292
+ the Software without restriction, including without limitation the rights to
22293
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
22294
+ the Software, and to permit persons to whom the Software is furnished to do so,
22295
+ subject to the following conditions:
22296
+
22297
+ The above copyright notice and this permission notice shall be included in all
22298
+ copies or substantial portions of the Software.
22299
+
22300
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22301
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22302
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22303
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22304
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22305
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22306
+
22307
+ ---
22308
+
22261
22309
  The following software may be included in this product: postcss-modules (6.0.1)
22262
22310
  This software contains the following license and notice below:
22263
22311
 
@@ -22801,34 +22849,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22801
22849
 
22802
22850
  ---
22803
22851
 
22804
- The following software may be included in this product: raw-body (2.5.2)
22805
- This software contains the following license and notice below:
22806
-
22807
- The MIT License (MIT)
22808
-
22809
- Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com>
22810
- Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
22811
-
22812
- Permission is hereby granted, free of charge, to any person obtaining a copy
22813
- of this software and associated documentation files (the "Software"), to deal
22814
- in the Software without restriction, including without limitation the rights
22815
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22816
- copies of the Software, and to permit persons to whom the Software is
22817
- furnished to do so, subject to the following conditions:
22818
-
22819
- The above copyright notice and this permission notice shall be included in
22820
- all copies or substantial portions of the Software.
22821
-
22822
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22823
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22824
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22825
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22826
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22827
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22828
- THE SOFTWARE.
22829
-
22830
- ---
22831
-
22832
22852
  The following software may be included in this product: raw-body (2.5.3)
22833
22853
  This software contains the following license and notice below:
22834
22854
 
@@ -24897,33 +24917,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
24897
24917
 
24898
24918
  ---
24899
24919
 
24900
- The following software may be included in this product: side-channel (1.1.0)
24901
- This software contains the following license and notice below:
24902
-
24903
- MIT License
24904
-
24905
- Copyright (c) 2019 Jordan Harband
24906
-
24907
- Permission is hereby granted, free of charge, to any person obtaining a copy
24908
- of this software and associated documentation files (the "Software"), to deal
24909
- in the Software without restriction, including without limitation the rights
24910
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24911
- copies of the Software, and to permit persons to whom the Software is
24912
- furnished to do so, subject to the following conditions:
24913
-
24914
- The above copyright notice and this permission notice shall be included in all
24915
- copies or substantial portions of the Software.
24916
-
24917
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24918
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24919
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24920
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24921
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24922
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24923
- SOFTWARE.
24924
-
24925
- ---
24926
-
24927
24920
  The following software may be included in this product: side-channel (1.1.1)
24928
24921
  This software contains the following license and notice below:
24929
24922
 
@@ -24951,33 +24944,6 @@ SOFTWARE.
24951
24944
 
24952
24945
  ---
24953
24946
 
24954
- The following software may be included in this product: side-channel-list (1.0.0)
24955
- This software contains the following license and notice below:
24956
-
24957
- MIT License
24958
-
24959
- Copyright (c) 2024 Jordan Harband
24960
-
24961
- Permission is hereby granted, free of charge, to any person obtaining a copy
24962
- of this software and associated documentation files (the "Software"), to deal
24963
- in the Software without restriction, including without limitation the rights
24964
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24965
- copies of the Software, and to permit persons to whom the Software is
24966
- furnished to do so, subject to the following conditions:
24967
-
24968
- The above copyright notice and this permission notice shall be included in all
24969
- copies or substantial portions of the Software.
24970
-
24971
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24972
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24973
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24974
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24975
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24976
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24977
- SOFTWARE.
24978
-
24979
- ---
24980
-
24981
24947
  The following software may be included in this product: side-channel-list (1.0.1)
24982
24948
  This software contains the following license and notice below:
24983
24949
 
@@ -26013,6 +25979,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
26013
25979
 
26014
25980
  ---
26015
25981
 
25982
+ The following software may be included in this product: supports-color (10.2.2)
25983
+ This software contains the following license and notice below:
25984
+
25985
+ MIT License
25986
+
25987
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
25988
+
25989
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
25990
+
25991
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
25992
+
25993
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25994
+
25995
+ ---
25996
+
26016
25997
  The following software may be included in this product: supports-preserve-symlinks-flag (1.0.0)
26017
25998
  This software contains the following license and notice below:
26018
25999
 
@@ -26811,7 +26792,7 @@ SOFTWARE.
26811
26792
 
26812
26793
  ---
26813
26794
 
26814
- The following software may be included in this product: tsx (4.23.0)
26795
+ The following software may be included in this product: tsx (4.23.1)
26815
26796
  This software contains the following license and notice below:
26816
26797
 
26817
26798
  MIT License
@@ -27649,7 +27630,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27649
27630
 
27650
27631
  ---
27651
27632
 
27652
- The following software may be included in this product: verdaccio (6.7.4)
27633
+ The following software may be included in this product: verdaccio (6.8.0)
27653
27634
  This software contains the following license and notice below:
27654
27635
 
27655
27636
  MIT License
@@ -27810,7 +27791,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27810
27791
 
27811
27792
  ---
27812
27793
 
27813
- The following software may be included in this product: vite (8.1.4)
27794
+ The following software may be included in this product: vite (8.1.5)
27814
27795
  This software contains the following license and notice below:
27815
27796
 
27816
27797
  # Vite core license
@@ -40337,6 +40318,27 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40337
40318
 
40338
40319
  ---
40339
40320
 
40321
+ The following software may be included in this product: semver (7.8.5)
40322
+ This software contains the following license and notice below:
40323
+
40324
+ The ISC License
40325
+
40326
+ Copyright (c) Isaac Z. Schlueter and Contributors
40327
+
40328
+ Permission to use, copy, modify, and/or distribute this software for any
40329
+ purpose with or without fee is hereby granted, provided that the above
40330
+ copyright notice and this permission notice appear in all copies.
40331
+
40332
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
40333
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
40334
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
40335
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
40336
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
40337
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
40338
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40339
+
40340
+ ---
40341
+
40340
40342
  The following software may be included in this product: setprototypeof (1.2.0)
40341
40343
  This software contains the following license and notice below:
40342
40344
 
@@ -41227,41 +41229,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41227
41229
 
41228
41230
  ---
41229
41231
 
41230
- The following software may be included in this product: qs (6.13.0)
41231
- This software contains the following license and notice below:
41232
-
41233
- BSD 3-Clause License
41234
-
41235
- Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors)
41236
- All rights reserved.
41237
-
41238
- Redistribution and use in source and binary forms, with or without
41239
- modification, are permitted provided that the following conditions are met:
41240
-
41241
- 1. Redistributions of source code must retain the above copyright notice, this
41242
- list of conditions and the following disclaimer.
41243
-
41244
- 2. Redistributions in binary form must reproduce the above copyright notice,
41245
- this list of conditions and the following disclaimer in the documentation
41246
- and/or other materials provided with the distribution.
41247
-
41248
- 3. Neither the name of the copyright holder nor the names of its
41249
- contributors may be used to endorse or promote products derived from
41250
- this software without specific prior written permission.
41251
-
41252
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
41253
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41254
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41255
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41256
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41257
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
41258
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41259
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
41260
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41261
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41262
-
41263
- ---
41264
-
41265
41232
  The following software may be included in this product: qs (6.14.1)
41266
41233
  This software contains the following license and notice below:
41267
41234
 
package/generators.json CHANGED
@@ -211,6 +211,12 @@
211
211
  "description": "Generate a TypeScript lambda function",
212
212
  "metric": "g21"
213
213
  },
214
+ "ts#dcr-proxy": {
215
+ "factory": "./src/ts/dcr-proxy/generator",
216
+ "schema": "./src/ts/dcr-proxy/schema.json",
217
+ "description": "Generate an OAuth Dynamic Client Registration (DCR) proxy construct for Cognito-authenticated MCP servers",
218
+ "metric": "g56"
219
+ },
214
220
  "ts#mcp-server": {
215
221
  "factory": "./src/ts/mcp-server/generator",
216
222
  "schema": "./src/ts/mcp-server/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.43",
3
+ "version": "1.0.0-rc.45",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@apidevtools/swagger-parser": "12.1.0",
43
43
  "@biomejs/js-api": "6.0.0",
44
- "@biomejs/wasm-nodejs": "2.5.3",
44
+ "@biomejs/wasm-nodejs": "2.5.4",
45
45
  "@getgrit/gritql": "0.0.3",
46
46
  "@iarna/toml": "2.2.5",
47
47
  "@modelcontextprotocol/sdk": "1.29.0",
@@ -52,7 +52,7 @@
52
52
  "@types/estree": "1.0.9",
53
53
  "@types/js-yaml": "4.0.9",
54
54
  "@types/mdast": "4.0.4",
55
- "@nxlv/python": "22.2.1",
55
+ "@nxlv/python": "22.2.2",
56
56
  "@phenomnomnominal/tsquery": "6.2.0",
57
57
  "enquirer": "2.4.1",
58
58
  "fast-glob": "3.3.3",
@@ -77,7 +77,7 @@
77
77
  "typescript": "6.0.3",
78
78
  "unified": "11.0.5",
79
79
  "unist-util-visit": "5.1.0",
80
- "vite": "8.1.4",
80
+ "vite": "8.1.5",
81
81
  "vitest": "4.1.10",
82
82
  "zod": "4.4.3"
83
83
  }
@@ -7,10 +7,19 @@ runtime.
7
7
 
8
8
  ## Default policy
9
9
 
10
+ <%_ if (auth === 'cognito') { _%>
11
+ `permit-all.cedar` permits any Cognito-authenticated caller
12
+ (`principal is AgentCore::OAuthUser`). The gateway's JWT authorizer already
13
+ validates the token's user pool and client before policies are evaluated, so
14
+ any principal that reaches the engine is an authenticated OAuth user. Tighten
15
+ this by matching JWT claims (e.g. `principal.scope`) — see the
16
+ [AgentCore common policy patterns](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/policy-common-patterns.html).
17
+ <%_ } else { _%>
10
18
  `permit-all.cedar` permits any IAM caller from the deploying AWS account.
11
19
  It is scoped to your account because AgentCore's policy validator rejects
12
20
  truly unrestricted permits (`permit (principal, action, resource)`) as
13
21
  "Overly Permissive".
22
+ <%_ } _%>
14
23
 
15
24
  **If you delete this file without adding replacement `permit` policies, the
16
25
  gateway will deny every request** — Cedar uses a default-deny evaluation
@@ -1,3 +1,17 @@
1
+ <%_ if (auth === 'cognito') { _%>
2
+ // Default policy: permit any Cognito-authenticated caller.
3
+ // The gateway's JWT authorizer already validates the token's user pool and
4
+ // client, so any principal reaching policy evaluation is an authenticated
5
+ // OAuth user. The PolicyEngine runs in ENFORCE mode (default-deny) — deleting
6
+ // this file without a replacement permit denies every call. See
7
+ // policies/README.md.
8
+
9
+ permit (
10
+ principal is AgentCore::OAuthUser,
11
+ action,
12
+ resource == AgentCore::Gateway::"<%%= gatewayArn %>"
13
+ );
14
+ <%_ } else { _%>
1
15
  // Default policy: permit any IAM caller from the deploying AWS account.
2
16
  // The PolicyEngine runs in ENFORCE mode (default-deny) — deleting this file
3
17
  // without a replacement permit denies every call. See policies/README.md.
@@ -9,3 +23,4 @@ permit (
9
23
  ) when {
10
24
  principal.id like "arn:aws:*::<%%= accountId %>:*"
11
25
  };
26
+ <%_ } _%>
@@ -21,11 +21,13 @@ export const agentcoreGatewayGenerator = async (tree, options)=>{
21
21
  const subDir = options.subDirectory ?? name;
22
22
  const projectRoot = joinPathFragments(parentDir, subDir);
23
23
  const fullyQualifiedName = `${getNpmScopePrefix(tree)}${name}`;
24
- // Protocol / auth are fixed to mcp / iam in v1 the enums accept only
25
- // these values, but we still persist the resolved value in metadata so
26
- // that connection generators can read it uniformly (and future additions
27
- // are non-breaking).
24
+ // Protocol is fixed to mcp the enum accepts only this value, but we still
25
+ // persist the resolved value in metadata so connection generators can read
26
+ // it uniformly (and future additions are non-breaking).
28
27
  const protocol = options.protocol ?? 'mcp';
28
+ // Inbound auth is iam (default) or cognito. Persisted in metadata so
29
+ // connection generators can validate it (agent -> gateway connections
30
+ // require an IAM gateway).
29
31
  const auth = options.auth ?? 'iam';
30
32
  const cedarPolicy = options.cedarPolicy ?? true;
31
33
  const infra = options.infra ?? 'agentcore';
@@ -84,8 +86,12 @@ export const agentcoreGatewayGenerator = async (tree, options)=>{
84
86
  overwriteStrategy: OverwriteStrategy.KeepExisting
85
87
  });
86
88
  if (cedarPolicy) {
89
+ // The default permit-all policy differs by auth type: AgentCore represents
90
+ // IAM callers as `AgentCore::IamEntity` and Cognito/JWT callers as
91
+ // `AgentCore::OAuthUser`, so the two policies match different principals.
87
92
  generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', 'cedar'), projectRoot, {
88
- nameClassName
93
+ nameClassName,
94
+ auth
89
95
  }, {
90
96
  overwriteStrategy: OverwriteStrategy.KeepExisting
91
97
  });
@@ -121,6 +127,7 @@ export const agentcoreGatewayGenerator = async (tree, options)=>{
121
127
  projectName: fullyQualifiedName,
122
128
  projectDirectory: projectRoot,
123
129
  cedarPolicy,
130
+ auth,
124
131
  iac
125
132
  });
126
133
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/agentcore-gateway/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n addProjectConfiguration,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { addAgentCoreGatewayInfra } from '../utils/agent-core-constructs/agent-core-constructs';\nimport { formatFilesInSubtree } from '../utils/format';\nimport { resolveIac } from '../utils/iac';\nimport { installDependencies } from '../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../utils/metrics';\nimport { kebabCase, toClassName } from '../utils/names';\nimport { getNpmScopePrefix } from '../utils/npm-scope';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { assignPort } from '../utils/port';\nimport { sharedConstructsGenerator } from '../utils/shared-constructs';\nimport { withVersions } from '../utils/versions';\nimport type { AgentcoreGatewayGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const agentcoreGatewayGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const name = kebabCase(options.name);\n const nameClassName = toClassName(name);\n const parentDir = options.directory ?? 'packages';\n const subDir = options.subDirectory ?? name;\n const projectRoot = joinPathFragments(parentDir, subDir);\n const fullyQualifiedName = `${getNpmScopePrefix(tree)}${name}`;\n\n // Protocol / auth are fixed to mcp / iam in v1 — the enums accept only\n // these values, but we still persist the resolved value in metadata so\n // that connection generators can read it uniformly (and future additions\n // are non-breaking).\n const protocol = options.protocol ?? 'mcp';\n const auth = options.auth ?? 'iam';\n const cedarPolicy = options.cedarPolicy ?? true;\n const infra = options.infra ?? 'agentcore';\n\n // local-dev.ts is the local gateway: a continuous MCP aggregator chaining\n // onto attached MCP servers' dev targets (added by the mcp-connection\n // generator), so a single `nx dev <gateway>` boots the gateway and every\n // attached MCP server together.\n //\n // `serve` exists for parity with other generators; the deployed Gateway is\n // a managed AWS resource, so `serve`-mode agents talk to it via runtime\n // config and the local gateway sits idle.\n const localGatewayTarget = (port: number) => ({\n executor: 'nx:run-commands' as const,\n continuous: true,\n options: {\n command: 'tsx local-dev.ts',\n cwd: '{projectRoot}',\n env: { PORT: `${port}` },\n },\n dependsOn: [] as Array<string | { projects: string[]; target: string }>,\n });\n let project: ProjectConfiguration;\n if (projectExists(tree, fullyQualifiedName)) {\n project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n } else {\n addProjectConfiguration(tree, fullyQualifiedName, {\n name: fullyQualifiedName,\n root: projectRoot,\n projectType: 'library',\n sourceRoot: projectRoot,\n tags: [],\n targets: {},\n metadata: {\n generator: AGENTCORE_GATEWAY_GENERATOR_INFO.id,\n } as any,\n });\n project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n }\n const port = assignPort(tree, project, 8100);\n // A gateway is its own standalone project, so it uses plain `serve` / `dev`\n // targets. Re-run: keep existing targets (their dependsOn may have been\n // populated by the mcp-connection generator), just ensure both exist.\n project.targets ??= {};\n project.targets['serve'] ??= localGatewayTarget(port);\n project.targets['dev'] ??= localGatewayTarget(port);\n updateProjectConfiguration(tree, project.name, project);\n\n // Scaffold the gateway project: local-dev.ts (+ Cedar policies if requested)\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'project'),\n projectRoot,\n { nameClassName, nameKebabCase: name, port, attachedMcpServers: [] },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n if (cedarPolicy) {\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'cedar'),\n projectRoot,\n { nameClassName },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n }\n\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n {\n name,\n rc: nameClassName,\n protocol,\n auth,\n port,\n },\n );\n\n // local-dev.ts dependencies (+ ejs for Cedar policy rendering in the\n // shared gateway construct)\n addDependenciesToPackageJson(\n tree,\n withVersions(['@modelcontextprotocol/sdk', 'express']),\n withVersions(['tsx', '@types/express', 'ejs', '@types/ejs']),\n );\n\n // Wire up infra (CDK or Terraform); re-running with infra=agentcore adds\n // the infrastructure to a previously infra-less gateway.\n if (infra === 'agentcore') {\n const iac = await resolveIac(tree, options.iac);\n await sharedConstructsGenerator(tree, { iac });\n\n await addAgentCoreGatewayInfra(tree, {\n gatewayNameClassName: nameClassName,\n gatewayNameKebabCase: name,\n projectName: fullyQualifiedName,\n projectDirectory: projectRoot,\n cedarPolicy,\n iac,\n });\n }\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\n/**\n * Gateway details stored in the gateway project's metadata.\n */\nexport interface AgentCoreGatewayMetadata {\n name: string;\n rc: string;\n protocol: string;\n auth: string;\n port: number;\n}\n\n/**\n * Read a gateway project's metadata, validating it was generated by the\n * agentcore-gateway generator.\n */\nexport const readAgentCoreGatewayMetadata = (\n project: ProjectConfiguration,\n): AgentCoreGatewayMetadata => {\n const metadata = project.metadata as any;\n if (metadata?.generator !== AGENTCORE_GATEWAY_GENERATOR_INFO.id) {\n throw new Error(\n `Project '${project.name}' was not generated by the '${AGENTCORE_GATEWAY_GENERATOR_INFO.id}' generator.`,\n );\n }\n return metadata as AgentCoreGatewayMetadata;\n};\n\nexport default agentcoreGatewayGenerator;\n"],"names":["addDependenciesToPackageJson","addProjectConfiguration","generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addAgentCoreGatewayInfra","formatFilesInSubtree","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","toClassName","getNpmScopePrefix","addGeneratorMetadata","getGeneratorInfo","projectExists","readProjectConfigurationUnqualified","assignPort","sharedConstructsGenerator","withVersions","AGENTCORE_GATEWAY_GENERATOR_INFO","filename","agentcoreGatewayGenerator","tree","options","name","nameClassName","parentDir","directory","subDir","subDirectory","projectRoot","fullyQualifiedName","protocol","auth","cedarPolicy","infra","localGatewayTarget","port","executor","continuous","command","cwd","env","PORT","dependsOn","project","root","projectType","sourceRoot","tags","targets","metadata","generator","id","dirname","nameKebabCase","attachedMcpServers","overwriteStrategy","KeepExisting","rc","iac","gatewayNameClassName","gatewayNameKebabCase","projectName","projectDirectory","preferInstallDependencies","languages","readAgentCoreGatewayMetadata","Error"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,uBAAuB,EAEvBC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,wBAAwB,QAAQ,0DAAuD;AAChG,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SAASC,UAAU,QAAQ,kBAAe;AAC1C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;QAC9C,MAAM3C,0BAA0BK,MAAM;YAAEsC;QAAI;QAE5C,MAAMxD,yBAAyBkB,MAAM;YACnCuC,sBAAsBpC;YACtBqC,sBAAsBtC;YACtBuC,aAAahC;YACbiC,kBAAkBlC;YAClBI;YACA0B;QACF;IACF;IAEA,MAAMpD,gCAAgCc,MAAM;QAC1CH;KACD;IAED,MAAMd,qBAAqBiB;IAC3B,OAAO,IACLf,oBAAoBe,MAAMC,QAAQ0C,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAaF;;;CAGC,GACD,OAAO,MAAMC,+BAA+B,CAC1CtB;IAEA,MAAMM,WAAWN,QAAQM,QAAQ;IACjC,IAAIA,UAAUC,cAAcjC,iCAAiCkC,EAAE,EAAE;QAC/D,MAAM,IAAIe,MACR,CAAC,SAAS,EAAEvB,QAAQrB,IAAI,CAAC,4BAA4B,EAAEL,iCAAiCkC,EAAE,CAAC,YAAY,CAAC;IAE5G;IACA,OAAOF;AACT,EAAE;AAEF,eAAe9B,0BAA0B"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/agentcore-gateway/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n addProjectConfiguration,\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { addAgentCoreGatewayInfra } from '../utils/agent-core-constructs/agent-core-constructs';\nimport { formatFilesInSubtree } from '../utils/format';\nimport { resolveIac } from '../utils/iac';\nimport { installDependencies } from '../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../utils/metrics';\nimport { kebabCase, toClassName } from '../utils/names';\nimport { getNpmScopePrefix } from '../utils/npm-scope';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { assignPort } from '../utils/port';\nimport { sharedConstructsGenerator } from '../utils/shared-constructs';\nimport { withVersions } from '../utils/versions';\nimport type { AgentcoreGatewayGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const agentcoreGatewayGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const name = kebabCase(options.name);\n const nameClassName = toClassName(name);\n const parentDir = options.directory ?? 'packages';\n const subDir = options.subDirectory ?? name;\n const projectRoot = joinPathFragments(parentDir, subDir);\n const fullyQualifiedName = `${getNpmScopePrefix(tree)}${name}`;\n\n // Protocol is fixed to mcp — the enum accepts only this value, but we still\n // persist the resolved value in metadata so connection generators can read\n // it uniformly (and future additions are non-breaking).\n const protocol = options.protocol ?? 'mcp';\n // Inbound auth is iam (default) or cognito. Persisted in metadata so\n // connection generators can validate it (agent -> gateway connections\n // require an IAM gateway).\n const auth = options.auth ?? 'iam';\n const cedarPolicy = options.cedarPolicy ?? true;\n const infra = options.infra ?? 'agentcore';\n\n // local-dev.ts is the local gateway: a continuous MCP aggregator chaining\n // onto attached MCP servers' dev targets (added by the mcp-connection\n // generator), so a single `nx dev <gateway>` boots the gateway and every\n // attached MCP server together.\n //\n // `serve` exists for parity with other generators; the deployed Gateway is\n // a managed AWS resource, so `serve`-mode agents talk to it via runtime\n // config and the local gateway sits idle.\n const localGatewayTarget = (port: number) => ({\n executor: 'nx:run-commands' as const,\n continuous: true,\n options: {\n command: 'tsx local-dev.ts',\n cwd: '{projectRoot}',\n env: { PORT: `${port}` },\n },\n dependsOn: [] as Array<string | { projects: string[]; target: string }>,\n });\n let project: ProjectConfiguration;\n if (projectExists(tree, fullyQualifiedName)) {\n project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n } else {\n addProjectConfiguration(tree, fullyQualifiedName, {\n name: fullyQualifiedName,\n root: projectRoot,\n projectType: 'library',\n sourceRoot: projectRoot,\n tags: [],\n targets: {},\n metadata: {\n generator: AGENTCORE_GATEWAY_GENERATOR_INFO.id,\n } as any,\n });\n project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);\n }\n const port = assignPort(tree, project, 8100);\n // A gateway is its own standalone project, so it uses plain `serve` / `dev`\n // targets. Re-run: keep existing targets (their dependsOn may have been\n // populated by the mcp-connection generator), just ensure both exist.\n project.targets ??= {};\n project.targets['serve'] ??= localGatewayTarget(port);\n project.targets['dev'] ??= localGatewayTarget(port);\n updateProjectConfiguration(tree, project.name, project);\n\n // Scaffold the gateway project: local-dev.ts (+ Cedar policies if requested)\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'project'),\n projectRoot,\n { nameClassName, nameKebabCase: name, port, attachedMcpServers: [] },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n if (cedarPolicy) {\n // The default permit-all policy differs by auth type: AgentCore represents\n // IAM callers as `AgentCore::IamEntity` and Cognito/JWT callers as\n // `AgentCore::OAuthUser`, so the two policies match different principals.\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'cedar'),\n projectRoot,\n { nameClassName, auth },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n }\n\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n {\n name,\n rc: nameClassName,\n protocol,\n auth,\n port,\n },\n );\n\n // local-dev.ts dependencies (+ ejs for Cedar policy rendering in the\n // shared gateway construct)\n addDependenciesToPackageJson(\n tree,\n withVersions(['@modelcontextprotocol/sdk', 'express']),\n withVersions(['tsx', '@types/express', 'ejs', '@types/ejs']),\n );\n\n // Wire up infra (CDK or Terraform); re-running with infra=agentcore adds\n // the infrastructure to a previously infra-less gateway.\n if (infra === 'agentcore') {\n const iac = await resolveIac(tree, options.iac);\n await sharedConstructsGenerator(tree, { iac });\n\n await addAgentCoreGatewayInfra(tree, {\n gatewayNameClassName: nameClassName,\n gatewayNameKebabCase: name,\n projectName: fullyQualifiedName,\n projectDirectory: projectRoot,\n cedarPolicy,\n auth,\n iac,\n });\n }\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\n/**\n * Gateway details stored in the gateway project's metadata.\n */\nexport interface AgentCoreGatewayMetadata {\n name: string;\n rc: string;\n protocol: string;\n auth: string;\n port: number;\n}\n\n/**\n * Read a gateway project's metadata, validating it was generated by the\n * agentcore-gateway generator.\n */\nexport const readAgentCoreGatewayMetadata = (\n project: ProjectConfiguration,\n): AgentCoreGatewayMetadata => {\n const metadata = project.metadata as any;\n if (metadata?.generator !== AGENTCORE_GATEWAY_GENERATOR_INFO.id) {\n throw new Error(\n `Project '${project.name}' was not generated by the '${AGENTCORE_GATEWAY_GENERATOR_INFO.id}' generator.`,\n );\n }\n return metadata as AgentCoreGatewayMetadata;\n};\n\nexport default agentcoreGatewayGenerator;\n"],"names":["addDependenciesToPackageJson","addProjectConfiguration","generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addAgentCoreGatewayInfra","formatFilesInSubtree","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","toClassName","getNpmScopePrefix","addGeneratorMetadata","getGeneratorInfo","projectExists","readProjectConfigurationUnqualified","assignPort","sharedConstructsGenerator","withVersions","AGENTCORE_GATEWAY_GENERATOR_INFO","filename","agentcoreGatewayGenerator","tree","options","name","nameClassName","parentDir","directory","subDir","subDirectory","projectRoot","fullyQualifiedName","protocol","auth","cedarPolicy","infra","localGatewayTarget","port","executor","continuous","command","cwd","env","PORT","dependsOn","project","root","projectType","sourceRoot","tags","targets","metadata","generator","id","dirname","nameKebabCase","attachedMcpServers","overwriteStrategy","KeepExisting","rc","iac","gatewayNameClassName","gatewayNameKebabCase","projectName","projectDirectory","preferInstallDependencies","languages","readAgentCoreGatewayMetadata","Error"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,uBAAuB,EAEvBC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,wBAAwB,QAAQ,0DAAuD;AAChG,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SAASC,UAAU,QAAQ,kBAAe;AAC1C,SAASC,mBAAmB,QAAQ,sBAAmB;AACvD,SAASC,+BAA+B,QAAQ,sBAAmB;AACnE,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAiB;AACxD,SAASC,iBAAiB,QAAQ,wBAAqB;AACvD,SACEC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,EACbC,mCAAmC,QAC9B,iBAAc;AACrB,SAASC,UAAU,QAAQ,mBAAgB;AAC3C,SAASC,yBAAyB,QAAQ,gCAA6B;AACvE,SAASC,YAAY,QAAQ,uBAAoB;AAGjD,OAAO,MAAMC,mCACXN,iBAAiB,YAAYO,QAAQ,EAAE;AAEzC,OAAO,MAAMC,4BAA4B,OACvCC,MACAC;IAEA,MAAMC,OAAOf,UAAUc,QAAQC,IAAI;IACnC,MAAMC,gBAAgBf,YAAYc;IAClC,MAAME,YAAYH,QAAQI,SAAS,IAAI;IACvC,MAAMC,SAASL,QAAQM,YAAY,IAAIL;IACvC,MAAMM,cAAc7B,kBAAkByB,WAAWE;IACjD,MAAMG,qBAAqB,GAAGpB,kBAAkBW,QAAQE,MAAM;IAE9D,4EAA4E;IAC5E,2EAA2E;IAC3E,wDAAwD;IACxD,MAAMQ,WAAWT,QAAQS,QAAQ,IAAI;IACrC,qEAAqE;IACrE,sEAAsE;IACtE,2BAA2B;IAC3B,MAAMC,OAAOV,QAAQU,IAAI,IAAI;IAC7B,MAAMC,cAAcX,QAAQW,WAAW,IAAI;IAC3C,MAAMC,QAAQZ,QAAQY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xB,aACA;YAAEL;YAAeQ;QAAK,GACtB;YAAEwB,mBAAmBvD,kBAAkBwD,YAAY;QAAC;IAExD;IAEA9C,qBACEU,MACAS,oBACAZ,kCACA;QACEK;QACAmC,IAAIlC;QACJO;QACAC;QACAI;IACF;IAGF,qEAAqE;IACrE,4BAA4B;IAC5BvC,6BACEwB,MACAJ,aAAa;QAAC;QAA6B;KAAU,GACrDA,aAAa;QAAC;QAAO;QAAkB;QAAO;KAAa;IAG7D,yEAAyE;IACzE,yDAAyD;IACzD,IAAIiB,UAAU,aAAa;QACzB,MAAMyB,MAAM,MAAMtD,WAAWgB,MAAMC,QAAQqC,GAAG;QAC9C,MAAM3C,0BAA0BK,MAAM;YAAEsC;QAAI;QAE5C,MAAMxD,yBAAyBkB,MAAM;YACnCuC,sBAAsBpC;YACtBqC,sBAAsBtC;YACtBuC,aAAahC;YACbiC,kBAAkBlC;YAClBI;YACAD;YACA2B;QACF;IACF;IAEA,MAAMpD,gCAAgCc,MAAM;QAC1CH;KACD;IAED,MAAMd,qBAAqBiB;IAC3B,OAAO,IACLf,oBAAoBe,MAAMC,QAAQ0C,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAaF;;;CAGC,GACD,OAAO,MAAMC,+BAA+B,CAC1CtB;IAEA,MAAMM,WAAWN,QAAQM,QAAQ;IACjC,IAAIA,UAAUC,cAAcjC,iCAAiCkC,EAAE,EAAE;QAC/D,MAAM,IAAIe,MACR,CAAC,SAAS,EAAEvB,QAAQrB,IAAI,CAAC,4BAA4B,EAAEL,iCAAiCkC,EAAE,CAAC,YAAY,CAAC;IAE5G;IACA,OAAOF;AACT,EAAE;AAEF,eAAe9B,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/agentcore-gateway/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { IacOption } from '../utils/iac';\n\nexport interface AgentcoreGatewayGeneratorSchema {\n name: string;\n directory?: string;\n subDirectory?: string;\n protocol?: 'mcp';\n auth?: 'iam';\n cedarPolicy?: boolean;\n infra?: 'agentcore' | 'none';\n iac: IacOption;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAUC"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/agentcore-gateway/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { IacOption } from '../utils/iac';\n\nexport interface AgentcoreGatewayGeneratorSchema {\n name: string;\n directory?: string;\n subDirectory?: string;\n protocol?: 'mcp';\n auth?: 'iam' | 'cognito';\n cedarPolicy?: boolean;\n infra?: 'agentcore' | 'none';\n iac: IacOption;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAUC"}
@@ -9,7 +9,7 @@ export interface AgentcoreGatewayGeneratorSchema {
9
9
  directory?: string;
10
10
  subDirectory?: string;
11
11
  protocol?: 'mcp';
12
- auth?: 'iam';
12
+ auth?: 'iam' | 'cognito';
13
13
  cedarPolicy?: boolean;
14
14
  infra?: 'agentcore' | 'none';
15
15
  iac: IacOption;
@@ -33,9 +33,10 @@
33
33
  },
34
34
  "auth": {
35
35
  "type": "string",
36
- "description": "The method used to authenticate inbound requests to your gateway. Only iam is supported today; cognito and custom-jwt may be added in future.",
37
- "enum": ["iam"],
36
+ "description": "The method used to authenticate inbound requests to your gateway. Only applicable when infra is set (ignored when infra is none).",
37
+ "enum": ["iam", "cognito"],
38
38
  "default": "iam",
39
+ "x-prompt": "How would you like to authenticate inbound requests to your gateway?",
39
40
  "x-priority": "important"
40
41
  },
41
42
  "cedarPolicy": {
@@ -13,11 +13,11 @@ import pyDynamoDBAgentConnectionGenerator from "../py/dynamodb/agent-connection/
13
13
  import pyDynamoDBFastApiConnectionGenerator from "../py/dynamodb/fast-api-connection/generator.js";
14
14
  import { PY_DYNAMODB_GENERATOR_INFO } from "../py/dynamodb/generator.js";
15
15
  import pyDynamoDBMcpServerConnectionGenerator from "../py/dynamodb/mcp-server-connection/generator.js";
16
+ import fastApiReactGenerator from "../py/fast-api/react/generator.js";
16
17
  import pyRdbAgentConnectionGenerator from "../py/rdb/agent-connection/generator.js";
17
18
  import pyRdbFastApiConnectionGenerator from "../py/rdb/fast-api-connection/generator.js";
18
19
  import { PY_RDB_GENERATOR_INFO } from "../py/rdb/generator.js";
19
20
  import pyRdbMcpServerConnectionGenerator from "../py/rdb/mcp-server-connection/generator.js";
20
- import fastApiReactGenerator from "../py/fast-api/react/generator.js";
21
21
  import { SMITHY_PROJECT_GENERATOR_INFO } from "../smithy/project/generator.js";
22
22
  import smithyReactConnectionGenerator from "../smithy/react-connection/generator.js";
23
23
  import { TS_SMITHY_API_GENERATOR_INFO } from "../smithy/ts/api/generator.js";