@aws/nx-plugin 1.0.0-rc.0 → 1.0.0-rc.10

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 (537) hide show
  1. package/LICENSE-THIRD-PARTY +3399 -4104
  2. package/README.md +8 -8
  3. package/executors.json +9 -0
  4. package/generators.json +44 -5
  5. package/package.json +16 -12
  6. package/sdk/license.d.ts +8 -0
  7. package/sdk/license.js +13 -0
  8. package/sdk/license.js.map +1 -0
  9. package/src/connection/agent-runtime-config.d.ts +1 -1
  10. package/src/connection/agent-runtime-config.js.map +1 -1
  11. package/src/connection/agent-serve-local.d.ts +2 -2
  12. package/src/connection/agent-serve-local.js +1 -1
  13. package/src/connection/agent-serve-local.js.map +1 -1
  14. package/src/connection/generator.d.ts +5 -5
  15. package/src/connection/generator.js +58 -39
  16. package/src/connection/generator.js.map +1 -1
  17. package/src/connection/serve-local.d.ts +1 -1
  18. package/src/connection/serve-local.js +1 -1
  19. package/src/connection/serve-local.js.map +1 -1
  20. package/src/infra/app/__snapshots__/generator.spec.ts.snap +49 -60
  21. package/src/infra/app/files/app/src/main.ts.template +2 -2
  22. package/src/infra/app/generator.d.ts +3 -3
  23. package/src/infra/app/generator.js +25 -23
  24. package/src/infra/app/generator.js.map +1 -1
  25. package/src/infra/app/schema.d.ts +1 -1
  26. package/src/infra/app/schema.json +1 -1
  27. package/src/license/__snapshots__/config.spec.ts.snap +23 -0
  28. package/src/license/config-types.d.ts +18 -1
  29. package/src/license/config-types.js +4 -0
  30. package/src/license/config-types.js.map +1 -1
  31. package/src/license/config.d.ts +65 -7
  32. package/src/license/config.js +315 -7
  33. package/src/license/config.js.map +1 -1
  34. package/src/license/dependency-check/check.d.ts +16 -0
  35. package/src/license/dependency-check/check.js +111 -0
  36. package/src/license/dependency-check/check.js.map +1 -0
  37. package/src/license/dependency-check/collectors/collector.d.ts +21 -0
  38. package/src/license/dependency-check/collectors/collector.js +76 -0
  39. package/src/license/dependency-check/collectors/collector.js.map +1 -0
  40. package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
  41. package/src/license/dependency-check/collectors/npm-collector.js +75 -0
  42. package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
  43. package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
  44. package/src/license/dependency-check/collectors/python-collector.js +121 -0
  45. package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
  46. package/src/license/dependency-check/evaluator.d.ts +9 -0
  47. package/src/license/dependency-check/evaluator.js +122 -0
  48. package/src/license/dependency-check/evaluator.js.map +1 -0
  49. package/src/license/dependency-check/executor-schema.json +6 -0
  50. package/src/license/dependency-check/executor.d.ts +9 -0
  51. package/src/license/dependency-check/executor.js +43 -0
  52. package/src/license/dependency-check/executor.js.map +1 -0
  53. package/src/license/dependency-check/pre-approved.d.ts +6 -0
  54. package/src/license/dependency-check/pre-approved.js +1280 -0
  55. package/src/license/dependency-check/pre-approved.js.map +1 -0
  56. package/src/license/dependency-check/types.d.ts +45 -0
  57. package/src/license/dependency-check/types.js +7 -0
  58. package/src/license/dependency-check/types.js.map +1 -0
  59. package/src/license/generator.d.ts +3 -3
  60. package/src/license/generator.js +113 -14
  61. package/src/license/generator.js.map +1 -1
  62. package/src/license/index.d.ts +8 -0
  63. package/src/license/index.js +13 -0
  64. package/src/license/index.js.map +1 -0
  65. package/src/license/known-exceptions.d.ts +7 -0
  66. package/src/license/known-exceptions.js +33 -0
  67. package/src/license/known-exceptions.js.map +1 -0
  68. package/src/license/schema.d.ts +5 -0
  69. package/src/license/schema.json +6 -0
  70. package/src/license/sync/generator.d.ts +2 -2
  71. package/src/license/sync/generator.js +15 -15
  72. package/src/license/sync/generator.js.map +1 -1
  73. package/src/license/sync/project-file-sync.d.ts +3 -3
  74. package/src/license/sync/project-file-sync.js.map +1 -1
  75. package/src/mcp-server/generator-info.d.ts +5 -1
  76. package/src/mcp-server/generator-info.js +7 -7
  77. package/src/mcp-server/generator-info.js.map +1 -1
  78. package/src/mcp-server/guide-pipeline.d.ts +1 -1
  79. package/src/mcp-server/guide-pipeline.js +10 -12
  80. package/src/mcp-server/guide-pipeline.js.map +1 -1
  81. package/src/mcp-server/mdx-ast.js +4 -0
  82. package/src/mcp-server/mdx-ast.js.map +1 -1
  83. package/src/mcp-server/server.js +3 -3
  84. package/src/mcp-server/server.js.map +1 -1
  85. package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
  86. package/src/mcp-server/tools/create-workspace-command.js +5 -5
  87. package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
  88. package/src/mcp-server/tools/general-guidance.d.ts +2 -2
  89. package/src/mcp-server/tools/general-guidance.js +2 -2
  90. package/src/mcp-server/tools/general-guidance.js.map +1 -1
  91. package/src/mcp-server/tools/generator-guide.d.ts +2 -2
  92. package/src/mcp-server/tools/generator-guide.js +2 -2
  93. package/src/mcp-server/tools/generator-guide.js.map +1 -1
  94. package/src/mcp-server/tools/list-generators.d.ts +2 -2
  95. package/src/mcp-server/tools/list-generators.js +1 -1
  96. package/src/mcp-server/tools/list-generators.js.map +1 -1
  97. package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
  98. package/src/open-api/ts-client/generator.d.ts +3 -3
  99. package/src/open-api/ts-client/generator.js +2 -2
  100. package/src/open-api/ts-client/generator.js.map +1 -1
  101. package/src/open-api/ts-hooks/generator.d.ts +3 -3
  102. package/src/open-api/ts-hooks/generator.js +2 -2
  103. package/src/open-api/ts-hooks/generator.js.map +1 -1
  104. package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
  105. package/src/open-api/ts-metadata/generator.d.ts +3 -3
  106. package/src/open-api/ts-metadata/generator.js +1 -1
  107. package/src/open-api/ts-metadata/generator.js.map +1 -1
  108. package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
  109. package/src/open-api/utils/codegen-data/languages.js +4 -4
  110. package/src/open-api/utils/codegen-data/languages.js.map +1 -1
  111. package/src/open-api/utils/codegen-data.d.ts +6 -2
  112. package/src/open-api/utils/codegen-data.js +6 -6
  113. package/src/open-api/utils/codegen-data.js.map +1 -1
  114. package/src/open-api/utils/normalise.d.ts +5 -1
  115. package/src/open-api/utils/normalise.js +5 -5
  116. package/src/open-api/utils/normalise.js.map +1 -1
  117. package/src/open-api/utils/parse.d.ts +2 -2
  118. package/src/open-api/utils/parse.js +4 -0
  119. package/src/open-api/utils/parse.js.map +1 -1
  120. package/src/open-api/utils/refs.d.ts +1 -1
  121. package/src/preset/__snapshots__/generator.spec.ts.snap +128 -14
  122. package/src/preset/generator.d.ts +4 -4
  123. package/src/preset/generator.js +24 -19
  124. package/src/preset/generator.js.map +1 -1
  125. package/src/preset/schema.d.ts +7 -5
  126. package/src/preset/schema.json +9 -4
  127. package/src/py/agent/__snapshots__/generator.spec.ts.snap +10 -9
  128. package/src/py/agent/a2a-connection/generator.d.ts +3 -3
  129. package/src/py/agent/a2a-connection/generator.js +8 -7
  130. package/src/py/agent/a2a-connection/generator.js.map +1 -1
  131. package/src/py/agent/files/common/agent.py.template +2 -0
  132. package/src/py/agent/files/deploy/Dockerfile.template +3 -3
  133. package/src/py/agent/files/http/init.py.template +2 -2
  134. package/src/py/agent/files/http/main.py.template +0 -1
  135. package/src/py/agent/generator.d.ts +3 -3
  136. package/src/py/agent/generator.js +45 -39
  137. package/src/py/agent/generator.js.map +1 -1
  138. package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -0
  139. package/src/py/agent/mcp-connection/generator.d.ts +3 -3
  140. package/src/py/agent/mcp-connection/generator.js +5 -5
  141. package/src/py/agent/mcp-connection/generator.js.map +1 -1
  142. package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -3
  143. package/src/py/agent/react-connection/generator.d.ts +3 -3
  144. package/src/py/agent/react-connection/generator.js +8 -8
  145. package/src/py/agent/react-connection/generator.js.map +1 -1
  146. package/src/py/agent/react-connection/serve-local.d.ts +2 -2
  147. package/src/py/agent/react-connection/serve-local.js.map +1 -1
  148. package/src/py/agent/schema.d.ts +8 -8
  149. package/src/py/agent/schema.json +18 -18
  150. package/src/py/api/generator.d.ts +3 -3
  151. package/src/py/api/generator.js +2 -2
  152. package/src/py/api/generator.js.map +1 -1
  153. package/src/py/api/schema.d.ts +4 -6
  154. package/src/py/api/schema.json +15 -15
  155. package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
  156. package/src/py/fast-api/generator.d.ts +3 -3
  157. package/src/py/fast-api/generator.js +73 -55
  158. package/src/py/fast-api/generator.js.map +1 -1
  159. package/src/py/fast-api/react/generator.d.ts +3 -3
  160. package/src/py/fast-api/react/generator.js +3 -3
  161. package/src/py/fast-api/react/generator.js.map +1 -1
  162. package/src/py/fast-api/react/open-api.d.ts +1 -1
  163. package/src/py/fast-api/react/open-api.js +5 -2
  164. package/src/py/fast-api/react/open-api.js.map +1 -1
  165. package/src/py/fast-api/schema.d.ts +4 -6
  166. package/src/py/fast-api/schema.json +15 -15
  167. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  168. package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +6 -6
  169. package/src/py/lambda-function/generator.d.ts +3 -3
  170. package/src/py/lambda-function/generator.js +34 -31
  171. package/src/py/lambda-function/generator.js.map +1 -1
  172. package/src/py/lambda-function/schema.d.ts +7 -4
  173. package/src/py/lambda-function/schema.json +15 -7
  174. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
  175. package/src/py/mcp-server/generator.d.ts +3 -3
  176. package/src/py/mcp-server/generator.js +44 -37
  177. package/src/py/mcp-server/generator.js.map +1 -1
  178. package/src/py/mcp-server/schema.d.ts +5 -9
  179. package/src/py/mcp-server/schema.json +15 -15
  180. package/src/py/project/generator.d.ts +3 -3
  181. package/src/py/project/generator.js +88 -69
  182. package/src/py/project/generator.js.map +1 -1
  183. package/src/py/project/schema.d.ts +1 -1
  184. package/src/py/project/schema.json +2 -2
  185. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +18 -16
  186. package/src/smithy/project/files/build.Dockerfile.template +1 -0
  187. package/src/smithy/project/generator.d.ts +3 -3
  188. package/src/smithy/project/generator.js +31 -29
  189. package/src/smithy/project/generator.js.map +1 -1
  190. package/src/smithy/react-connection/generator.d.ts +3 -3
  191. package/src/smithy/react-connection/generator.js +4 -4
  192. package/src/smithy/react-connection/generator.js.map +1 -1
  193. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +12 -38
  194. package/src/smithy/ts/api/generator.d.ts +3 -3
  195. package/src/smithy/ts/api/generator.js +89 -66
  196. package/src/smithy/ts/api/generator.js.map +1 -1
  197. package/src/smithy/ts/api/schema.d.ts +4 -6
  198. package/src/smithy/ts/api/schema.json +15 -15
  199. package/src/terraform/project/generator.d.ts +3 -3
  200. package/src/terraform/project/generator.js +14 -9
  201. package/src/terraform/project/generator.js.map +1 -1
  202. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
  203. package/src/trpc/backend/files/src/client/index.ts.template +5 -5
  204. package/src/trpc/backend/files/src/handler.ts.template +2 -2
  205. package/src/trpc/backend/generator.d.ts +3 -3
  206. package/src/trpc/backend/generator.js +80 -61
  207. package/src/trpc/backend/generator.js.map +1 -1
  208. package/src/trpc/backend/schema.d.ts +5 -5
  209. package/src/trpc/backend/schema.json +15 -15
  210. package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
  211. package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +14 -14
  212. package/src/trpc/react/generator.d.ts +3 -3
  213. package/src/trpc/react/generator.js +11 -10
  214. package/src/trpc/react/generator.js.map +1 -1
  215. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -5
  216. package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
  217. package/src/ts/agent/a2a-connection/generator.js +9 -8
  218. package/src/ts/agent/a2a-connection/generator.js.map +1 -1
  219. package/src/ts/agent/files/common/agent.ts.template +6 -2
  220. package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
  221. package/src/ts/agent/generator.d.ts +3 -3
  222. package/src/ts/agent/generator.js +40 -35
  223. package/src/ts/agent/generator.js.map +1 -1
  224. package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -2
  225. package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
  226. package/src/ts/agent/mcp-connection/generator.js +6 -6
  227. package/src/ts/agent/mcp-connection/generator.js.map +1 -1
  228. package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +8 -8
  229. package/src/ts/agent/react-connection/generator.d.ts +3 -3
  230. package/src/ts/agent/react-connection/generator.js +15 -15
  231. package/src/ts/agent/react-connection/generator.js.map +1 -1
  232. package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
  233. package/src/ts/agent/react-connection/serve-local.js +2 -2
  234. package/src/ts/agent/schema.d.ts +8 -8
  235. package/src/ts/agent/schema.json +18 -18
  236. package/src/ts/api/generator.d.ts +3 -3
  237. package/src/ts/api/generator.js +10 -8
  238. package/src/ts/api/generator.js.map +1 -1
  239. package/src/ts/api/schema.d.ts +5 -4
  240. package/src/ts/api/schema.json +15 -15
  241. package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
  242. package/src/ts/astro-docs/generator.d.ts +3 -3
  243. package/src/ts/astro-docs/generator.js +14 -11
  244. package/src/ts/astro-docs/generator.js.map +1 -1
  245. package/src/ts/docs/generator.d.ts +3 -3
  246. package/src/ts/docs/generator.js.map +1 -1
  247. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1502 -0
  248. package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
  249. package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
  250. package/src/ts/dynamodb/agent-connection/generator.js +32 -0
  251. package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
  252. package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
  253. package/src/ts/dynamodb/agent-connection/schema.json +22 -0
  254. package/src/ts/dynamodb/files/scripts/create-local-table.ts.template +161 -0
  255. package/src/ts/dynamodb/files/scripts/start-container.ts.template +81 -0
  256. package/src/ts/dynamodb/files/src/client.ts.template +45 -0
  257. package/src/ts/dynamodb/files/src/constants.ts.template +9 -0
  258. package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
  259. package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
  260. package/src/ts/dynamodb/files/src/gsi.ts.template +14 -0
  261. package/src/ts/dynamodb/files/src/index.ts.template +11 -0
  262. package/src/ts/dynamodb/generator.d.ts +10 -0
  263. package/src/ts/dynamodb/generator.js +106 -0
  264. package/src/ts/dynamodb/generator.js.map +1 -0
  265. package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
  266. package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
  267. package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
  268. package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
  269. package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
  270. package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
  271. package/src/ts/dynamodb/schema.d.ts +14 -0
  272. package/src/ts/dynamodb/schema.json +52 -0
  273. package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
  274. package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
  275. package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
  276. package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
  277. package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
  278. package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
  279. package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
  280. package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
  281. package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
  282. package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
  283. package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
  284. package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
  285. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  286. package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +10 -10
  287. package/src/ts/lambda-function/generator.d.ts +3 -3
  288. package/src/ts/lambda-function/generator.js +41 -36
  289. package/src/ts/lambda-function/generator.js.map +1 -1
  290. package/src/ts/lambda-function/schema.d.ts +7 -4
  291. package/src/ts/lambda-function/schema.json +15 -7
  292. package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
  293. package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
  294. package/src/ts/lib/biome.d.ts +7 -0
  295. package/src/ts/lib/biome.js +58 -0
  296. package/src/ts/lib/biome.js.map +1 -0
  297. package/src/ts/lib/generator.d.ts +3 -3
  298. package/src/ts/lib/generator.js +27 -29
  299. package/src/ts/lib/generator.js.map +1 -1
  300. package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -1
  301. package/src/ts/lib/ts-project-utils.d.ts +12 -2
  302. package/src/ts/lib/ts-project-utils.js +30 -10
  303. package/src/ts/lib/ts-project-utils.js.map +1 -1
  304. package/src/ts/lib/vitest.d.ts +2 -2
  305. package/src/ts/lib/vitest.js +1 -1
  306. package/src/ts/lib/vitest.js.map +1 -1
  307. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
  308. package/src/ts/mcp-server/generator.d.ts +3 -3
  309. package/src/ts/mcp-server/generator.js +46 -24
  310. package/src/ts/mcp-server/generator.js.map +1 -1
  311. package/src/ts/mcp-server/schema.d.ts +5 -9
  312. package/src/ts/mcp-server/schema.json +15 -15
  313. package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +20 -15
  314. package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
  315. package/src/ts/nx-generator/generator.d.ts +2 -2
  316. package/src/ts/nx-generator/generator.js +23 -19
  317. package/src/ts/nx-generator/generator.js.map +1 -1
  318. package/src/ts/nx-plugin/generator.d.ts +3 -3
  319. package/src/ts/nx-plugin/generator.js +12 -11
  320. package/src/ts/nx-plugin/generator.js.map +1 -1
  321. package/src/ts/nx-plugin/utils.d.ts +1 -1
  322. package/src/ts/nx-plugin/utils.js +10 -4
  323. package/src/ts/nx-plugin/utils.js.map +1 -1
  324. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +120 -60
  325. package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
  326. package/src/ts/rdb/agent-connection/generator.js +4 -4
  327. package/src/ts/rdb/agent-connection/generator.js.map +1 -1
  328. package/src/ts/rdb/files/prisma.config.ts.template +1 -1
  329. package/src/ts/rdb/files/scripts/pull-image.ts.template +15 -0
  330. package/src/ts/rdb/files/scripts/{docker-start.ts.template → start-container.ts.template} +24 -24
  331. package/src/ts/rdb/files/scripts/wait-for-db.ts.template +3 -3
  332. package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
  333. package/src/ts/rdb/files/src/migration-handler.ts.template +2 -2
  334. package/src/ts/rdb/files/src/prisma.ts.template +2 -2
  335. package/src/ts/rdb/generator.d.ts +3 -3
  336. package/src/ts/rdb/generator.js +103 -82
  337. package/src/ts/rdb/generator.js.map +1 -1
  338. package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
  339. package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
  340. package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
  341. package/src/ts/rdb/schema.d.ts +5 -5
  342. package/src/ts/rdb/schema.json +13 -13
  343. package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
  344. package/src/ts/rdb/smithy-connection/generator.js +4 -4
  345. package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
  346. package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
  347. package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
  348. package/src/ts/rdb/trpc-connection/generator.js +3 -3
  349. package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
  350. package/src/ts/rdb/utils.d.ts +1 -1
  351. package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +9 -9
  352. package/src/ts/react-website/agui/generator.d.ts +3 -3
  353. package/src/ts/react-website/agui/generator.js +13 -13
  354. package/src/ts/react-website/agui/generator.js.map +1 -1
  355. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +423 -386
  356. package/src/ts/react-website/app/files/app/cloudscape/src/components/AppLayout/index.tsx.template +5 -5
  357. package/src/ts/react-website/app/files/app/cloudscape/src/main.tsx.template +1 -1
  358. package/src/ts/react-website/app/files/app/cloudscape/src/styles.css.template +1 -1
  359. package/src/ts/react-website/app/files/app/none/src/components/AppLayout/index.tsx.template +5 -5
  360. package/src/ts/react-website/app/files/app/none/src/main.tsx.template +1 -1
  361. package/src/ts/react-website/app/files/app/none/src/styles.css.template +2 -2
  362. package/src/ts/react-website/app/files/app/shadcn/src/components/AppLayout/index.tsx.template +6 -6
  363. package/src/ts/react-website/app/files/app/shadcn/src/main.tsx.template +1 -1
  364. package/src/ts/react-website/app/generator.d.ts +6 -6
  365. package/src/ts/react-website/app/generator.js +124 -114
  366. package/src/ts/react-website/app/generator.js.map +1 -1
  367. package/src/ts/react-website/app/schema.d.ts +9 -6
  368. package/src/ts/react-website/app/schema.json +13 -13
  369. package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
  370. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
  371. package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +3 -23
  372. package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
  373. package/src/ts/react-website/cognito-auth/generator.js +19 -22
  374. package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
  375. package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
  376. package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
  377. package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
  378. package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
  379. package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
  380. package/src/ts/react-website/cognito-auth/schema.d.ts +2 -2
  381. package/src/ts/react-website/cognito-auth/schema.json +4 -4
  382. package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
  383. package/src/ts/react-website/cognito-auth/utils.js +1 -1
  384. package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
  385. package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
  386. package/src/ts/react-website/runtime-config/generator.js +4 -4
  387. package/src/ts/react-website/runtime-config/generator.js.map +1 -1
  388. package/src/ts/sync/generator.d.ts +3 -3
  389. package/src/ts/sync/generator.js +2 -2
  390. package/src/ts/sync/generator.js.map +1 -1
  391. package/src/ts/website/app/generator.d.ts +3 -3
  392. package/src/ts/website/app/generator.js +1 -1
  393. package/src/ts/website/app/generator.js.map +1 -1
  394. package/src/ts/website/app/schema.d.ts +8 -6
  395. package/src/ts/website/app/schema.json +21 -13
  396. package/src/ts/website/auth/generator.d.ts +3 -3
  397. package/src/ts/website/auth/generator.js +2 -2
  398. package/src/ts/website/auth/generator.js.map +1 -1
  399. package/src/ts/website/auth/schema.d.ts +2 -2
  400. package/src/ts/website/auth/schema.json +4 -4
  401. package/src/utils/agent-connection/agent-connection.d.ts +1 -1
  402. package/src/utils/agent-connection/agent-connection.js +17 -11
  403. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  404. package/src/utils/agent-connection/files/core-runtime-config/model-errors.ts.template +36 -0
  405. package/src/utils/agent-connection/files/py-core-runtime-config/model_errors.py.template +40 -0
  406. package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +10 -10
  407. package/src/utils/agent-core-constructs/agent-core-constructs.js +14 -24
  408. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  409. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +13 -13
  410. package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
  411. package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
  412. package/src/utils/api-constructs/api-constructs.d.ts +4 -4
  413. package/src/utils/api-constructs/api-constructs.js +5 -7
  414. package/src/utils/api-constructs/api-constructs.js.map +1 -1
  415. package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +12 -12
  416. package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +12 -12
  417. package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +7 -7
  418. package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -10
  419. package/src/utils/api-constructs/open-api-metadata.d.ts +4 -4
  420. package/src/utils/api-constructs/open-api-metadata.js +2 -2
  421. package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
  422. package/src/utils/ast/website.d.ts +5 -1
  423. package/src/utils/ast/website.js +3 -3
  424. package/src/utils/ast/website.js.map +1 -1
  425. package/src/utils/ast.d.ts +33 -1
  426. package/src/utils/ast.js +89 -4
  427. package/src/utils/ast.js.map +1 -1
  428. package/src/utils/bundle/bundle.d.ts +1 -1
  429. package/src/utils/bundle/bundle.js +2 -2
  430. package/src/utils/bundle/bundle.js.map +1 -1
  431. package/src/utils/commands.d.ts +1 -1
  432. package/src/utils/commands.js +2 -2
  433. package/src/utils/commands.js.map +1 -1
  434. package/src/utils/config/__snapshots__/utils.spec.ts.snap +6 -6
  435. package/src/utils/config/index.d.ts +5 -5
  436. package/src/utils/config/utils.d.ts +13 -3
  437. package/src/utils/config/utils.js +37 -5
  438. package/src/utils/config/utils.js.map +1 -1
  439. package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
  440. package/src/utils/connection/open-api/react.d.ts +2 -2
  441. package/src/utils/connection/open-api/react.js +7 -7
  442. package/src/utils/connection/open-api/react.js.map +1 -1
  443. package/src/utils/containers.d.ts +6 -6
  444. package/src/utils/containers.js +6 -6
  445. package/src/utils/containers.js.map +1 -1
  446. package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
  447. package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
  448. package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
  449. package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +30 -0
  450. package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
  451. package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +65 -0
  452. package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
  453. package/src/utils/format.d.ts +45 -2
  454. package/src/utils/format.js +167 -46
  455. package/src/utils/format.js.map +1 -1
  456. package/src/utils/fs.d.ts +1 -1
  457. package/src/utils/fs.js.map +1 -1
  458. package/src/utils/function-constructs/files/cdk/app/lambda-functions/{__functionNameKebabCase__.ts.template → __nameKebabCase__.ts.template} +1 -1
  459. package/src/utils/function-constructs/files/terraform/app/lambda-functions/{__functionNameKebabCase__/__functionNameKebabCase__.tf.template → __nameKebabCase__/__nameKebabCase__.tf.template} +7 -7
  460. package/src/utils/function-constructs/function-constructs.d.ts +5 -5
  461. package/src/utils/function-constructs/function-constructs.js +6 -8
  462. package/src/utils/function-constructs/function-constructs.js.map +1 -1
  463. package/src/utils/generators.d.ts +4 -0
  464. package/src/utils/generators.js +4 -4
  465. package/src/utils/generators.js.map +1 -1
  466. package/src/utils/git.d.ts +1 -1
  467. package/src/utils/git.js.map +1 -1
  468. package/src/utils/iac-providers.d.ts +3 -3
  469. package/src/utils/iac-providers.js +1 -1
  470. package/src/utils/iac.d.ts +3 -3
  471. package/src/utils/iac.js +6 -6
  472. package/src/utils/iac.js.map +1 -1
  473. package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
  474. package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
  475. package/src/utils/identity-constructs/identity-constructs.d.ts +3 -3
  476. package/src/utils/identity-constructs/identity-constructs.js +4 -4
  477. package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
  478. package/src/utils/js.d.ts +4 -0
  479. package/src/utils/js.js +4 -4
  480. package/src/utils/js.js.map +1 -1
  481. package/src/utils/mcp.d.ts +25 -0
  482. package/src/utils/mcp.js +81 -0
  483. package/src/utils/mcp.js.map +1 -0
  484. package/src/utils/metrics.d.ts +9 -3
  485. package/src/utils/metrics.js +58 -28
  486. package/src/utils/metrics.js.map +1 -1
  487. package/src/utils/npm-scope.d.ts +1 -1
  488. package/src/utils/npm-scope.js.map +1 -1
  489. package/src/utils/nx.d.ts +7 -2
  490. package/src/utils/nx.js +46 -14
  491. package/src/utils/nx.js.map +1 -1
  492. package/src/utils/nxlv-python.d.ts +1 -1
  493. package/src/utils/paths.d.ts +1 -1
  494. package/src/utils/pnpm-workspace.d.ts +1 -1
  495. package/src/utils/pnpm-workspace.js.map +1 -1
  496. package/src/utils/port.d.ts +30 -3
  497. package/src/utils/port.js +72 -4
  498. package/src/utils/port.js.map +1 -1
  499. package/src/utils/py.d.ts +2 -2
  500. package/src/utils/py.js +13 -6
  501. package/src/utils/py.js.map +1 -1
  502. package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
  503. package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +18 -9
  504. package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -5
  505. package/src/utils/rdb-constructs/rdb-constructs.js +7 -17
  506. package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
  507. package/src/utils/shared-constructs.d.ts +3 -3
  508. package/src/utils/shared-constructs.js +10 -10
  509. package/src/utils/shared-constructs.js.map +1 -1
  510. package/src/utils/shared-infra-config.d.ts +1 -1
  511. package/src/utils/shared-infra-config.js +1 -1
  512. package/src/utils/shared-infra-config.js.map +1 -1
  513. package/src/utils/shared-scripts.d.ts +1 -1
  514. package/src/utils/shared-scripts.js +2 -2
  515. package/src/utils/shared-scripts.js.map +1 -1
  516. package/src/utils/shared-shadcn.d.ts +1 -1
  517. package/src/utils/shared-shadcn.js +1 -13
  518. package/src/utils/shared-shadcn.js.map +1 -1
  519. package/src/utils/test.d.ts +5 -1
  520. package/src/utils/test.js +9 -5
  521. package/src/utils/test.js.map +1 -1
  522. package/src/utils/toml.d.ts +1 -1
  523. package/src/utils/toml.js +4 -0
  524. package/src/utils/toml.js.map +1 -1
  525. package/src/utils/versions.d.ts +68 -72
  526. package/src/utils/versions.js +67 -71
  527. package/src/utils/versions.js.map +1 -1
  528. package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +52 -5
  529. package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +38 -11
  530. package/src/utils/website-constructs/website-constructs.d.ts +3 -3
  531. package/src/utils/website-constructs/website-constructs.js +5 -7
  532. package/src/utils/website-constructs/website-constructs.js.map +1 -1
  533. package/src/ts/lib/eslint.d.ts +0 -14
  534. package/src/ts/lib/eslint.js +0 -90
  535. package/src/ts/lib/eslint.js.map +0 -1
  536. package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
  537. /package/src/ts/{rdb/files/scripts/docker-pull.ts.template → dynamodb/files/scripts/pull-image.ts.template} +0 -0
@@ -13,14 +13,6 @@
13
13
  },
14
14
  "x-prompt": "What name would you like your API to have? i.e: MyApi"
15
15
  },
16
- "computeType": {
17
- "type": "string",
18
- "description": "The type of compute to use to deploy this API. Choose between ServerlessApiGatewayRestApi (default) or ServerlessApiGatewayHttpApi.",
19
- "default": "ServerlessApiGatewayRestApi",
20
- "enum": ["ServerlessApiGatewayRestApi", "ServerlessApiGatewayHttpApi"],
21
- "x-prompt": "What compute type would you like to deploy your API with?",
22
- "x-priority": "important"
23
- },
24
16
  "integrationPattern": {
25
17
  "type": "string",
26
18
  "description": "How API Gateway integrations are generated for the API. Choose between isolated (default) and shared.",
@@ -45,9 +37,9 @@
45
37
  },
46
38
  "auth": {
47
39
  "type": "string",
48
- "description": "The method used to authenticate with your API. Choose between IAM (default), Cognito or Custom.",
49
- "default": "IAM",
50
- "enum": ["IAM", "Cognito", "Custom"],
40
+ "description": "The method used to authenticate with your API. Choose between iam (default), cognito or custom.",
41
+ "default": "iam",
42
+ "enum": ["iam", "cognito", "custom"],
51
43
  "x-prompt": "How would you like users to authenticate with your API?",
52
44
  "x-priority": "important"
53
45
  },
@@ -64,13 +56,21 @@
64
56
  "description": "The sub directory the project is placed in. By default this is the project name.",
65
57
  "x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
66
58
  },
67
- "iacProvider": {
59
+ "iac": {
68
60
  "type": "string",
69
61
  "description": "The preferred IaC provider. By default this is inherited from your initial selection.",
70
- "enum": ["Inherit", "CDK", "Terraform"],
62
+ "enum": ["inherit", "cdk", "terraform"],
71
63
  "x-priority": "important",
72
- "default": "Inherit",
73
- "x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
64
+ "default": "inherit",
65
+ "x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
66
+ },
67
+ "infra": {
68
+ "type": "string",
69
+ "description": "The type of infrastructure to use to deploy this API.",
70
+ "default": "rest-lambda",
71
+ "enum": ["rest-lambda", "http-lambda", "none"],
72
+ "x-prompt": "What infrastructure would you like to deploy your API with?",
73
+ "x-priority": "important"
74
74
  }
75
75
  },
76
76
  "required": ["name"]
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`trpc react generator > REST API (ServerlessApiGatewayRestApi) > should generate REST API client provider with splitLink for Cognito auth > TestApiClientProvider-REST-Cognito.tsx 1`] = `
3
+ exports[`trpc react generator > REST API (rest-lambda) > should generate REST API client provider with splitLink for Cognito auth > TestApiClientProvider-REST-Cognito.tsx 1`] = `
4
4
  "import { AppRouter } from 'backend';
5
5
  import { useQueryClient } from '@tanstack/react-query';
6
6
  import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
@@ -77,7 +77,7 @@ export default TestApiClientProvider;
77
77
  "
78
78
  `;
79
79
 
80
- exports[`trpc react generator > REST API (ServerlessApiGatewayRestApi) > should generate REST API client provider with splitLink for Custom auth > TestApiClientProvider-REST-Custom.tsx 1`] = `
80
+ exports[`trpc react generator > REST API (rest-lambda) > should generate REST API client provider with splitLink for Custom auth > TestApiClientProvider-REST-Custom.tsx 1`] = `
81
81
  "import { AppRouter } from 'backend';
82
82
  import { useQueryClient } from '@tanstack/react-query';
83
83
  import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
@@ -147,7 +147,7 @@ export default TestApiClientProvider;
147
147
  "
148
148
  `;
149
149
 
150
- exports[`trpc react generator > REST API (ServerlessApiGatewayRestApi) > should generate REST API client provider with splitLink for IAM auth > TestApiClientProvider-REST-IAM.tsx 1`] = `
150
+ exports[`trpc react generator > REST API (rest-lambda) > should generate REST API client provider with splitLink for IAM auth > TestApiClientProvider-REST-IAM.tsx 1`] = `
151
151
  "import { AppRouter } from 'backend';
152
152
  import { useQueryClient } from '@tanstack/react-query';
153
153
  import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
@@ -9,9 +9,9 @@ import { EventSourcePolyfill } from "event-source-polyfill";
9
9
  <%_ } else { _%>
10
10
  import { HTTPLinkOptions, TRPCClient, createTRPCClient, httpLink } from "@trpc/client";
11
11
  <%_ } _%>
12
- <%_ if (auth === 'IAM') { _%>
12
+ <%_ if (auth === 'iam') { _%>
13
13
  import { useSigV4 } from "../hooks/useSigV4";
14
- <%_ } else if (auth === 'Cognito') { _%>
14
+ <%_ } else if (auth === 'cognito') { _%>
15
15
  import { useAuth } from "react-oidc-context";
16
16
  <%_ } _%>
17
17
 
@@ -28,9 +28,9 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
28
28
  const queryClient = useQueryClient();
29
29
  const runtimeConfig = useRuntimeConfig();
30
30
  const apiUrl = runtimeConfig.apis.<%= apiNameClassName %>;
31
- <%_ if (auth === 'IAM') { _%>
31
+ <%_ if (auth === 'iam') { _%>
32
32
  const sigv4Client = useSigV4();
33
- <%_ } else if (auth === 'Cognito') { _%>
33
+ <%_ } else if (auth === 'cognito') { _%>
34
34
  const auth = useAuth();
35
35
  const user = auth?.user;
36
36
  <%_ } _%>
@@ -45,7 +45,7 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
45
45
  url: apiUrl,
46
46
  EventSource: EventSourcePolyfill,
47
47
  eventSourceOptions: async ({ op }) => {
48
- <%_ if (auth === 'IAM') { _%>
48
+ <%_ if (auth === 'iam') { _%>
49
49
  const url =
50
50
  `${apiUrl.replace(/\/$/, '')}/${op.path}` +
51
51
  (op.input !== undefined
@@ -57,13 +57,13 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
57
57
  headers[k] = v;
58
58
  });
59
59
  return { headers };
60
- <%_ } else if (auth === 'Cognito') { _%>
60
+ <%_ } else if (auth === 'cognito') { _%>
61
61
  return {
62
62
  headers: {
63
63
  Authorization: `Bearer ${user?.id_token}`,
64
64
  },
65
65
  };
66
- <%_ } else if (auth === 'Custom') { _%>
66
+ <%_ } else if (auth === 'custom') { _%>
67
67
  // TODO: Add headers required by your custom authorizer
68
68
  return { headers: {} };
69
69
  <%_ } _%>
@@ -71,13 +71,13 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
71
71
  }),
72
72
  false: httpLink({
73
73
  url: apiUrl,
74
- <%_ if (auth === 'IAM') { _%>
74
+ <%_ if (auth === 'iam') { _%>
75
75
  fetch: sigv4Client.fetch,
76
- <%_ } else if (auth === 'Cognito') { _%>
76
+ <%_ } else if (auth === 'cognito') { _%>
77
77
  headers: {
78
78
  Authorization: `Bearer ${user?.id_token}`,
79
79
  },
80
- <%_ } else if (auth === 'Custom') { _%>
80
+ <%_ } else if (auth === 'custom') { _%>
81
81
  // TODO: Add headers required by your custom authorizer
82
82
  headers: {},
83
83
  <%_ } _%>
@@ -88,13 +88,13 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
88
88
  <%_ } else { _%>
89
89
  const linkOptions: HTTPLinkOptions<any> = {
90
90
  url: apiUrl,
91
- <%_ if (auth === 'IAM') { _%>
91
+ <%_ if (auth === 'iam') { _%>
92
92
  fetch: sigv4Client.fetch,
93
- <%_ } else if (auth === 'Cognito') { _%>
93
+ <%_ } else if (auth === 'cognito') { _%>
94
94
  headers: {
95
95
  Authorization: `Bearer ${user?.id_token}`,
96
96
  },
97
- <%_ } else if (auth === 'Custom') { _%>
97
+ <%_ } else if (auth === 'custom') { _%>
98
98
  // TODO: Add headers required by your custom authorizer
99
99
  headers: {},
100
100
  <%_ } _%>
@@ -111,7 +111,7 @@ export const <%= apiNameClassName %>ClientProvider: FC<PropsWithChildren> = ({
111
111
  });
112
112
 
113
113
  return { optionsProxy, client };
114
- }, [apiUrl, queryClient<% if (auth === 'IAM') { %>, sigv4Client<% } else if (auth === 'Cognito') { %>, user<% } %>]);
114
+ }, [apiUrl, queryClient<% if (auth === 'iam') { %>, sigv4Client<% } else if (auth === 'cognito') { %>, user<% } %>]);
115
115
 
116
116
  return (
117
117
  <<%= apiNameClassName %>TRPCContext.Provider value={container}>
@@ -2,9 +2,9 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { Tree } from '@nx/devkit';
6
- import { ReactGeneratorSchema } from './schema';
7
- import { NxGeneratorInfo } from '../../utils/nx';
5
+ import { type Tree } from '@nx/devkit';
6
+ import { type NxGeneratorInfo } from '../../utils/nx';
7
+ import type { ReactGeneratorSchema } from './schema';
8
8
  export declare const TRPC_REACT_GENERATOR_INFO: NxGeneratorInfo;
9
9
  export declare function reactGenerator(tree: Tree, options: ReactGeneratorSchema): Promise<() => void>;
10
10
  export default reactGenerator;
@@ -7,15 +7,15 @@ exports.reactGenerator = reactGenerator;
7
7
  * SPDX-License-Identifier: Apache-2.0
8
8
  */
9
9
  const devkit_1 = require("@nx/devkit");
10
+ const serve_local_1 = require("../../connection/serve-local");
10
11
  const generator_1 = require("../../ts/react-website/runtime-config/generator");
11
- const npm_scope_1 = require("../../utils/npm-scope");
12
- const versions_1 = require("../../utils/versions");
13
12
  const ast_1 = require("../../utils/ast");
14
- const names_1 = require("../../utils/names");
15
13
  const format_1 = require("../../utils/format");
16
- const nx_1 = require("../../utils/nx");
17
14
  const metrics_1 = require("../../utils/metrics");
18
- const serve_local_1 = require("../../connection/serve-local");
15
+ const names_1 = require("../../utils/names");
16
+ const npm_scope_1 = require("../../utils/npm-scope");
17
+ const nx_1 = require("../../utils/nx");
18
+ const versions_1 = require("../../utils/versions");
19
19
  exports.TRPC_REACT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
20
20
  async function reactGenerator(tree, options) {
21
21
  const frontendProjectConfig = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.frontendProjectName);
@@ -23,9 +23,10 @@ async function reactGenerator(tree, options) {
23
23
  /* eslint-disable @typescript-eslint/no-explicit-any */
24
24
  const metadata = backendProjectConfig.metadata;
25
25
  const apiName = metadata.apiName;
26
- const auth = metadata.auth ?? 'IAM';
26
+ const auth = (metadata.auth ?? 'iam').toLowerCase();
27
27
  const port = metadata.port ?? metadata.ports?.[0] ?? 2022;
28
- const isRestApi = metadata.computeType === 'ServerlessApiGatewayRestApi';
28
+ const rawInfra = (metadata.infra ?? metadata.computeType ?? '').toLowerCase();
29
+ const isRestApi = rawInfra === 'rest-lambda' || rawInfra === 'serverlessapigatewayrestapi';
29
30
  const apiNameClassName = (0, names_1.toClassName)(apiName);
30
31
  const backendProjectAlias = (0, npm_scope_1.toScopeAlias)(backendProjectConfig.name);
31
32
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), frontendProjectConfig.root, {
@@ -42,7 +43,7 @@ async function reactGenerator(tree, options) {
42
43
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../../utils/files/website/components/tanstack-query'), (0, devkit_1.joinPathFragments)(frontendProjectConfig.sourceRoot, 'components'), {}, {
43
44
  overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
44
45
  });
45
- if (auth === 'IAM') {
46
+ if (auth === 'iam') {
46
47
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../../utils/files/website/hooks/sigv4'), (0, devkit_1.joinPathFragments)(frontendProjectConfig.sourceRoot, 'hooks'), {}, {
47
48
  overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
48
49
  });
@@ -69,7 +70,7 @@ async function reactGenerator(tree, options) {
69
70
  '@tanstack/react-query',
70
71
  '@tanstack/react-query-devtools',
71
72
  ...(isRestApi ? ['event-source-polyfill'] : []),
72
- ...(auth === 'IAM'
73
+ ...(auth === 'iam'
73
74
  ? [
74
75
  'oidc-client-ts',
75
76
  'aws4fetch',
@@ -77,7 +78,7 @@ async function reactGenerator(tree, options) {
77
78
  'react-oidc-context',
78
79
  ]
79
80
  : []),
80
- ...(auth === 'Cognito' ? ['react-oidc-context'] : []),
81
+ ...(auth === 'cognito' ? ['react-oidc-context'] : []),
81
82
  ]), (0, versions_1.withVersions)([
82
83
  '@smithy/types',
83
84
  ...(isRestApi ? ['@types/event-source-polyfill'] : []),
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/trpc/react/generator.ts"],"names":[],"mappings":";;;AA8BA,wCA8IC;AA5KD;;;GAGG;AACH,uCAOoB;AAEpB,+EAAyF;AACzF,qDAAqD;AACrD,mDAAoD;AACpD,yCAA+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ACzB;QACE,GAAG,EAAE,oBAAoB,IAAI,GAAG;QAChC,OAAO;KACR,CACF,CAAC;IAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,cAAc;QACd,4BAA4B;QAC5B,uBAAuB;QACvB,gCAAgC;QAChC,GAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;QACxD,GAAI,CAAC,IAAI,KAAK,KAAK;YACjB,CAAC,CAAC;gBACE,gBAAgB;gBAChB,WAAW;gBACX,+CAA+C;gBAC/C,oBAAoB;aACrB;YACH,CAAC,CAAC,EAAE,CAAS;QACf,GAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;KAC/D,CAAC,EACF,IAAA,uBAAY,EAAC;QACX,eAAe;QACf,GAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;KAChE,CAAC,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,iCAAyB,CAAC,CAAC,CAAC;IAEzE,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/trpc/react/generator.ts"],"names":[],"mappings":";;;AA8BA,wCAgJC;AA9KD;;;GAGG;AACH,uCAOoB;AACpB,8DAAqE;AACrE,+EAAyF;AACzF,yCAA+D;AAC/D,+CAA0D;AAC1D,iDAAsE;AACtE,6CAAgD;AAChD,qDAAqD;AACrD,uCAIwB;AACxB,mDAAoD;AAGvC,QAAA,yBAAyB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ACzB,IAAI,EACJ,qBAAqB,CAAC,IAAI,EAC1B,oBAAoB,CAAC,IAAI,EACzB;QACE,GAAG,EAAE,oBAAoB,IAAI,GAAG;QAChC,OAAO;KACR,CACF,CAAC;IAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,cAAc;QACd,4BAA4B;QAC5B,uBAAuB;QACvB,gCAAgC;QAChC,GAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;QACxD,GAAI,CAAC,IAAI,KAAK,KAAK;YACjB,CAAC,CAAC;gBACE,gBAAgB;gBAChB,WAAW;gBACX,+CAA+C;gBAC/C,oBAAoB;aACrB;YACH,CAAC,CAAC,EAAE,CAAS;QACf,GAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;KAC/D,CAAC,EACF,IAAA,uBAAY,EAAC;QACX,eAAe;QACf,GAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAS;KAChE,CAAC,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,iCAAyB,CAAC,CAAC,CAAC;IAEzE,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,cAAc,CAAC"}
@@ -292,7 +292,7 @@ variable "server_protocol" {
292
292
  default = "HTTP"
293
293
  validation {
294
294
  condition = contains(["MCP", "HTTP", "A2A"], var.server_protocol)
295
- error_message = "Protocol type must be either 'MCP', 'HTTP', or 'A2A'."
295
+ error_message = "Protocol type must be either 'mcp', 'http', or 'a2a'."
296
296
  }
297
297
  }
298
298
 
@@ -629,6 +629,7 @@ output "agent_runtime_version" {
629
629
 
630
630
  exports[`ts#agent generator > should match snapshot for generated files > agent-agent.ts 1`] = `
631
631
  "import { Agent, tool } from '@strands-agents/sdk';
632
+ import { logModelErrors } from ':proj/agent-connection';
632
633
  import { z } from 'zod';
633
634
 
634
635
  const multiply = tool({
@@ -641,13 +642,16 @@ const multiply = tool({
641
642
  callback: ({ a, b }) => a * b,
642
643
  });
643
644
 
644
- export const getAgent = async () =>
645
- new Agent({
645
+ export const getAgent = async () => {
646
+ const agent = new Agent({
646
647
  systemPrompt: \`You are a mathematical wizard.
647
648
  Use your tools for mathematical tasks.
648
649
  Refer to tools as your 'spellbook'.\`,
649
650
  tools: [multiply],
650
651
  });
652
+ logModelErrors(agent);
653
+ return agent;
654
+ };
651
655
  "
652
656
  `;
653
657
 
@@ -728,7 +732,8 @@ export interface AgentCoreTrpcClientOptions {
728
732
  sessionId?: string;
729
733
  }
730
734
 
731
- export interface AgentCoreTrpcClientIamOptions extends AgentCoreTrpcClientOptions {
735
+ export interface AgentCoreTrpcClientIamOptions
736
+ extends AgentCoreTrpcClientOptions {
732
737
  /**
733
738
  * Optional AWS credential provider. If not provided, uses the default
734
739
  * credential provider chain from the AWS SDK.
@@ -736,7 +741,8 @@ export interface AgentCoreTrpcClientIamOptions extends AgentCoreTrpcClientOption
736
741
  credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
737
742
  }
738
743
 
739
- export interface AgentCoreTrpcClientJwtOptions extends AgentCoreTrpcClientOptions {
744
+ export interface AgentCoreTrpcClientJwtOptions
745
+ extends AgentCoreTrpcClientOptions {
740
746
  /**
741
747
  * A function which returns the JWT access token used to authenticate
742
748
  */
@@ -2,9 +2,9 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { GeneratorCallback, Tree } from '@nx/devkit';
6
- import { TsAgentA2aConnectionGeneratorSchema } from './schema';
7
- import { NxGeneratorInfo } from '../../../utils/nx';
5
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
6
+ import { type NxGeneratorInfo } from '../../../utils/nx';
7
+ import type { TsAgentA2aConnectionGeneratorSchema } from './schema';
8
8
  export declare const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
9
9
  export declare const tsAgentA2aConnectionGenerator: (tree: Tree, options: TsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
10
10
  export default tsAgentA2aConnectionGenerator;
@@ -6,14 +6,14 @@ exports.tsAgentA2aConnectionGenerator = exports.TS_AGENT_A2A_CONNECTION_GENERATO
6
6
  * SPDX-License-Identifier: Apache-2.0
7
7
  */
8
8
  const devkit_1 = require("@nx/devkit");
9
- const nx_1 = require("../../../utils/nx");
10
- const metrics_1 = require("../../../utils/metrics");
9
+ const agent_connection_1 = require("../../../utils/agent-connection/agent-connection");
10
+ const ast_1 = require("../../../utils/ast");
11
11
  const format_1 = require("../../../utils/format");
12
+ const metrics_1 = require("../../../utils/metrics");
12
13
  const names_1 = require("../../../utils/names");
13
- const versions_1 = require("../../../utils/versions");
14
14
  const npm_scope_1 = require("../../../utils/npm-scope");
15
- const ast_1 = require("../../../utils/ast");
16
- const agent_connection_1 = require("../../../utils/agent-connection/agent-connection");
15
+ const nx_1 = require("../../../utils/nx");
16
+ const versions_1 = require("../../../utils/versions");
17
17
  exports.TS_AGENT_A2A_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
18
18
  const tsAgentA2aConnectionGenerator = async (tree, options) => {
19
19
  const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
@@ -23,10 +23,11 @@ const tsAgentA2aConnectionGenerator = async (tree, options) => {
23
23
  if (!agentComponent || !targetAgentComponent) {
24
24
  throw new Error('Both sourceComponent and targetComponent must be provided for ts#agent -> a2a connections');
25
25
  }
26
- if (targetAgentComponent.protocol !== 'A2A') {
27
- throw new Error(`Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'HTTP'} protocol — only A2A agents can be connected as tools.`);
26
+ if ((targetAgentComponent.protocol ?? '').toLowerCase() !== 'a2a') {
27
+ throw new Error(`Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'http'} protocol — only A2A agents can be connected as tools.`);
28
28
  }
29
- if (targetAgentComponent.auth && targetAgentComponent.auth !== 'IAM') {
29
+ if (targetAgentComponent.auth &&
30
+ targetAgentComponent.auth.toLowerCase() !== 'iam') {
30
31
  throw new Error(`A2A agent connection currently only supports IAM authentication, but '${targetAgentComponent.name}' uses '${targetAgentComponent.auth}' authentication.`);
31
32
  }
32
33
  const targetAgentComponentName = targetAgentComponent.name ?? 'agent';
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/a2a-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,0CAK2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAiD;AACjD,sDAAuD;AACvD,wDAAuD;AACvD,4CAI4B;AAC5B,uFAI0D;AAE7C,QAAA,sCAAsC,GACjD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,6BAA6B,GAAG,KAAK,EAChD,IAAU,EACV,OAA4C,EAChB,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IAEF,MAAM,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAC/C,MAAM,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAErD,IAAI,CAAC,cAAc,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;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,CACvG,CAAC;QAEF,4DAA4D;QAC5D,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,aAAa,EACb,4CAA4C,WAAW,4EAA4E,WAAW,MAAM,CACrJ,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,2EAA2E;IAC3E,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,IAAI,OAAO,CAAC;IACjD,MAAM,oBAAoB,GAAG,GAAG,SAAS,cAAc,CAAC;IACxD,MAAM,0BAA0B,GAAG,GAAG,wBAAwB,cAAc,CAAC;IAE7E,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAClD,IAAA,sCAAiC,EAAC,aAAa,EAAE,oBAAoB,EAAE;YACrE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;QACH,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,sBAAsB;IACtB,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,aAAa;QACb,qBAAqB;QACrB,mCAAmC;QACnC,+BAA+B;QAC/B,WAAW;QACX,+BAA+B;QAC/B,KAAK;KACN,CAAC,EACF,EAAE,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,8CAAsC;KACvC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AApKW,QAAA,6BAA6B,iCAoKxC;AAEF,kBAAe,qCAA6B,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/a2a-connection/generator.ts"],"names":[],"mappings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YAC9B,MAAM,EAAE,0BAA0B;SACnC,CAAC,CAAC;QACH,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,sBAAsB;IACtB,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,aAAa;QACb,qBAAqB;QACrB,mCAAmC;QACnC,+BAA+B;QAC/B,WAAW;QACX,+BAA+B;QAC/B,KAAK;KACN,CAAC,EACF,EAAE,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,8CAAsC;KACvC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAvKW,QAAA,6BAA6B,iCAuKxC;AAEF,kBAAe,qCAA6B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Agent, tool } from '@strands-agents/sdk';
2
+ import { logModelErrors } from '<%- agentConnectionImport %>';
2
3
  import { z } from 'zod';
3
4
 
4
5
  const multiply = tool({
@@ -11,10 +12,13 @@ const multiply = tool({
11
12
  callback: ({ a, b }) => a * b,
12
13
  });
13
14
 
14
- export const getAgent = async () =>
15
- new Agent({
15
+ export const getAgent = async () => {
16
+ const agent = new Agent({
16
17
  systemPrompt: `You are a mathematical wizard.
17
18
  Use your tools for mathematical tasks.
18
19
  Refer to tools as your 'spellbook'.`,
19
20
  tools: [multiply],
20
21
  });
22
+ logModelErrors(agent);
23
+ return agent;
24
+ };
@@ -9,7 +9,7 @@ RUN npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation@<%- adotV
9
9
  # Copy bundled agent
10
10
  COPY index.js /app
11
11
 
12
- <%_ if (protocol === 'A2A') { _%>
12
+ <%_ if (protocol === 'a2a') { _%>
13
13
  EXPOSE 9000
14
14
  <%_ } else { _%>
15
15
  EXPOSE 8080
@@ -2,9 +2,9 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { GeneratorCallback, Tree } from '@nx/devkit';
6
- import { TsAgentGeneratorSchema } from './schema';
7
- import { NxGeneratorInfo } from '../../utils/nx';
5
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
6
+ import { type NxGeneratorInfo } from '../../utils/nx';
7
+ import type { TsAgentGeneratorSchema } from './schema';
8
8
  export declare const TS_AGENT_GENERATOR_INFO: NxGeneratorInfo;
9
9
  export declare const tsAgentGenerator: (tree: Tree, options: TsAgentGeneratorSchema) => Promise<GeneratorCallback>;
10
10
  export default tsAgentGenerator;
@@ -6,20 +6,21 @@ exports.tsAgentGenerator = exports.TS_AGENT_GENERATOR_INFO = void 0;
6
6
  * SPDX-License-Identifier: Apache-2.0
7
7
  */
8
8
  const devkit_1 = require("@nx/devkit");
9
- const nx_1 = require("../../utils/nx");
10
- const metrics_1 = require("../../utils/metrics");
9
+ const agent_connection_1 = require("../../utils/agent-connection/agent-connection");
10
+ const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent-core-constructs");
11
+ const bundle_1 = require("../../utils/bundle/bundle");
12
+ const containers_1 = require("../../utils/containers");
11
13
  const format_1 = require("../../utils/format");
14
+ const fs_1 = require("../../utils/fs");
15
+ const iac_1 = require("../../utils/iac");
16
+ const metrics_1 = require("../../utils/metrics");
12
17
  const names_1 = require("../../utils/names");
13
- const versions_1 = require("../../utils/versions");
14
18
  const npm_scope_1 = require("../../utils/npm-scope");
15
- const bundle_1 = require("../../utils/bundle/bundle");
16
- const iac_1 = require("../../utils/iac");
17
- const containers_1 = require("../../utils/containers");
18
- const shared_constructs_1 = require("../../utils/shared-constructs");
19
- const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent-core-constructs");
19
+ const nx_1 = require("../../utils/nx");
20
+ const object_1 = require("../../utils/object");
20
21
  const port_1 = require("../../utils/port");
21
- const fs_1 = require("../../utils/fs");
22
- const agent_connection_1 = require("../../utils/agent-connection/agent-connection");
22
+ const shared_constructs_1 = require("../../utils/shared-constructs");
23
+ const versions_1 = require("../../utils/versions");
23
24
  exports.TS_AGENT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
24
25
  const tsAgentGenerator = async (tree, options) => {
25
26
  const project = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.project);
@@ -34,12 +35,12 @@ const tsAgentGenerator = async (tree, options) => {
34
35
  const targetSourceDir = (0, devkit_1.joinPathFragments)(project.root, targetSourceDirRelativeToProjectRoot);
35
36
  const relativeSourceDir = targetSourceDir.replace(project.root + '/', './');
36
37
  const distDir = (0, devkit_1.joinPathFragments)('dist', project.root);
37
- const computeType = options.computeType ?? 'BedrockAgentCoreRuntime';
38
- const protocol = options.protocol ?? 'HTTP';
39
- if (computeType === 'None' && options.auth && options.auth !== 'IAM') {
40
- console.warn('Warning: auth is ignored when no compute type is configured (no infrastructure is generated)');
38
+ const infra = options.infra ?? 'agentcore';
39
+ const protocol = options.protocol ?? 'http';
40
+ if (infra === 'none' && options.auth && options.auth !== 'iam') {
41
+ console.warn('Warning: auth is ignored when no infrastructure is configured (no infrastructure is generated)');
41
42
  }
42
- const auth = options.auth ?? 'IAM';
43
+ const auth = options.auth ?? 'iam';
43
44
  // Ensure the shared agent-connection project exists so the server entry
44
45
  // point can import `runWithSessionId` and propagate the AgentCore session
45
46
  // ID to any downstream MCP / A2A clients a later connection generator
@@ -55,8 +56,8 @@ const tsAgentGenerator = async (tree, options) => {
55
56
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'common'), targetSourceDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
56
57
  // Generate protocol-specific files
57
58
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', protocol.toLowerCase()), targetSourceDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
58
- if (computeType === 'BedrockAgentCoreRuntime') {
59
- const containerEngine = await (0, containers_1.resolveContainerEngine)(tree, 'Inherit');
59
+ if (infra === 'agentcore') {
60
+ const containers = await (0, containers_1.resolveContainers)(tree, 'inherit');
60
61
  const dockerImageTag = `${(0, npm_scope_1.getNpmScope)(tree)}-${name}:latest`;
61
62
  // Add bundle target
62
63
  await (0, bundle_1.addTypeScriptBundleTarget)(tree, project, {
@@ -80,7 +81,7 @@ const tsAgentGenerator = async (tree, options) => {
80
81
  options: {
81
82
  commands: [
82
83
  fs.cp(`${targetSourceDir}/Dockerfile`, `${dockerOutputDir}/Dockerfile`),
83
- `${containerEngine} build --platform linux/arm64 -t ${dockerImageTag} ${dockerOutputDir}`,
84
+ `${containers} build --platform linux/arm64 -t ${dockerImageTag} ${dockerOutputDir}`,
84
85
  ],
85
86
  parallel: false,
86
87
  },
@@ -89,20 +90,20 @@ const tsAgentGenerator = async (tree, options) => {
89
90
  (0, nx_1.addDependencyToTargetIfNotPresent)(project, 'docker', dockerTargetName);
90
91
  (0, nx_1.addDependencyToTargetIfNotPresent)(project, 'build', 'docker');
91
92
  // Add shared constructs
92
- const iacProvider = await (0, iac_1.resolveIacProvider)(tree, options.iacProvider);
93
- await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iacProvider });
93
+ const iac = await (0, iac_1.resolveIac)(tree, options.iac);
94
+ await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iac });
94
95
  // AG-UI uses HTTP as the AgentCore protocol type (AG-UI is HTTP-based with SSE over POST).
95
- const infraProtocol = protocol === 'AG-UI' ? 'HTTP' : protocol;
96
+ const infraProtocol = protocol === 'ag-ui' ? 'http' : protocol;
96
97
  await (0, agent_core_constructs_1.addAgentInfra)(tree, {
97
98
  agentNameKebabCase: name,
98
99
  agentNameClassName,
99
100
  projectName: project.name,
100
101
  dockerImageTag,
101
102
  dockerOutputDir,
102
- iacProvider,
103
+ iac,
103
104
  auth,
104
105
  serverProtocol: infraProtocol,
105
- containerEngine,
106
+ containers,
106
107
  });
107
108
  }
108
109
  // Add dependencies
@@ -113,9 +114,9 @@ const tsAgentGenerator = async (tree, options) => {
113
114
  '@aws-sdk/client-appconfigdata',
114
115
  '@aws-lambda-powertools/parameters',
115
116
  '@modelcontextprotocol/sdk',
116
- ...(protocol === 'A2A'
117
+ ...(protocol === 'a2a'
117
118
  ? ['express', '@a2a-js/sdk']
118
- : protocol === 'AG-UI'
119
+ : protocol === 'ag-ui'
119
120
  ? [
120
121
  '@ag-ui/aws-strands',
121
122
  '@ag-ui/core',
@@ -134,18 +135,20 @@ const tsAgentGenerator = async (tree, options) => {
134
135
  'tsx',
135
136
  '@types/node',
136
137
  'agent-chat-cli',
137
- ...(protocol === 'A2A' || protocol === 'AG-UI'
138
+ ...(protocol === 'a2a' || protocol === 'ag-ui'
138
139
  ? ['@types/express', '@types/cors']
139
140
  : ['@types/ws', '@types/cors']),
140
141
  ]));
141
142
  // A2A servers use port 9000 as per the Strands A2A SDK default and AgentCore A2A contract.
142
143
  // HTTP and AG-UI agents use port 8081+ to avoid conflict with VS Code server on 8080.
143
- const localDevPortStart = protocol === 'A2A' ? 9000 : 8081;
144
- const localDevPort = (0, port_1.assignPort)(tree, project, localDevPortStart);
144
+ const localDevPortStart = protocol === 'a2a' ? 9000 : 8081;
145
+ const localDevPort = (0, port_1.assignPort)(tree, project, localDevPortStart, {
146
+ component: { info: exports.TS_AGENT_GENERATOR_INFO, name: agentTargetPrefix },
147
+ });
145
148
  // HTTP chat needs a tiny generated script to wrap the project's tRPC
146
149
  // WebSocket client in a `ChatAdapter`. A2A speaks the standard A2A
147
150
  // protocol, so we can run `agent-chat-cli` directly as a binary.
148
- if (protocol === 'HTTP') {
151
+ if (protocol === 'http') {
149
152
  const scriptsDir = (0, devkit_1.joinPathFragments)(project.root, 'scripts', agentTargetPrefix);
150
153
  const relativeAgentImport = `../../${targetSourceDirRelativeToProjectRoot}`;
151
154
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'scripts', 'http'), scriptsDir, {
@@ -155,19 +158,21 @@ const tsAgentGenerator = async (tree, options) => {
155
158
  relativeAgentImport,
156
159
  }, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
157
160
  }
158
- const chatUrl = protocol === 'HTTP'
161
+ const chatUrl = protocol === 'http'
159
162
  ? `ws://localhost:${localDevPort}/ws`
160
- : protocol === 'AG-UI'
163
+ : protocol === 'ag-ui'
161
164
  ? `http://localhost:${localDevPort}/invocations`
162
165
  : `http://localhost:${localDevPort}`;
163
- const chatCommand = protocol === 'HTTP'
166
+ const chatCommand = protocol === 'http'
164
167
  ? `tsx ./scripts/${agentTargetPrefix}/chat.ts`
165
- : protocol === 'AG-UI'
168
+ : protocol === 'ag-ui'
166
169
  ? `agent-chat-cli agui ${chatUrl}`
167
170
  : `agent-chat-cli a2a ${chatUrl}`;
168
171
  (0, devkit_1.updateProjectConfiguration)(tree, project.name, {
169
172
  ...project,
170
- targets: {
173
+ // Sort targets so their order is stable regardless of insertion order on
174
+ // first run vs re-run.
175
+ targets: (0, object_1.sortObjectKeys)({
171
176
  ...project.targets,
172
177
  [`${agentTargetPrefix}-serve`]: {
173
178
  executor: 'nx:run-commands',
@@ -203,7 +208,7 @@ const tsAgentGenerator = async (tree, options) => {
203
208
  },
204
209
  dependsOn: [`${agentTargetPrefix}-serve-local`],
205
210
  },
206
- },
211
+ }),
207
212
  });
208
213
  (0, nx_1.addComponentGeneratorMetadata)(tree, project.name, exports.TS_AGENT_GENERATOR_INFO, targetSourceDirRelativeToProjectRoot, agentTargetPrefix, { port: localDevPort, rc: agentNameClassName, auth, protocol });
209
214
  await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_AGENT_GENERATOR_INFO]);