@aws/nx-plugin-mcp 1.0.0-rc.9 → 1.0.0-rc.90

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 (200) hide show
  1. package/bin/aws-nx-mcp.js +14263 -13571
  2. package/docs/get_started/building-with-ai.mdx +116 -0
  3. package/docs/get_started/concepts.mdx +67 -0
  4. package/docs/get_started/existing-project.mdx +180 -0
  5. package/docs/get_started/graph-builder.mdx +39 -0
  6. package/docs/get_started/quick-start.mdx +277 -0
  7. package/docs/get_started/tutorials/contribute-generator.mdx +408 -0
  8. package/docs/get_started/tutorials/dungeon-game/1.mdx +1578 -0
  9. package/docs/get_started/tutorials/dungeon-game/2.mdx +245 -0
  10. package/docs/get_started/tutorials/dungeon-game/3.mdx +66 -0
  11. package/docs/get_started/tutorials/dungeon-game/4.mdx +164 -0
  12. package/docs/get_started/tutorials/dungeon-game/overview.mdx +145 -0
  13. package/docs/get_started/tutorials/dungeon-game/wrap-up.mdx +41 -0
  14. package/docs/get_started/upgrading.mdx +157 -0
  15. package/docs/guides/agentcore-gateway.mdx +490 -0
  16. package/docs/guides/agentcore-harness.mdx +312 -0
  17. package/docs/guides/astro-docs.mdx +8 -0
  18. package/docs/guides/connection/agentcore-gateway-agent.mdx +222 -0
  19. package/docs/guides/connection/agentcore-gateway-gateway.mdx +154 -0
  20. package/docs/guides/connection/agentcore-gateway-mcp.mdx +134 -0
  21. package/docs/guides/connection/py-agent-a2a.mdx +48 -16
  22. package/docs/guides/connection/py-agent-dynamodb.mdx +115 -0
  23. package/docs/guides/connection/py-agent-gateway.mdx +182 -0
  24. package/docs/guides/connection/py-agent-mcp.mdx +43 -14
  25. package/docs/guides/connection/py-agent-rdb.mdx +169 -0
  26. package/docs/guides/connection/py-fast-api-dynamodb.mdx +56 -0
  27. package/docs/guides/connection/py-fast-api-rdb.mdx +175 -0
  28. package/docs/guides/connection/py-mcp-server-dynamodb.mdx +115 -0
  29. package/docs/guides/connection/py-mcp-server-rdb.mdx +178 -0
  30. package/docs/guides/connection/react-agentcore-gateway.mdx +112 -0
  31. package/docs/guides/connection/react-agui.mdx +33 -14
  32. package/docs/guides/connection/react-fastapi.mdx +39 -3
  33. package/docs/guides/connection/react-py-agent.mdx +10 -16
  34. package/docs/guides/connection/react-smithy.mdx +4 -4
  35. package/docs/guides/connection/react-trpc.mdx +1 -1
  36. package/docs/guides/connection/react-ts-agent.mdx +9 -9
  37. package/docs/guides/connection/smithy-dynamodb.mdx +5 -5
  38. package/docs/guides/connection/smithy-rdb.mdx +9 -9
  39. package/docs/guides/connection/trpc-dynamodb.mdx +4 -4
  40. package/docs/guides/connection/trpc-rdb.mdx +5 -5
  41. package/docs/guides/connection/ts-agent-a2a.mdx +14 -11
  42. package/docs/guides/connection/ts-agent-dynamodb.mdx +35 -36
  43. package/docs/guides/connection/ts-agent-gateway.mdx +147 -0
  44. package/docs/guides/connection/ts-agent-mcp.mdx +12 -9
  45. package/docs/guides/connection/ts-agent-rdb.mdx +61 -25
  46. package/docs/guides/connection/ts-mcp-server-dynamodb.mdx +35 -36
  47. package/docs/guides/connection/ts-mcp-server-rdb.mdx +59 -18
  48. package/docs/guides/connection.mdx +122 -5
  49. package/docs/guides/docker-bundling.mdx +82 -14
  50. package/docs/guides/fastapi.mdx +253 -12
  51. package/docs/guides/local-development.mdx +87 -0
  52. package/docs/guides/nx-generator.mdx +4 -3
  53. package/docs/guides/nx-migration.mdx +165 -0
  54. package/docs/guides/py-agent.mdx +332 -55
  55. package/docs/guides/py-dynamodb.mdx +476 -0
  56. package/docs/guides/py-mcp-server.mdx +57 -2
  57. package/docs/guides/py-rdb.mdx +269 -0
  58. package/docs/guides/python-lambda-function.mdx +1 -1
  59. package/docs/guides/python-project.mdx +31 -0
  60. package/docs/guides/react-website-auth.mdx +104 -5
  61. package/docs/guides/react-website.mdx +409 -95
  62. package/docs/guides/runtime-config.mdx +17 -4
  63. package/docs/guides/security.mdx +75 -0
  64. package/docs/guides/smithy-project.mdx +167 -0
  65. package/docs/guides/terraform-project.mdx +119 -8
  66. package/docs/guides/trpc.mdx +55 -14
  67. package/docs/guides/ts-agent.mdx +207 -23
  68. package/docs/guides/ts-dcr-proxy.mdx +569 -0
  69. package/docs/guides/ts-dynamodb.mdx +66 -242
  70. package/docs/guides/ts-lambda-function.mdx +1 -1
  71. package/docs/guides/ts-mcp-server.mdx +111 -29
  72. package/docs/guides/ts-nx-plugin.mdx +4 -4
  73. package/docs/guides/ts-rdb.mdx +116 -466
  74. package/docs/guides/ts-smithy-api.mdx +260 -16
  75. package/docs/guides/typescript-infrastructure.mdx +79 -25
  76. package/docs/guides/typescript-project.mdx +157 -24
  77. package/docs/guides/workspace.mdx +31 -2
  78. package/docs/snippets/agent/architecture.mdx +1 -1
  79. package/docs/snippets/agent/bedrock-deployment.mdx +9 -5
  80. package/docs/snippets/agent/runtime-arn.mdx +23 -2
  81. package/docs/snippets/agent/securing-your-agent.mdx +39 -0
  82. package/docs/snippets/api/access-logging.mdx +38 -0
  83. package/docs/snippets/api/cors-configuration-cdk-note.mdx +1 -1
  84. package/docs/snippets/api/cors-configuration-terraform-note.mdx +1 -1
  85. package/docs/snippets/api/type-safe-api-integrations.mdx +218 -373
  86. package/docs/snippets/api/waf-configuration.mdx +3 -3
  87. package/docs/snippets/connection/a2a-infrastructure.mdx +1 -1
  88. package/docs/snippets/connection/dynamodb-local-development.mdx +2 -2
  89. package/docs/snippets/connection/lambda-dynamodb-access.mdx +2 -2
  90. package/docs/snippets/connection/py-dynamodb-local-development.mdx +7 -0
  91. package/docs/snippets/connection/py-lambda-rdb-ssl-requirements.mdx +7 -0
  92. package/docs/snippets/connection/rdb-api-infrastructure.mdx +42 -19
  93. package/docs/snippets/dynamodb/deploying-table.mdx +176 -0
  94. package/docs/snippets/dynamodb/encryption-options.mdx +168 -0
  95. package/docs/snippets/dynamodb/gsi-config.mdx +38 -0
  96. package/docs/snippets/dynamodb/infrastructure.mdx +33 -0
  97. package/docs/snippets/dynamodb/local-dev-start.mdx +13 -0
  98. package/docs/snippets/dynamodb/local-dev-windows.mdx +15 -0
  99. package/docs/snippets/experimental-generator.mdx +8 -0
  100. package/docs/snippets/lambda-function/deploying-your-function.mdx +3 -3
  101. package/docs/snippets/mcp/architecture.mdx +1 -1
  102. package/docs/snippets/mcp/bedrock-deployment.mdx +9 -5
  103. package/docs/snippets/mcp/config.mdx +3 -2
  104. package/docs/snippets/mcp/shared-constructs.mdx +4 -5
  105. package/docs/snippets/pdk-migration/example/01-migrate-api.mdx +7 -5
  106. package/docs/snippets/pdk-migration/example/02-migrate-website.mdx +29 -10
  107. package/docs/snippets/pdk-migration/example/03-migrate-infra.mdx +4 -4
  108. package/docs/snippets/pdk-migration/faq/type-safe-api.mdx +5 -111
  109. package/docs/snippets/prerequisites.mdx +1 -4
  110. package/docs/snippets/rdb/admin-credentials.mdx +42 -0
  111. package/docs/snippets/rdb/architecture.mdx +39 -0
  112. package/docs/snippets/rdb/cluster-instances.mdx +31 -0
  113. package/docs/snippets/rdb/deletion-protection.mdx +64 -0
  114. package/docs/snippets/rdb/deploying.mdx +178 -0
  115. package/docs/snippets/rdb/encryption-key-rotation.mdx +30 -0
  116. package/docs/snippets/rdb/engine-version.mdx +63 -0
  117. package/docs/snippets/rdb/infrastructure.mdx +35 -0
  118. package/docs/snippets/rdb/logging-mysql.mdx +5 -0
  119. package/docs/snippets/rdb/logging-postgres.mdx +5 -0
  120. package/docs/snippets/rdb/performance-insights.mdx +36 -0
  121. package/docs/snippets/rdb/rds-proxy.mdx +50 -0
  122. package/docs/snippets/rdb/removal-policy.mdx +57 -0
  123. package/docs/snippets/rdb/serverless-capacity.mdx +32 -0
  124. package/docs/snippets/recommended-prerequisites.mdx +10 -0
  125. package/docs/snippets/required-prerequisites.mdx +1 -4
  126. package/docs/snippets/runtime-config-app-id-note.mdx +8 -0
  127. package/docs/snippets/shared-constructs.mdx +1 -1
  128. package/docs/snippets/trivy-image-scan.mdx +37 -0
  129. package/generators.json +170 -10
  130. package/package.json +1 -1
  131. package/src/agentcore-gateway/agent-connection/schema.json +31 -0
  132. package/src/agentcore-gateway/gateway-connection/schema.json +31 -0
  133. package/src/agentcore-gateway/mcp-connection/schema.json +31 -0
  134. package/src/agentcore-gateway/react-connection/schema.json +31 -0
  135. package/src/agentcore-gateway/schema.json +72 -0
  136. package/src/agentcore-harness/schema.json +53 -0
  137. package/src/connection/schema.json +5 -0
  138. package/src/infra/app/schema.json +5 -0
  139. package/src/init/schema.json +35 -0
  140. package/src/internal/test-matrix/schema.json +21 -0
  141. package/src/license/schema.json +5 -0
  142. package/src/open-api/json-metadata/schema.json +20 -0
  143. package/src/preset/schema.json +16 -5
  144. package/src/py/agent/a2a-connection/schema.json +5 -0
  145. package/src/py/agent/gateway-connection/schema.json +31 -0
  146. package/src/py/agent/mcp-connection/schema.json +5 -0
  147. package/src/py/agent/react-connection/schema.json +5 -0
  148. package/src/py/agent/schema.json +15 -1
  149. package/src/py/api/schema.json +5 -0
  150. package/src/py/dynamodb/agent-connection/schema.json +27 -0
  151. package/src/py/dynamodb/fast-api-connection/schema.json +23 -0
  152. package/src/py/dynamodb/mcp-server-connection/schema.json +27 -0
  153. package/src/py/dynamodb/schema.json +76 -0
  154. package/src/py/fast-api/react/schema.json +5 -0
  155. package/src/py/fast-api/schema.json +6 -0
  156. package/src/py/lambda-function/schema.json +6 -1
  157. package/src/py/mcp-server/schema.json +6 -0
  158. package/src/py/project/schema.json +6 -0
  159. package/src/py/rdb/agent-connection/schema.json +27 -0
  160. package/src/py/rdb/fast-api-connection/schema.json +23 -0
  161. package/src/py/rdb/mcp-server-connection/schema.json +27 -0
  162. package/src/py/rdb/schema.json +78 -0
  163. package/src/smithy/project/schema.json +28 -1
  164. package/src/smithy/react-connection/schema.json +5 -0
  165. package/src/smithy/ts/api/schema.json +6 -0
  166. package/src/terraform/project/schema.json +5 -0
  167. package/src/trpc/backend/schema.json +6 -0
  168. package/src/trpc/react/schema.json +5 -0
  169. package/src/ts/agent/a2a-connection/schema.json +5 -0
  170. package/src/ts/agent/gateway-connection/schema.json +31 -0
  171. package/src/ts/agent/mcp-connection/schema.json +5 -0
  172. package/src/ts/agent/react-connection/schema.json +5 -0
  173. package/src/ts/agent/schema.json +14 -0
  174. package/src/ts/api/schema.json +5 -0
  175. package/src/ts/astro-docs/schema.json +3 -3
  176. package/src/ts/dcr-proxy/schema.json +44 -0
  177. package/src/ts/docs/schema.json +3 -3
  178. package/src/ts/dynamodb/agent-connection/schema.json +5 -0
  179. package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
  180. package/src/ts/dynamodb/schema.json +26 -2
  181. package/src/ts/dynamodb/smithy-connection/schema.json +5 -0
  182. package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
  183. package/src/ts/lambda-function/schema.json +5 -0
  184. package/src/ts/lib/schema.json +5 -0
  185. package/src/ts/mcp-server/schema.json +6 -0
  186. package/src/ts/nx-generator/schema.json +5 -0
  187. package/src/ts/nx-migration/schema.json +63 -0
  188. package/src/ts/nx-plugin/schema.json +5 -0
  189. package/src/ts/rdb/agent-connection/schema.json +5 -0
  190. package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
  191. package/src/ts/rdb/schema.json +7 -1
  192. package/src/ts/rdb/smithy-connection/schema.json +5 -0
  193. package/src/ts/rdb/trpc-connection/schema.json +5 -0
  194. package/src/ts/react-website/app/schema.json +12 -6
  195. package/src/ts/react-website/cognito-auth/schema.json +5 -0
  196. package/src/ts/react-website/runtime-config/schema.json +5 -0
  197. package/src/ts/website/app/schema.json +11 -6
  198. package/src/ts/website/auth/schema.json +5 -0
  199. /package/docs/snippets/connection/{lambda-rdb-ssl-requirements.mdx → ts-lambda-rdb-ssl-requirements.mdx} +0 -0
  200. /package/docs/snippets/connection/{mcp-server-rdb-ssl-requirements.mdx → ts-mcp-server-rdb-ssl-requirements.mdx} +0 -0
@@ -2,7 +2,7 @@
2
2
  title: React to AG-UI Agent
3
3
  description: Connect a React website to an Agent via the AG-UI protocol using CopilotKit
4
4
  when:
5
- sourceType: react
5
+ sourceType: ts#react-website
6
6
  targetType:
7
7
  - ts#agent
8
8
  - py#agent
@@ -22,7 +22,7 @@ Nx Plugin for AWS provides a generator to connect a React website to an Agent th
22
22
  Before using this generator, ensure you have:
23
23
 
24
24
  1. A React website (generated using the <Link path="guides/react-website">`ts#website` generator</Link>)
25
- 2. A TypeScript or Python Agent with `protocol=AG-UI` (generated using the <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link> generator)
25
+ 2. A TypeScript or Python Agent with `protocol=ag-ui` (generated using the <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link> generator)
26
26
  3. For deployed agents, Cognito Auth added via the <Link path="/guides/react-website-auth">`ts#website#auth` generator</Link>
27
27
 
28
28
  ## Usage
@@ -47,8 +47,8 @@ The generator creates a **single shared** `AguiProvider` component, one hook per
47
47
  - components
48
48
  - AguiProvider.tsx Single `CopilotKitProvider` for every AG-UI agent. Created on the first `connection` run and updated on subsequent runs to register each new agent.
49
49
  - copilot
50
- - index.tsx Re-exports `CopilotChat`, `CopilotSidebar` and `CopilotPopup` with slot defaults that match your website's `uxProvider` (Cloudscape, Shadcn, or no theme at all).
51
- - *ThemeComponents*.tsx Per-slot theme components (e.g. `CloudscapeAssistantMessage.tsx`, `ShadcnChatInput.tsx`). Only vended when `uxProvider` is `Cloudscape` or `Shadcn`.
50
+ - index.tsx Re-exports `CopilotChat`, `CopilotSidebar` and `CopilotPopup` with slot defaults that match your website's `ux` (Cloudscape, Shadcn, or no theme at all).
51
+ - *ThemeComponents*.tsx Per-slot theme components (e.g. `CloudscapeAssistantMessage.tsx`, `ShadcnChatInput.tsx`). Only vended when `ux` is `cloudscape` or `shadcn`.
52
52
  - hooks
53
53
  - useAgui\<AgentName>.tsx Registers one AG-UI agent. One file per `connection` run.
54
54
  - useSigV4.tsx SigV4 signing (IAM only)
@@ -71,7 +71,7 @@ The following dependencies are added to the root `package.json`:
71
71
  Each `useAgui<AgentName>` hook reads its agent's runtime value from <Link path="guides/runtime-config">Runtime Configuration</Link> and instantiates an `@ag-ui/client` `HttpAgent`:
72
72
 
73
73
  - **Deployed**: the runtime value is a Bedrock AgentCore Runtime ARN, which is converted to the AgentCore HTTPS endpoint: `https://bedrock-agentcore.<region>.amazonaws.com/runtimes/<encoded-arn>/invocations?qualifier=DEFAULT`
74
- - **Local development**: `serve-local` overrides the value to the agent's local URL (e.g. `http://localhost:8081`)
74
+ - **Local development**: `dev` overrides the value to the agent's local URL (e.g. `http://localhost:8081`)
75
75
 
76
76
  The shared `AguiProvider` calls every generated hook and spreads each one into `selfManagedAgents` on a single `CopilotKitProvider`, which exposes them all to CopilotKit components.
77
77
 
@@ -92,6 +92,25 @@ The generated code handles authentication depending on your agent's configuratio
92
92
  - **IAM** (default): uses AWS SigV4-signed HTTP requests. Credentials are obtained from the Cognito Identity Pool configured with your website's auth.
93
93
  - **Cognito**: embeds the JWT access token in the `Authorization` header as a Bearer token.
94
94
 
95
+ ### Sessions and Threads
96
+
97
+ AG-UI and AgentCore Runtime each identify a conversation differently, and the generated hook ties them together:
98
+
99
+ - **`threadId`** — the AG-UI conversation identifier, sent in the request body. CopilotKit generates a random UUID per chat unless you pass an explicit `threadId`.
100
+ - **Session ID** — the AgentCore Runtime session, sent in the `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id` header. It selects the [microVM](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-how-it-works.html) serving the request, and is what your agent's `session.ts` / `session.py` keys conversation state on.
101
+
102
+ The hook derives the session ID from the thread ID, right-padding it to the 33 characters AgentCore Runtime requires:
103
+
104
+ ```ts
105
+ function agentCoreSessionId(input: RunAgentInput): string {
106
+ return (input.threadId ?? '').padEnd(33, '0');
107
+ }
108
+ ```
109
+
110
+ Leaving `threadId` unset is simplest — CopilotKit's generated UUID is already 36 characters. If you pass one explicitly, make it at least 33 characters, since padding maps thread IDs that differ only in trailing characters onto the same session.
111
+
112
+ Both Session ID and Thread ID are provided by the browser. To restrict each user to their own conversations, refer to the <Link path="guides/py-agent">`py#agent`</Link> or <Link path="guides/ts-agent">`ts#agent`</Link> guide.
113
+
95
114
  ## Infrastructure
96
115
 
97
116
  <Snippet name="connection/react-agent-infrastructure" parentHeading="Infrastructure" />
@@ -102,7 +121,7 @@ The generated code handles authentication depending on your agent's configuratio
102
121
 
103
122
  Instantiate CopilotKit components with `agentId` to select which agent to use. The id is the agent's name — the same one you chose when you ran the <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link> generator — and you can also find it in the generated hook file (e.g. the key returned from `packages/web/src/hooks/useAgui<AgentName>.tsx`).
104
123
 
105
- Import the chat components from the generated `./components/copilot` module so the theme that matches your website's `uxProvider` is applied automatically:
124
+ Import the chat components from the generated `./components/copilot` module so the theme that matches your website's `ux` is applied automatically:
106
125
 
107
126
  ```tsx
108
127
  import { CopilotChat } from './components/copilot';
@@ -137,13 +156,13 @@ import { CopilotChat } from './components/copilot';
137
156
 
138
157
  ### Built-in Themes
139
158
 
140
- The generator reads `metadata.uxProvider` from your React website project and vends a themed wrapper module at `src/components/copilot/index.tsx` so the chat components match the rest of your UI without any extra configuration:
159
+ The generator reads `metadata.ux` from your React website project and vends a themed wrapper module at `src/components/copilot/index.tsx` so the chat components match the rest of your UI without any extra configuration:
141
160
 
142
- | `uxProvider` | Styling applied to `CopilotChat` / `CopilotSidebar` / `CopilotPopup` |
161
+ | `ux` | Styling applied to `CopilotChat` / `CopilotSidebar` / `CopilotPopup` |
143
162
  | ------------ | -------------------------------------------------------------------- |
144
- | `Cloudscape` | Messages render inside Cloudscape `ChatBubble`s with gen-AI `Avatar`s (matching the [Cloudscape generative AI chat pattern](https://cloudscape.design/patterns/genai/generative-AI-chat/)); the typing indicator becomes a `LoadingBar` and the input is a `PromptInput`. Built from `@cloudscape-design/components` and `@cloudscape-design/chat-components`. |
145
- | `Shadcn` | Assistant messages render in a `bg-muted` bubble with a `Sparkles` avatar; user messages render right-aligned in a `bg-primary` bubble with a `User` avatar. The input is a rounded `Textarea` + pill-shaped send/stop `Button` (Enter submits, Shift+Enter newlines). Uses shadcn primitives from the shared `common-shadcn` package. |
146
- | `None` (or anything else) | No theme — the module just re-exports the default CopilotKit components. |
163
+ | `cloudscape` | Messages render inside Cloudscape `ChatBubble`s with gen-AI `Avatar`s (matching the [Cloudscape generative AI chat pattern](https://cloudscape.design/patterns/genai/generative-AI-chat/)); the typing indicator becomes a `LoadingBar` and the input is a `PromptInput`. Built from `@cloudscape-design/components` and `@cloudscape-design/chat-components`. |
164
+ | `shadcn` | Assistant messages render in a `bg-muted` bubble with a `Sparkles` avatar; user messages render right-aligned in a `bg-primary` bubble with a `User` avatar. The input is a rounded `Textarea` + pill-shaped send/stop `Button` (Enter submits, Shift+Enter newlines). Uses shadcn primitives from the shared `common-shadcn` package. |
165
+ | `none` (or anything else) | No theme — the module just re-exports the default CopilotKit components. |
147
166
 
148
167
  Import the themed components from the **local theme module** (not `@copilotkit/react-core/v2` directly) so the theme is applied automatically:
149
168
 
@@ -218,13 +237,13 @@ Deeper overrides follow the same shape — e.g. replace just the copy button on
218
237
 
219
238
  ## Local Development
220
239
 
221
- The connection generator automatically configures `serve-local` integration:
240
+ The connection generator automatically configures `dev` integration:
222
241
 
223
- 1. Running `nx serve-local <website>` will also start the agent's local server
242
+ 1. Running `nx dev <website>` will also start the agent's local server
224
243
  2. The runtime config is overridden to point to the local AG-UI URL (e.g. `http://localhost:8081`)
225
244
  3. Both the website and the agent hot-reload together
226
245
 
227
- <NxCommands commands={['serve-local <WebsiteProject>']} />
246
+ <NxCommands commands={['dev <WebsiteProject>']} />
228
247
 
229
248
  :::tip[Hot Reloading]
230
249
  The website and connected agent hot-reload together, enabling you to quickly iterate on both sides without deploying to AWS.
@@ -2,7 +2,7 @@
2
2
  title: React to FastAPI
3
3
  description: Connect a React website to a Python FastAPI
4
4
  when:
5
- sourceType: react
5
+ sourceType: ts#react-website
6
6
  targetType: py#fast-api
7
7
  ---
8
8
 
@@ -115,9 +115,9 @@ Whenever you make changes to your FastAPI, you need to rebuild your project in o
115
115
  :::
116
116
 
117
117
  :::tip[Auto-Regeneration]
118
- If you're actively working on both your React application and FastAPI together, use the React application's `serve-local` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local FastAPI server:
118
+ If you're actively working on both your React application and FastAPI together, use the React application's `dev` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local FastAPI server:
119
119
 
120
- <NxCommands commands={['serve-local <WebsiteProject>']} />
120
+ <NxCommands commands={['dev <WebsiteProject>']} />
121
121
 
122
122
  For more fine-grained control, you can use the `watch-generate:<ApiName>-client` target for your React application to regenerate the client every time you make API changes:
123
123
 
@@ -312,6 +312,42 @@ function CreateItemForm() {
312
312
  ```
313
313
  </Drawer>
314
314
 
315
+ ### File Uploads
316
+
317
+ For endpoints that accept a file upload, the generated client sends the request as `FormData`. Define an operation with a `multipart/form-data` body in your FastAPI, for example using `UploadFile`:
318
+
319
+ ```python
320
+ from fastapi import UploadFile
321
+
322
+ @app.post("/files")
323
+ async def upload_file(file: UploadFile, description: str = "") -> FileMetadata:
324
+ contents = await file.read()
325
+ ...
326
+ ```
327
+
328
+ Binary fields are typed as `Blob` on the generated client, and other fields (such as `description` above) keep their modelled types. Pass a `Blob` or `File` — for example one obtained from an `<input type="file">`:
329
+
330
+ ```tsx {9-12}
331
+ import { useMutation } from '@tanstack/react-query';
332
+ import { useMyApi } from './hooks/useMyApi';
333
+
334
+ function UploadForm() {
335
+ const api = useMyApi();
336
+ const uploadFile = useMutation(api.uploadFile.mutationOptions());
337
+
338
+ const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
339
+ const file = e.target.files?.[0];
340
+ if (file) {
341
+ uploadFile.mutate({ file, description: file.name });
342
+ }
343
+ };
344
+
345
+ return <input type="file" onChange={handleChange} />;
346
+ }
347
+ ```
348
+
349
+ The client builds a `FormData` body and lets `fetch` set the `Content-Type` (including the multipart boundary) automatically.
350
+
315
351
  ### Pagination with Infinite Queries
316
352
 
317
353
  For endpoints that accept a `cursor` parameter as input, the generated hooks provide support for infinite queries using TanStack Query's `useInfiniteQuery` hook. This makes it easy to implement "load more" or infinite scrolling functionality.
@@ -2,7 +2,7 @@
2
2
  title: React to Python Agent
3
3
  description: Connect a React website to a Python Agent
4
4
  when:
5
- sourceType: react
5
+ sourceType: ts#react-website
6
6
  targetType: py#agent
7
7
  protocol: http
8
8
  ---
@@ -16,7 +16,7 @@ import Snippet from '@components/snippet.astro';
16
16
  Nx Plugin for AWS provides a generator to quickly integrate your <Link path="guides/py-agent">Python Agent</Link> with a React website. It sets up all necessary configuration for connecting to your agent via a type-safe OpenAPI-generated client, including AWS IAM and Cognito authentication support.
17
17
 
18
18
  :::tip[AG-UI agents]
19
- If your Python Agent was generated with `protocol=AG-UI`, the connection generator instead wires up [CopilotKit](https://docs.copilotkit.ai/aws-strands) and an [`@ag-ui/client`](https://docs.ag-ui.com/) `HttpAgent` on the React website. See the <Link path="guides/connection/react-agui">React to AG-UI Agent</Link> guide for details.
19
+ If your Python Agent was generated with `protocol=ag-ui`, the connection generator instead wires up [CopilotKit](https://docs.copilotkit.ai/aws-strands) and an [`@ag-ui/client`](https://docs.ag-ui.com/) `HttpAgent` on the React website. See the <Link path="guides/connection/react-agui">React to AG-UI Agent</Link> guide for details.
20
20
  :::
21
21
 
22
22
  ## Prerequisites
@@ -24,7 +24,7 @@ If your Python Agent was generated with `protocol=AG-UI`, the connection generat
24
24
  Before using this generator, ensure you have:
25
25
 
26
26
  1. A React website (generated using the <Link path="guides/react-website">`ts#website` generator</Link>)
27
- 2. A Python Agent with `protocol=HTTP` (generated using the <Link path="guides/py-agent">`py#agent` generator</Link>)
27
+ 2. A Python Agent with `protocol=http` (generated using the <Link path="guides/py-agent">`py#agent` generator</Link>)
28
28
  3. Cognito Auth added via the <Link path="/guides/react-website-auth">`ts#website#auth` generator</Link>
29
29
 
30
30
  ## Usage
@@ -122,11 +122,8 @@ function ChatComponent() {
122
122
  },
123
123
  }));
124
124
 
125
- const handleSend = (message: string) => {
126
- invoke.mutate({
127
- prompt: message,
128
- sessionId: 'my-session',
129
- });
125
+ const handleSend = (prompt: string) => {
126
+ invoke.mutate({ prompt });
130
127
  };
131
128
 
132
129
  return (
@@ -154,12 +151,9 @@ function ChatComponent() {
154
151
  const client = useMyAgentClient();
155
152
  const [chunks, setChunks] = useState<StreamChunk[]>([]);
156
153
 
157
- const handleSend = async (message: string) => {
154
+ const handleSend = async (prompt: string) => {
158
155
  setChunks([]);
159
- for await (const chunk of client.invoke({
160
- prompt: message,
161
- sessionId: 'my-session',
162
- })) {
156
+ for await (const chunk of client.invoke({ prompt })) {
163
157
  setChunks((prev) => [...prev, chunk]);
164
158
  }
165
159
  };
@@ -177,13 +171,13 @@ function ChatComponent() {
177
171
 
178
172
  ## Local Development
179
173
 
180
- The connection generator automatically configures `serve-local` integration:
174
+ The connection generator automatically configures `dev` integration:
181
175
 
182
- 1. Running `nx serve-local <website>` will also start the agent's local FastAPI server
176
+ 1. Running `nx dev <website>` will also start the agent's local FastAPI server
183
177
  2. The runtime config is overridden to point to the local HTTP URL (e.g., `http://localhost:8081/`)
184
178
  3. The TypeScript client is automatically regenerated when the agent's API changes
185
179
 
186
- <NxCommands commands={['serve-local <WebsiteProject>']} />
180
+ <NxCommands commands={['dev <WebsiteProject>']} />
187
181
 
188
182
  :::tip[Hot Reloading]
189
183
  The website and connected agent will hot-reload, enabling you to quickly iterate on both together without deploying to AWS.
@@ -2,8 +2,8 @@
2
2
  title: React to Smithy API
3
3
  description: Connect a React website to a Smithy TypeScript API
4
4
  when:
5
- sourceType: react
6
- targetType: smithy
5
+ sourceType: ts#react-website
6
+ targetType: ts#smithy-api
7
7
  ---
8
8
 
9
9
  import { FileTree, Steps } from '@astrojs/starlight/components';
@@ -116,9 +116,9 @@ Whenever you make changes to your Smithy API model, you need to rebuild your pro
116
116
  :::
117
117
 
118
118
  :::tip[Auto-Regeneration]
119
- If you're actively working on both your React application and Smithy API together, use the React application's `serve-local` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local Smithy API server:
119
+ If you're actively working on both your React application and Smithy API together, use the React application's `dev` target which will automatically regenerate the client whenever your API changes, as well as hot-reloading your website and local Smithy API server:
120
120
 
121
- <NxCommands commands={['serve-local <WebsiteProject>']} />
121
+ <NxCommands commands={['dev <WebsiteProject>']} />
122
122
 
123
123
  For more fine-grained control, you can use the `watch-generate:<ApiName>-client` target for your React application to regenerate the client every time you make API changes:
124
124
 
@@ -2,7 +2,7 @@
2
2
  title: React to tRPC
3
3
  description: Connect a React website to a tRPC API
4
4
  when:
5
- sourceType: react
5
+ sourceType: ts#react-website
6
6
  targetType: ts#trpc-api
7
7
  ---
8
8
  import { FileTree } from '@astrojs/starlight/components';
@@ -2,7 +2,7 @@
2
2
  title: React to TypeScript Agent
3
3
  description: Connect a React website to a TypeScript Agent
4
4
  when:
5
- sourceType: react
5
+ sourceType: ts#react-website
6
6
  targetType: ts#agent
7
7
  protocol: http
8
8
  ---
@@ -64,13 +64,13 @@ Additionally, it installs the required dependencies:
64
64
  The generated client connects to your Agent via tRPC over WebSocket. The agent exposes a tRPC router (including the `invoke` subscription for streaming agent responses) over a WebSocket endpoint.
65
65
 
66
66
  - **Deployed**: The agent runtime ARN is loaded from <Link path="guides/runtime-config">Runtime Configuration</Link>. Running this connection generator also patches the agent's generated CDK/Terraform construct to publish its ARN to the website's `runtime-config.json` (under the `connection` namespace), so only agents you explicitly connect are exposed to the frontend. The ARN is converted to a WebSocket URL following the Bedrock AgentCore Runtime WebSocket protocol: `wss://bedrock-agentcore.<region>.amazonaws.com/runtimes/<encoded-arn>/ws`
67
- - **Local development**: When running with `serve-local`, the runtime config override sets the value to a local `ws://` URL (e.g., `ws://localhost:8081/ws`), and the client connects directly
67
+ - **Local development**: When running with `dev`, the runtime config override sets the value to a local `ws://` URL (e.g., `ws://localhost:8081/ws`), and the client connects directly
68
68
 
69
69
  ### Authentication
70
70
 
71
71
  The generated code handles authentication depending on your agent's configuration:
72
72
 
73
- - **IAM** (default): Uses AWS SigV4 presigned URLs to authenticate the WebSocket connection. Credentials are obtained from the Cognito Identity Pool configured with your website's auth. In `serve-local` mode, signing is automatically skipped when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
73
+ - **IAM** (default): Uses AWS SigV4 presigned URLs to authenticate the WebSocket connection. Credentials are obtained from the Cognito Identity Pool configured with your website's auth. In `dev` mode, signing is automatically skipped when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
74
74
  - **Cognito**: Embeds the JWT access token in the `Sec-WebSocket-Protocol` header as a base64url-encoded bearer token, following the [AgentCore WebSocket auth protocol](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-websocket.html)
75
75
 
76
76
 
@@ -93,7 +93,7 @@ function ChatComponent() {
93
93
 
94
94
  const subscription = useSubscription(
95
95
  trpc.invoke.subscriptionOptions(
96
- { message: 'What can you help me with?' },
96
+ { prompt: 'What can you help me with?' },
97
97
  {
98
98
  enabled: true,
99
99
  onStarted: () => {
@@ -135,9 +135,9 @@ function ChatComponent() {
135
135
  const client = useMyAgentAgentClient();
136
136
  const [messages, setMessages] = useState<string[]>([]);
137
137
 
138
- const sendMessage = (message: string) => {
138
+ const sendMessage = (prompt: string) => {
139
139
  const subscription = client.invoke.subscribe(
140
- { message },
140
+ { prompt },
141
141
  {
142
142
  onData: (token) => {
143
143
  setMessages((prev) => [...prev, token]);
@@ -174,11 +174,11 @@ For more details on the vanilla tRPC client, see the [tRPC Vanilla Client docume
174
174
 
175
175
  ## Local Development
176
176
 
177
- The connection generator automatically configures `serve-local` integration for your react website:
177
+ The connection generator automatically configures `dev` integration for your react website:
178
178
 
179
- 1. Running `nx serve-local <website>` will also start the agent's local server
179
+ 1. Running `nx dev <website>` will also start the agent's local server
180
180
  2. The runtime config is overridden to point to the local WebSocket URL (e.g., `ws://localhost:8081/ws`)
181
- 3. Like with connected APIs, authentication is skipped in `serve-local` mode when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
181
+ 3. Like with connected APIs, authentication is skipped in `dev` mode when <Link path="guides/react-website#runtime-configuration">`runtime-config.json`</Link> is not present
182
182
 
183
183
  :::tip[Hot Reloading]
184
184
  The website and connected agent will hot-reload, enabling you to quickly iterate on both together without deploying to AWS.
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Smithy API to DynamoDB
3
- description: Connect a Smithy API to a DynamoDB table
3
+ description: Connect a Smithy API to a TypeScript DynamoDB project
4
4
  when:
5
- sourceType: smithy
5
+ sourceType: ts#smithy-api
6
6
  targetType: ts#dynamodb
7
7
  ---
8
8
  import { FileTree } from '@astrojs/starlight/components';
@@ -12,7 +12,7 @@ import GeneratorParameters from '@components/generator-parameters.astro';
12
12
  import NxCommands from '@components/nx-commands.astro';
13
13
  import Snippet from '@components/snippet.astro';
14
14
 
15
- The `connection` generator wires a <Link path="guides/ts-smithy-api">Smithy API</Link> to a <Link path="guides/ts-dynamodb">DynamoDB</Link> project, configuring local development so both start together automatically.
15
+ The `connection` generator wires a <Link path="guides/ts-smithy-api">Smithy API</Link> to a <Link path="guides/ts-dynamodb">TypeScript DynamoDB</Link> project, configuring local development so both start together automatically.
16
16
 
17
17
  ## Prerequisites
18
18
 
@@ -35,14 +35,14 @@ Select your Smithy API backend project as the source and your DynamoDB project a
35
35
 
36
36
  ## Generator Output
37
37
 
38
- The generator updates your Smithy API's `project.json` to add a dependency from its `serve-local` target to the DynamoDB project's `serve-local` target. No source files are modified.
38
+ The generator updates your Smithy API's `project.json` to add a dependency from its `dev` target to the DynamoDB project's `dev` target. No source files are modified.
39
39
 
40
40
  ## Using DynamoDB in Operations
41
41
 
42
42
  Import entity factories from the DynamoDB package and use them inside your operation implementations:
43
43
 
44
44
  ```ts title="packages/api/src/operations/list-examples.ts"
45
- import { createExampleEntity } from ':my-scope/my-table';
45
+ import { createExampleEntity } from '@my-scope/my-table';
46
46
  import {
47
47
  ListExamplesOperationInput,
48
48
  ListExamplesOperationOutput,
@@ -2,7 +2,7 @@
2
2
  title: Smithy API to Relational Database
3
3
  description: Connect a Smithy API to a Relational Database
4
4
  when:
5
- sourceType: smithy
5
+ sourceType: ts#smithy-api
6
6
  targetType: ts#rdb
7
7
  ---
8
8
  import { FileTree } from '@astrojs/starlight/components';
@@ -46,7 +46,7 @@ The generator modifies three existing files in your Smithy API backend:
46
46
 
47
47
  </FileTree>
48
48
 
49
- Additionally, it updates the API's `serve-local` target to start the database automatically.
49
+ Additionally, it updates the API's `dev` target to start the database automatically.
50
50
 
51
51
  ## How It Works
52
52
 
@@ -55,7 +55,7 @@ Additionally, it updates the API's `serve-local` target to start the database au
55
55
  The generator adds a typed `db` property to `ServiceContext` in `context.ts`:
56
56
 
57
57
  ```ts title="packages/api/src/context.ts" {1,7}
58
- import { getPrisma as getMyDb } from ':my-scope/my-db';
58
+ import { getPrisma as getMyDb } from '@my-scope/my-db';
59
59
 
60
60
  export interface ServiceContext {
61
61
  tracer: Tracer;
@@ -69,8 +69,8 @@ export interface ServiceContext {
69
69
 
70
70
  The Prisma client is instantiated inside `lambdaHandler` and passed through the service context:
71
71
 
72
- ```ts title="packages/api/src/handler.ts" {1,10}
73
- import { getPrisma as getMyDb } from ':my-scope/my-db';
72
+ ```ts title="packages/api/src/handler.ts" {1,5,10}
73
+ import { getPrisma as getMyDb } from '@my-scope/my-db';
74
74
 
75
75
  export const lambdaHandler = async (event: APIGatewayProxyEvent) => {
76
76
  const httpRequest = convertEvent(event);
@@ -134,14 +134,14 @@ const httpResponse = await serviceHandler.handle(httpRequest, {
134
134
 
135
135
  ### SSL Requirements When Connecting Without RDS Proxy
136
136
 
137
- <Snippet name="connection/lambda-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
137
+ <Snippet name="connection/ts-lambda-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
138
138
 
139
139
  ## Local Development
140
140
 
141
141
  The generator applies the same Prisma client injection inside the request handler in `local-server.ts`:
142
142
 
143
143
  ```ts title="packages/api/src/local-server.ts" {1,5,10}
144
- import { getPrisma as getMyDb } from ':my-scope/my-db';
144
+ import { getPrisma as getMyDb } from '@my-scope/my-db';
145
145
 
146
146
  const server = createServer(async function (req, res) {
147
147
  const httpRequest = convertRequest(req);
@@ -156,6 +156,6 @@ const server = createServer(async function (req, res) {
156
156
  });
157
157
  ```
158
158
 
159
- <NxCommands commands={["serve-local <api-project-name>"]} />
159
+ <NxCommands commands={["dev <api-project-name>"]} />
160
160
 
161
- This starts both the API and the local database. The `SERVE_LOCAL=true` environment variable is set automatically, so the Prisma client connects to the local Docker database instead of Aurora.
161
+ This starts both the API and the local database. The `LOCAL_DEV=true` environment variable is set automatically, so the Prisma client connects to the local Docker database instead of Aurora.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: tRPC API to DynamoDB
3
- description: Connect a tRPC API to a DynamoDB table
3
+ description: Connect a tRPC API to a TypeScript DynamoDB project
4
4
  when:
5
5
  sourceType: ts#trpc-api
6
6
  targetType: ts#dynamodb
@@ -12,7 +12,7 @@ import GeneratorParameters from '@components/generator-parameters.astro';
12
12
  import NxCommands from '@components/nx-commands.astro';
13
13
  import Snippet from '@components/snippet.astro';
14
14
 
15
- The `connection` generator wires a <Link path="guides/trpc">tRPC API</Link> to a <Link path="guides/ts-dynamodb">DynamoDB</Link> project, configuring local development so both start together automatically.
15
+ The `connection` generator wires a <Link path="guides/trpc">tRPC API</Link> to a <Link path="guides/ts-dynamodb">TypeScript DynamoDB</Link> project, configuring local development so both start together automatically.
16
16
 
17
17
  ## Prerequisites
18
18
 
@@ -35,14 +35,14 @@ Select your tRPC API project as the source and your DynamoDB project as the targ
35
35
 
36
36
  ## Generator Output
37
37
 
38
- The generator updates your tRPC API's `project.json` to add a dependency from its `serve-local` target to the DynamoDB project's `serve-local` target. No source files are modified.
38
+ The generator updates your tRPC API's `project.json` to add a dependency from its `dev` target to the DynamoDB project's `dev` target. No source files are modified.
39
39
 
40
40
  ## Using DynamoDB in Procedures
41
41
 
42
42
  Import entity factories from the DynamoDB package and use them inside your tRPC procedures:
43
43
 
44
44
  ```ts title="packages/api/src/procedures/example.ts"
45
- import { createExampleEntity } from ':my-scope/my-table';
45
+ import { createExampleEntity } from '@my-scope/my-table';
46
46
  import { publicProcedure } from '../init.js';
47
47
 
48
48
  export const listExamples = publicProcedure
@@ -45,7 +45,7 @@ The generator creates a middleware file in your tRPC API project:
45
45
 
46
46
  </FileTree>
47
47
 
48
- Additionally, it updates your tRPC API's `serve-local` target to start the database automatically when running locally.
48
+ Additionally, it updates your tRPC API's `dev` target to start the database automatically when running locally.
49
49
 
50
50
  ## Using the Middleware
51
51
 
@@ -65,7 +65,7 @@ export const authenticatedProcedure = t.procedure
65
65
 
66
66
  The plugin merges `IMyDbContext` into your procedure context, making `myDb` available as an optional property:
67
67
 
68
- ```ts title="packages/api/src/procedures/users.ts" {8,12}
68
+ ```ts title="packages/api/src/procedures/users.ts" {7-8}
69
69
  import { z } from 'zod';
70
70
  import { authenticatedProcedure } from '../router.js';
71
71
 
@@ -116,12 +116,12 @@ export const dbProcedure = t.procedure
116
116
 
117
117
  ### SSL Requirements When Connecting Without RDS Proxy
118
118
 
119
- <Snippet name="connection/lambda-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
119
+ <Snippet name="connection/ts-lambda-rdb-ssl-requirements" parentHeading="SSL Requirements When Connecting Without RDS Proxy" />
120
120
 
121
121
  ## Local Development
122
122
 
123
- The generator configures your tRPC API's `serve-local` target to depend on the database's `serve-local` target, so running:
123
+ The generator configures your tRPC API's `dev` target to depend on the database's `dev` target, so running:
124
124
 
125
- <NxCommands commands={["serve-local <api-project-name>"]} />
125
+ <NxCommands commands={["dev <api-project-name>"]} />
126
126
 
127
127
  will automatically start the local database alongside your API.
@@ -23,7 +23,7 @@ The generator sets up all the necessary wiring so your agent can discover and in
23
23
  Before using this generator, ensure you have:
24
24
 
25
25
  1. A TypeScript project with a <Link path="guides/ts-agent">Strands Agent</Link> component (any protocol)
26
- 2. A project with an Agent component generated with `--protocol=A2A` and `--auth=IAM` (either <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link>)
26
+ 2. A project with an Agent component generated with `--protocol=a2a` and `--auth=iam` (either <Link path="guides/ts-agent">`ts#agent`</Link> or <Link path="guides/py-agent">`py#agent`</Link>)
27
27
  3. Both components created with `infra: agentcore`
28
28
 
29
29
  ## Usage
@@ -47,9 +47,12 @@ The generator creates a shared `agent-connection` package and modifies your agen
47
47
  - packages/common/agent-connection
48
48
  - src
49
49
  - app
50
- - \<target-agent-name>-client.ts High-level client for the connected A2A agent
50
+ - \<target-agent-name>-client-strands.ts High-level Strands client for the connected A2A agent
51
51
  - core
52
- - agentcore-a2a-client.ts Low-level AgentCore A2A client with SigV4 authentication
52
+ - agentcore-endpoints.ts Framework-agnostic ARN/URL resolution
53
+ - agentcore-fetch.ts Framework-agnostic SigV4 / JWT / session-forwarding fetch
54
+ - agentcore-a2a-client-config.ts Framework-agnostic A2A client config (signed `clientFactory`)
55
+ - agentcore-a2a-client-strands.ts Strands A2A client wrapping the config
53
56
  - index.ts Exports all clients
54
57
  - project.json
55
58
  - tsconfig.json
@@ -58,20 +61,20 @@ The generator creates a shared `agent-connection` package and modifies your agen
58
61
 
59
62
  Additionally, it:
60
63
  - Transforms your agent's `agent.ts` to register the remote A2A agent as a Strands `tool`
61
- - Updates the agent's `serve-local` target to depend on the target agent's `serve-local` target
64
+ - Updates the agent's `dev` target to depend on the target agent's `dev` target
62
65
  - Installs required dependencies
63
66
 
64
67
  ## Using the Connected A2A Agent
65
68
 
66
69
  The generator transforms your agent's `agent.ts` to wrap the remote A2A agent as a tool:
67
70
 
68
- ```ts title="packages/example/src/my-agent/agent.ts" {2,5-11,14}
71
+ ```ts title="packages/example/src/my-agent/agent.ts" {2,5-12,15}
69
72
  import { Agent, tool } from '@strands-agents/sdk';
70
- import { RemoteAgentClient } from ':my-scope/agent-connection';
73
+ import { RemoteAgentClientStrands } from '@my-scope/agent-connection';
71
74
  import { z } from 'zod';
72
75
 
73
76
  export const getAgent = async (sessionId: string) => {
74
- const remoteAgent = await RemoteAgentClient.create(sessionId);
77
+ const remoteAgent = await RemoteAgentClientStrands.create(sessionId);
75
78
  const remoteAgentTool = tool({
76
79
  name: 'askRemoteAgent',
77
80
  description: 'Delegate a question to the remote RemoteAgent A2A agent and return its reply.',
@@ -87,7 +90,7 @@ export const getAgent = async (sessionId: string) => {
87
90
 
88
91
  The `sessionId` parameter is plumbed through from the caller, ensuring consistency for [Bedrock AgentCore Observability](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html).
89
92
 
90
- Under the hood, `RemoteAgentClient.create(sessionId)` returns a Strands `A2AAgent` configured with a SigV4-signing `clientFactory` when deployed to AWS, and a plain `http://localhost:<port>/` endpoint when `SERVE_LOCAL=true`.
93
+ Under the hood, `RemoteAgentClientStrands.create(sessionId)` returns a Strands `A2AAgent` configured with a SigV4-signing `clientFactory` when deployed to AWS, and a plain `http://localhost:<port>/` endpoint when `LOCAL_DEV=true`. The signing and endpoint resolution live in the framework-agnostic `agentcore-a2a-client-config.ts`; only the thin `agentcore-a2a-client-strands.ts` depends on Strands.
91
94
 
92
95
  ## Infrastructure
93
96
 
@@ -95,12 +98,12 @@ Under the hood, `RemoteAgentClient.create(sessionId)` returns a Strands `A2AAgen
95
98
 
96
99
  ## Local Development
97
100
 
98
- The generator configures the host agent's `serve-local` target to:
101
+ The generator configures the host agent's `dev` target to:
99
102
  1. Start the connected A2A agent(s) automatically
100
- 2. Set `SERVE_LOCAL=true` so the generated client connects directly to `http://localhost:<port>/` instead of AgentCore
103
+ 2. Set `LOCAL_DEV=true` so the generated client connects directly to `http://localhost:<port>/` instead of AgentCore
101
104
 
102
105
  Run the agent locally with:
103
106
 
104
- <NxCommands commands={["<agent-name>-serve-local <project-name>"]} />
107
+ <NxCommands commands={["<agent-name>-dev <project-name>"]} />
105
108
 
106
109
  This will start both the host agent and all connected A2A agents, with the host agent calling the remote agents over plain HTTP on their assigned local ports.