@aws/nx-plugin 1.0.0-rc.17 → 1.0.0-rc.19
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.
- package/generators.json +9 -1
- package/package.json +1 -1
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +41 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/project/serve-local.ts.template +3 -2
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +102 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +26 -0
- package/src/agentcore-gateway/mcp-connection/generator.js +8 -24
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
- package/src/connection/generator.js +66 -63
- package/src/connection/generator.js.map +1 -1
- package/src/license/generator.js +8 -19
- package/src/license/generator.js.map +1 -1
- package/src/license/known-exceptions.d.ts +0 -1
- package/src/license/known-exceptions.js +1 -8
- package/src/license/known-exceptions.js.map +1 -1
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +15 -6
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +201 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/{__targetAgentSnakeCase___client.py.template → __targetAgentSnakeCase___client_strands.py.template} +7 -5
- package/src/py/agent/a2a-connection/generator.js +6 -5
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/http/main.py.template +2 -2
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +197 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/{__gatewaySnakeCase___client.py.template → __gatewaySnakeCase___client_strands.py.template} +6 -6
- package/src/py/agent/gateway-connection/generator.js +5 -5
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/generator.js +3 -5
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +157 -79
- package/src/py/agent/mcp-connection/files/agent-connection/app/{__mcpServerSnakeCase___client.py.template → __mcpServerSnakeCase___client_strands.py.template} +7 -5
- package/src/py/agent/mcp-connection/generator.js +5 -5
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +37 -3
- package/src/py/fast-api/files/app/__name__/main.py.template +4 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +13 -4
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +1 -0
- package/src/smithy/project/files/src/operations/echo.smithy.template +1 -0
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +35 -4
- package/src/trpc/backend/files/src/procedures/echo.ts.template +1 -1
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +14 -5
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +256 -0
- package/src/ts/agent/a2a-connection/files/agent-connection/app/{__targetAgentKebabCase__-client.ts.template → __targetAgentKebabCase__-client-strands.ts.template} +5 -5
- package/src/ts/agent/a2a-connection/generator.js +3 -3
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/http/router.ts.template +1 -1
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +220 -0
- package/src/ts/agent/gateway-connection/files/agent-connection/app/{__gatewayKebabCase__-client.ts.template → __gatewayKebabCase__-client-strands.ts.template} +5 -5
- package/src/ts/agent/gateway-connection/generator.js +3 -3
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/generator.js +3 -0
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +183 -110
- package/src/ts/agent/mcp-connection/files/agent-connection/app/{__mcpServerKebabCase__-client.ts.template → __mcpServerKebabCase__-client-strands.ts.template} +5 -5
- package/src/ts/agent/mcp-connection/generator.js +3 -3
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +13 -4
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +64 -24
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +13 -4
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +9 -3
- package/src/utils/agent-connection/agent-connection.d.ts +50 -24
- package/src/utils/agent-connection/agent-connection.js +137 -45
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +93 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-endpoints.ts.template +37 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +54 -0
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +41 -0
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +70 -0
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +39 -0
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +61 -0
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +26 -0
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +27 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client_config.py.template +43 -0
- package/src/utils/agent-connection/files/py-core-auth/agentcore_endpoints.py.template +47 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/session.py.template +51 -0
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +28 -0
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-shared/agentcore_transport.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/a2a/agentcore_a2a_client_strands.py.template +66 -0
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +22 -0
- package/src/utils/agent-connection/files/py-core-strands/mcp/agentcore_mcp_client_strands.py.template +30 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +3 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +110 -28
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +95 -2
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +13 -4
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +9 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +23 -1
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +9 -3
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +7 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +9 -3
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +22 -8
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +10 -4
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +13 -4
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +0 -123
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-client.ts.template +0 -78
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-client.ts.template +0 -128
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +0 -120
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_client.py.template +0 -78
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_client.py.template +0 -89
- /package/src/utils/agent-connection/files/{core-runtime-config/model-errors.ts.template → core-strands/base/model-errors-strands.ts.template} +0 -0
- /package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → core-strands/base/with-session-id-strands.ts.template} +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/model_errors.py.template → py-core-strands/base/model_errors_strands.py.template} +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/with_session_id.py.template → py-core-strands/base/with_session_id_strands.py.template} +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`ts#agent#a2a-connection generator > should match snapshot for agent-connection src files > agent-connection-index.ts 1`] = `
|
|
4
|
+
"export * from './app/remote-client-strands.js';
|
|
5
|
+
export * from './core/model-errors-strands.js';
|
|
6
|
+
export * from './core/with-session-id-strands.js';
|
|
7
|
+
export * from './core/session-context.js';
|
|
8
|
+
// Export your library code here
|
|
9
|
+
"
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
exports[`ts#agent#a2a-connection generator > should match snapshot for agent-connection src files > agentcore-a2a-client-config.ts 1`] = `
|
|
13
|
+
"import {
|
|
14
|
+
ClientFactory,
|
|
15
|
+
ClientFactoryOptions,
|
|
16
|
+
DefaultAgentCardResolver,
|
|
17
|
+
JsonRpcTransportFactory,
|
|
18
|
+
} from '@a2a-js/sdk/client';
|
|
19
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
20
|
+
import { a2aUrlFromArn, regionFromArn } from './agentcore-endpoints.js';
|
|
21
|
+
import {
|
|
22
|
+
createJwtFetch,
|
|
23
|
+
createPlainFetch,
|
|
24
|
+
createSigV4Fetch,
|
|
25
|
+
} from './agentcore-fetch.js';
|
|
26
|
+
|
|
27
|
+
/** Common options for resolving an AgentCore A2A endpoint. */
|
|
28
|
+
export interface AgentCoreA2aClientConfigOptions {
|
|
29
|
+
/** The ARN of the Bedrock AgentCore Runtime to connect to. */
|
|
30
|
+
agentRuntimeArn: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Options for an A2A client config with IAM authentication. */
|
|
34
|
+
export interface AgentCoreA2aClientConfigIamOptions
|
|
35
|
+
extends AgentCoreA2aClientConfigOptions {
|
|
36
|
+
/** AWS credential provider; defaults to the standard provider chain. */
|
|
37
|
+
credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Options for an A2A client config with JWT authentication. */
|
|
41
|
+
export interface AgentCoreA2aClientConfigJwtOptions
|
|
42
|
+
extends AgentCoreA2aClientConfigOptions {
|
|
43
|
+
/** A function which returns the JWT access token used to authenticate. */
|
|
44
|
+
accessTokenProvider: () => Promise<string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Options for an A2A client config with no auth (local dev). */
|
|
48
|
+
export interface AgentCoreA2aClientConfigNoAuthOptions {
|
|
49
|
+
/** Full URL of the local A2A endpoint. */
|
|
50
|
+
url: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A resolved A2A endpoint and a configured \`@a2a-js\` client factory. */
|
|
54
|
+
export interface A2aClientConfig {
|
|
55
|
+
/** The A2A endpoint URL. */
|
|
56
|
+
url: string;
|
|
57
|
+
/** A client factory wired with a signed, session-forwarding fetch. */
|
|
58
|
+
clientFactory: ClientFactory;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const build = (url: string, fetchFn: typeof fetch): A2aClientConfig => {
|
|
62
|
+
const clientFactory = new ClientFactory({
|
|
63
|
+
...ClientFactoryOptions.default,
|
|
64
|
+
transports: [new JsonRpcTransportFactory({ fetchImpl: fetchFn })],
|
|
65
|
+
cardResolver: new DefaultAgentCardResolver({ fetchImpl: fetchFn }),
|
|
66
|
+
});
|
|
67
|
+
return { url, clientFactory };
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Factory for A2A client configs that connect to a Bedrock AgentCore runtime.
|
|
72
|
+
* Each forwards the current async-context session via the AgentCore session
|
|
73
|
+
* header. Framework-agnostic — wrap the result in a framework's A2A client.
|
|
74
|
+
*/
|
|
75
|
+
export class AgentCoreA2aClientConfig {
|
|
76
|
+
/** SigV4-authenticated A2A client config for a Bedrock AgentCore runtime. */
|
|
77
|
+
static withIamAuth(
|
|
78
|
+
options: AgentCoreA2aClientConfigIamOptions,
|
|
79
|
+
): A2aClientConfig {
|
|
80
|
+
return build(
|
|
81
|
+
a2aUrlFromArn(options.agentRuntimeArn),
|
|
82
|
+
createSigV4Fetch({
|
|
83
|
+
region: regionFromArn(options.agentRuntimeArn),
|
|
84
|
+
credentialProvider: options.credentialProvider,
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Bearer-authenticated A2A client config for a Bedrock AgentCore runtime. */
|
|
90
|
+
static withJwtAuth(
|
|
91
|
+
options: AgentCoreA2aClientConfigJwtOptions,
|
|
92
|
+
): A2aClientConfig {
|
|
93
|
+
return build(
|
|
94
|
+
a2aUrlFromArn(options.agentRuntimeArn),
|
|
95
|
+
createJwtFetch(options.accessTokenProvider),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** For local dev — plain HTTP, no auth. */
|
|
100
|
+
static withoutAuth(
|
|
101
|
+
options: AgentCoreA2aClientConfigNoAuthOptions,
|
|
102
|
+
): A2aClientConfig {
|
|
103
|
+
return build(options.url, createPlainFetch());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
"
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
exports[`ts#agent#a2a-connection generator > should match snapshot for agent-connection src files > agentcore-a2a-client-strands.ts 1`] = `
|
|
110
|
+
"import { A2AAgent } from '@strands-agents/sdk/a2a';
|
|
111
|
+
import {
|
|
112
|
+
type A2aClientConfig,
|
|
113
|
+
AgentCoreA2aClientConfig,
|
|
114
|
+
type AgentCoreA2aClientConfigIamOptions,
|
|
115
|
+
type AgentCoreA2aClientConfigJwtOptions,
|
|
116
|
+
type AgentCoreA2aClientConfigNoAuthOptions,
|
|
117
|
+
} from './agentcore-a2a-client-config.js';
|
|
118
|
+
|
|
119
|
+
/** Optional friendly metadata for the remote agent. */
|
|
120
|
+
export interface StrandsA2aOptions {
|
|
121
|
+
/** Optional friendly name for the remote agent. */
|
|
122
|
+
name?: string;
|
|
123
|
+
/** Optional description for the remote agent. */
|
|
124
|
+
description?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Strands A2A clients for a Bedrock AgentCore runtime. */
|
|
128
|
+
export class AgentCoreA2aClientStrands {
|
|
129
|
+
private static build(
|
|
130
|
+
{ url, clientFactory }: A2aClientConfig,
|
|
131
|
+
options: StrandsA2aOptions,
|
|
132
|
+
): A2AAgent {
|
|
133
|
+
return new A2AAgent({
|
|
134
|
+
url,
|
|
135
|
+
clientFactory,
|
|
136
|
+
...(options.name ? { name: options.name } : {}),
|
|
137
|
+
...(options.description ? { description: options.description } : {}),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** SigV4-authenticated client for a Bedrock AgentCore runtime. */
|
|
142
|
+
static withIamAuth(
|
|
143
|
+
options: AgentCoreA2aClientConfigIamOptions & StrandsA2aOptions,
|
|
144
|
+
): A2AAgent {
|
|
145
|
+
return AgentCoreA2aClientStrands.build(
|
|
146
|
+
AgentCoreA2aClientConfig.withIamAuth(options),
|
|
147
|
+
options,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Bearer-authenticated client for a Bedrock AgentCore runtime. */
|
|
152
|
+
static withJwtAuth(
|
|
153
|
+
options: AgentCoreA2aClientConfigJwtOptions & StrandsA2aOptions,
|
|
154
|
+
): A2AAgent {
|
|
155
|
+
return AgentCoreA2aClientStrands.build(
|
|
156
|
+
AgentCoreA2aClientConfig.withJwtAuth(options),
|
|
157
|
+
options,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** For local dev — plain HTTP, no auth. */
|
|
162
|
+
static withoutAuth(
|
|
163
|
+
options: AgentCoreA2aClientConfigNoAuthOptions & StrandsA2aOptions,
|
|
164
|
+
): A2AAgent {
|
|
165
|
+
return AgentCoreA2aClientStrands.build(
|
|
166
|
+
AgentCoreA2aClientConfig.withoutAuth(options),
|
|
167
|
+
options,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
"
|
|
172
|
+
`;
|
|
173
|
+
|
|
174
|
+
exports[`ts#agent#a2a-connection generator > should match snapshot for agent-connection src files > agentcore-fetch.ts 1`] = `
|
|
175
|
+
"import { AwsClient } from 'aws4fetch';
|
|
176
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
177
|
+
import { getCurrentSessionId } from './session-context.js';
|
|
178
|
+
|
|
179
|
+
const SESSION_HEADER = 'X-Amzn-Bedrock-AgentCore-Runtime-Session-Id';
|
|
180
|
+
|
|
181
|
+
/** Wrap a fetch so each request carries the current async-context session id. */
|
|
182
|
+
const withSessionHeader =
|
|
183
|
+
(inner: typeof fetch): typeof fetch =>
|
|
184
|
+
async (input, init) => {
|
|
185
|
+
const headers = new Headers(init?.headers);
|
|
186
|
+
const sessionId = getCurrentSessionId();
|
|
187
|
+
if (sessionId) headers.set(SESSION_HEADER, sessionId);
|
|
188
|
+
return inner(input, { ...init, headers });
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/** Options for a SigV4-signing fetch. */
|
|
192
|
+
export interface SigV4FetchOptions {
|
|
193
|
+
/** AWS region to sign for. */
|
|
194
|
+
region: string;
|
|
195
|
+
/** AWS service to sign for. Defaults to \`bedrock-agentcore\`. */
|
|
196
|
+
service?: string;
|
|
197
|
+
/** AWS credential provider; defaults to the standard provider chain. */
|
|
198
|
+
credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** A fetch that signs every request with AWS SigV4 (per-request, body-aware). */
|
|
202
|
+
export const createSigV4Fetch = (options: SigV4FetchOptions): typeof fetch => {
|
|
203
|
+
const { region, service = 'bedrock-agentcore' } = options;
|
|
204
|
+
const credentialProvider =
|
|
205
|
+
options.credentialProvider ?? fromNodeProviderChain();
|
|
206
|
+
const signedFetch: typeof fetch = async (...args) => {
|
|
207
|
+
const client = new AwsClient({
|
|
208
|
+
...(await credentialProvider()),
|
|
209
|
+
service,
|
|
210
|
+
region,
|
|
211
|
+
});
|
|
212
|
+
return client.fetch(...args);
|
|
213
|
+
};
|
|
214
|
+
return withSessionHeader(signedFetch);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/** A fetch that adds a bearer token from the given async provider. */
|
|
218
|
+
export const createJwtFetch = (
|
|
219
|
+
accessTokenProvider: () => Promise<string>,
|
|
220
|
+
): typeof fetch =>
|
|
221
|
+
withSessionHeader(async (input, init) => {
|
|
222
|
+
const headers = new Headers(init?.headers);
|
|
223
|
+
headers.set('Authorization', \`Bearer \${await accessTokenProvider()}\`);
|
|
224
|
+
return fetch(input, { ...init, headers });
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
/** A plain fetch (local dev) that still forwards the session id. */
|
|
228
|
+
export const createPlainFetch = (): typeof fetch => withSessionHeader(fetch);
|
|
229
|
+
"
|
|
230
|
+
`;
|
|
231
|
+
|
|
232
|
+
exports[`ts#agent#a2a-connection generator > should match snapshot for agent-connection src files > remote-client-strands.ts 1`] = `
|
|
233
|
+
"import { A2AAgent } from '@strands-agents/sdk/a2a';
|
|
234
|
+
import { AgentCoreA2aClientStrands } from '../core/agentcore-a2a-client-strands.js';
|
|
235
|
+
import { getAgentCoreRuntimeConfig } from '../core/runtime-config.js';
|
|
236
|
+
|
|
237
|
+
/** Strands client for the Remote A2A agent. */
|
|
238
|
+
export class RemoteClientStrands {
|
|
239
|
+
static async create(): Promise<A2AAgent> {
|
|
240
|
+
if (process.env.SERVE_LOCAL === 'true') {
|
|
241
|
+
return AgentCoreA2aClientStrands.withoutAuth({
|
|
242
|
+
url: 'http://localhost:9000/',
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const config = await getAgentCoreRuntimeConfig();
|
|
246
|
+
const agentRuntimeArn = config.agentRuntimes?.['Remote'];
|
|
247
|
+
if (!agentRuntimeArn) {
|
|
248
|
+
throw new Error(
|
|
249
|
+
\`No connected agent runtime named 'Remote' found in runtime configuration.\`,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
return AgentCoreA2aClientStrands.withIamAuth({ agentRuntimeArn });
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
"
|
|
256
|
+
`;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { A2AAgent } from '@strands-agents/sdk/a2a';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentCoreA2aClientStrands } from '../core/agentcore-a2a-client-strands.js';
|
|
3
3
|
import { getAgentCoreRuntimeConfig } from '../core/runtime-config.js';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
export class <%- targetAgentClassName %>
|
|
5
|
+
/** Strands client for the <%- targetAgentClassName %> A2A agent. */
|
|
6
|
+
export class <%- targetAgentClassName %>ClientStrands {
|
|
7
7
|
static async create(): Promise<A2AAgent> {
|
|
8
8
|
if (process.env.SERVE_LOCAL === 'true') {
|
|
9
|
-
return
|
|
9
|
+
return AgentCoreA2aClientStrands.withoutAuth({
|
|
10
10
|
url: 'http://localhost:<%- targetAgentPort %>/',
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -18,6 +18,6 @@ export class <%- targetAgentClassName %>Client {
|
|
|
18
18
|
`No connected agent runtime named '<%- targetAgentClassName %>' found in runtime configuration.`,
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return AgentCoreA2aClientStrands.withIamAuth({ agentRuntimeArn });
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -37,7 +37,7 @@ const tsAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
37
37
|
const npmScope = (0, npm_scope_1.getNpmScope)(tree);
|
|
38
38
|
// 1. Ensure the shared agent-connection project exists + has the A2A core client
|
|
39
39
|
await (0, agent_connection_1.ensureTypeScriptAgentConnectionProject)(tree);
|
|
40
|
-
(0, agent_connection_1.addTypeScriptCoreClient)(tree, 'a2a');
|
|
40
|
+
await (0, agent_connection_1.addTypeScriptCoreClient)(tree, 'a2a');
|
|
41
41
|
// 2. Generate the per-connection <Name>Client into app/
|
|
42
42
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'agent-connection', 'app'), (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'app'), {
|
|
43
43
|
targetAgentKebabCase,
|
|
@@ -45,12 +45,12 @@ const tsAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
45
45
|
targetAgentPort,
|
|
46
46
|
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
47
47
|
// Add re-export to index.ts
|
|
48
|
-
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), `./app/${targetAgentKebabCase}-client.js`);
|
|
48
|
+
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), `./app/${targetAgentKebabCase}-client-strands.js`);
|
|
49
49
|
// 3. AST transform agent.ts to add the remote A2A agent as a tool
|
|
50
50
|
const agentSourceDir = (0, devkit_1.joinPathFragments)(sourceProject.root, agentComponent.path ?? 'src');
|
|
51
51
|
const agentFilePath = (0, devkit_1.joinPathFragments)(agentSourceDir, 'agent.ts');
|
|
52
52
|
if (tree.exists(agentFilePath)) {
|
|
53
|
-
const clientClassName = `${targetAgentClassName}
|
|
53
|
+
const clientClassName = `${targetAgentClassName}ClientStrands`;
|
|
54
54
|
const clientVarName = targetAgentClassName.charAt(0).toLowerCase() +
|
|
55
55
|
targetAgentClassName.slice(1);
|
|
56
56
|
const toolName = `ask${targetAgentClassName}`;
|
|
@@ -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;AACpB,uFAI0D;AAC1D,4CAI4B;AAC5B,kDAA6D;AAC7D,oDAAyE;AACzE,gDAAiD;AACjD,wDAAuD;AACvD,0CAK2B;AAC3B,sDAAuD;AAG1C,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;IACJ,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,iBAAiB,oBAAoB,CAAC,IAAI,cAAc,oBAAoB,CAAC,QAAQ,IAAI,MAAM,wDAAwD,CACxJ,CAAC;IACJ,CAAC;IAED,IACE,oBAAoB,CAAC,IAAI;QACzB,oBAAoB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,EACjD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,yEAAyE,oBAAoB,CAAC,IAAI,WAAW,oBAAoB,CAAC,IAAI,mBAAmB,CAC1J,CAAC;IACJ,CAAC;IAED,MAAM,wBAAwB,GAAG,oBAAoB,CAAC,IAAI,IAAI,OAAO,CAAC;IACtE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,EAAY,CAAC;IAC/D,MAAM,oBAAoB,GAAG,IAAA,iBAAS,EAAC,oBAAoB,CAAC,CAAC;IAC7D,MAAM,eAAe,GAAG,oBAAoB,CAAC,IAAI,IAAI,IAAI,CAAC;IAE1D,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,iFAAiF;IACjF,MAAM,IAAA,yDAAsC,EAAC,IAAI,CAAC,CAAC;IACnD,IAAA,0CAAuB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/a2a-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AACpB,uFAI0D;AAC1D,4CAI4B;AAC5B,kDAA6D;AAC7D,oDAAyE;AACzE,gDAAiD;AACjD,wDAAuD;AACvD,0CAK2B;AAC3B,sDAAuD;AAG1C,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,C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AAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAvKW,QAAA,6BAA6B,iCAuKxC;AAEF,kBAAe,qCAA6B,CAAC"}
|
|
@@ -10,7 +10,7 @@ const agent = withSessionId(getAgent);
|
|
|
10
10
|
|
|
11
11
|
export const appRouter = router({
|
|
12
12
|
invoke: publicProcedure
|
|
13
|
-
.input(z.object({ message: z.string() }))
|
|
13
|
+
.input(z.object({ message: z.string().max(100000) }))
|
|
14
14
|
.output(
|
|
15
15
|
zAsyncIterable({
|
|
16
16
|
yield: z.string(),
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > agent-connection-index.ts 1`] = `
|
|
4
|
+
"export * from './app/my-gateway-client-strands.js';
|
|
5
|
+
export * from './core/model-errors-strands.js';
|
|
6
|
+
export * from './core/with-session-id-strands.js';
|
|
7
|
+
export * from './core/session-context.js';
|
|
8
|
+
// Export your library code here
|
|
9
|
+
"
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > agentcore-fetch.ts 1`] = `
|
|
13
|
+
"import { AwsClient } from 'aws4fetch';
|
|
14
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
15
|
+
import { getCurrentSessionId } from './session-context.js';
|
|
16
|
+
|
|
17
|
+
const SESSION_HEADER = 'X-Amzn-Bedrock-AgentCore-Runtime-Session-Id';
|
|
18
|
+
|
|
19
|
+
/** Wrap a fetch so each request carries the current async-context session id. */
|
|
20
|
+
const withSessionHeader =
|
|
21
|
+
(inner: typeof fetch): typeof fetch =>
|
|
22
|
+
async (input, init) => {
|
|
23
|
+
const headers = new Headers(init?.headers);
|
|
24
|
+
const sessionId = getCurrentSessionId();
|
|
25
|
+
if (sessionId) headers.set(SESSION_HEADER, sessionId);
|
|
26
|
+
return inner(input, { ...init, headers });
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Options for a SigV4-signing fetch. */
|
|
30
|
+
export interface SigV4FetchOptions {
|
|
31
|
+
/** AWS region to sign for. */
|
|
32
|
+
region: string;
|
|
33
|
+
/** AWS service to sign for. Defaults to \`bedrock-agentcore\`. */
|
|
34
|
+
service?: string;
|
|
35
|
+
/** AWS credential provider; defaults to the standard provider chain. */
|
|
36
|
+
credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A fetch that signs every request with AWS SigV4 (per-request, body-aware). */
|
|
40
|
+
export const createSigV4Fetch = (options: SigV4FetchOptions): typeof fetch => {
|
|
41
|
+
const { region, service = 'bedrock-agentcore' } = options;
|
|
42
|
+
const credentialProvider =
|
|
43
|
+
options.credentialProvider ?? fromNodeProviderChain();
|
|
44
|
+
const signedFetch: typeof fetch = async (...args) => {
|
|
45
|
+
const client = new AwsClient({
|
|
46
|
+
...(await credentialProvider()),
|
|
47
|
+
service,
|
|
48
|
+
region,
|
|
49
|
+
});
|
|
50
|
+
return client.fetch(...args);
|
|
51
|
+
};
|
|
52
|
+
return withSessionHeader(signedFetch);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** A fetch that adds a bearer token from the given async provider. */
|
|
56
|
+
export const createJwtFetch = (
|
|
57
|
+
accessTokenProvider: () => Promise<string>,
|
|
58
|
+
): typeof fetch =>
|
|
59
|
+
withSessionHeader(async (input, init) => {
|
|
60
|
+
const headers = new Headers(init?.headers);
|
|
61
|
+
headers.set('Authorization', \`Bearer \${await accessTokenProvider()}\`);
|
|
62
|
+
return fetch(input, { ...init, headers });
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/** A plain fetch (local dev) that still forwards the session id. */
|
|
66
|
+
export const createPlainFetch = (): typeof fetch => withSessionHeader(fetch);
|
|
67
|
+
"
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > agentcore-gateway-mcp-client-strands.ts 1`] = `
|
|
71
|
+
"import { McpClient } from '@strands-agents/sdk';
|
|
72
|
+
import {
|
|
73
|
+
AgentCoreGatewayMcpTransport,
|
|
74
|
+
type AgentCoreGatewayMcpTransportIamOptions,
|
|
75
|
+
} from './agentcore-gateway-mcp-transport.js';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Strands MCP clients that connect to an AgentCore Gateway.
|
|
79
|
+
*/
|
|
80
|
+
export class AgentCoreGatewayMcpClientStrands {
|
|
81
|
+
/** Create a gateway MCP client authenticated with IAM SigV4. */
|
|
82
|
+
static withIamAuth(
|
|
83
|
+
options: AgentCoreGatewayMcpTransportIamOptions,
|
|
84
|
+
): McpClient {
|
|
85
|
+
return new McpClient({
|
|
86
|
+
transport: AgentCoreGatewayMcpTransport.withIamAuth(options),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Plain-HTTP gateway client, for the local gateway started by serve-local. */
|
|
91
|
+
static withoutAuth(options: { gatewayUrl: string }): McpClient {
|
|
92
|
+
return new McpClient({
|
|
93
|
+
transport: AgentCoreGatewayMcpTransport.withoutAuth(options),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
"
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > agentcore-gateway-mcp-transport.ts 1`] = `
|
|
101
|
+
"import type { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
102
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
103
|
+
import { regionFromGatewayUrl } from './agentcore-endpoints.js';
|
|
104
|
+
import { sigV4Transport, noAuthTransport } from './agentcore-transport.js';
|
|
105
|
+
|
|
106
|
+
export interface AgentCoreGatewayMcpTransportIamOptions {
|
|
107
|
+
/**
|
|
108
|
+
* The MCP URL of the AgentCore Gateway, of the form
|
|
109
|
+
* https://<gatewayId>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp
|
|
110
|
+
*/
|
|
111
|
+
gatewayUrl: string;
|
|
112
|
+
/** AWS region override; by default parsed from \`gatewayUrl\`. */
|
|
113
|
+
region?: string;
|
|
114
|
+
/** AWS credential provider; defaults to the standard provider chain. */
|
|
115
|
+
credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Factory for MCP transports that connect to an AgentCore Gateway. Forwards the
|
|
120
|
+
* current async-context session via the AgentCore session header, which the
|
|
121
|
+
* gateway propagates to downstream MCP server targets.
|
|
122
|
+
*/
|
|
123
|
+
export class AgentCoreGatewayMcpTransport {
|
|
124
|
+
/** Create a gateway MCP transport authenticated with IAM SigV4. */
|
|
125
|
+
static withIamAuth(
|
|
126
|
+
options: AgentCoreGatewayMcpTransportIamOptions,
|
|
127
|
+
): StreamableHTTPClientTransport {
|
|
128
|
+
return sigV4Transport({
|
|
129
|
+
region: options.region ?? regionFromGatewayUrl(options.gatewayUrl),
|
|
130
|
+
url: options.gatewayUrl,
|
|
131
|
+
credentialProvider: options.credentialProvider,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Plain-HTTP gateway transport, for the local gateway started by serve-local. */
|
|
136
|
+
static withoutAuth(options: {
|
|
137
|
+
gatewayUrl: string;
|
|
138
|
+
}): StreamableHTTPClientTransport {
|
|
139
|
+
return noAuthTransport({ url: options.gatewayUrl });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
"
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > agentcore-transport.ts 1`] = `
|
|
146
|
+
"import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
147
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
148
|
+
import {
|
|
149
|
+
createSigV4Fetch,
|
|
150
|
+
createJwtFetch,
|
|
151
|
+
createPlainFetch,
|
|
152
|
+
} from './agentcore-fetch.js';
|
|
153
|
+
|
|
154
|
+
const build = (
|
|
155
|
+
url: string,
|
|
156
|
+
fetchFn: typeof fetch,
|
|
157
|
+
): StreamableHTTPClientTransport =>
|
|
158
|
+
new StreamableHTTPClientTransport(new URL(url), { fetch: fetchFn });
|
|
159
|
+
|
|
160
|
+
/** SigV4-signed transport for a resolved AgentCore endpoint. */
|
|
161
|
+
export const sigV4Transport = (options: {
|
|
162
|
+
region: string;
|
|
163
|
+
url: string;
|
|
164
|
+
credentialProvider?: ReturnType<typeof fromNodeProviderChain>;
|
|
165
|
+
}): StreamableHTTPClientTransport =>
|
|
166
|
+
build(
|
|
167
|
+
options.url,
|
|
168
|
+
createSigV4Fetch({
|
|
169
|
+
region: options.region,
|
|
170
|
+
credentialProvider: options.credentialProvider,
|
|
171
|
+
}),
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
/** Bearer-token transport for a resolved AgentCore endpoint. */
|
|
175
|
+
export const jwtTransport = (options: {
|
|
176
|
+
url: string;
|
|
177
|
+
accessTokenProvider: () => Promise<string>;
|
|
178
|
+
}): StreamableHTTPClientTransport =>
|
|
179
|
+
build(options.url, createJwtFetch(options.accessTokenProvider));
|
|
180
|
+
|
|
181
|
+
/** Plain-HTTP transport — for local dev. */
|
|
182
|
+
export const noAuthTransport = (options: {
|
|
183
|
+
url: string;
|
|
184
|
+
}): StreamableHTTPClientTransport => build(options.url, createPlainFetch());
|
|
185
|
+
"
|
|
186
|
+
`;
|
|
187
|
+
|
|
188
|
+
exports[`ts#agent#gateway-connection generator > should match snapshot for agent-connection src files > my-gateway-client-strands.ts 1`] = `
|
|
189
|
+
"import { McpClient } from '@strands-agents/sdk';
|
|
190
|
+
import { AgentCoreGatewayMcpClientStrands } from '../core/agentcore-gateway-mcp-client-strands.js';
|
|
191
|
+
import { getAgentCoreRuntimeConfig } from '../core/runtime-config.js';
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Strands client for the MyGateway AgentCore Gateway.
|
|
195
|
+
*
|
|
196
|
+
* Deployed: a SigV4-signed MCP client pointing at the gateway URL.
|
|
197
|
+
* Local (\`SERVE_LOCAL=true\`): a plain-HTTP client pointing at the local
|
|
198
|
+
* gateway started by the gateway project's serve-local target. The local
|
|
199
|
+
* gateway aggregates every attached MCP server but does not evaluate
|
|
200
|
+
* Cedar policies.
|
|
201
|
+
*/
|
|
202
|
+
export class MyGatewayClientStrands {
|
|
203
|
+
static async create(): Promise<McpClient> {
|
|
204
|
+
if (process.env.SERVE_LOCAL === 'true') {
|
|
205
|
+
return AgentCoreGatewayMcpClientStrands.withoutAuth({
|
|
206
|
+
gatewayUrl: 'http://localhost:8100/mcp',
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
const config = await getAgentCoreRuntimeConfig();
|
|
210
|
+
const gatewayUrl = config.gateways?.['MyGateway'];
|
|
211
|
+
if (!gatewayUrl) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
\`No connected gateway named 'MyGateway' found in runtime configuration.\`,
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return AgentCoreGatewayMcpClientStrands.withIamAuth({ gatewayUrl });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
"
|
|
220
|
+
`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { McpClient } from '@strands-agents/sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentCoreGatewayMcpClientStrands } from '../core/agentcore-gateway-mcp-client-strands.js';
|
|
3
3
|
import { getAgentCoreRuntimeConfig } from '../core/runtime-config.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Strands client for the <%- gatewayClassName %> AgentCore Gateway.
|
|
7
7
|
*
|
|
8
8
|
* Deployed: a SigV4-signed MCP client pointing at the gateway URL.
|
|
9
9
|
* Local (`SERVE_LOCAL=true`): a plain-HTTP client pointing at the local
|
|
@@ -11,10 +11,10 @@ import { getAgentCoreRuntimeConfig } from '../core/runtime-config.js';
|
|
|
11
11
|
* gateway aggregates every attached MCP server but does not evaluate
|
|
12
12
|
* Cedar policies.
|
|
13
13
|
*/
|
|
14
|
-
export class <%- gatewayClassName %>
|
|
14
|
+
export class <%- gatewayClassName %>ClientStrands {
|
|
15
15
|
static async create(): Promise<McpClient> {
|
|
16
16
|
if (process.env.SERVE_LOCAL === 'true') {
|
|
17
|
-
return
|
|
17
|
+
return AgentCoreGatewayMcpClientStrands.withoutAuth({
|
|
18
18
|
gatewayUrl: 'http://localhost:<%- gatewayPort %>/mcp',
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -25,6 +25,6 @@ export class <%- gatewayClassName %>Client {
|
|
|
25
25
|
`No connected gateway named '<%- gatewayClassName %>' found in runtime configuration.`,
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return AgentCoreGatewayMcpClientStrands.withIamAuth({ gatewayUrl });
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -41,7 +41,7 @@ const tsAgentGatewayConnectionGenerator = async (tree, options) => {
|
|
|
41
41
|
// 1. Ensure the shared agent-connection project exists + has the gateway
|
|
42
42
|
// core client template.
|
|
43
43
|
await (0, agent_connection_1.ensureTypeScriptAgentConnectionProject)(tree);
|
|
44
|
-
(0, agent_connection_1.addTypeScriptCoreClient)(tree, 'gateway');
|
|
44
|
+
await (0, agent_connection_1.addTypeScriptCoreClient)(tree, 'gateway');
|
|
45
45
|
// 2. Generate the per-connection <Gateway>Client into app/. Local mode
|
|
46
46
|
// points at the gateway project's local gateway port.
|
|
47
47
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'agent-connection', 'app'), (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'app'), {
|
|
@@ -50,13 +50,13 @@ const tsAgentGatewayConnectionGenerator = async (tree, options) => {
|
|
|
50
50
|
gatewayPort: gateway.port,
|
|
51
51
|
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
52
52
|
// Re-export from the agent-connection index
|
|
53
|
-
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), `./app/${gatewayKebabCase}-client.js`);
|
|
53
|
+
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(agent_connection_1.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), `./app/${gatewayKebabCase}-client-strands.js`);
|
|
54
54
|
// 3. AST-transform agent.ts to add the gateway client (an McpClient in
|
|
55
55
|
// both deployed and local modes) to the agent's tools.
|
|
56
56
|
const agentSourceDir = (0, devkit_1.joinPathFragments)(sourceProject.root, agentComponent.path ?? 'src');
|
|
57
57
|
const agentFilePath = (0, devkit_1.joinPathFragments)(agentSourceDir, 'agent.ts');
|
|
58
58
|
if (tree.exists(agentFilePath)) {
|
|
59
|
-
const clientClassName = `${gatewayClassName}
|
|
59
|
+
const clientClassName = `${gatewayClassName}ClientStrands`;
|
|
60
60
|
const clientVarName = gatewayClassName.charAt(0).toLowerCase() + gatewayClassName.slice(1);
|
|
61
61
|
await (0, ast_1.addDestructuredImport)(tree, agentFilePath, [clientClassName], `:${npmScope}/agent-connection`);
|
|
62
62
|
await (0, agent_connection_1.addTypeScriptClientToAgent)(tree, agentFilePath, clientClassName, clientVarName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/gateway-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AACpB,oEAAoF;AACpF,uFAK0D;AAC1D,4CAA0E;AAC1E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CAAC,CAAC;IACrD,MAAM,sBAAsB,GAAG,GAAG,gBAAgB,QAAQ,CAAC;IAC3D,MAAM,2BAA2B,GAAG,GAAG,gBAAgB,cAAc,CAAC;IAEtE,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,yEAAyE;IACzE,2BAA2B;IAC3B,MAAM,IAAA,yDAAsC,EAAC,IAAI,CAAC,CAAC;IACnD,IAAA,0CAAuB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/gateway-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AACpB,oEAAoF;AACpF,uFAK0D;AAC1D,4CAA0E;AAC1E,kDAA6D;AAC7D,oDAAyE;AACzE,gDAAiD;AACjD,wDAAuD;AACvD,0CAK2B;AAC3B,sDAAuD;AAG1C,QAAA,0CAA0C,GACrD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,iCAAiC,GAAG,KAAK,EACpD,IAAU,EACV,OAAgD,EACpB,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,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,wCAA4B,EAAC,aAAa,CAAC,CAAC;IAE5D,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,YAAY,OAAO,CAAC,IAAI,mBAAmB,OAA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oB,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,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,2BAA2B;SACpC,CAAC,CAAC;QACH,oBAAoB,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,IAAI,oBAAoB,EAAE,CAAC;QACzB,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,kBAAkB;IAClB,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,2BAA2B;QAC3B,qBAAqB;QACrB,mCAAmC;QACnC,+BAA+B;QAC/B,WAAW;QACX,+BAA+B;KAChC,CAAC,EACF,EAAE,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,kDAA0C;KAC3C,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;AA/IW,QAAA,iCAAiC,qCA+I5C;AAEF,kBAAe,yCAAiC,CAAC"}
|
|
@@ -47,6 +47,9 @@ const tsAgentGenerator = async (tree, options) => {
|
|
|
47
47
|
// ID to any downstream MCP / A2A clients a later connection generator
|
|
48
48
|
// wires into this agent.
|
|
49
49
|
await (0, agent_connection_1.ensureTypeScriptAgentConnectionProject)(tree);
|
|
50
|
+
// The agent server imports the framework base helpers (session cache + model
|
|
51
|
+
// error logging) regardless of whether a connection client is wired in.
|
|
52
|
+
await (0, agent_connection_1.addTypeScriptFrameworkBase)(tree);
|
|
50
53
|
const templateContext = {
|
|
51
54
|
name,
|
|
52
55
|
agentNameClassName,
|