@aws/nx-plugin 1.0.0-rc.24 → 1.0.0-rc.26

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 (302) hide show
  1. package/LICENSE-THIRD-PARTY +2020 -702
  2. package/package.json +6 -6
  3. package/src/agentcore-gateway/gateway-connection/generator.d.ts +1 -1
  4. package/src/agentcore-gateway/gateway-connection/generator.js +7 -5
  5. package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -1
  6. package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -1
  7. package/src/agentcore-gateway/gateway-connection/schema.d.ts +1 -0
  8. package/src/agentcore-gateway/gateway-connection/schema.json +5 -0
  9. package/src/agentcore-gateway/generator.js +7 -4
  10. package/src/agentcore-gateway/generator.js.map +1 -1
  11. package/src/agentcore-gateway/mcp-connection/generator.d.ts +1 -1
  12. package/src/agentcore-gateway/mcp-connection/generator.js +7 -5
  13. package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
  14. package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -1
  15. package/src/agentcore-gateway/mcp-connection/schema.d.ts +1 -0
  16. package/src/agentcore-gateway/mcp-connection/schema.json +5 -0
  17. package/src/agentcore-gateway/schema.d.js.map +1 -1
  18. package/src/agentcore-gateway/schema.d.ts +1 -0
  19. package/src/agentcore-gateway/schema.json +5 -0
  20. package/src/connection/generator.d.ts +3 -10
  21. package/src/connection/generator.js +18 -148
  22. package/src/connection/generator.js.map +1 -1
  23. package/src/connection/schema.d.js.map +1 -1
  24. package/src/connection/schema.d.ts +1 -0
  25. package/src/connection/schema.json +5 -0
  26. package/src/connection/supported-connections.d.ts +98 -0
  27. package/src/connection/supported-connections.js +138 -0
  28. package/src/connection/supported-connections.js.map +1 -0
  29. package/src/infra/app/__snapshots__/generator.spec.ts.snap +29 -21
  30. package/src/infra/app/generator.js +12 -6
  31. package/src/infra/app/generator.js.map +1 -1
  32. package/src/infra/app/schema.d.js.map +1 -1
  33. package/src/infra/app/schema.d.ts +1 -1
  34. package/src/infra/app/schema.json +5 -0
  35. package/src/license/schema.d.js.map +1 -1
  36. package/src/license/schema.d.ts +2 -0
  37. package/src/license/schema.json +5 -0
  38. package/src/mcp-server/tools/general-guidance.js +17 -0
  39. package/src/mcp-server/tools/general-guidance.js.map +1 -1
  40. package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
  41. package/src/preset/generator.d.ts +1 -1
  42. package/src/preset/generator.js +8 -5
  43. package/src/preset/generator.js.map +1 -1
  44. package/src/preset/schema.d.js.map +1 -1
  45. package/src/preset/schema.d.ts +1 -0
  46. package/src/preset/schema.json +5 -0
  47. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +9 -9
  48. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +10 -10
  49. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1 -1
  50. package/src/py/agent/a2a-connection/generator.js +7 -4
  51. package/src/py/agent/a2a-connection/generator.js.map +1 -1
  52. package/src/py/agent/a2a-connection/schema.d.js.map +1 -1
  53. package/src/py/agent/a2a-connection/schema.d.ts +1 -0
  54. package/src/py/agent/a2a-connection/schema.json +5 -0
  55. package/src/py/agent/gateway-connection/generator.js +7 -4
  56. package/src/py/agent/gateway-connection/generator.js.map +1 -1
  57. package/src/py/agent/gateway-connection/schema.d.js.map +1 -1
  58. package/src/py/agent/gateway-connection/schema.d.ts +1 -0
  59. package/src/py/agent/gateway-connection/schema.json +5 -0
  60. package/src/py/agent/generator.js +8 -6
  61. package/src/py/agent/generator.js.map +1 -1
  62. package/src/py/agent/mcp-connection/generator.js +7 -4
  63. package/src/py/agent/mcp-connection/generator.js.map +1 -1
  64. package/src/py/agent/mcp-connection/schema.d.js.map +1 -1
  65. package/src/py/agent/mcp-connection/schema.d.ts +1 -0
  66. package/src/py/agent/mcp-connection/schema.json +5 -0
  67. package/src/py/agent/react-connection/generator.d.ts +1 -1
  68. package/src/py/agent/react-connection/generator.js +7 -4
  69. package/src/py/agent/react-connection/generator.js.map +1 -1
  70. package/src/py/agent/react-connection/schema.d.js.map +1 -1
  71. package/src/py/agent/react-connection/schema.d.ts +1 -0
  72. package/src/py/agent/react-connection/schema.json +5 -0
  73. package/src/py/agent/schema.d.js.map +1 -1
  74. package/src/py/agent/schema.d.ts +1 -0
  75. package/src/py/agent/schema.json +5 -0
  76. package/src/py/api/generator.js +2 -1
  77. package/src/py/api/generator.js.map +1 -1
  78. package/src/py/api/schema.d.js.map +1 -1
  79. package/src/py/api/schema.d.ts +1 -0
  80. package/src/py/api/schema.json +5 -0
  81. package/src/py/dynamodb/agent-connection/generator.js +8 -6
  82. package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
  83. package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -1
  84. package/src/py/dynamodb/agent-connection/schema.d.ts +1 -0
  85. package/src/py/dynamodb/agent-connection/schema.json +5 -0
  86. package/src/py/dynamodb/fast-api-connection/generator.js +8 -6
  87. package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
  88. package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -1
  89. package/src/py/dynamodb/fast-api-connection/schema.d.ts +1 -0
  90. package/src/py/dynamodb/fast-api-connection/schema.json +5 -0
  91. package/src/py/dynamodb/generator.js +10 -7
  92. package/src/py/dynamodb/generator.js.map +1 -1
  93. package/src/py/dynamodb/mcp-server-connection/generator.js +8 -6
  94. package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
  95. package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
  96. package/src/py/dynamodb/mcp-server-connection/schema.d.ts +1 -0
  97. package/src/py/dynamodb/mcp-server-connection/schema.json +5 -0
  98. package/src/py/dynamodb/schema.d.js.map +1 -1
  99. package/src/py/dynamodb/schema.d.ts +1 -0
  100. package/src/py/dynamodb/schema.json +5 -0
  101. package/src/py/fast-api/generator.js +10 -7
  102. package/src/py/fast-api/generator.js.map +1 -1
  103. package/src/py/fast-api/react/generator.d.ts +2 -2
  104. package/src/py/fast-api/react/generator.js +7 -5
  105. package/src/py/fast-api/react/generator.js.map +1 -1
  106. package/src/py/fast-api/react/schema.d.js.map +1 -1
  107. package/src/py/fast-api/react/schema.d.ts +1 -0
  108. package/src/py/fast-api/react/schema.json +5 -0
  109. package/src/py/fast-api/schema.d.js.map +1 -1
  110. package/src/py/fast-api/schema.d.ts +1 -0
  111. package/src/py/fast-api/schema.json +5 -0
  112. package/src/py/lambda-function/generator.js +8 -6
  113. package/src/py/lambda-function/generator.js.map +1 -1
  114. package/src/py/lambda-function/schema.d.js.map +1 -1
  115. package/src/py/lambda-function/schema.d.ts +1 -0
  116. package/src/py/lambda-function/schema.json +5 -0
  117. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
  118. package/src/py/mcp-server/generator.js +8 -6
  119. package/src/py/mcp-server/generator.js.map +1 -1
  120. package/src/py/mcp-server/schema.d.js.map +1 -1
  121. package/src/py/mcp-server/schema.d.ts +1 -0
  122. package/src/py/mcp-server/schema.json +5 -0
  123. package/src/py/project/generator.js +9 -6
  124. package/src/py/project/generator.js.map +1 -1
  125. package/src/py/project/schema.d.js.map +1 -1
  126. package/src/py/project/schema.d.ts +1 -0
  127. package/src/py/project/schema.json +5 -0
  128. package/src/sdk/open-api.d.ts +1 -1
  129. package/src/sdk/open-api.js +1 -1
  130. package/src/sdk/open-api.js.map +1 -1
  131. package/src/sdk/utils/ast.d.ts +1 -2
  132. package/src/sdk/utils/ast.js +1 -2
  133. package/src/sdk/utils/ast.js.map +1 -1
  134. package/src/smithy/project/generator.js +7 -4
  135. package/src/smithy/project/generator.js.map +1 -1
  136. package/src/smithy/project/schema.d.js.map +1 -1
  137. package/src/smithy/project/schema.d.ts +1 -0
  138. package/src/smithy/project/schema.json +5 -0
  139. package/src/smithy/react-connection/generator.js +7 -4
  140. package/src/smithy/react-connection/generator.js.map +1 -1
  141. package/src/smithy/react-connection/schema.d.js.map +1 -1
  142. package/src/smithy/react-connection/schema.d.ts +1 -0
  143. package/src/smithy/react-connection/schema.json +5 -0
  144. package/src/smithy/ts/api/generator.js +11 -6
  145. package/src/smithy/ts/api/generator.js.map +1 -1
  146. package/src/smithy/ts/api/schema.d.js.map +1 -1
  147. package/src/smithy/ts/api/schema.d.ts +1 -0
  148. package/src/smithy/ts/api/schema.json +5 -0
  149. package/src/terraform/project/generator.js +13 -4
  150. package/src/terraform/project/generator.js.map +1 -1
  151. package/src/terraform/project/schema.d.js.map +1 -1
  152. package/src/terraform/project/schema.d.ts +1 -0
  153. package/src/terraform/project/schema.json +5 -0
  154. package/src/trpc/backend/generator.d.ts +1 -1
  155. package/src/trpc/backend/generator.js +9 -5
  156. package/src/trpc/backend/generator.js.map +1 -1
  157. package/src/trpc/backend/schema.d.js.map +1 -1
  158. package/src/trpc/backend/schema.d.ts +1 -0
  159. package/src/trpc/backend/schema.json +5 -0
  160. package/src/trpc/react/generator.d.ts +1 -1
  161. package/src/trpc/react/generator.js +9 -5
  162. package/src/trpc/react/generator.js.map +1 -1
  163. package/src/trpc/react/schema.d.js.map +1 -1
  164. package/src/trpc/react/schema.d.ts +1 -0
  165. package/src/trpc/react/schema.json +5 -0
  166. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +2 -2
  167. package/src/ts/agent/a2a-connection/generator.js +7 -4
  168. package/src/ts/agent/a2a-connection/generator.js.map +1 -1
  169. package/src/ts/agent/a2a-connection/schema.d.js.map +1 -1
  170. package/src/ts/agent/a2a-connection/schema.d.ts +1 -0
  171. package/src/ts/agent/a2a-connection/schema.json +5 -0
  172. package/src/ts/agent/gateway-connection/generator.js +7 -4
  173. package/src/ts/agent/gateway-connection/generator.js.map +1 -1
  174. package/src/ts/agent/gateway-connection/schema.d.js.map +1 -1
  175. package/src/ts/agent/gateway-connection/schema.d.ts +1 -0
  176. package/src/ts/agent/gateway-connection/schema.json +5 -0
  177. package/src/ts/agent/generator.js +7 -4
  178. package/src/ts/agent/generator.js.map +1 -1
  179. package/src/ts/agent/mcp-connection/generator.js +7 -4
  180. package/src/ts/agent/mcp-connection/generator.js.map +1 -1
  181. package/src/ts/agent/mcp-connection/schema.d.js.map +1 -1
  182. package/src/ts/agent/mcp-connection/schema.d.ts +1 -0
  183. package/src/ts/agent/mcp-connection/schema.json +5 -0
  184. package/src/ts/agent/react-connection/generator.d.ts +1 -1
  185. package/src/ts/agent/react-connection/generator.js +14 -8
  186. package/src/ts/agent/react-connection/generator.js.map +1 -1
  187. package/src/ts/agent/react-connection/schema.d.js.map +1 -1
  188. package/src/ts/agent/react-connection/schema.d.ts +1 -0
  189. package/src/ts/agent/react-connection/schema.json +5 -0
  190. package/src/ts/agent/schema.d.js.map +1 -1
  191. package/src/ts/agent/schema.d.ts +1 -0
  192. package/src/ts/agent/schema.json +5 -0
  193. package/src/ts/api/generator.js +4 -2
  194. package/src/ts/api/generator.js.map +1 -1
  195. package/src/ts/api/schema.d.js.map +1 -1
  196. package/src/ts/api/schema.d.ts +1 -0
  197. package/src/ts/api/schema.json +5 -0
  198. package/src/ts/astro-docs/generator.js +7 -6
  199. package/src/ts/astro-docs/generator.js.map +1 -1
  200. package/src/ts/astro-docs/schema.d.js.map +1 -1
  201. package/src/ts/astro-docs/schema.d.ts +2 -2
  202. package/src/ts/astro-docs/schema.json +3 -3
  203. package/src/ts/docs/schema.d.js.map +1 -1
  204. package/src/ts/docs/schema.d.ts +1 -4
  205. package/src/ts/docs/schema.json +3 -3
  206. package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -1
  207. package/src/ts/dynamodb/agent-connection/schema.d.ts +1 -0
  208. package/src/ts/dynamodb/agent-connection/schema.json +5 -0
  209. package/src/ts/dynamodb/generator.js +9 -5
  210. package/src/ts/dynamodb/generator.js.map +1 -1
  211. package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
  212. package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +1 -0
  213. package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
  214. package/src/ts/dynamodb/schema.d.js.map +1 -1
  215. package/src/ts/dynamodb/schema.d.ts +1 -0
  216. package/src/ts/dynamodb/schema.json +5 -0
  217. package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -1
  218. package/src/ts/dynamodb/smithy-connection/schema.d.ts +1 -0
  219. package/src/ts/dynamodb/smithy-connection/schema.json +5 -0
  220. package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -1
  221. package/src/ts/dynamodb/trpc-connection/schema.d.ts +1 -0
  222. package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
  223. package/src/ts/lambda-function/generator.js +7 -4
  224. package/src/ts/lambda-function/generator.js.map +1 -1
  225. package/src/ts/lambda-function/schema.d.js.map +1 -1
  226. package/src/ts/lambda-function/schema.d.ts +1 -0
  227. package/src/ts/lambda-function/schema.json +5 -0
  228. package/src/ts/lib/generator.js +10 -6
  229. package/src/ts/lib/generator.js.map +1 -1
  230. package/src/ts/lib/schema.d.js.map +1 -1
  231. package/src/ts/lib/schema.d.ts +1 -1
  232. package/src/ts/lib/schema.json +5 -0
  233. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
  234. package/src/ts/mcp-server/generator.js +7 -4
  235. package/src/ts/mcp-server/generator.js.map +1 -1
  236. package/src/ts/mcp-server/schema.d.js.map +1 -1
  237. package/src/ts/mcp-server/schema.d.ts +1 -0
  238. package/src/ts/mcp-server/schema.json +5 -0
  239. package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +18 -8
  240. package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
  241. package/src/ts/nx-generator/files/common/schema.json.template +5 -0
  242. package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +3 -4
  243. package/src/ts/nx-generator/generator.js +7 -4
  244. package/src/ts/nx-generator/generator.js.map +1 -1
  245. package/src/ts/nx-generator/schema.d.js.map +1 -1
  246. package/src/ts/nx-generator/schema.d.ts +1 -0
  247. package/src/ts/nx-generator/schema.json +5 -0
  248. package/src/ts/nx-plugin/generator.js +13 -6
  249. package/src/ts/nx-plugin/generator.js.map +1 -1
  250. package/src/ts/nx-plugin/schema.json +5 -0
  251. package/src/ts/rdb/agent-connection/schema.d.js.map +1 -1
  252. package/src/ts/rdb/agent-connection/schema.d.ts +1 -0
  253. package/src/ts/rdb/agent-connection/schema.json +5 -0
  254. package/src/ts/rdb/generator.js +9 -5
  255. package/src/ts/rdb/generator.js.map +1 -1
  256. package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -1
  257. package/src/ts/rdb/mcp-server-connection/schema.d.ts +1 -0
  258. package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
  259. package/src/ts/rdb/schema.d.js.map +1 -1
  260. package/src/ts/rdb/schema.d.ts +1 -0
  261. package/src/ts/rdb/schema.json +5 -0
  262. package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -1
  263. package/src/ts/rdb/smithy-connection/schema.d.ts +1 -0
  264. package/src/ts/rdb/smithy-connection/schema.json +5 -0
  265. package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -1
  266. package/src/ts/rdb/trpc-connection/schema.d.ts +1 -0
  267. package/src/ts/rdb/trpc-connection/schema.json +5 -0
  268. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +26 -26
  269. package/src/ts/react-website/app/generator.d.ts +1 -1
  270. package/src/ts/react-website/app/generator.js +18 -6
  271. package/src/ts/react-website/app/generator.js.map +1 -1
  272. package/src/ts/react-website/app/schema.d.js.map +1 -1
  273. package/src/ts/react-website/app/schema.d.ts +1 -1
  274. package/src/ts/react-website/app/schema.json +5 -0
  275. package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +10 -7
  276. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
  277. package/src/ts/react-website/cognito-auth/generator.d.ts +1 -1
  278. package/src/ts/react-website/cognito-auth/generator.js +9 -5
  279. package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
  280. package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -1
  281. package/src/ts/react-website/cognito-auth/schema.d.ts +1 -0
  282. package/src/ts/react-website/cognito-auth/schema.json +5 -0
  283. package/src/ts/react-website/runtime-config/schema.d.js.map +1 -1
  284. package/src/ts/react-website/runtime-config/schema.d.ts +1 -0
  285. package/src/ts/react-website/runtime-config/schema.json +5 -0
  286. package/src/ts/website/app/schema.d.js.map +1 -1
  287. package/src/ts/website/app/schema.d.ts +1 -1
  288. package/src/ts/website/app/schema.json +5 -0
  289. package/src/ts/website/auth/generator.d.ts +1 -1
  290. package/src/ts/website/auth/generator.js +2 -1
  291. package/src/ts/website/auth/generator.js.map +1 -1
  292. package/src/ts/website/auth/schema.d.js.map +1 -1
  293. package/src/ts/website/auth/schema.d.ts +1 -0
  294. package/src/ts/website/auth/schema.json +5 -0
  295. package/src/utils/files/common/scripts/src/infra/stage-credentials/cdk-command.ts.template +11 -3
  296. package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +10 -7
  297. package/src/utils/install.d.ts +32 -0
  298. package/src/utils/install.js +56 -0
  299. package/src/utils/install.js.map +1 -0
  300. package/src/utils/versions.d.ts +64 -64
  301. package/src/utils/versions.js +63 -63
  302. package/src/utils/versions.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.24",
3
+ "version": "1.0.0-rc.26",
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": "4.0.0",
44
- "@biomejs/wasm-nodejs": "2.5.0",
44
+ "@biomejs/wasm-nodejs": "2.5.1",
45
45
  "@getgrit/gritql": "0.0.3",
46
46
  "@hey-api/openapi-ts": "0.64.13",
47
47
  "@iarna/toml": "2.2.5",
@@ -53,12 +53,12 @@
53
53
  "@types/estree": "1.0.9",
54
54
  "@types/js-yaml": "4.0.9",
55
55
  "@types/mdast": "4.0.4",
56
- "@nxlv/python": "22.2.0",
56
+ "@nxlv/python": "22.2.1",
57
57
  "@phenomnomnominal/tsquery": "6.2.0",
58
58
  "enquirer": "2.4.1",
59
59
  "fast-glob": "3.3.3",
60
60
  "jiti": "2.7.0",
61
- "js-yaml": "4.2.0",
61
+ "js-yaml": "4.3.0",
62
62
  "license-checker-rseidelsohn": "4.4.2",
63
63
  "lodash.camelcase": "4.3.0",
64
64
  "lodash.clonedeepwith": "4.5.0",
@@ -78,8 +78,8 @@
78
78
  "typescript": "6.0.3",
79
79
  "unified": "11.0.5",
80
80
  "unist-util-visit": "5.1.0",
81
- "vite": "8.0.16",
82
- "vitest": "4.1.8",
81
+ "vite": "8.1.0",
82
+ "vitest": "4.1.9",
83
83
  "zod": "4.4.3"
84
84
  }
85
85
  }
@@ -2,7 +2,7 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { type GeneratorCallback, type Tree } from '@nx/devkit';
5
+ import type { GeneratorCallback, Tree } from '@nx/devkit';
6
6
  import { type NxGeneratorInfo } from '../../utils/nx';
7
7
  import type { AgentcoreGatewayGatewayConnectionGeneratorSchema } from './schema';
8
8
  export declare const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */ import { installPackagesTask } from "@nx/devkit";
5
- import { formatFilesInSubtree } from "../../utils/format.js";
4
+ */ import { formatFilesInSubtree } from "../../utils/format.js";
5
+ import { installDependencies } from "../../utils/install.js";
6
6
  import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
7
7
  import { kebabCase } from "../../utils/names.js";
8
8
  import { getGeneratorInfo, readProjectConfigurationUnqualified } from "../../utils/nx.js";
@@ -57,9 +57,11 @@ export const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO = getGeneratorI
57
57
  AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO
58
58
  ]);
59
59
  await formatFilesInSubtree(tree);
60
- return ()=>{
61
- installPackagesTask(tree);
62
- };
60
+ return ()=>installDependencies(tree, options.preferInstallDependencies, {
61
+ languages: [
62
+ 'typescript'
63
+ ]
64
+ });
63
65
  };
64
66
  /**
65
67
  * Reject connections that would make the local gateway graph cyclic — a
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n installPackagesTask,\n type Tree,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport {\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { attachUpstreamToLocalGateway } from '../attach-upstream';\nimport {\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n readAgentCoreGatewayMetadata,\n} from '../generator';\nimport type { AgentcoreGatewayGatewayConnectionGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\n/**\n * Connect an AgentCore Gateway to another AgentCore Gateway.\n *\n * Chains the source gateway's dev target to the target gateway's\n * dev target, and registers the target gateway in the source\n * gateway's local local-dev.ts so the local gateway aggregates its tools\n * (already prefixed by the target gateway) under\n * `<targetGateway>___<targetName>___<toolName>`. Users must still call\n * `gateway.addGateway(...)` in their application stack to create the\n * actual CDK/Terraform resource.\n */\nexport const agentcoreGatewayGatewayConnectionGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayGatewayConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const sourceGateway = readAgentCoreGatewayMetadata(sourceProject);\n const targetGateway = readAgentCoreGatewayMetadata(targetProject);\n\n if (sourceProject.name === targetProject.name) {\n throw new Error(\n `Cannot connect gateway '${sourceGateway.name}' to itself.`,\n );\n }\n\n for (const gateway of [sourceGateway, targetGateway]) {\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Gateway->Gateway connections are only supported between MCP-protocol gateways.`,\n );\n }\n }\n\n // The source gateway invokes the target signing with its own IAM role, so\n // only the target's inbound auth must be IAM. The source's inbound auth (how\n // its own callers reach it) is irrelevant to this hop.\n if (targetGateway.auth !== 'iam') {\n throw new Error(\n `Gateway '${targetGateway.name}' uses auth='${targetGateway.auth}'. Gateway->Gateway connections currently require the target gateway to use IAM authentication.`,\n );\n }\n\n assertNoCycle(tree, sourceProject.name, targetProject.name);\n\n // The target name must match the deployed Gateway target (`gatewayName` on\n // the gateway construct, the project's class name in kebab-case) so\n // `<targetGateway>___<target>___<tool>` resolves identically locally and\n // deployed.\n const targetGatewayKebabCase = kebabCase(targetGateway.rc);\n\n await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {\n targetName: targetGatewayKebabCase,\n port: targetGateway.port,\n upstreamProjectName: targetProject.name,\n upstreamDevTargetName: 'dev',\n });\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n\n return () => {\n installPackagesTask(tree);\n };\n};\n\n/**\n * Reject connections that would make the local gateway graph cyclic — a\n * cycle would recurse infinitely on tools/list both locally and deployed.\n *\n * Walks gateway dev dependsOn edges from the target gateway; the\n * source gateway must not be reachable.\n */\nconst assertNoCycle = (\n tree: Tree,\n sourceProjectName: string,\n targetProjectName: string,\n) => {\n const visited = new Set<string>();\n const stack = [targetProjectName];\n while (stack.length > 0) {\n const current = stack.pop();\n if (current === sourceProjectName) {\n throw new Error(\n `Connecting '${sourceProjectName}' to '${targetProjectName}' would create a cycle: '${targetProjectName}' already routes to '${sourceProjectName}'.`,\n );\n }\n if (visited.has(current)) {\n continue;\n }\n visited.add(current);\n const project = readProjectConfigurationUnqualified(tree, current);\n if (\n (project.metadata as any)?.generator !==\n AGENTCORE_GATEWAY_GENERATOR_INFO.id\n ) {\n continue;\n }\n readAgentCoreGatewayMetadata(project);\n const devTarget = project.targets?.['dev'];\n for (const dep of devTarget?.dependsOn ?? []) {\n if (typeof dep !== 'string') {\n stack.push(...(dep.projects ?? []));\n }\n }\n }\n};\n\nexport default agentcoreGatewayGatewayConnectionGenerator;\n"],"names":["installPackagesTask","formatFilesInSubtree","addGeneratorMetricsIfApplicable","kebabCase","getGeneratorInfo","readProjectConfigurationUnqualified","attachUpstreamToLocalGateway","AGENTCORE_GATEWAY_GENERATOR_INFO","readAgentCoreGatewayMetadata","AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO","filename","agentcoreGatewayGatewayConnectionGenerator","tree","options","sourceProject","targetProject","sourceGateway","targetGateway","name","Error","gateway","protocol","auth","assertNoCycle","targetGatewayKebabCase","rc","targetName","port","upstreamProjectName","upstreamDevTargetName","sourceProjectName","targetProjectName","visited","Set","stack","length","current","pop","has","add","project","metadata","generator","id","devTarget","targets","dep","dependsOn","push","projects"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,mBAAmB,QAEd,aAAa;AACpB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SACEC,gBAAgB,EAEhBC,mCAAmC,Q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IACzB;IAEA,MAAM3B,gCAAgCU,MAAM;QAC1CH;KACD;IAED,MAAMR,qBAAqBW;IAE3B,OAAO;QACLZ,oBAAoBY;IACtB;AACF,EAAE;AAEF;;;;;;CAMC,GACD,MAAMW,gBAAgB,CACpBX,MACAkB,mBACAC;IAEA,MAAMC,UAAU,IAAIC;IACpB,MAAMC,QAAQ;QAACH;KAAkB;IACjC,MAAOG,MAAMC,MAAM,GAAG,EAAG;QACvB,MAAMC,UAAUF,MAAMG,GAAG;QACzB,IAAID,YAAYN,mBAAmB;YACjC,MAAM,IAAIX,MACR,CAAC,YAAY,EAAEW,kBAAkB,MAAM,EAAEC,kBAAkB,yBAAyB,EAAEA,kBAAkB,qBAAqB,EAAED,kBAAkB,EAAE,CAAC;QAExJ;QACA,IAAIE,QAAQM,GAAG,CAACF,UAAU;YACxB;QACF;QACAJ,QAAQO,GAAG,CAACH;QACZ,MAAMI,UAAUnC,oCAAoCO,MAAMwB;QAC1D,IACE,AAACI,QAAQC,QAAQ,EAAUC,cAC3BnC,iCAAiCoC,EAAE,EACnC;YACA;QACF;QACAnC,6BAA6BgC;QAC7B,MAAMI,YAAYJ,QAAQK,OAAO,EAAE,CAAC,MAAM;QAC1C,KAAK,MAAMC,OAAOF,WAAWG,aAAa,EAAE,CAAE;YAC5C,IAAI,OAAOD,QAAQ,UAAU;gBAC3BZ,MAAMc,IAAI,IAAKF,IAAIG,QAAQ,IAAI,EAAE;YACnC;QACF;IACF;AACF;AAEA,eAAetC,2CAA2C"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/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 { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport {\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { attachUpstreamToLocalGateway } from '../attach-upstream';\nimport {\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n readAgentCoreGatewayMetadata,\n} from '../generator';\nimport type { AgentcoreGatewayGatewayConnectionGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\n/**\n * Connect an AgentCore Gateway to another AgentCore Gateway.\n *\n * Chains the source gateway's dev target to the target gateway's\n * dev target, and registers the target gateway in the source\n * gateway's local local-dev.ts so the local gateway aggregates its tools\n * (already prefixed by the target gateway) under\n * `<targetGateway>___<targetName>___<toolName>`. Users must still call\n * `gateway.addGateway(...)` in their application stack to create the\n * actual CDK/Terraform resource.\n */\nexport const agentcoreGatewayGatewayConnectionGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayGatewayConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const sourceGateway = readAgentCoreGatewayMetadata(sourceProject);\n const targetGateway = readAgentCoreGatewayMetadata(targetProject);\n\n if (sourceProject.name === targetProject.name) {\n throw new Error(\n `Cannot connect gateway '${sourceGateway.name}' to itself.`,\n );\n }\n\n for (const gateway of [sourceGateway, targetGateway]) {\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Gateway->Gateway connections are only supported between MCP-protocol gateways.`,\n );\n }\n }\n\n // The source gateway invokes the target signing with its own IAM role, so\n // only the target's inbound auth must be IAM. The source's inbound auth (how\n // its own callers reach it) is irrelevant to this hop.\n if (targetGateway.auth !== 'iam') {\n throw new Error(\n `Gateway '${targetGateway.name}' uses auth='${targetGateway.auth}'. Gateway->Gateway connections currently require the target gateway to use IAM authentication.`,\n );\n }\n\n assertNoCycle(tree, sourceProject.name, targetProject.name);\n\n // The target name must match the deployed Gateway target (`gatewayName` on\n // the gateway construct, the project's class name in kebab-case) so\n // `<targetGateway>___<target>___<tool>` resolves identically locally and\n // deployed.\n const targetGatewayKebabCase = kebabCase(targetGateway.rc);\n\n await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {\n targetName: targetGatewayKebabCase,\n port: targetGateway.port,\n upstreamProjectName: targetProject.name,\n upstreamDevTargetName: 'dev',\n });\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\n/**\n * Reject connections that would make the local gateway graph cyclic — a\n * cycle would recurse infinitely on tools/list both locally and deployed.\n *\n * Walks gateway dev dependsOn edges from the target gateway; the\n * source gateway must not be reachable.\n */\nconst assertNoCycle = (\n tree: Tree,\n sourceProjectName: string,\n targetProjectName: string,\n) => {\n const visited = new Set<string>();\n const stack = [targetProjectName];\n while (stack.length > 0) {\n const current = stack.pop();\n if (current === sourceProjectName) {\n throw new Error(\n `Connecting '${sourceProjectName}' to '${targetProjectName}' would create a cycle: '${targetProjectName}' already routes to '${sourceProjectName}'.`,\n );\n }\n if (visited.has(current)) {\n continue;\n }\n visited.add(current);\n const project = readProjectConfigurationUnqualified(tree, current);\n if (\n (project.metadata as any)?.generator !==\n AGENTCORE_GATEWAY_GENERATOR_INFO.id\n ) {\n continue;\n }\n readAgentCoreGatewayMetadata(project);\n const devTarget = project.targets?.['dev'];\n for (const dep of devTarget?.dependsOn ?? []) {\n if (typeof dep !== 'string') {\n stack.push(...(dep.projects ?? []));\n }\n }\n }\n};\n\nexport default agentcoreGatewayGatewayConnectionGenerator;\n"],"names":["formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","getGeneratorInfo","readProjectConfigurationUnqualified","attachUpstreamToLocalGateway","AGENTCORE_GATEWAY_GENERATOR_INFO","readAgentCoreGatewayMetadata","AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO","filename","agentcoreGatewayGatewayConnectionGenerator","tree","options","sourceProject","targetProject","sourceGateway","targetGateway","name","Error","gateway","protocol","auth","assertNoCycle","targetGatewayKebabCase","rc","targetName","port","upstreamProjectName","upstreamDevTargetName","preferInstallDependencies","languages","sourceProjectName","targetProjectName","visited","Set","stack","length","current","pop","has","add","project","metadata","generator","id","devTarget","targets","dep","dependsOn","push","projects"],"mappings":"AAAA;;;CAGC,GAED,SAASA,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SACEC,gBAAgB,EAEhBC,mCAAmC,QAC9B,oBAAiB;AACxB,SAASC,4BAA4B,QAAQ,wBAAqB;AAClE,SACEC,gCAAgC,EAChCC,4BAA4B,QACvB,kBAAe;AAGtB,OAAO,MAAMC,sDACXL,iBAAiB,YAAYM,QAAQ,EAAE;AAEzC;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,6CAA6C,OACxDC,MACAC;IAEA,MAAMC,gBAAgBT,oCACpBO,MACAC,QAAQC,aAAa;IAEvB,MAAMC,gBAAgBV,oCACpBO,MACAC,QAAQE,aAAa;IAGvB,MAAMC,gBAAgBR,6BAA6BM;IACnD,MAAMG,gBAAgBT,6BAA6BO;IAEnD,IAAID,cAAcI,IAAI,KAAKH,cAAcG,IAAI,EAAE;QAC7C,MAAM,IAAIC,MACR,CAAC,wBAAwB,EAAEH,cAAcE,IAAI,CAAC,YAAY,CAAC;IAE/D;IAEA,KAAK,MAAME,WAAW;QAACJ;QAAeC;KAAc,CAAE;QACpD,IAAIG,QAAQC,QAAQ,KAAK,OAAO;YAC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MI,UAAUrC,oCAAoCO,MAAM0B;QAC1D,IACE,AAACI,QAAQC,QAAQ,EAAUC,cAC3BrC,iCAAiCsC,EAAE,EACnC;YACA;QACF;QACArC,6BAA6BkC;QAC7B,MAAMI,YAAYJ,QAAQK,OAAO,EAAE,CAAC,MAAM;QAC1C,KAAK,MAAMC,OAAOF,WAAWG,aAAa,EAAE,CAAE;YAC5C,IAAI,OAAOD,QAAQ,UAAU;gBAC3BZ,MAAMc,IAAI,IAAKF,IAAIG,QAAQ,IAAI,EAAE;YACnC;QACF;IACF;AACF;AAEA,eAAexC,2CAA2C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/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 { ComponentMetadata } from '../../utils/nx';\n\nexport interface AgentcoreGatewayGatewayConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAKC"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/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 { ComponentMetadata } from '../../utils/nx';\n\nexport interface AgentcoreGatewayGatewayConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAMC"}
@@ -9,4 +9,5 @@ export interface AgentcoreGatewayGatewayConnectionGeneratorSchema {
9
9
  targetProject: string;
10
10
  sourceComponent?: ComponentMetadata;
11
11
  targetComponent?: ComponentMetadata;
12
+ preferInstallDependencies?: boolean;
12
13
  }
@@ -20,6 +20,11 @@
20
20
  "targetComponent": {
21
21
  "type": "string",
22
22
  "description": "The gateway component in the target project"
23
+ },
24
+ "preferInstallDependencies": {
25
+ "type": "boolean",
26
+ "description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
27
+ "default": true
23
28
  }
24
29
  },
25
30
  "required": ["sourceProject", "targetProject"]
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */ import { addDependenciesToPackageJson, addProjectConfiguration, generateFiles, installPackagesTask, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
4
+ */ import { addDependenciesToPackageJson, addProjectConfiguration, generateFiles, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
5
5
  import { addAgentCoreGatewayInfra } from "../utils/agent-core-constructs/agent-core-constructs.js";
6
6
  import { formatFilesInSubtree } from "../utils/format.js";
7
7
  import { resolveIac } from "../utils/iac.js";
8
+ import { installDependencies } from "../utils/install.js";
8
9
  import { addGeneratorMetricsIfApplicable } from "../utils/metrics.js";
9
10
  import { kebabCase, toClassName } from "../utils/names.js";
10
11
  import { getNpmScopePrefix } from "../utils/npm-scope.js";
@@ -127,9 +128,11 @@ export const agentcoreGatewayGenerator = async (tree, options)=>{
127
128
  AGENTCORE_GATEWAY_GENERATOR_INFO
128
129
  ]);
129
130
  await formatFilesInSubtree(tree);
130
- return ()=>{
131
- installPackagesTask(tree);
132
- };
131
+ return ()=>installDependencies(tree, options.preferInstallDependencies, {
132
+ languages: [
133
+ 'typescript'
134
+ ]
135
+ });
133
136
  };
134
137
  /**
135
138
  * Read a gateway project's metadata, validating it was generated by the
@@ -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 installPackagesTask,\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 { 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 installPackagesTask(tree);\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","installPackagesTask","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addAgentCoreGatewayInfra","formatFilesInSubtree","resolveIac","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","readAgentCoreGatewayMetadata","Error"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,uBAAuB,EAEvBC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,wBAAwB,QAAQ,0DAAuD;AAChG,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SAASC,UAAU,QAAQ,kBAAe;AAC1C,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,cAAc5B,kBAAkBwB,WAAWE;IACjD,MAAMG,qBAAqB,GAAGpB,kBA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],"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,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,YAA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iCkC,EAAE,CAAC,YAAY,CAAC;IAE5G;IACA,OAAOF;AACT,EAAE;AAEF,eAAe9B,0BAA0B"}
@@ -2,7 +2,7 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { type GeneratorCallback, type Tree } from '@nx/devkit';
5
+ import type { GeneratorCallback, Tree } from '@nx/devkit';
6
6
  import { type NxGeneratorInfo } from '../../utils/nx';
7
7
  import type { AgentcoreGatewayMcpConnectionGeneratorSchema } from './schema';
8
8
  export declare const AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */ import { installPackagesTask } from "@nx/devkit";
5
- import { formatFilesInSubtree } from "../../utils/format.js";
4
+ */ import { formatFilesInSubtree } from "../../utils/format.js";
5
+ import { installDependencies } from "../../utils/install.js";
6
6
  import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
7
7
  import { kebabCase } from "../../utils/names.js";
8
8
  import { getGeneratorInfo, readProjectConfigurationUnqualified } from "../../utils/nx.js";
@@ -48,9 +48,11 @@ export const AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO = getGeneratorInfo(
48
48
  AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO
49
49
  ]);
50
50
  await formatFilesInSubtree(tree);
51
- return ()=>{
52
- installPackagesTask(tree);
53
- };
51
+ return ()=>installDependencies(tree, options.preferInstallDependencies, {
52
+ languages: [
53
+ 'typescript'
54
+ ]
55
+ });
54
56
  };
55
57
  export default agentcoreGatewayMcpConnectionGenerator;
56
58
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/mcp-connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n installPackagesTask,\n type Tree,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport {\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { attachUpstreamToLocalGateway } from '../attach-upstream';\nimport { readAgentCoreGatewayMetadata } from '../generator';\nimport type { AgentcoreGatewayMcpConnectionGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\n/**\n * Connect an AgentCore Gateway to an MCP server.\n *\n * Chains the gateway's dev target to the MCP server's dev\n * target, and registers the server in the gateway's local local-dev.ts so\n * the local gateway aggregates its tools. Users must still call\n * `gateway.addMcpServer(...)` in their application stack to create the\n * actual CDK/Terraform resource.\n */\nexport const agentcoreGatewayMcpConnectionGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayMcpConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const gateway = readAgentCoreGatewayMetadata(sourceProject);\n const mcpComponent = options.targetComponent;\n\n if (!mcpComponent) {\n throw new Error(\n `Target project '${options.targetProject}' has no MCP server component metadata. Did you run the 'ts#mcp-server' or 'py#mcp-server' generator?`,\n );\n }\n\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. MCP server targets can only be attached to MCP-protocol gateways.`,\n );\n }\n if (mcpComponent.auth && mcpComponent.auth !== 'iam') {\n throw new Error(\n `MCP server '${mcpComponent.name}' uses auth='${mcpComponent.auth}'. Gateway->MCP connections currently require the MCP server to use IAM authentication.`,\n );\n }\n\n // The target name must match what the deployed Gateway uses\n // (`mcpServerName` on the MCP construct, derived from the project's class\n // name) so `<target>___<tool>` resolves identically locally and deployed.\n // Component-level `name` would clash whenever two MCP server projects\n // both default to `mcp-server`.\n const mcpTargetName = kebabCase(mcpComponent.rc as string);\n const mcpComponentName = mcpComponent.name ?? 'mcp-server';\n\n await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {\n targetName: mcpTargetName,\n port: (mcpComponent.port as number | undefined) ?? 8000,\n upstreamProjectName: targetProject.name,\n upstreamDevTargetName: `${mcpComponentName}-dev`,\n });\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n\n return () => {\n installPackagesTask(tree);\n };\n};\n\nexport default agentcoreGatewayMcpConnectionGenerator;\n"],"names":["installPackagesTask","formatFilesInSubtree","addGeneratorMetricsIfApplicable","kebabCase","getGeneratorInfo","readProjectConfigurationUnqualified","attachUpstreamToLocalGateway","readAgentCoreGatewayMetadata","AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO","filename","agentcoreGatewayMcpConnectionGenerator","tree","options","sourceProject","targetProject","gateway","mcpComponent","targetComponent","Error","protocol","name","auth","mcpTargetName","rc","mcpComponentName","targetName","port","upstreamProjectName","upstreamDevTargetName"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,mBAAmB,QAEd,aAAa;AACpB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SACEC,gBAAgB,EAEhBC,mCAAmC,QAC9B,oBAAiB;AACxB,SAASC,4BAA4B,QAAQ,wBAAqB;AAClE,SAASC,4BAA4B,QAAQ,kBAAe;AAG5D,OAAO,MAAMC,kDACXJ,iBAAiB,YAAYK,QAAQ,EAAE;AAEzC;;;;;;;;CAQC,GACD,OAAO,MAAMC,yCAAyC,OACpDC,MACAC;IAEA,MAAMC,gBAAgBR,oCACpBM,MACAC,QAAQC,aAAa;IAEvB,MAAMC,gBAAgBT,oCACpBM,MACAC,QAAQE,aAAa;IAGvB,MAAMC,UAAUR,6BAA6BM;IAC7C,MAAMG,eAAeJ,QAAQK,eAAe;IAE5C,IAAI,CAACD,cAAc;QACjB,MAAM,IAAIE,MACR,CAAC,gBAAgB,EAAEN,QAAQE,aAAa,CAAC,qGAAqG,CAAC;IAEnJ;IAEA,IAAIC,QAAQI,QAAQ,KAAK,OAAO;QAC9B,MAAM,IAAID,MACR,CAAC,SAAS,EAAEH,QAAQK,IAAI,CAAC,gBAAgB,EAAEL,QAAQI,QAAQ,CAAC,oEAAoE,CAAC;IAErI;IACA,IAAIH,aAAaK,IAAI,IAAIL,aAAaK,IAAI,KAAK,OAAO;QACpD,MAAM,IAAIH,MACR,CAAC,YAAY,EAAEF,aAAaI,IAAI,CAAC,aAAa,EAAEJ,aAAaK,IAAI,CAAC,uFAAuF,CAAC;IAE9J;IAEA,4DAA4D;IAC5D,0EAA0E;IAC1E,0EAA0E;IAC1E,sEAAsE;IACtE,gCAAgC;IAChC,MAAMC,gBAAgBnB,UAAUa,aAAaO,EAAE;IAC/C,MAAMC,mBAAmBR,aAAaI,IAAI,IAAI;IAE9C,MAAMd,6BAA6BK,MAAME,eAAe,OAAO;QAC7DY,YAAYH;QACZI,MAAM,AAACV,aAAaU,IAAI,IAA2B;QACnDC,qBAAqBb,cAAcM,IAAI;QACvCQ,uBAAuB,GAAGJ,iBAAiB,IAAI,CAAC;IAClD;IAEA,MAAMtB,gCAAgCS,MAAM;QAC1CH;KACD;IAED,MAAMP,qBAAqBU;IAE3B,OAAO;QACLX,oBAAoBW;IACtB;AACF,EAAE;AAEF,eAAeD,uCAAuC"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/mcp-connection/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 { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport {\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { attachUpstreamToLocalGateway } from '../attach-upstream';\nimport { readAgentCoreGatewayMetadata } from '../generator';\nimport type { AgentcoreGatewayMcpConnectionGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\n/**\n * Connect an AgentCore Gateway to an MCP server.\n *\n * Chains the gateway's dev target to the MCP server's dev\n * target, and registers the server in the gateway's local local-dev.ts so\n * the local gateway aggregates its tools. Users must still call\n * `gateway.addMcpServer(...)` in their application stack to create the\n * actual CDK/Terraform resource.\n */\nexport const agentcoreGatewayMcpConnectionGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayMcpConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const gateway = readAgentCoreGatewayMetadata(sourceProject);\n const mcpComponent = options.targetComponent;\n\n if (!mcpComponent) {\n throw new Error(\n `Target project '${options.targetProject}' has no MCP server component metadata. Did you run the 'ts#mcp-server' or 'py#mcp-server' generator?`,\n );\n }\n\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. MCP server targets can only be attached to MCP-protocol gateways.`,\n );\n }\n if (mcpComponent.auth && mcpComponent.auth !== 'iam') {\n throw new Error(\n `MCP server '${mcpComponent.name}' uses auth='${mcpComponent.auth}'. Gateway->MCP connections currently require the MCP server to use IAM authentication.`,\n );\n }\n\n // The target name must match what the deployed Gateway uses\n // (`mcpServerName` on the MCP construct, derived from the project's class\n // name) so `<target>___<tool>` resolves identically locally and deployed.\n // Component-level `name` would clash whenever two MCP server projects\n // both default to `mcp-server`.\n const mcpTargetName = kebabCase(mcpComponent.rc as string);\n const mcpComponentName = mcpComponent.name ?? 'mcp-server';\n\n await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {\n targetName: mcpTargetName,\n port: (mcpComponent.port as number | undefined) ?? 8000,\n upstreamProjectName: targetProject.name,\n upstreamDevTargetName: `${mcpComponentName}-dev`,\n });\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default agentcoreGatewayMcpConnectionGenerator;\n"],"names":["formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","getGeneratorInfo","readProjectConfigurationUnqualified","attachUpstreamToLocalGateway","readAgentCoreGatewayMetadata","AGENTCORE_GATEWAY_MCP_CONNECTION_GENERATOR_INFO","filename","agentcoreGatewayMcpConnectionGenerator","tree","options","sourceProject","targetProject","gateway","mcpComponent","targetComponent","Error","protocol","name","auth","mcpTargetName","rc","mcpComponentName","targetName","port","upstreamProjectName","upstreamDevTargetName","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GAED,SAASA,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SACEC,gBAAgB,EAEhBC,mCAAmC,QAC9B,oBAAiB;AACxB,SAASC,4BAA4B,QAAQ,wBAAqB;AAClE,SAASC,4BAA4B,QAAQ,kBAAe;AAG5D,OAAO,MAA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AAEF,eAAepB,uCAAuC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/mcp-connection/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 { ComponentMetadata } from '../../utils/nx';\n\nexport interface AgentcoreGatewayMcpConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAKC"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/mcp-connection/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 { ComponentMetadata } from '../../utils/nx';\n\nexport interface AgentcoreGatewayMcpConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAMC"}
@@ -9,4 +9,5 @@ export interface AgentcoreGatewayMcpConnectionGeneratorSchema {
9
9
  targetProject: string;
10
10
  sourceComponent?: ComponentMetadata;
11
11
  targetComponent?: ComponentMetadata;
12
+ preferInstallDependencies?: boolean;
12
13
  }
@@ -20,6 +20,11 @@
20
20
  "targetComponent": {
21
21
  "type": "string",
22
22
  "description": "The MCP server component in the target project"
23
+ },
24
+ "preferInstallDependencies": {
25
+ "type": "boolean",
26
+ "description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
27
+ "default": true
23
28
  }
24
29
  },
25
30
  "required": ["sourceProject", "targetProject"]
@@ -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}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WASC"}
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"}
@@ -13,4 +13,5 @@ export interface AgentcoreGatewayGeneratorSchema {
13
13
  cedarPolicy?: boolean;
14
14
  infra?: 'agentcore' | 'none';
15
15
  iac: IacOption;
16
+ preferInstallDependencies?: boolean;
16
17
  }
@@ -59,6 +59,11 @@
59
59
  "x-priority": "important",
60
60
  "default": "inherit",
61
61
  "x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
62
+ },
63
+ "preferInstallDependencies": {
64
+ "type": "boolean",
65
+ "description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
66
+ "default": true
62
67
  }
63
68
  },
64
69
  "required": ["name"]
@@ -5,17 +5,9 @@
5
5
  import { type ProjectConfiguration, type Tree } from '@nx/devkit';
6
6
  import { type ComponentMetadata } from '../utils/nx';
7
7
  import type { ConnectionGeneratorSchema } from './schema';
8
- /**
9
- * List of supported source and target project types for connections.
10
- * These can be project-level types (determined by introspection) or
11
- * component generator ids (from component metadata).
12
- */
13
- declare const SUPPORTED_PROJECT_TYPES: readonly ["ts#trpc-api", "py#fast-api", "react", "smithy", "ts#rdb", "ts#dynamodb", "py#dynamodb", "agentcore-gateway"];
8
+ import { type Connection, type SUPPORTED_PROJECT_TYPES } from './supported-connections';
9
+ export type { Connection };
14
10
  type ProjectType = (typeof SUPPORTED_PROJECT_TYPES)[number];
15
- export type Connection = {
16
- source: string;
17
- target: string;
18
- };
19
11
  /**
20
12
  * Sentinel value for sourceComponent/targetComponent that means
21
13
  * "use the project-level connection, not a component".
@@ -41,6 +33,7 @@ export interface ResolvedConnectionOptions {
41
33
  targetProject: string;
42
34
  sourceComponent?: ComponentMetadata;
43
35
  targetComponent?: ComponentMetadata;
36
+ preferInstallDependencies?: boolean;
44
37
  }
45
38
  /**
46
39
  * Generator for a connection between two projects
@@ -35,168 +35,37 @@ import tsRdbTrpcConnectionGenerator from "../ts/rdb/trpc-connection/generator.js
35
35
  import { hasExportDeclaration } from "../utils/ast.js";
36
36
  import { readProjectConfigurationUnqualified } from "../utils/nx.js";
37
37
  import { readToml } from "../utils/toml.js";
38
- /**
39
- * List of supported source and target project types for connections.
40
- * These can be project-level types (determined by introspection) or
41
- * component generator ids (from component metadata).
42
- */ const SUPPORTED_PROJECT_TYPES = [
43
- 'ts#trpc-api',
44
- 'py#fast-api',
45
- 'react',
46
- 'smithy',
47
- 'ts#rdb',
48
- 'ts#dynamodb',
49
- 'py#dynamodb',
50
- 'agentcore-gateway'
51
- ];
38
+ import { SUPPORTED_CONNECTIONS } from "./supported-connections.js";
52
39
  /**
53
40
  * Sentinel value for sourceComponent/targetComponent that means
54
41
  * "use the project-level connection, not a component".
55
42
  */ export const PROJECT_COMPONENT_SENTINEL = '.';
56
- /**
57
- * Enumerates the supported project connections.
58
- * Source and target can be project-level types or component generator ids.
59
- */ const SUPPORTED_CONNECTIONS = [
60
- {
61
- source: 'ts#trpc-api',
62
- target: 'ts#rdb'
63
- },
64
- {
65
- source: 'ts#trpc-api',
66
- target: 'ts#dynamodb'
67
- },
68
- {
69
- source: 'ts#agent',
70
- target: 'ts#rdb'
71
- },
72
- {
73
- source: 'smithy',
74
- target: 'ts#rdb'
75
- },
76
- {
77
- source: 'smithy',
78
- target: 'ts#dynamodb'
79
- },
80
- {
81
- source: 'ts#mcp-server',
82
- target: 'ts#rdb'
83
- },
84
- {
85
- source: 'ts#mcp-server',
86
- target: 'ts#dynamodb'
87
- },
88
- {
89
- source: 'react',
90
- target: 'ts#trpc-api'
91
- },
92
- {
93
- source: 'react',
94
- target: 'py#fast-api'
95
- },
96
- {
97
- source: 'react',
98
- target: 'smithy'
99
- },
100
- {
101
- source: 'react',
102
- target: 'ts#agent'
103
- },
104
- {
105
- source: 'react',
106
- target: 'py#agent'
107
- },
108
- {
109
- source: 'ts#agent',
110
- target: 'ts#mcp-server'
111
- },
112
- {
113
- source: 'ts#agent',
114
- target: 'py#mcp-server'
115
- },
116
- {
117
- source: 'ts#agent',
118
- target: 'ts#dynamodb'
119
- },
120
- {
121
- source: 'py#agent',
122
- target: 'ts#mcp-server'
123
- },
124
- {
125
- source: 'py#agent',
126
- target: 'py#mcp-server'
127
- },
128
- {
129
- source: 'ts#agent',
130
- target: 'ts#agent'
131
- },
132
- {
133
- source: 'ts#agent',
134
- target: 'py#agent'
135
- },
136
- {
137
- source: 'py#agent',
138
- target: 'ts#agent'
139
- },
140
- {
141
- source: 'py#agent',
142
- target: 'py#agent'
143
- },
144
- {
145
- source: 'ts#agent',
146
- target: 'agentcore-gateway'
147
- },
148
- {
149
- source: 'py#agent',
150
- target: 'agentcore-gateway'
151
- },
152
- {
153
- source: 'agentcore-gateway',
154
- target: 'ts#mcp-server'
155
- },
156
- {
157
- source: 'agentcore-gateway',
158
- target: 'py#mcp-server'
159
- },
160
- {
161
- source: 'agentcore-gateway',
162
- target: 'agentcore-gateway'
163
- },
164
- {
165
- source: 'py#fast-api',
166
- target: 'py#dynamodb'
167
- },
168
- {
169
- source: 'py#agent',
170
- target: 'py#dynamodb'
171
- },
172
- {
173
- source: 'py#mcp-server',
174
- target: 'py#dynamodb'
175
- }
176
- ];
177
43
  const CONNECTION_GENERATORS = {
178
44
  'ts#trpc-api -> ts#rdb': (tree, options)=>tsRdbTrpcConnectionGenerator(tree, options),
179
45
  'ts#agent -> ts#rdb': (tree, options)=>tsRdbAgentConnectionGenerator(tree, options),
180
- 'smithy -> ts#rdb': (tree, options)=>tsRdbSmithyConnectionGenerator(tree, options),
46
+ 'ts#smithy-api -> ts#rdb': (tree, options)=>tsRdbSmithyConnectionGenerator(tree, options),
181
47
  'ts#mcp-server -> ts#rdb': (tree, options)=>tsRdbMcpServerConnectionGenerator(tree, options),
182
48
  'ts#trpc-api -> ts#dynamodb': (tree, options)=>tsDynamoDBTrpcConnectionGenerator(tree, options),
183
49
  'ts#agent -> ts#dynamodb': (tree, options)=>tsDynamoDBAgentConnectionGenerator(tree, options),
184
- 'smithy -> ts#dynamodb': (tree, options)=>tsDynamoDBSmithyConnectionGenerator(tree, options),
50
+ 'ts#smithy-api -> ts#dynamodb': (tree, options)=>tsDynamoDBSmithyConnectionGenerator(tree, options),
185
51
  'ts#mcp-server -> ts#dynamodb': (tree, options)=>tsDynamoDBMcpServerConnectionGenerator(tree, options),
186
- 'react -> ts#trpc-api': (tree, options)=>trpcReactGenerator(tree, {
52
+ 'ts#react-website -> ts#trpc-api': (tree, options)=>trpcReactGenerator(tree, {
187
53
  frontendProjectName: options.sourceProject,
188
- backendProjectName: options.targetProject
54
+ backendProjectName: options.targetProject,
55
+ preferInstallDependencies: options.preferInstallDependencies
189
56
  }),
190
- 'react -> py#fast-api': (tree, options)=>fastApiReactGenerator(tree, {
57
+ 'ts#react-website -> py#fast-api': (tree, options)=>fastApiReactGenerator(tree, {
191
58
  frontendProjectName: options.sourceProject,
192
- fastApiProjectName: options.targetProject
59
+ fastApiProjectName: options.targetProject,
60
+ preferInstallDependencies: options.preferInstallDependencies
193
61
  }),
194
- 'react -> smithy': (tree, options)=>smithyReactConnectionGenerator(tree, {
62
+ 'ts#react-website -> ts#smithy-api': (tree, options)=>smithyReactConnectionGenerator(tree, {
195
63
  frontendProjectName: options.sourceProject,
196
- smithyModelOrBackendProjectName: options.targetProject
64
+ smithyModelOrBackendProjectName: options.targetProject,
65
+ preferInstallDependencies: options.preferInstallDependencies
197
66
  }),
198
- 'react -> ts#agent': (tree, options)=>tsAgentReactConnectionGenerator(tree, options),
199
- 'react -> py#agent': (tree, options)=>pyAgentReactConnectionGenerator(tree, options),
67
+ 'ts#react-website -> ts#agent': (tree, options)=>tsAgentReactConnectionGenerator(tree, options),
68
+ 'ts#react-website -> py#agent': (tree, options)=>pyAgentReactConnectionGenerator(tree, options),
200
69
  'ts#agent -> ts#mcp-server': (tree, options)=>tsAgentMcpConnectionGenerator(tree, options),
201
70
  'ts#agent -> py#mcp-server': (tree, options)=>tsAgentMcpConnectionGenerator(tree, options),
202
71
  'py#agent -> ts#mcp-server': (tree, options)=>pyAgentMcpConnectionGenerator(tree, options),
@@ -223,7 +92,8 @@ const CONNECTION_GENERATORS = {
223
92
  sourceProject: options.sourceProject,
224
93
  targetProject: options.targetProject,
225
94
  sourceComponent: resolved.sourceComponent,
226
- targetComponent: resolved.targetComponent
95
+ targetComponent: resolved.targetComponent,
96
+ preferInstallDependencies: options.preferInstallDependencies
227
97
  });
228
98
  };
229
99
  /**
@@ -345,10 +215,10 @@ const CONNECTION_GENERATORS = {
345
215
  return 'py#fast-api';
346
216
  }
347
217
  if (isSmithyApi(tree, projectConfiguration)) {
348
- return 'smithy';
218
+ return 'ts#smithy-api';
349
219
  }
350
220
  if (isReact(tree, projectConfiguration)) {
351
- return 'react';
221
+ return 'ts#react-website';
352
222
  }
353
223
  if (isRdb(projectConfiguration)) {
354
224
  return 'ts#rdb';