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

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 (297) 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 +1 -0
  21. package/src/connection/generator.js +8 -4
  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/infra/app/__snapshots__/generator.spec.ts.snap +29 -21
  27. package/src/infra/app/generator.js +12 -6
  28. package/src/infra/app/generator.js.map +1 -1
  29. package/src/infra/app/schema.d.js.map +1 -1
  30. package/src/infra/app/schema.d.ts +1 -1
  31. package/src/infra/app/schema.json +5 -0
  32. package/src/license/schema.d.js.map +1 -1
  33. package/src/license/schema.d.ts +2 -0
  34. package/src/license/schema.json +5 -0
  35. package/src/mcp-server/tools/general-guidance.js +17 -0
  36. package/src/mcp-server/tools/general-guidance.js.map +1 -1
  37. package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
  38. package/src/preset/generator.d.ts +1 -1
  39. package/src/preset/generator.js +8 -5
  40. package/src/preset/generator.js.map +1 -1
  41. package/src/preset/schema.d.js.map +1 -1
  42. package/src/preset/schema.d.ts +1 -0
  43. package/src/preset/schema.json +5 -0
  44. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +9 -9
  45. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +10 -10
  46. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1 -1
  47. package/src/py/agent/a2a-connection/generator.js +7 -4
  48. package/src/py/agent/a2a-connection/generator.js.map +1 -1
  49. package/src/py/agent/a2a-connection/schema.d.js.map +1 -1
  50. package/src/py/agent/a2a-connection/schema.d.ts +1 -0
  51. package/src/py/agent/a2a-connection/schema.json +5 -0
  52. package/src/py/agent/gateway-connection/generator.js +7 -4
  53. package/src/py/agent/gateway-connection/generator.js.map +1 -1
  54. package/src/py/agent/gateway-connection/schema.d.js.map +1 -1
  55. package/src/py/agent/gateway-connection/schema.d.ts +1 -0
  56. package/src/py/agent/gateway-connection/schema.json +5 -0
  57. package/src/py/agent/generator.js +8 -6
  58. package/src/py/agent/generator.js.map +1 -1
  59. package/src/py/agent/mcp-connection/generator.js +7 -4
  60. package/src/py/agent/mcp-connection/generator.js.map +1 -1
  61. package/src/py/agent/mcp-connection/schema.d.js.map +1 -1
  62. package/src/py/agent/mcp-connection/schema.d.ts +1 -0
  63. package/src/py/agent/mcp-connection/schema.json +5 -0
  64. package/src/py/agent/react-connection/generator.d.ts +1 -1
  65. package/src/py/agent/react-connection/generator.js +7 -4
  66. package/src/py/agent/react-connection/generator.js.map +1 -1
  67. package/src/py/agent/react-connection/schema.d.js.map +1 -1
  68. package/src/py/agent/react-connection/schema.d.ts +1 -0
  69. package/src/py/agent/react-connection/schema.json +5 -0
  70. package/src/py/agent/schema.d.js.map +1 -1
  71. package/src/py/agent/schema.d.ts +1 -0
  72. package/src/py/agent/schema.json +5 -0
  73. package/src/py/api/generator.js +2 -1
  74. package/src/py/api/generator.js.map +1 -1
  75. package/src/py/api/schema.d.js.map +1 -1
  76. package/src/py/api/schema.d.ts +1 -0
  77. package/src/py/api/schema.json +5 -0
  78. package/src/py/dynamodb/agent-connection/generator.js +8 -6
  79. package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
  80. package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -1
  81. package/src/py/dynamodb/agent-connection/schema.d.ts +1 -0
  82. package/src/py/dynamodb/agent-connection/schema.json +5 -0
  83. package/src/py/dynamodb/fast-api-connection/generator.js +8 -6
  84. package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
  85. package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -1
  86. package/src/py/dynamodb/fast-api-connection/schema.d.ts +1 -0
  87. package/src/py/dynamodb/fast-api-connection/schema.json +5 -0
  88. package/src/py/dynamodb/generator.js +10 -7
  89. package/src/py/dynamodb/generator.js.map +1 -1
  90. package/src/py/dynamodb/mcp-server-connection/generator.js +8 -6
  91. package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
  92. package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
  93. package/src/py/dynamodb/mcp-server-connection/schema.d.ts +1 -0
  94. package/src/py/dynamodb/mcp-server-connection/schema.json +5 -0
  95. package/src/py/dynamodb/schema.d.js.map +1 -1
  96. package/src/py/dynamodb/schema.d.ts +1 -0
  97. package/src/py/dynamodb/schema.json +5 -0
  98. package/src/py/fast-api/generator.js +10 -7
  99. package/src/py/fast-api/generator.js.map +1 -1
  100. package/src/py/fast-api/react/generator.d.ts +2 -2
  101. package/src/py/fast-api/react/generator.js +7 -5
  102. package/src/py/fast-api/react/generator.js.map +1 -1
  103. package/src/py/fast-api/react/schema.d.js.map +1 -1
  104. package/src/py/fast-api/react/schema.d.ts +1 -0
  105. package/src/py/fast-api/react/schema.json +5 -0
  106. package/src/py/fast-api/schema.d.js.map +1 -1
  107. package/src/py/fast-api/schema.d.ts +1 -0
  108. package/src/py/fast-api/schema.json +5 -0
  109. package/src/py/lambda-function/generator.js +8 -6
  110. package/src/py/lambda-function/generator.js.map +1 -1
  111. package/src/py/lambda-function/schema.d.js.map +1 -1
  112. package/src/py/lambda-function/schema.d.ts +1 -0
  113. package/src/py/lambda-function/schema.json +5 -0
  114. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
  115. package/src/py/mcp-server/generator.js +8 -6
  116. package/src/py/mcp-server/generator.js.map +1 -1
  117. package/src/py/mcp-server/schema.d.js.map +1 -1
  118. package/src/py/mcp-server/schema.d.ts +1 -0
  119. package/src/py/mcp-server/schema.json +5 -0
  120. package/src/py/project/generator.js +9 -6
  121. package/src/py/project/generator.js.map +1 -1
  122. package/src/py/project/schema.d.js.map +1 -1
  123. package/src/py/project/schema.d.ts +1 -0
  124. package/src/py/project/schema.json +5 -0
  125. package/src/sdk/open-api.d.ts +1 -1
  126. package/src/sdk/open-api.js +1 -1
  127. package/src/sdk/open-api.js.map +1 -1
  128. package/src/sdk/utils/ast.d.ts +1 -2
  129. package/src/sdk/utils/ast.js +1 -2
  130. package/src/sdk/utils/ast.js.map +1 -1
  131. package/src/smithy/project/generator.js +7 -4
  132. package/src/smithy/project/generator.js.map +1 -1
  133. package/src/smithy/project/schema.d.js.map +1 -1
  134. package/src/smithy/project/schema.d.ts +1 -0
  135. package/src/smithy/project/schema.json +5 -0
  136. package/src/smithy/react-connection/generator.js +7 -4
  137. package/src/smithy/react-connection/generator.js.map +1 -1
  138. package/src/smithy/react-connection/schema.d.js.map +1 -1
  139. package/src/smithy/react-connection/schema.d.ts +1 -0
  140. package/src/smithy/react-connection/schema.json +5 -0
  141. package/src/smithy/ts/api/generator.js +11 -6
  142. package/src/smithy/ts/api/generator.js.map +1 -1
  143. package/src/smithy/ts/api/schema.d.js.map +1 -1
  144. package/src/smithy/ts/api/schema.d.ts +1 -0
  145. package/src/smithy/ts/api/schema.json +5 -0
  146. package/src/terraform/project/generator.js +13 -4
  147. package/src/terraform/project/generator.js.map +1 -1
  148. package/src/terraform/project/schema.d.js.map +1 -1
  149. package/src/terraform/project/schema.d.ts +1 -0
  150. package/src/terraform/project/schema.json +5 -0
  151. package/src/trpc/backend/generator.d.ts +1 -1
  152. package/src/trpc/backend/generator.js +9 -5
  153. package/src/trpc/backend/generator.js.map +1 -1
  154. package/src/trpc/backend/schema.d.js.map +1 -1
  155. package/src/trpc/backend/schema.d.ts +1 -0
  156. package/src/trpc/backend/schema.json +5 -0
  157. package/src/trpc/react/generator.d.ts +1 -1
  158. package/src/trpc/react/generator.js +9 -5
  159. package/src/trpc/react/generator.js.map +1 -1
  160. package/src/trpc/react/schema.d.js.map +1 -1
  161. package/src/trpc/react/schema.d.ts +1 -0
  162. package/src/trpc/react/schema.json +5 -0
  163. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +2 -2
  164. package/src/ts/agent/a2a-connection/generator.js +7 -4
  165. package/src/ts/agent/a2a-connection/generator.js.map +1 -1
  166. package/src/ts/agent/a2a-connection/schema.d.js.map +1 -1
  167. package/src/ts/agent/a2a-connection/schema.d.ts +1 -0
  168. package/src/ts/agent/a2a-connection/schema.json +5 -0
  169. package/src/ts/agent/gateway-connection/generator.js +7 -4
  170. package/src/ts/agent/gateway-connection/generator.js.map +1 -1
  171. package/src/ts/agent/gateway-connection/schema.d.js.map +1 -1
  172. package/src/ts/agent/gateway-connection/schema.d.ts +1 -0
  173. package/src/ts/agent/gateway-connection/schema.json +5 -0
  174. package/src/ts/agent/generator.js +7 -4
  175. package/src/ts/agent/generator.js.map +1 -1
  176. package/src/ts/agent/mcp-connection/generator.js +7 -4
  177. package/src/ts/agent/mcp-connection/generator.js.map +1 -1
  178. package/src/ts/agent/mcp-connection/schema.d.js.map +1 -1
  179. package/src/ts/agent/mcp-connection/schema.d.ts +1 -0
  180. package/src/ts/agent/mcp-connection/schema.json +5 -0
  181. package/src/ts/agent/react-connection/generator.d.ts +1 -1
  182. package/src/ts/agent/react-connection/generator.js +14 -8
  183. package/src/ts/agent/react-connection/generator.js.map +1 -1
  184. package/src/ts/agent/react-connection/schema.d.js.map +1 -1
  185. package/src/ts/agent/react-connection/schema.d.ts +1 -0
  186. package/src/ts/agent/react-connection/schema.json +5 -0
  187. package/src/ts/agent/schema.d.js.map +1 -1
  188. package/src/ts/agent/schema.d.ts +1 -0
  189. package/src/ts/agent/schema.json +5 -0
  190. package/src/ts/api/generator.js +4 -2
  191. package/src/ts/api/generator.js.map +1 -1
  192. package/src/ts/api/schema.d.js.map +1 -1
  193. package/src/ts/api/schema.d.ts +1 -0
  194. package/src/ts/api/schema.json +5 -0
  195. package/src/ts/astro-docs/generator.js +7 -6
  196. package/src/ts/astro-docs/generator.js.map +1 -1
  197. package/src/ts/astro-docs/schema.d.js.map +1 -1
  198. package/src/ts/astro-docs/schema.d.ts +2 -2
  199. package/src/ts/astro-docs/schema.json +3 -3
  200. package/src/ts/docs/schema.d.js.map +1 -1
  201. package/src/ts/docs/schema.d.ts +1 -4
  202. package/src/ts/docs/schema.json +3 -3
  203. package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -1
  204. package/src/ts/dynamodb/agent-connection/schema.d.ts +1 -0
  205. package/src/ts/dynamodb/agent-connection/schema.json +5 -0
  206. package/src/ts/dynamodb/generator.js +9 -5
  207. package/src/ts/dynamodb/generator.js.map +1 -1
  208. package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -1
  209. package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +1 -0
  210. package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
  211. package/src/ts/dynamodb/schema.d.js.map +1 -1
  212. package/src/ts/dynamodb/schema.d.ts +1 -0
  213. package/src/ts/dynamodb/schema.json +5 -0
  214. package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -1
  215. package/src/ts/dynamodb/smithy-connection/schema.d.ts +1 -0
  216. package/src/ts/dynamodb/smithy-connection/schema.json +5 -0
  217. package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -1
  218. package/src/ts/dynamodb/trpc-connection/schema.d.ts +1 -0
  219. package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
  220. package/src/ts/lambda-function/generator.js +7 -4
  221. package/src/ts/lambda-function/generator.js.map +1 -1
  222. package/src/ts/lambda-function/schema.d.js.map +1 -1
  223. package/src/ts/lambda-function/schema.d.ts +1 -0
  224. package/src/ts/lambda-function/schema.json +5 -0
  225. package/src/ts/lib/generator.js +10 -6
  226. package/src/ts/lib/generator.js.map +1 -1
  227. package/src/ts/lib/schema.d.js.map +1 -1
  228. package/src/ts/lib/schema.d.ts +1 -1
  229. package/src/ts/lib/schema.json +5 -0
  230. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
  231. package/src/ts/mcp-server/generator.js +7 -4
  232. package/src/ts/mcp-server/generator.js.map +1 -1
  233. package/src/ts/mcp-server/schema.d.js.map +1 -1
  234. package/src/ts/mcp-server/schema.d.ts +1 -0
  235. package/src/ts/mcp-server/schema.json +5 -0
  236. package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +18 -8
  237. package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
  238. package/src/ts/nx-generator/files/common/schema.json.template +5 -0
  239. package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +3 -4
  240. package/src/ts/nx-generator/generator.js +7 -4
  241. package/src/ts/nx-generator/generator.js.map +1 -1
  242. package/src/ts/nx-generator/schema.d.js.map +1 -1
  243. package/src/ts/nx-generator/schema.d.ts +1 -0
  244. package/src/ts/nx-generator/schema.json +5 -0
  245. package/src/ts/nx-plugin/generator.js +13 -6
  246. package/src/ts/nx-plugin/generator.js.map +1 -1
  247. package/src/ts/nx-plugin/schema.json +5 -0
  248. package/src/ts/rdb/agent-connection/schema.d.js.map +1 -1
  249. package/src/ts/rdb/agent-connection/schema.d.ts +1 -0
  250. package/src/ts/rdb/agent-connection/schema.json +5 -0
  251. package/src/ts/rdb/generator.js +9 -5
  252. package/src/ts/rdb/generator.js.map +1 -1
  253. package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -1
  254. package/src/ts/rdb/mcp-server-connection/schema.d.ts +1 -0
  255. package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
  256. package/src/ts/rdb/schema.d.js.map +1 -1
  257. package/src/ts/rdb/schema.d.ts +1 -0
  258. package/src/ts/rdb/schema.json +5 -0
  259. package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -1
  260. package/src/ts/rdb/smithy-connection/schema.d.ts +1 -0
  261. package/src/ts/rdb/smithy-connection/schema.json +5 -0
  262. package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -1
  263. package/src/ts/rdb/trpc-connection/schema.d.ts +1 -0
  264. package/src/ts/rdb/trpc-connection/schema.json +5 -0
  265. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +26 -26
  266. package/src/ts/react-website/app/generator.d.ts +1 -1
  267. package/src/ts/react-website/app/generator.js +18 -6
  268. package/src/ts/react-website/app/generator.js.map +1 -1
  269. package/src/ts/react-website/app/schema.d.js.map +1 -1
  270. package/src/ts/react-website/app/schema.d.ts +1 -1
  271. package/src/ts/react-website/app/schema.json +5 -0
  272. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
  273. package/src/ts/react-website/cognito-auth/generator.d.ts +1 -1
  274. package/src/ts/react-website/cognito-auth/generator.js +9 -5
  275. package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
  276. package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -1
  277. package/src/ts/react-website/cognito-auth/schema.d.ts +1 -0
  278. package/src/ts/react-website/cognito-auth/schema.json +5 -0
  279. package/src/ts/react-website/runtime-config/schema.d.js.map +1 -1
  280. package/src/ts/react-website/runtime-config/schema.d.ts +1 -0
  281. package/src/ts/react-website/runtime-config/schema.json +5 -0
  282. package/src/ts/website/app/schema.d.js.map +1 -1
  283. package/src/ts/website/app/schema.d.ts +1 -1
  284. package/src/ts/website/app/schema.json +5 -0
  285. package/src/ts/website/auth/generator.d.ts +1 -1
  286. package/src/ts/website/auth/generator.js +2 -1
  287. package/src/ts/website/auth/generator.js.map +1 -1
  288. package/src/ts/website/auth/schema.d.js.map +1 -1
  289. package/src/ts/website/auth/schema.d.ts +1 -0
  290. package/src/ts/website/auth/schema.json +5 -0
  291. package/src/utils/files/common/scripts/src/infra/stage-credentials/cdk-command.ts.template +11 -3
  292. package/src/utils/install.d.ts +32 -0
  293. package/src/utils/install.js +56 -0
  294. package/src/utils/install.js.map +1 -0
  295. package/src/utils/versions.d.ts +64 -64
  296. package/src/utils/versions.js +63 -63
  297. 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.25",
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,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,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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;YAC9B,MAAM,IAAIF,MACR,CAAC,SAAS,EAAEC,QAAQF,IAAI,CAAC,gBAAgB,EAAEE,QAAQC,QAAQ,CAAC,iFAAiF,CAAC;QAElJ;IACF;IAEA,0EAA0E;IAC1E,6EAA6E;IAC7E,uDAAuD;IACvD,IAAIJ,cAAcK,I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AAK,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,kBAAkBW,QAAQE,MAAM;IAE9D,uEAAuE;IACvE,uEAAuE;IACvE,yEAAyE;IACzE,qBAAqB;IACrB,MAAMQ,WAAWT,QAAQS,QAAQ,IAAI;IACrC,MAAMC,OAAOV,QAAQU,IAAI,IAAI;IAC7B,MAAMC,cAAcX,QAAQW,WA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YAAEL;QAAc,GAChB;YAAEgC,mBAAmBtD,kBAAkBuD,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,MAAMrD,WAAWe,MAAMC,QAAQqC,GAAG;QAC9C,MAAM3C,0BAA0BK,MAAM;YAAEsC;QAAI;QAE5C,MAAMvD,yBAAyBiB,MAAM;YACnCuC,sBAAsBpC;YACtBqC,sBAAsBtC;YACtBuC,aAAahC;YACbiC,kBAAkBlC;YAClBI;YACA0B;QACF;IACF;IAEA,MAAMpD,gCAAgCc,MAAM;QAC1CH;KACD;IAED,MAAMb,qBAAqBgB;IAC3B,OAAO;QACLrB,oBAAoBqB;IACtB;AACF,EAAE;AAaF;;;CAGC,GACD,OAAO,MAAM2C,+BAA+B,CAC1CpB;IAEA,MAAMM,WAAWN,QAAQM,QAAQ;IACjC,IAAIA,UAAUC,cAAcjC,iCAAiCkC,EAAE,EAAE;QAC/D,MAAM,IAAIa,MACR,CAAC,SAAS,EAAErB,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 / 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,YAAY,IAAIL;IACvC,MAAMM,cAAc7B,kBAAkByB,WAAWE;IACjD,MAAMG,qBAAqB,GAAGpB,kBAAkBW,QAAQE,MAAM;IAE9D,uEAAuE;IACvE,uEAAuE;IACvE,yEAAyE;IACzE,qBAAqB;IACrB,MAAMQ,WAAWT,QAAQS,QA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
- 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,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,MAAMR,qBAAqBW;IAE3B,OAAO,IACLV,oBAAoBU,MAAMC,QAAQiB,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;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"]
@@ -41,6 +41,7 @@ export interface ResolvedConnectionOptions {
41
41
  targetProject: string;
42
42
  sourceComponent?: ComponentMetadata;
43
43
  targetComponent?: ComponentMetadata;
44
+ preferInstallDependencies?: boolean;
44
45
  }
45
46
  /**
46
47
  * Generator for a connection between two projects
@@ -185,15 +185,18 @@ const CONNECTION_GENERATORS = {
185
185
  'ts#mcp-server -> ts#dynamodb': (tree, options)=>tsDynamoDBMcpServerConnectionGenerator(tree, options),
186
186
  'react -> ts#trpc-api': (tree, options)=>trpcReactGenerator(tree, {
187
187
  frontendProjectName: options.sourceProject,
188
- backendProjectName: options.targetProject
188
+ backendProjectName: options.targetProject,
189
+ preferInstallDependencies: options.preferInstallDependencies
189
190
  }),
190
191
  'react -> py#fast-api': (tree, options)=>fastApiReactGenerator(tree, {
191
192
  frontendProjectName: options.sourceProject,
192
- fastApiProjectName: options.targetProject
193
+ fastApiProjectName: options.targetProject,
194
+ preferInstallDependencies: options.preferInstallDependencies
193
195
  }),
194
196
  'react -> smithy': (tree, options)=>smithyReactConnectionGenerator(tree, {
195
197
  frontendProjectName: options.sourceProject,
196
- smithyModelOrBackendProjectName: options.targetProject
198
+ smithyModelOrBackendProjectName: options.targetProject,
199
+ preferInstallDependencies: options.preferInstallDependencies
197
200
  }),
198
201
  'react -> ts#agent': (tree, options)=>tsAgentReactConnectionGenerator(tree, options),
199
202
  'react -> py#agent': (tree, options)=>pyAgentReactConnectionGenerator(tree, options),
@@ -223,7 +226,8 @@ const CONNECTION_GENERATORS = {
223
226
  sourceProject: options.sourceProject,
224
227
  targetProject: options.targetProject,
225
228
  sourceComponent: resolved.sourceComponent,
226
- targetComponent: resolved.targetComponent
229
+ targetComponent: resolved.targetComponent,
230
+ preferInstallDependencies: options.preferInstallDependencies
227
231
  });
228
232
  };
229
233
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/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 joinPathFragments,\n type ProjectConfiguration,\n type Tree,\n} from '@nx/devkit';\nimport agentcoreGatewayGatewayConnectionGenerator from '../agentcore-gateway/gateway-connection/generator';\nimport { AGENTCORE_GATEWAY_GENERATOR_INFO } from '../agentcore-gateway/generator';\nimport agentcoreGatewayMcpConnectionGenerator from '../agentcore-gateway/mcp-connection/generator';\nimport pyAgentA2aConnectionGenerator from '../py/agent/a2a-connection/generator';\nimport pyAgentGatewayConnectionGenerator from '../py/agent/gateway-connection/generator';\nimport pyAgentMcpConnectionGenerator from '../py/agent/mcp-connection/generator';\nimport pyAgentReactConnectionGenerator from '../py/agent/react-connection/generator';\nimport pyDynamoDBAgentConnectionGenerator from '../py/dynamodb/agent-connection/generator';\nimport pyDynamoDBFastApiConnectionGenerator from '../py/dynamodb/fast-api-connection/generator';\nimport { PY_DYNAMODB_GENERATOR_INFO } from '../py/dynamodb/generator';\nimport pyDynamoDBMcpServerConnectionGenerator from '../py/dynamodb/mcp-server-connection/generator';\nimport fastApiReactGenerator from '../py/fast-api/react/generator';\nimport { SMITHY_PROJECT_GENERATOR_INFO } from '../smithy/project/generator';\nimport smithyReactConnectionGenerator from '../smithy/react-connection/generator';\nimport { TS_SMITHY_API_GENERATOR_INFO } from '../smithy/ts/api/generator';\nimport trpcReactGenerator from '../trpc/react/generator';\nimport tsAgentA2aConnectionGenerator from '../ts/agent/a2a-connection/generator';\nimport tsAgentGatewayConnectionGenerator from '../ts/agent/gateway-connection/generator';\nimport tsAgentMcpConnectionGenerator from '../ts/agent/mcp-connection/generator';\nimport tsAgentReactConnectionGenerator from '../ts/agent/react-connection/generator';\nimport tsDynamoDBAgentConnectionGenerator from '../ts/dynamodb/agent-connection/generator';\nimport { TS_DYNAMODB_GENERATOR_INFO } from '../ts/dynamodb/generator';\nimport tsDynamoDBMcpServerConnectionGenerator from '../ts/dynamodb/mcp-server-connection/generator';\nimport tsDynamoDBSmithyConnectionGenerator from '../ts/dynamodb/smithy-connection/generator';\nimport tsDynamoDBTrpcConnectionGenerator from '../ts/dynamodb/trpc-connection/generator';\nimport tsRdbAgentConnectionGenerator from '../ts/rdb/agent-connection/generator';\nimport { TS_RDB_GENERATOR_INFO } from '../ts/rdb/generator';\nimport tsRdbMcpServerConnectionGenerator from '../ts/rdb/mcp-server-connection/generator';\nimport tsRdbSmithyConnectionGenerator from '../ts/rdb/smithy-connection/generator';\nimport tsRdbTrpcConnectionGenerator from '../ts/rdb/trpc-connection/generator';\nimport { hasExportDeclaration } from '../utils/ast';\nimport {\n type ComponentMetadata,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { readToml } from '../utils/toml';\nimport type { ConnectionGeneratorSchema } from './schema';\n\n/**\n * List of supported source and target project types for connections.\n * These can be project-level types (determined by introspection) or\n * component generator ids (from component metadata).\n */\nconst SUPPORTED_PROJECT_TYPES = [\n 'ts#trpc-api',\n 'py#fast-api',\n 'react',\n 'smithy',\n 'ts#rdb',\n 'ts#dynamodb',\n 'py#dynamodb',\n 'agentcore-gateway',\n] as const;\n\ntype ProjectType = (typeof SUPPORTED_PROJECT_TYPES)[number];\n\nexport type Connection = { source: string; target: string };\n\n/**\n * Sentinel value for sourceComponent/targetComponent that means\n * \"use the project-level connection, not a component\".\n */\nexport const PROJECT_COMPONENT_SENTINEL = '.';\n\n/**\n * The result of resolving a connection, including the matched connection\n * and any resolved source/target component metadata.\n */\nexport interface ResolvedConnection {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Enumerates the supported project connections.\n * Source and target can be project-level types or component generator ids.\n */\nconst SUPPORTED_CONNECTIONS = [\n { source: 'ts#trpc-api', target: 'ts#rdb' },\n { source: 'ts#trpc-api', target: 'ts#dynamodb' },\n { source: 'ts#agent', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#dynamodb' },\n { source: 'ts#mcp-server', target: 'ts#rdb' },\n { source: 'ts#mcp-server', target: 'ts#dynamodb' },\n { source: 'react', target: 'ts#trpc-api' },\n { source: 'react', target: 'py#fast-api' },\n { source: 'react', target: 'smithy' },\n { source: 'react', target: 'ts#agent' },\n { source: 'react', target: 'py#agent' },\n { source: 'ts#agent', target: 'ts#mcp-server' },\n { source: 'ts#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#dynamodb' },\n { source: 'py#agent', target: 'ts#mcp-server' },\n { source: 'py#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#agent' },\n { source: 'ts#agent', target: 'py#agent' },\n { source: 'py#agent', target: 'ts#agent' },\n { source: 'py#agent', target: 'py#agent' },\n { source: 'ts#agent', target: 'agentcore-gateway' },\n { source: 'py#agent', target: 'agentcore-gateway' },\n { source: 'agentcore-gateway', target: 'ts#mcp-server' },\n { source: 'agentcore-gateway', target: 'py#mcp-server' },\n { source: 'agentcore-gateway', target: 'agentcore-gateway' },\n { source: 'py#fast-api', target: 'py#dynamodb' },\n { source: 'py#agent', target: 'py#dynamodb' },\n { source: 'py#mcp-server', target: 'py#dynamodb' },\n] as const satisfies readonly Connection[];\n\ntype ConnectionKey = (typeof SUPPORTED_CONNECTIONS)[number] extends infer C\n ? C extends Connection\n ? `${C['source']} -> ${C['target']}`\n : never\n : never;\n\n/**\n * Generators for each connection type\n */\n/**\n * Options passed to connection generators, including resolved component metadata.\n */\nexport interface ResolvedConnectionOptions {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n}\n\nconst CONNECTION_GENERATORS = {\n 'ts#trpc-api -> ts#rdb': (tree, options) =>\n tsRdbTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#rdb': (tree, options) =>\n tsRdbAgentConnectionGenerator(tree, options),\n 'smithy -> ts#rdb': (tree, options) =>\n tsRdbSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#rdb': (tree, options) =>\n tsRdbMcpServerConnectionGenerator(tree, options),\n 'ts#trpc-api -> ts#dynamodb': (tree, options) =>\n tsDynamoDBTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#dynamodb': (tree, options) =>\n tsDynamoDBAgentConnectionGenerator(tree, options),\n 'smithy -> ts#dynamodb': (tree, options) =>\n tsDynamoDBSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#dynamodb': (tree, options) =>\n tsDynamoDBMcpServerConnectionGenerator(tree, options),\n 'react -> ts#trpc-api': (tree, options) =>\n trpcReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n backendProjectName: options.targetProject,\n }),\n 'react -> py#fast-api': (tree, options) =>\n fastApiReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n fastApiProjectName: options.targetProject,\n }),\n 'react -> smithy': (tree, options) =>\n smithyReactConnectionGenerator(tree, {\n frontendProjectName: options.sourceProject,\n smithyModelOrBackendProjectName: options.targetProject,\n }),\n 'react -> ts#agent': (tree, options) =>\n tsAgentReactConnectionGenerator(tree, options),\n 'react -> py#agent': (tree, options) =>\n pyAgentReactConnectionGenerator(tree, options),\n 'ts#agent -> ts#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> py#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> ts#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> py#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> ts#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> py#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> ts#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> py#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> agentcore-gateway': (tree, options) =>\n tsAgentGatewayConnectionGenerator(tree, options),\n 'py#agent -> agentcore-gateway': (tree, options) =>\n pyAgentGatewayConnectionGenerator(tree, options),\n 'agentcore-gateway -> ts#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> py#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> agentcore-gateway': (tree, options) =>\n agentcoreGatewayGatewayConnectionGenerator(tree, options),\n 'py#fast-api -> py#dynamodb': (tree, options) =>\n pyDynamoDBFastApiConnectionGenerator(tree, options),\n 'py#agent -> py#dynamodb': (tree, options) =>\n pyDynamoDBAgentConnectionGenerator(tree, options),\n 'py#mcp-server -> py#dynamodb': (tree, options) =>\n pyDynamoDBMcpServerConnectionGenerator(tree, options),\n} satisfies Record<\n ConnectionKey,\n (tree: Tree, options: ResolvedConnectionOptions) => Promise<any>\n>;\n\n/**\n * Generator for a connection between two projects\n */\nexport const connectionGenerator = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n) => {\n const resolved = await resolveConnection(tree, options);\n\n const connectionKey =\n `${resolved.connection.source} -> ${resolved.connection.target}` as ConnectionKey;\n\n return await CONNECTION_GENERATORS[connectionKey](tree, {\n sourceProject: options.sourceProject,\n targetProject: options.targetProject,\n sourceComponent: resolved.sourceComponent,\n targetComponent: resolved.targetComponent,\n });\n};\n\n/**\n * Find a component in project metadata matching the given reference.\n * Checks by name first, then by path, then by generator.\n */\nexport const findComponentInMetadata = (\n projectConfiguration: ProjectConfiguration,\n componentRef: string,\n): ComponentMetadata | undefined => {\n const components: ComponentMetadata[] =\n (projectConfiguration.metadata as any)?.components ?? [];\n\n return (\n components.find((c) => c.name === componentRef) ??\n components.find((c) => c.path === componentRef) ??\n components.find((c) => c.generator === componentRef)\n );\n};\n\n/**\n * Represents a candidate source or target for a connection, which may be\n * the project itself or a specific component within the project.\n */\ninterface ConnectionCandidate {\n readonly type: string;\n readonly component?: ComponentMetadata;\n}\n\n/**\n * A matched connection between source and target candidates.\n */\ninterface ConnectionMatch {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Gather all connection candidates for a project configuration. This includes:\n * - The project-level type (if it's a supported type)\n * - Each component's generator id as a candidate type\n */\nconst gatherCandidates = async (\n tree: Tree,\n projectConfig: ProjectConfiguration,\n): Promise<ConnectionCandidate[]> => {\n const type = await determineProjectTypeFromConfig(tree, projectConfig);\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n\n return [\n ...(type ? [{ type: type }] : []),\n ...components.map((component) => ({\n type: component.generator,\n component,\n })),\n ];\n};\n\n/**\n * Validate that a specified component exists in the project metadata.\n * Skips validation for undefined refs and the project sentinel '.'.\n */\nconst validateComponent = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n side: 'source' | 'target',\n) => {\n if (!componentRef || componentRef === PROJECT_COMPONENT_SENTINEL) return;\n const found = findComponentInMetadata(projectConfig, componentRef);\n if (!found) {\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n throw new Error(\n `Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` +\n `Available components: ${components.length > 0 ? components.map((c) => c.name ?? c.generator).join(', ') : 'none'}`,\n );\n }\n};\n\n/**\n * Narrow candidates based on the user's specified component reference.\n */\nconst filterConnectionCandidatesForComponentReference = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n candidates: ConnectionCandidate[],\n supportedConnections: readonly Connection[],\n side: 'source' | 'target',\n): ConnectionCandidate[] => {\n if (!componentRef) return candidates;\n if (componentRef === PROJECT_COMPONENT_SENTINEL) {\n return candidates.filter((c) => !c.component);\n }\n const component = findComponentInMetadata(projectConfig, componentRef);\n if (!component) return candidates;\n const isConnectionParticipant = supportedConnections.some(\n (c) => c[side] === component.generator,\n );\n if (!isConnectionParticipant) return candidates;\n // Filter to the specific matched component, not all components with the same generator\n return candidates.filter((c) => c.component === component);\n};\n\n/**\n * Resolve the connection to use, considering source/target projects and components.\n */\nexport const resolveConnection = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n supportedConnections: readonly Connection[] = SUPPORTED_CONNECTIONS,\n): Promise<ResolvedConnection> => {\n const sourceConfig = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetConfig = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n // Validate explicitly specified components exist\n validateComponent(options.sourceComponent, sourceConfig, 'source');\n validateComponent(options.targetComponent, targetConfig, 'target');\n\n // Gather and narrow candidates\n const sourceCandidates = filterConnectionCandidatesForComponentReference(\n options.sourceComponent,\n sourceConfig,\n await gatherCandidates(tree, sourceConfig),\n supportedConnections,\n 'source',\n );\n const targetCandidates = filterConnectionCandidatesForComponentReference(\n options.targetComponent,\n targetConfig,\n await gatherCandidates(tree, targetConfig),\n supportedConnections,\n 'target',\n );\n\n // Cross-product candidates and find supported connections\n const matches: ConnectionMatch[] = [];\n for (const source of sourceCandidates) {\n for (const target of targetCandidates) {\n const match = supportedConnections.find(\n (c) => c.source === source.type && c.target === target.type,\n );\n if (match) {\n matches.push({\n connection: match,\n sourceComponent: source.component,\n targetComponent: target.component,\n });\n }\n }\n }\n\n if (matches.length === 0) {\n const sourceTypes = [...new Set(sourceCandidates.map((c) => c.type))];\n const targetTypes = [...new Set(targetCandidates.map((c) => c.type))];\n throw new Error(\n `This generator does not support a connection from ${options.sourceProject}${sourceTypes.length > 0 ? ` (${sourceTypes.join(', ')})` : ''} to ${options.targetProject}${targetTypes.length > 0 ? ` (${targetTypes.join(', ')})` : ''}`,\n );\n }\n\n if (matches.length > 1) {\n const connectionDescriptions = matches\n .map((m) => {\n const sourceName = m.sourceComponent?.name;\n const targetName = m.targetComponent?.name;\n const sourceLabel = sourceName\n ? `${sourceName} (${m.connection.source})`\n : m.connection.source;\n const targetLabel = targetName\n ? `${targetName} (${m.connection.target})`\n : m.connection.target;\n return `${sourceLabel} -> ${targetLabel}`;\n })\n .join(', ');\n throw new Error(\n `Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` +\n `Multiple supported connections found: ${connectionDescriptions}. ` +\n `Please specify sourceComponent and/or targetComponent to disambiguate.`,\n );\n }\n\n return {\n connection: matches[0].connection,\n sourceComponent: matches[0].sourceComponent,\n targetComponent: matches[0].targetComponent,\n };\n};\n\n/**\n * Determine whether the given project is of a known project type\n */\nexport const determineProjectType = async (\n tree: Tree,\n projectName: string,\n): Promise<ProjectType | undefined> => {\n const projectConfiguration = readProjectConfigurationUnqualified(\n tree,\n projectName,\n );\n return await determineProjectTypeFromConfig(tree, projectConfiguration);\n};\n\n/**\n * Determine whether the given project configuration is of a known project type\n */\nconst determineProjectTypeFromConfig = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<ProjectType | undefined> => {\n // NB: if adding new checks, ensure these go from most to least specific\n // eg. react website is more specific than typescript project\n\n if (await isTrpcApi(tree, projectConfiguration)) {\n return 'ts#trpc-api';\n }\n\n if (isFastApi(tree, projectConfiguration)) {\n return 'py#fast-api';\n }\n\n if (isSmithyApi(tree, projectConfiguration)) {\n return 'smithy';\n }\n\n if (isReact(tree, projectConfiguration)) {\n return 'react';\n }\n\n if (isRdb(projectConfiguration)) {\n return 'ts#rdb';\n }\n\n if (isTsDynamoDB(projectConfiguration)) {\n return 'ts#dynamodb';\n }\n\n if (isPyDynamoDB(projectConfiguration)) {\n return 'py#dynamodb';\n }\n\n if (isAgentCoreGateway(projectConfiguration)) {\n return 'agentcore-gateway';\n }\n\n return undefined;\n};\n\nconst sourceRoot = (projectConfiguration: ProjectConfiguration) =>\n projectConfiguration.sourceRoot ??\n joinPathFragments(projectConfiguration.root, 'src');\n\nconst isTrpcApi = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<boolean> => {\n // If the project.json says it's a trpc api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'trpc') {\n return true;\n }\n\n // Find the src/index.ts\n const indexTs = tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'index.ts'),\n 'utf-8',\n );\n if (indexTs === null) {\n return false;\n }\n\n // If the index file exports an AppRouter, it's a trpc api\n if (await hasExportDeclaration(tree, indexTs, 'AppRouter')) {\n return true;\n }\n\n // If there's a src/router.ts or src/lambdas/router.ts which exports an AppRouter, it's a trpc api\n const trpcRouter =\n tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'router.ts'),\n 'utf-8',\n ) ??\n tree.read(\n joinPathFragments(\n sourceRoot(projectConfiguration),\n 'lambdas',\n 'router.ts',\n ),\n 'utf-8',\n );\n\n if (trpcRouter === null) {\n return false;\n }\n\n if (await hasExportDeclaration(tree, trpcRouter, 'AppRouter')) {\n return true;\n }\n\n return false;\n};\n\nconst isReact = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // if there's a main.tsx, it's a react app\n return tree.exists(\n joinPathFragments(sourceRoot(projectConfiguration), 'main.tsx'),\n );\n};\n\nconst isFastApi = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // If the project.json says it's a fast api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'fast-api') {\n return true;\n }\n\n const pyProjectPath = joinPathFragments(\n projectConfiguration.root,\n 'pyproject.toml',\n );\n if (tree.exists(pyProjectPath)) {\n const pyProject = readToml(tree, pyProjectPath);\n if (((pyProject as any)?.project?.dependencies ?? []).includes('fastapi')) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isSmithyApi = (\n _tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // Support selecting either the smithy model or backend project\n return [\n SMITHY_PROJECT_GENERATOR_INFO.id,\n TS_SMITHY_API_GENERATOR_INFO.id,\n ].includes(((projectConfiguration.metadata as any) ?? {}).generator);\n};\n\nconst isRdb = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_RDB_GENERATOR_INFO.id;\n\nconst isTsDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_DYNAMODB_GENERATOR_INFO.id;\n\nconst isPyDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n PY_DYNAMODB_GENERATOR_INFO.id;\n\nconst isAgentCoreGateway = (\n projectConfiguration: ProjectConfiguration,\n): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n AGENTCORE_GATEWAY_GENERATOR_INFO.id;\n\nexport default connectionGenerator;\n"],"names":["joinPathFragments","agentcoreGatewayGatewayConnectionGenerator","AGENTCORE_GATEWAY_GENERATOR_INFO","agentcoreGatewayMcpConnectionGenerator","pyAgentA2aConnectionGenerator","pyAgentGatewayConnectionGenerator","pyAgentMcpConnectionGenerator","pyAgentReactConnectionGenerator","pyDynamoDBAgentConnectionGenerator","pyDynamoDBFastApiConnectionGenerator","PY_DYNAMODB_GENERATOR_INFO","pyDynamoDBMcpServerConnectionGenerator","fastApiReactGenerator","SMITHY_PROJECT_GENERATOR_INFO","smithyReactConnectionGenerator","TS_SMITHY_API_GENERATOR_INFO","trpcReactGenerator","tsAgentA2aConnectionGenerator","tsAgentGatewayConnectionGenerator","tsAgentMcpConnectionGenerator","tsAgentReactConnectionGenerator","tsDynamoDBAgentConnectionGenerator","TS_DYNAMODB_GENERATOR_INFO","tsDynamoDBMcpServerConnectionGenerator","tsDynamoDBSmithyConnectionGenerator","tsDynamoDBTrpcConnectionGenerator","tsRdbAgentConnectionGenerator","TS_RDB_GENERATOR_INFO","tsRdbMcpServerConnectionGenerator","tsRdbSmithyConnectionGenerator","tsRdbTrpcConnectionGenerator","hasExportDeclaration","readProjectConfigurationUnqualified","readToml","SUPPORTED_PROJECT_TYPES","PROJECT_COMPONENT_SENTINEL","SUPPORTED_CONNECTIONS","source","target","CONNECTION_GENERATORS","tree","options","frontendProjectName","sourceProject","backendProjectName","targetProject","fastApiProjectName","smithyModelOrBackendProjectName","connectionGenerator","resolved","resolveConnection","connectionKey","connection","sourceComponent","targetComponent","findComponentInMetadata","projectConfiguration","componentRef","components","metadata","find","c","name","path","generator","gatherCandidates","projectConfig","type","determineProjectTypeFromConfig","map","component","validateComponent","side","found","Error","length","join","filterConnectionCandidatesForComponentReference","candidates","supportedConnections","filter","isConnectionParticipant","some","sourceConfig","targetConfig","sourceCandidates","targetCandidates","matches","match","push","sourceTypes","Set","targetTypes","connectionDescriptions","m","sourceName","targetName","sourceLabel","targetLabel","determineProjectType","projectName","isTrpcApi","isFastApi","isSmithyApi","isReact","isRdb","isTsDynamoDB","isPyDynamoDB","isAgentCoreGateway","undefined","sourceRoot","root","apiType","indexTs","read","trpcRouter","exists","pyProjectPath","pyProject","project","dependencies","includes","_tree","id"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,QAGZ,aAAa;AACpB,OAAOC,gDAAgD,uDAAoD;AAC3G,SAASC,gCAAgC,QAAQ,oCAAiC;AAClF,OAAOC,4CAA4C,mDAAgD;AACnG,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,qCAAqC,4CAAyC;AACrF,OAAOC,wCAAwC,+CAA4C;AAC3F,OAAOC,0CAA0C,kDAA+C;AAChG,SAASC,0BAA0B,QAAQ,8BAA2B;AACtE,OAAOC,4CAA4C,oDAAiD;AACpG,OAAOC,2BAA2B,oCAAiC;AACnE,SAASC,6BAA6B,QAAQ,iCAA8B;AAC5E,OAAOC,oCAAoC,0CAAuC;AAClF,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,OAAOC,wBAAwB,6BAA0B;AACzD,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,OAAOC,qCAAqC,4CAAyC;AACrF,OAAOC,wCAAwC,+CAA4C;AAC3F,SAASC,0BAA0B,QAAQ,8BAA2B;AACtE,OAAOC,4CAA4C,oDAAiD;AACpG,OAAOC,yCAAyC,gDAA6C;AAC7F,OAAOC,uCAAuC,8CAA2C;AACzF,OAAOC,mCAAmC,0CAAuC;AACjF,SAASC,qBAAqB,QAAQ,yBAAsB;AAC5D,OAAOC,uCAAuC,+CAA4C;AAC1F,OAAOC,oCAAoC,2CAAwC;AACnF,OAAOC,kCAAkC,yCAAsC;AAC/E,SAASC,oBAAoB,QAAQ,kBAAe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ACxDrC,sBAAsBgG,EAAE;AAE1B,MAAMjB,eAAe,CAAClD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD1C,2BAA2BqG,EAAE;AAE/B,MAAMhB,eAAe,CAACnD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDtD,2BAA2BiH,EAAE;AAE/B,MAAMf,qBAAqB,CACzBpD,uBAEA,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD9D,iCAAiCyH,EAAE;AAErC,eAAe3E,oBAAoB"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/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 joinPathFragments,\n type ProjectConfiguration,\n type Tree,\n} from '@nx/devkit';\nimport agentcoreGatewayGatewayConnectionGenerator from '../agentcore-gateway/gateway-connection/generator';\nimport { AGENTCORE_GATEWAY_GENERATOR_INFO } from '../agentcore-gateway/generator';\nimport agentcoreGatewayMcpConnectionGenerator from '../agentcore-gateway/mcp-connection/generator';\nimport pyAgentA2aConnectionGenerator from '../py/agent/a2a-connection/generator';\nimport pyAgentGatewayConnectionGenerator from '../py/agent/gateway-connection/generator';\nimport pyAgentMcpConnectionGenerator from '../py/agent/mcp-connection/generator';\nimport pyAgentReactConnectionGenerator from '../py/agent/react-connection/generator';\nimport pyDynamoDBAgentConnectionGenerator from '../py/dynamodb/agent-connection/generator';\nimport pyDynamoDBFastApiConnectionGenerator from '../py/dynamodb/fast-api-connection/generator';\nimport { PY_DYNAMODB_GENERATOR_INFO } from '../py/dynamodb/generator';\nimport pyDynamoDBMcpServerConnectionGenerator from '../py/dynamodb/mcp-server-connection/generator';\nimport fastApiReactGenerator from '../py/fast-api/react/generator';\nimport { SMITHY_PROJECT_GENERATOR_INFO } from '../smithy/project/generator';\nimport smithyReactConnectionGenerator from '../smithy/react-connection/generator';\nimport { TS_SMITHY_API_GENERATOR_INFO } from '../smithy/ts/api/generator';\nimport trpcReactGenerator from '../trpc/react/generator';\nimport tsAgentA2aConnectionGenerator from '../ts/agent/a2a-connection/generator';\nimport tsAgentGatewayConnectionGenerator from '../ts/agent/gateway-connection/generator';\nimport tsAgentMcpConnectionGenerator from '../ts/agent/mcp-connection/generator';\nimport tsAgentReactConnectionGenerator from '../ts/agent/react-connection/generator';\nimport tsDynamoDBAgentConnectionGenerator from '../ts/dynamodb/agent-connection/generator';\nimport { TS_DYNAMODB_GENERATOR_INFO } from '../ts/dynamodb/generator';\nimport tsDynamoDBMcpServerConnectionGenerator from '../ts/dynamodb/mcp-server-connection/generator';\nimport tsDynamoDBSmithyConnectionGenerator from '../ts/dynamodb/smithy-connection/generator';\nimport tsDynamoDBTrpcConnectionGenerator from '../ts/dynamodb/trpc-connection/generator';\nimport tsRdbAgentConnectionGenerator from '../ts/rdb/agent-connection/generator';\nimport { TS_RDB_GENERATOR_INFO } from '../ts/rdb/generator';\nimport tsRdbMcpServerConnectionGenerator from '../ts/rdb/mcp-server-connection/generator';\nimport tsRdbSmithyConnectionGenerator from '../ts/rdb/smithy-connection/generator';\nimport tsRdbTrpcConnectionGenerator from '../ts/rdb/trpc-connection/generator';\nimport { hasExportDeclaration } from '../utils/ast';\nimport {\n type ComponentMetadata,\n readProjectConfigurationUnqualified,\n} from '../utils/nx';\nimport { readToml } from '../utils/toml';\nimport type { ConnectionGeneratorSchema } from './schema';\n\n/**\n * List of supported source and target project types for connections.\n * These can be project-level types (determined by introspection) or\n * component generator ids (from component metadata).\n */\nconst SUPPORTED_PROJECT_TYPES = [\n 'ts#trpc-api',\n 'py#fast-api',\n 'react',\n 'smithy',\n 'ts#rdb',\n 'ts#dynamodb',\n 'py#dynamodb',\n 'agentcore-gateway',\n] as const;\n\ntype ProjectType = (typeof SUPPORTED_PROJECT_TYPES)[number];\n\nexport type Connection = { source: string; target: string };\n\n/**\n * Sentinel value for sourceComponent/targetComponent that means\n * \"use the project-level connection, not a component\".\n */\nexport const PROJECT_COMPONENT_SENTINEL = '.';\n\n/**\n * The result of resolving a connection, including the matched connection\n * and any resolved source/target component metadata.\n */\nexport interface ResolvedConnection {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Enumerates the supported project connections.\n * Source and target can be project-level types or component generator ids.\n */\nconst SUPPORTED_CONNECTIONS = [\n { source: 'ts#trpc-api', target: 'ts#rdb' },\n { source: 'ts#trpc-api', target: 'ts#dynamodb' },\n { source: 'ts#agent', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#rdb' },\n { source: 'smithy', target: 'ts#dynamodb' },\n { source: 'ts#mcp-server', target: 'ts#rdb' },\n { source: 'ts#mcp-server', target: 'ts#dynamodb' },\n { source: 'react', target: 'ts#trpc-api' },\n { source: 'react', target: 'py#fast-api' },\n { source: 'react', target: 'smithy' },\n { source: 'react', target: 'ts#agent' },\n { source: 'react', target: 'py#agent' },\n { source: 'ts#agent', target: 'ts#mcp-server' },\n { source: 'ts#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#dynamodb' },\n { source: 'py#agent', target: 'ts#mcp-server' },\n { source: 'py#agent', target: 'py#mcp-server' },\n { source: 'ts#agent', target: 'ts#agent' },\n { source: 'ts#agent', target: 'py#agent' },\n { source: 'py#agent', target: 'ts#agent' },\n { source: 'py#agent', target: 'py#agent' },\n { source: 'ts#agent', target: 'agentcore-gateway' },\n { source: 'py#agent', target: 'agentcore-gateway' },\n { source: 'agentcore-gateway', target: 'ts#mcp-server' },\n { source: 'agentcore-gateway', target: 'py#mcp-server' },\n { source: 'agentcore-gateway', target: 'agentcore-gateway' },\n { source: 'py#fast-api', target: 'py#dynamodb' },\n { source: 'py#agent', target: 'py#dynamodb' },\n { source: 'py#mcp-server', target: 'py#dynamodb' },\n] as const satisfies readonly Connection[];\n\ntype ConnectionKey = (typeof SUPPORTED_CONNECTIONS)[number] extends infer C\n ? C extends Connection\n ? `${C['source']} -> ${C['target']}`\n : never\n : never;\n\n/**\n * Generators for each connection type\n */\n/**\n * Options passed to connection generators, including resolved component metadata.\n */\nexport interface ResolvedConnectionOptions {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n\nconst CONNECTION_GENERATORS = {\n 'ts#trpc-api -> ts#rdb': (tree, options) =>\n tsRdbTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#rdb': (tree, options) =>\n tsRdbAgentConnectionGenerator(tree, options),\n 'smithy -> ts#rdb': (tree, options) =>\n tsRdbSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#rdb': (tree, options) =>\n tsRdbMcpServerConnectionGenerator(tree, options),\n 'ts#trpc-api -> ts#dynamodb': (tree, options) =>\n tsDynamoDBTrpcConnectionGenerator(tree, options),\n 'ts#agent -> ts#dynamodb': (tree, options) =>\n tsDynamoDBAgentConnectionGenerator(tree, options),\n 'smithy -> ts#dynamodb': (tree, options) =>\n tsDynamoDBSmithyConnectionGenerator(tree, options),\n 'ts#mcp-server -> ts#dynamodb': (tree, options) =>\n tsDynamoDBMcpServerConnectionGenerator(tree, options),\n 'react -> ts#trpc-api': (tree, options) =>\n trpcReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n backendProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'react -> py#fast-api': (tree, options) =>\n fastApiReactGenerator(tree, {\n frontendProjectName: options.sourceProject,\n fastApiProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'react -> smithy': (tree, options) =>\n smithyReactConnectionGenerator(tree, {\n frontendProjectName: options.sourceProject,\n smithyModelOrBackendProjectName: options.targetProject,\n preferInstallDependencies: options.preferInstallDependencies,\n }),\n 'react -> ts#agent': (tree, options) =>\n tsAgentReactConnectionGenerator(tree, options),\n 'react -> py#agent': (tree, options) =>\n pyAgentReactConnectionGenerator(tree, options),\n 'ts#agent -> ts#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> py#mcp-server': (tree, options) =>\n tsAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> ts#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'py#agent -> py#mcp-server': (tree, options) =>\n pyAgentMcpConnectionGenerator(tree, options),\n 'ts#agent -> ts#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> py#agent': (tree, options) =>\n tsAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> ts#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'py#agent -> py#agent': (tree, options) =>\n pyAgentA2aConnectionGenerator(tree, options),\n 'ts#agent -> agentcore-gateway': (tree, options) =>\n tsAgentGatewayConnectionGenerator(tree, options),\n 'py#agent -> agentcore-gateway': (tree, options) =>\n pyAgentGatewayConnectionGenerator(tree, options),\n 'agentcore-gateway -> ts#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> py#mcp-server': (tree, options) =>\n agentcoreGatewayMcpConnectionGenerator(tree, options),\n 'agentcore-gateway -> agentcore-gateway': (tree, options) =>\n agentcoreGatewayGatewayConnectionGenerator(tree, options),\n 'py#fast-api -> py#dynamodb': (tree, options) =>\n pyDynamoDBFastApiConnectionGenerator(tree, options),\n 'py#agent -> py#dynamodb': (tree, options) =>\n pyDynamoDBAgentConnectionGenerator(tree, options),\n 'py#mcp-server -> py#dynamodb': (tree, options) =>\n pyDynamoDBMcpServerConnectionGenerator(tree, options),\n} satisfies Record<\n ConnectionKey,\n (tree: Tree, options: ResolvedConnectionOptions) => Promise<any>\n>;\n\n/**\n * Generator for a connection between two projects\n */\nexport const connectionGenerator = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n) => {\n const resolved = await resolveConnection(tree, options);\n\n const connectionKey =\n `${resolved.connection.source} -> ${resolved.connection.target}` as ConnectionKey;\n\n return await CONNECTION_GENERATORS[connectionKey](tree, {\n sourceProject: options.sourceProject,\n targetProject: options.targetProject,\n sourceComponent: resolved.sourceComponent,\n targetComponent: resolved.targetComponent,\n preferInstallDependencies: options.preferInstallDependencies,\n });\n};\n\n/**\n * Find a component in project metadata matching the given reference.\n * Checks by name first, then by path, then by generator.\n */\nexport const findComponentInMetadata = (\n projectConfiguration: ProjectConfiguration,\n componentRef: string,\n): ComponentMetadata | undefined => {\n const components: ComponentMetadata[] =\n (projectConfiguration.metadata as any)?.components ?? [];\n\n return (\n components.find((c) => c.name === componentRef) ??\n components.find((c) => c.path === componentRef) ??\n components.find((c) => c.generator === componentRef)\n );\n};\n\n/**\n * Represents a candidate source or target for a connection, which may be\n * the project itself or a specific component within the project.\n */\ninterface ConnectionCandidate {\n readonly type: string;\n readonly component?: ComponentMetadata;\n}\n\n/**\n * A matched connection between source and target candidates.\n */\ninterface ConnectionMatch {\n readonly connection: Connection;\n readonly sourceComponent?: ComponentMetadata;\n readonly targetComponent?: ComponentMetadata;\n}\n\n/**\n * Gather all connection candidates for a project configuration. This includes:\n * - The project-level type (if it's a supported type)\n * - Each component's generator id as a candidate type\n */\nconst gatherCandidates = async (\n tree: Tree,\n projectConfig: ProjectConfiguration,\n): Promise<ConnectionCandidate[]> => {\n const type = await determineProjectTypeFromConfig(tree, projectConfig);\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n\n return [\n ...(type ? [{ type: type }] : []),\n ...components.map((component) => ({\n type: component.generator,\n component,\n })),\n ];\n};\n\n/**\n * Validate that a specified component exists in the project metadata.\n * Skips validation for undefined refs and the project sentinel '.'.\n */\nconst validateComponent = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n side: 'source' | 'target',\n) => {\n if (!componentRef || componentRef === PROJECT_COMPONENT_SENTINEL) return;\n const found = findComponentInMetadata(projectConfig, componentRef);\n if (!found) {\n const components: ComponentMetadata[] =\n (projectConfig.metadata as any)?.components ?? [];\n throw new Error(\n `Component '${componentRef}' not found in ${side} project ${projectConfig.name}. ` +\n `Available components: ${components.length > 0 ? components.map((c) => c.name ?? c.generator).join(', ') : 'none'}`,\n );\n }\n};\n\n/**\n * Narrow candidates based on the user's specified component reference.\n */\nconst filterConnectionCandidatesForComponentReference = (\n componentRef: string | undefined,\n projectConfig: ProjectConfiguration,\n candidates: ConnectionCandidate[],\n supportedConnections: readonly Connection[],\n side: 'source' | 'target',\n): ConnectionCandidate[] => {\n if (!componentRef) return candidates;\n if (componentRef === PROJECT_COMPONENT_SENTINEL) {\n return candidates.filter((c) => !c.component);\n }\n const component = findComponentInMetadata(projectConfig, componentRef);\n if (!component) return candidates;\n const isConnectionParticipant = supportedConnections.some(\n (c) => c[side] === component.generator,\n );\n if (!isConnectionParticipant) return candidates;\n // Filter to the specific matched component, not all components with the same generator\n return candidates.filter((c) => c.component === component);\n};\n\n/**\n * Resolve the connection to use, considering source/target projects and components.\n */\nexport const resolveConnection = async (\n tree: Tree,\n options: ConnectionGeneratorSchema,\n supportedConnections: readonly Connection[] = SUPPORTED_CONNECTIONS,\n): Promise<ResolvedConnection> => {\n const sourceConfig = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetConfig = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n // Validate explicitly specified components exist\n validateComponent(options.sourceComponent, sourceConfig, 'source');\n validateComponent(options.targetComponent, targetConfig, 'target');\n\n // Gather and narrow candidates\n const sourceCandidates = filterConnectionCandidatesForComponentReference(\n options.sourceComponent,\n sourceConfig,\n await gatherCandidates(tree, sourceConfig),\n supportedConnections,\n 'source',\n );\n const targetCandidates = filterConnectionCandidatesForComponentReference(\n options.targetComponent,\n targetConfig,\n await gatherCandidates(tree, targetConfig),\n supportedConnections,\n 'target',\n );\n\n // Cross-product candidates and find supported connections\n const matches: ConnectionMatch[] = [];\n for (const source of sourceCandidates) {\n for (const target of targetCandidates) {\n const match = supportedConnections.find(\n (c) => c.source === source.type && c.target === target.type,\n );\n if (match) {\n matches.push({\n connection: match,\n sourceComponent: source.component,\n targetComponent: target.component,\n });\n }\n }\n }\n\n if (matches.length === 0) {\n const sourceTypes = [...new Set(sourceCandidates.map((c) => c.type))];\n const targetTypes = [...new Set(targetCandidates.map((c) => c.type))];\n throw new Error(\n `This generator does not support a connection from ${options.sourceProject}${sourceTypes.length > 0 ? ` (${sourceTypes.join(', ')})` : ''} to ${options.targetProject}${targetTypes.length > 0 ? ` (${targetTypes.join(', ')})` : ''}`,\n );\n }\n\n if (matches.length > 1) {\n const connectionDescriptions = matches\n .map((m) => {\n const sourceName = m.sourceComponent?.name;\n const targetName = m.targetComponent?.name;\n const sourceLabel = sourceName\n ? `${sourceName} (${m.connection.source})`\n : m.connection.source;\n const targetLabel = targetName\n ? `${targetName} (${m.connection.target})`\n : m.connection.target;\n return `${sourceLabel} -> ${targetLabel}`;\n })\n .join(', ');\n throw new Error(\n `Ambiguous connection from ${options.sourceProject} to ${options.targetProject}. ` +\n `Multiple supported connections found: ${connectionDescriptions}. ` +\n `Please specify sourceComponent and/or targetComponent to disambiguate.`,\n );\n }\n\n return {\n connection: matches[0].connection,\n sourceComponent: matches[0].sourceComponent,\n targetComponent: matches[0].targetComponent,\n };\n};\n\n/**\n * Determine whether the given project is of a known project type\n */\nexport const determineProjectType = async (\n tree: Tree,\n projectName: string,\n): Promise<ProjectType | undefined> => {\n const projectConfiguration = readProjectConfigurationUnqualified(\n tree,\n projectName,\n );\n return await determineProjectTypeFromConfig(tree, projectConfiguration);\n};\n\n/**\n * Determine whether the given project configuration is of a known project type\n */\nconst determineProjectTypeFromConfig = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<ProjectType | undefined> => {\n // NB: if adding new checks, ensure these go from most to least specific\n // eg. react website is more specific than typescript project\n\n if (await isTrpcApi(tree, projectConfiguration)) {\n return 'ts#trpc-api';\n }\n\n if (isFastApi(tree, projectConfiguration)) {\n return 'py#fast-api';\n }\n\n if (isSmithyApi(tree, projectConfiguration)) {\n return 'smithy';\n }\n\n if (isReact(tree, projectConfiguration)) {\n return 'react';\n }\n\n if (isRdb(projectConfiguration)) {\n return 'ts#rdb';\n }\n\n if (isTsDynamoDB(projectConfiguration)) {\n return 'ts#dynamodb';\n }\n\n if (isPyDynamoDB(projectConfiguration)) {\n return 'py#dynamodb';\n }\n\n if (isAgentCoreGateway(projectConfiguration)) {\n return 'agentcore-gateway';\n }\n\n return undefined;\n};\n\nconst sourceRoot = (projectConfiguration: ProjectConfiguration) =>\n projectConfiguration.sourceRoot ??\n joinPathFragments(projectConfiguration.root, 'src');\n\nconst isTrpcApi = async (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): Promise<boolean> => {\n // If the project.json says it's a trpc api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'trpc') {\n return true;\n }\n\n // Find the src/index.ts\n const indexTs = tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'index.ts'),\n 'utf-8',\n );\n if (indexTs === null) {\n return false;\n }\n\n // If the index file exports an AppRouter, it's a trpc api\n if (await hasExportDeclaration(tree, indexTs, 'AppRouter')) {\n return true;\n }\n\n // If there's a src/router.ts or src/lambdas/router.ts which exports an AppRouter, it's a trpc api\n const trpcRouter =\n tree.read(\n joinPathFragments(sourceRoot(projectConfiguration), 'router.ts'),\n 'utf-8',\n ) ??\n tree.read(\n joinPathFragments(\n sourceRoot(projectConfiguration),\n 'lambdas',\n 'router.ts',\n ),\n 'utf-8',\n );\n\n if (trpcRouter === null) {\n return false;\n }\n\n if (await hasExportDeclaration(tree, trpcRouter, 'AppRouter')) {\n return true;\n }\n\n return false;\n};\n\nconst isReact = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // if there's a main.tsx, it's a react app\n return tree.exists(\n joinPathFragments(sourceRoot(projectConfiguration), 'main.tsx'),\n );\n};\n\nconst isFastApi = (\n tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // If the project.json says it's a fast api, there's no need for introspection\n if ((projectConfiguration.metadata as any)?.apiType === 'fast-api') {\n return true;\n }\n\n const pyProjectPath = joinPathFragments(\n projectConfiguration.root,\n 'pyproject.toml',\n );\n if (tree.exists(pyProjectPath)) {\n const pyProject = readToml(tree, pyProjectPath);\n if (((pyProject as any)?.project?.dependencies ?? []).includes('fastapi')) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isSmithyApi = (\n _tree: Tree,\n projectConfiguration: ProjectConfiguration,\n): boolean => {\n // Support selecting either the smithy model or backend project\n return [\n SMITHY_PROJECT_GENERATOR_INFO.id,\n TS_SMITHY_API_GENERATOR_INFO.id,\n ].includes(((projectConfiguration.metadata as any) ?? {}).generator);\n};\n\nconst isRdb = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_RDB_GENERATOR_INFO.id;\n\nconst isTsDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n TS_DYNAMODB_GENERATOR_INFO.id;\n\nconst isPyDynamoDB = (projectConfiguration: ProjectConfiguration): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n PY_DYNAMODB_GENERATOR_INFO.id;\n\nconst isAgentCoreGateway = (\n projectConfiguration: ProjectConfiguration,\n): boolean =>\n ((projectConfiguration.metadata as any) ?? {}).generator ===\n AGENTCORE_GATEWAY_GENERATOR_INFO.id;\n\nexport default connectionGenerator;\n"],"names":["joinPathFragments","agentcoreGatewayGatewayConnectionGenerator","AGENTCORE_GATEWAY_GENERATOR_INFO","agentcoreGatewayMcpConnectionGenerator","pyAgentA2aConnectionGenerator","pyAgentGatewayConnectionGenerator","pyAgentMcpConnectionGenerator","pyAgentReactConnectionGenerator","pyDynamoDBAgentConnectionGenerator","pyDynamoDBFastApiConnectionGenerator","PY_DYNAMODB_GENERATOR_INFO","pyDynamoDBMcpServerConnectionGenerator","fastApiReactGenerator","SMITHY_PROJECT_GENERATOR_INFO","smithyReactConnectionGenerator","TS_SMITHY_API_GENERATOR_INFO","trpcReactGenerator","tsAgentA2aConnectionGenerator","tsAgentGatewayConnectionGenerator","tsAgentMcpConnectionGenerator","tsAgentReactConnectionGenerator","tsDynamoDBAgentConnectionGenerator","TS_DYNAMODB_GENERATOR_INFO","tsDynamoDBMcpServerConnectionGenerator","tsDynamoDBSmithyConnectionGenerator","tsDynamoDBTrpcConnectionGenerator","tsRdbAgentConnectionGenerator","TS_RDB_GENERATOR_INFO","tsRdbMcpServerConnectionGenerator","tsRdbSmithyConnectionGenerator","tsRdbTrpcConnectionGenerator","hasExportDeclaration","readProjectConfigurationUnqualified","readToml","SUPPORTED_PROJECT_TYPES","PROJECT_COMPONENT_SENTINEL","SUPPORTED_CONNECTIONS","source","target","CONNECTION_GENERATORS","tree","options","frontendProjectName","sourceProject","backendProjectName","targetProject","preferInstallDependencies","fastApiProjectName","smithyModelOrBackendProjectName","connectionGenerator","resolved","resolveConnection","connectionKey","connection","sourceComponent","targetComponent","findComponentInMetadata","projectConfiguration","componentRef","components","metadata","find","c","name","path","generator","gatherCandidates","projectConfig","type","determineProjectTypeFromConfig","map","component","validateComponent","side","found","Error","length","join","filterConnectionCandidatesForComponentReference","candidates","supportedConnections","filter","isConnectionParticipant","some","sourceConfig","targetConfig","sourceCandidates","targetCandidates","matches","match","push","sourceTypes","Set","targetTypes","connectionDescriptions","m","sourceName","targetName","sourceLabel","targetLabel","determineProjectType","projectName","isTrpcApi","isFastApi","isSmithyApi","isReact","isRdb","isTsDynamoDB","isPyDynamoDB","isAgentCoreGateway","undefined","sourceRoot","root","apiType","indexTs","read","trpcRouter","exists","pyProjectPath","pyProject","project","dependencies","includes","_tree","id"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,QAGZ,aAAa;AAC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AAS,KACxD3C,2BAA2BsG,EAAE;AAE/B,MAAMhB,eAAe,CAACnD,uBACpB,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxDvD,2BAA2BkH,EAAE;AAE/B,MAAMf,qBAAqB,CACzBpD,uBAEA,AAAC,CAAA,AAACA,qBAAqBG,QAAQ,IAAY,CAAC,CAAA,EAAGK,SAAS,KACxD/D,iCAAiC0H,EAAE;AAErC,eAAe3E,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: string;\n targetComponent?: string;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAED,WAKC"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: string;\n targetComponent?: string;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAED,WAMC"}
@@ -8,4 +8,5 @@ export interface ConnectionGeneratorSchema {
8
8
  targetProject: string;
9
9
  sourceComponent?: string;
10
10
  targetComponent?: string;
11
+ preferInstallDependencies?: boolean;
11
12
  }