@aws/nx-plugin-mcp 1.0.0-rc.95 → 1.0.0-rc.97

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 (66) hide show
  1. package/bin/aws-nx-mcp.js +61 -14
  2. package/docs/get_started/existing-project.mdx +6 -3
  3. package/docs/get_started/quick-start.mdx +8 -0
  4. package/docs/get_started/tutorials/dungeon-game/1.mdx +12 -14
  5. package/docs/get_started/tutorials/dungeon-game/2.mdx +10 -2
  6. package/docs/get_started/tutorials/dungeon-game/3.mdx +4 -0
  7. package/docs/get_started/tutorials/dungeon-game/4.mdx +2 -2
  8. package/docs/guides/agentcore-gateway.mdx +4 -2
  9. package/docs/guides/agentcore-harness.mdx +2 -1
  10. package/docs/guides/astro-docs.mdx +25 -7
  11. package/docs/guides/connection/py-agent-a2a.mdx +2 -0
  12. package/docs/guides/connection/py-agent-dynamodb.mdx +1 -1
  13. package/docs/guides/connection/py-agent-gateway.mdx +3 -0
  14. package/docs/guides/connection/py-agent-mcp.mdx +18 -4
  15. package/docs/guides/connection/py-agent-rdb.mdx +5 -4
  16. package/docs/guides/connection/py-fast-api-dynamodb.mdx +1 -1
  17. package/docs/guides/connection/py-fast-api-rdb.mdx +7 -2
  18. package/docs/guides/connection/py-mcp-server-dynamodb.mdx +1 -1
  19. package/docs/guides/connection/py-mcp-server-rdb.mdx +6 -6
  20. package/docs/guides/connection/react-agui.mdx +34 -25
  21. package/docs/guides/connection/react-fastapi.mdx +114 -116
  22. package/docs/guides/connection/react-py-agent.mdx +4 -0
  23. package/docs/guides/connection/react-smithy.mdx +152 -98
  24. package/docs/guides/connection/react-trpc.mdx +13 -6
  25. package/docs/guides/connection/smithy-dynamodb.mdx +2 -8
  26. package/docs/guides/connection/smithy-rdb.mdx +3 -6
  27. package/docs/guides/connection/trpc-rdb.mdx +6 -6
  28. package/docs/guides/connection/ts-agent-a2a.mdx +4 -4
  29. package/docs/guides/connection/ts-agent-dynamodb.mdx +13 -11
  30. package/docs/guides/connection/ts-agent-gateway.mdx +2 -0
  31. package/docs/guides/connection/ts-agent-mcp.mdx +19 -7
  32. package/docs/guides/connection/ts-agent-rdb.mdx +2 -2
  33. package/docs/guides/connection/ts-mcp-server-dynamodb.mdx +11 -7
  34. package/docs/guides/connection/ts-mcp-server-rdb.mdx +4 -3
  35. package/docs/guides/docker-bundling.mdx +23 -3
  36. package/docs/guides/fastapi.mdx +16 -5
  37. package/docs/guides/py-agent.mdx +129 -54
  38. package/docs/guides/py-mcp-server.mdx +3 -1
  39. package/docs/guides/py-rdb.mdx +13 -4
  40. package/docs/guides/python-lambda-function.mdx +8 -8
  41. package/docs/guides/python-project.mdx +28 -25
  42. package/docs/guides/react-website-auth.mdx +8 -8
  43. package/docs/guides/react-website.mdx +46 -27
  44. package/docs/guides/runtime-config.mdx +24 -4
  45. package/docs/guides/security.mdx +1 -1
  46. package/docs/guides/terraform-project.mdx +8 -2
  47. package/docs/guides/trpc.mdx +96 -12
  48. package/docs/guides/ts-agent.mdx +17 -3
  49. package/docs/guides/ts-dcr-proxy.mdx +24 -6
  50. package/docs/guides/ts-lambda-function.mdx +7 -1
  51. package/docs/guides/ts-mcp-server.mdx +45 -15
  52. package/docs/guides/ts-rdb.mdx +9 -2
  53. package/docs/guides/ts-smithy-api.mdx +76 -7
  54. package/docs/guides/typescript-infrastructure.mdx +24 -10
  55. package/docs/guides/typescript-project.mdx +12 -5
  56. package/docs/guides/workspace.mdx +21 -9
  57. package/docs/snippets/api/type-safe-api-integrations.mdx +2 -0
  58. package/docs/snippets/connection/a2a-infrastructure.mdx +3 -0
  59. package/docs/snippets/connection/infra-project-prerequisite.mdx +8 -0
  60. package/docs/snippets/connection/strands-agent-rdb-ssl-requirements.mdx +1 -1
  61. package/docs/snippets/connection/ts-lambda-rdb-ssl-requirements.mdx +1 -1
  62. package/docs/snippets/connection/ts-mcp-server-rdb-ssl-requirements.mdx +1 -1
  63. package/docs/snippets/required-prerequisites.mdx +1 -1
  64. package/package.json +1 -1
  65. package/src/init/schema.json +5 -0
  66. package/src/py/project/schema.json +3 -1
@@ -46,16 +46,17 @@ The generator creates a **single shared** `AguiProvider` component, one hook per
46
46
  - src
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
+ - \<agent-name>-chat.tsx A themed `<AgentName>Chat` bound to this agent's id. One file per `connection` run.
49
50
  - copilot
50
51
  - 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
52
  - *ThemeComponents*.tsx Per-slot theme components (e.g. `CloudscapeAssistantMessage.tsx`, `ShadcnChatInput.tsx`). Only vended when `ux` is `cloudscape` or `shadcn`.
52
53
  - hooks
53
- - useAgui\<AgentName>.tsx Registers one AG-UI agent. One file per `connection` run.
54
+ - useAgui\<AgentName>.tsx Registers one AG-UI agent and exports its id as `<AGENT_NAME>_ID`. One file per `connection` run.
54
55
  - useSigV4.tsx SigV4 signing (IAM only)
55
56
 
56
57
  </FileTree>
57
58
 
58
- Running `connection` a second time for a different agent **adds a new `useAgui<AgentName>.tsx` hook** and updates `AguiProvider.tsx` to register both hooks — any custom edits you've made to the provider are preserved. `main.tsx` keeps its single `<AguiProvider>` wrapper — you never end up with nested providers.
59
+ Running `connection` a second time for a different agent **adds a new `useAgui<AgentName>.tsx` hook and `<agent-name>-chat.tsx` component** and updates `AguiProvider.tsx` to register both hooks — any custom edits you've made to the provider are preserved. `main.tsx` keeps its single `<AguiProvider>` wrapper — you never end up with nested providers.
59
60
 
60
61
  The following dependencies are added to the root `package.json`:
61
62
 
@@ -119,17 +120,14 @@ Both Session ID and Thread ID are provided by the browser. To restrict each user
119
120
 
120
121
  ### Adding a Chat Interface
121
122
 
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`).
123
-
124
- Import the chat components from the generated `./components/copilot` module so the theme that matches your website's `ux` is applied automatically:
123
+ The generator vends a `<AgentName>Chat` component per connected agent, already bound to that agent's id and themed to match your website's `ux`. Drop it anywhere inside the `<AguiProvider>` wrapper:
125
124
 
126
125
  ```tsx
127
- import { CopilotChat } from './components/copilot';
126
+ import { StoryAgentChat } from './components/story-agent-chat';
128
127
 
129
128
  function ChatPage() {
130
129
  return (
131
- <CopilotChat
132
- agentId="agent"
130
+ <StoryAgentChat
133
131
  labels={{
134
132
  welcomeMessageText: 'How can I help you today?',
135
133
  chatInputPlaceholder: 'Ask me anything...',
@@ -139,15 +137,24 @@ function ChatPage() {
139
137
  }
140
138
  ```
141
139
 
140
+ It forwards every `CopilotChat` prop except `agentId`, so anything you can pass to `<CopilotChat />` works here too.
141
+
142
142
  ### Connecting Multiple AG-UI Agents
143
143
 
144
- Run the `connection` generator once per agent. Every agent registered via the shared `AguiProvider` is visible from anywhere in the app — instantiate a CopilotKit component with a different `agentId` to route each chat to the agent you want:
144
+ Run the `connection` generator once per agent. Each run vends that agent's own chat component, so routing a chat to a particular agent is a matter of which component you render:
145
145
 
146
146
  ```tsx
147
- import { CopilotChat } from './components/copilot';
147
+ import { StoryAgentChat } from './components/story-agent-chat';
148
+ import { ResearchAgentChat } from './components/research-agent-chat';
148
149
 
149
- <CopilotChat agentId="story" /> {/* talks to StoryAgent */}
150
- <CopilotChat agentId="research" /> {/* talks to ResearchAgent */}
150
+ <StoryAgentChat /> {/* talks to StoryAgent */}
151
+ <ResearchAgentChat /> {/* talks to ResearchAgent */}
152
+ ```
153
+
154
+ If you need the raw id — to call CopilotKit's own hooks, say — each generated hook exports it:
155
+
156
+ ```tsx
157
+ import { STORY_AGENT_ID } from './hooks/useAguiStoryAgent';
151
158
  ```
152
159
 
153
160
  ## Customising the Look and Feel
@@ -164,12 +171,13 @@ The generator reads `metadata.ux` from your React website project and vends a th
164
171
  | `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
172
  | `none` (or anything else) | No theme — the module just re-exports the default CopilotKit components. |
166
173
 
167
- Import the themed components from the **local theme module** (not `@copilotkit/react-core/v2` directly) so the theme is applied automatically:
174
+ The vended `<AgentName>Chat` components are already themed. For a chat you wire up yourself, import from the **local theme module** (not `@copilotkit/react-core/v2` directly) so the theme is applied automatically:
168
175
 
169
176
  ```tsx
170
177
  import { CopilotChat } from './components/copilot';
178
+ import { STORY_AGENT_ID } from './hooks/useAguiStoryAgent';
171
179
 
172
- <CopilotChat agentId="agent" />
180
+ <CopilotChat agentId={STORY_AGENT_ID} />
173
181
  ```
174
182
 
175
183
  The theme is applied as slot defaults, so any slot you explicitly pass still wins — you keep full control whenever you need a one-off override.
@@ -188,8 +196,7 @@ For example, to drop in your own user-message renderer while keeping the rest of
188
196
  Per-chat overrides still work alongside the theme — anything you pass as a slot prop overrides the themed default:
189
197
 
190
198
  ```tsx
191
- <CopilotChat
192
- agentId="agent"
199
+ <StoryAgentChat
193
200
  // style the input and its children
194
201
  input={{
195
202
  textArea: 'text-blue-600',
@@ -205,28 +212,26 @@ Per-chat overrides still work alongside the theme — anything you pass as a slo
205
212
 
206
213
  ### Replacing a slot with a custom component
207
214
 
208
- Any slot can take a React component instead of a className, so you can replace the default entirely:
215
+ Any slot can take a React component instead of a className, so you can replace the default entirely. Type your component against the props the slot declares — `sendButton` renders a `<button>`, so it receives `ButtonHTMLAttributes`:
209
216
 
210
217
  ```tsx
211
- import { CopilotChat } from './components/copilot';
218
+ import { StoryAgentChat } from './components/story-agent-chat';
212
219
 
213
- const MySendButton: React.FC<{ onClick: () => void }> = ({ onClick }) => (
220
+ const MySendButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>> = ({
221
+ onClick,
222
+ }) => (
214
223
  <button onClick={onClick} className="my-send-btn">
215
224
  Send
216
225
  </button>
217
226
  );
218
227
 
219
- <CopilotChat
220
- agentId="agent"
221
- input={{ sendButton: MySendButton }}
222
- />;
228
+ <StoryAgentChat input={{ sendButton: MySendButton }} />;
223
229
  ```
224
230
 
225
231
  Deeper overrides follow the same shape — e.g. replace just the copy button on assistant messages:
226
232
 
227
233
  ```tsx
228
- <CopilotChat
229
- agentId="agent"
234
+ <StoryAgentChat
230
235
  messageView={{
231
236
  assistantMessage: {
232
237
  copyButton: ({ onClick }) => <button onClick={onClick}>Copy</button>,
@@ -249,6 +254,10 @@ The connection generator automatically configures `dev` integration:
249
254
  The website and connected agent hot-reload together, enabling you to quickly iterate on both sides without deploying to AWS.
250
255
  :::
251
256
 
257
+ :::note[The dev target requires the Nx Daemon]
258
+ The `dev` target hot-reloads local dev servers. Many of these rely on [`nx watch`](https://nx.dev/docs/guides/tasks--caching/workspace-watching) to achieve this, which requires the [Nx Daemon](https://nx.dev/docs/concepts/nx-daemon) to be enabled.
259
+ :::
260
+
252
261
  ## More Information
253
262
 
254
263
  - <Link path="guides/ts-agent">TypeScript Agent Guide</Link>