@aws/nx-plugin 1.0.0-rc.18 → 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/package.json +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 -0
- 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/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +7 -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/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
|
@@ -14,6 +14,11 @@ resource "null_resource" "print_info" {
|
|
|
14
14
|
# }
|
|
15
15
|
|
|
16
16
|
provisioner "local-exec" {
|
|
17
|
-
command = "echo
|
|
17
|
+
command = "echo \"AWS Region: $AWS_REGION, AWS Account: $ACCOUNT_ID, Environment: $ENVIRONMENT\""
|
|
18
|
+
environment = {
|
|
19
|
+
AWS_REGION = local.aws_region
|
|
20
|
+
ACCOUNT_ID = local.account_id
|
|
21
|
+
ENVIRONMENT = var.environment
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
}
|
|
@@ -281,7 +281,7 @@ import { EchoInputSchema, EchoOutputSchema } from '../schema/index.js';
|
|
|
281
281
|
export const echo = publicProcedure
|
|
282
282
|
.input(EchoInputSchema)
|
|
283
283
|
.output(EchoOutputSchema)
|
|
284
|
-
.query((opts) => ({
|
|
284
|
+
.query((opts) => ({ message: opts.input.message }));
|
|
285
285
|
"
|
|
286
286
|
`;
|
|
287
287
|
|
|
@@ -303,13 +303,13 @@ exports[`trpc backend generator > should generate the project > apps/test-api/sr
|
|
|
303
303
|
"import { z } from 'zod';
|
|
304
304
|
|
|
305
305
|
export const EchoInputSchema = z.object({
|
|
306
|
-
message: z.string(),
|
|
306
|
+
message: z.string().max(1024),
|
|
307
307
|
});
|
|
308
308
|
|
|
309
309
|
export type IEchoInput = z.TypeOf<typeof EchoInputSchema>;
|
|
310
310
|
|
|
311
311
|
export const EchoOutputSchema = z.object({
|
|
312
|
-
|
|
312
|
+
message: z.string().max(1024),
|
|
313
313
|
});
|
|
314
314
|
|
|
315
315
|
export type IEchoOutput = z.TypeOf<typeof EchoOutputSchema>;
|
|
@@ -1206,6 +1206,7 @@ import {
|
|
|
1206
1206
|
HttpMethod,
|
|
1207
1207
|
HttpStage,
|
|
1208
1208
|
LogGroupLogDestination,
|
|
1209
|
+
ThrottleSettings,
|
|
1209
1210
|
} from 'aws-cdk-lib/aws-apigatewayv2';
|
|
1210
1211
|
import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
1211
1212
|
import { suppressRules } from '../checkov.js';
|
|
@@ -1232,6 +1233,12 @@ export interface HttpApiProps<
|
|
|
1232
1233
|
* Map of operation names to their API Gateway integrations
|
|
1233
1234
|
*/
|
|
1234
1235
|
readonly integrations: TIntegrations;
|
|
1236
|
+
/**
|
|
1237
|
+
* Default throttling limits applied to the API's default stage.
|
|
1238
|
+
*
|
|
1239
|
+
* @default { rateLimit: 10000, burstLimit: 5000 }
|
|
1240
|
+
*/
|
|
1241
|
+
readonly throttle?: ThrottleSettings;
|
|
1235
1242
|
}
|
|
1236
1243
|
|
|
1237
1244
|
/**
|
|
@@ -1265,6 +1272,7 @@ export class HttpApi<
|
|
|
1265
1272
|
apiName,
|
|
1266
1273
|
operations,
|
|
1267
1274
|
integrations,
|
|
1275
|
+
throttle = { rateLimit: 10000, burstLimit: 5000 },
|
|
1268
1276
|
...props
|
|
1269
1277
|
}: HttpApiProps<TIntegrations, TOperation>,
|
|
1270
1278
|
) {
|
|
@@ -1292,6 +1300,7 @@ export class HttpApi<
|
|
|
1292
1300
|
this.defaultStage = new HttpStage(this, 'DefaultStage', {
|
|
1293
1301
|
httpApi: this.api,
|
|
1294
1302
|
autoDeploy: true,
|
|
1303
|
+
throttle,
|
|
1295
1304
|
accessLogSettings: {
|
|
1296
1305
|
destination: new LogGroupLogDestination(accessLogGroup),
|
|
1297
1306
|
},
|
|
@@ -2073,6 +2082,7 @@ import {
|
|
|
2073
2082
|
RestApiProps as _RestApiProps,
|
|
2074
2083
|
IResource,
|
|
2075
2084
|
Stage,
|
|
2085
|
+
ThrottleSettings,
|
|
2076
2086
|
} from 'aws-cdk-lib/aws-apigateway';
|
|
2077
2087
|
import { IAspect, RemovalPolicy } from 'aws-cdk-lib';
|
|
2078
2088
|
import {
|
|
@@ -2119,6 +2129,12 @@ export interface RestApiProps<
|
|
|
2119
2129
|
* @default true
|
|
2120
2130
|
*/
|
|
2121
2131
|
readonly enableWaf?: boolean;
|
|
2132
|
+
/**
|
|
2133
|
+
* Default throttling limits applied to all methods on the API's default stage.
|
|
2134
|
+
*
|
|
2135
|
+
* @default { rateLimit: 10000, burstLimit: 5000 }
|
|
2136
|
+
*/
|
|
2137
|
+
readonly throttle?: ThrottleSettings;
|
|
2122
2138
|
}
|
|
2123
2139
|
|
|
2124
2140
|
/**
|
|
@@ -2153,6 +2169,7 @@ export class RestApi<
|
|
|
2153
2169
|
operations,
|
|
2154
2170
|
integrations,
|
|
2155
2171
|
enableWaf = true,
|
|
2172
|
+
throttle = { rateLimit: 10000, burstLimit: 5000 },
|
|
2156
2173
|
...props
|
|
2157
2174
|
}: RestApiProps<TIntegrations, TOperation>,
|
|
2158
2175
|
) {
|
|
@@ -2160,7 +2177,21 @@ export class RestApi<
|
|
|
2160
2177
|
this.integrations = integrations;
|
|
2161
2178
|
|
|
2162
2179
|
// Create the API Gateway REST API
|
|
2163
|
-
this.api = new _RestApi(this, 'Api',
|
|
2180
|
+
this.api = new _RestApi(this, 'Api', {
|
|
2181
|
+
...props,
|
|
2182
|
+
deployOptions: {
|
|
2183
|
+
...props.deployOptions,
|
|
2184
|
+
methodOptions: {
|
|
2185
|
+
...props.deployOptions?.methodOptions,
|
|
2186
|
+
// Default throttling applied to all resource paths and methods
|
|
2187
|
+
'/*/*': {
|
|
2188
|
+
throttlingRateLimit: throttle.rateLimit,
|
|
2189
|
+
throttlingBurstLimit: throttle.burstLimit,
|
|
2190
|
+
...props.deployOptions?.methodOptions?.['/*/*'],
|
|
2191
|
+
},
|
|
2192
|
+
},
|
|
2193
|
+
},
|
|
2194
|
+
});
|
|
2164
2195
|
|
|
2165
2196
|
if (enableWaf) {
|
|
2166
2197
|
this.webAcl = new CfnWebACL(this, 'WebAcl', {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const EchoInputSchema = z.object({
|
|
4
|
-
message: z.string(),
|
|
4
|
+
message: z.string().max(1024),
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
export type IEchoInput = z.TypeOf<typeof EchoInputSchema>;
|
|
8
8
|
|
|
9
9
|
export const EchoOutputSchema = z.object({
|
|
10
|
-
|
|
10
|
+
message: z.string().max(1024),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export type IEchoOutput = z.TypeOf<typeof EchoOutputSchema>;
|
|
@@ -1104,14 +1104,19 @@ resource "null_resource" "docker_publish" {
|
|
|
1104
1104
|
provisioner "local-exec" {
|
|
1105
1105
|
command = <<-EOT
|
|
1106
1106
|
# Get ECR login token
|
|
1107
|
-
aws ecr get-login-password --region
|
|
1107
|
+
aws ecr get-login-password --region "$AWS_REGION" | docker login --username AWS --password-stdin "$REPOSITORY_URL"
|
|
1108
1108
|
|
|
1109
1109
|
# Tag the image
|
|
1110
|
-
docker tag
|
|
1110
|
+
docker tag "$DOCKER_IMAGE_TAG" "$REPOSITORY_URL:latest"
|
|
1111
1111
|
|
|
1112
1112
|
# Push the image
|
|
1113
|
-
docker push
|
|
1113
|
+
docker push "$REPOSITORY_URL:latest"
|
|
1114
1114
|
EOT
|
|
1115
|
+
environment = {
|
|
1116
|
+
AWS_REGION = local.aws_region
|
|
1117
|
+
REPOSITORY_URL = self.triggers.repository_url
|
|
1118
|
+
DOCKER_IMAGE_TAG = self.triggers.docker_image_tag
|
|
1119
|
+
}
|
|
1115
1120
|
}
|
|
1116
1121
|
|
|
1117
1122
|
depends_on = [aws_ecr_repository_policy.agent_core_ecr_policy]
|
|
@@ -1173,10 +1178,11 @@ resource "null_resource" "runtime_ready" {
|
|
|
1173
1178
|
uv run --with boto3 python -c "
|
|
1174
1179
|
import boto3
|
|
1175
1180
|
import json
|
|
1181
|
+
import os
|
|
1176
1182
|
import time
|
|
1177
1183
|
import uuid
|
|
1178
1184
|
|
|
1179
|
-
runtime_arn =
|
|
1185
|
+
runtime_arn = os.environ['RUNTIME_ARN']
|
|
1180
1186
|
client = boto3.client('bedrock-agentcore')
|
|
1181
1187
|
initialize_request = json.dumps({
|
|
1182
1188
|
'jsonrpc': '2.0',
|
|
@@ -1208,6 +1214,9 @@ while True:
|
|
|
1208
1214
|
print(f'Runtime {runtime_arn} is serving MCP')
|
|
1209
1215
|
"
|
|
1210
1216
|
EOT
|
|
1217
|
+
environment = {
|
|
1218
|
+
RUNTIME_ARN = self.triggers.runtime_arn
|
|
1219
|
+
}
|
|
1211
1220
|
}
|
|
1212
1221
|
}
|
|
1213
1222
|
|
|
@@ -1560,7 +1569,7 @@ const agent = withSessionId(getAgent);
|
|
|
1560
1569
|
|
|
1561
1570
|
export const appRouter = router({
|
|
1562
1571
|
invoke: publicProcedure
|
|
1563
|
-
.input(z.object({ message: z.string() }))
|
|
1572
|
+
.input(z.object({ message: z.string().max(100000) }))
|
|
1564
1573
|
.output(
|
|
1565
1574
|
zAsyncIterable({
|
|
1566
1575
|
yield: z.string(),
|
|
@@ -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":["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I,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,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,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ure
|
|
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(),
|