@aws/nx-plugin 0.97.1 → 0.99.0
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 +17 -1
- package/package.json +1 -1
- package/src/connection/agent-runtime-config.d.ts +19 -0
- package/src/connection/agent-runtime-config.js +52 -0
- package/src/connection/agent-runtime-config.js.map +1 -0
- package/src/connection/generator.js +15 -5
- package/src/connection/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +3 -17
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +8 -5
- package/src/py/strands-agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +29 -0
- package/src/py/strands-agent/a2a-connection/generator.d.ts +10 -0
- package/src/py/strands-agent/a2a-connection/generator.js +164 -0
- package/src/py/strands-agent/a2a-connection/generator.js.map +1 -0
- package/src/py/strands-agent/a2a-connection/schema.d.ts +15 -0
- package/src/py/strands-agent/a2a-connection/schema.json +26 -0
- package/src/py/strands-agent/files/a2a/main.py.template +33 -0
- package/src/py/strands-agent/files/{app → common}/agent.py.template +2 -0
- package/src/py/strands-agent/files/deploy/Dockerfile.template +9 -0
- package/src/py/strands-agent/generator.js +29 -16
- package/src/py/strands-agent/generator.js.map +1 -1
- package/src/py/strands-agent/mcp-connection/__snapshots__/generator.spec.ts.snap +9 -63
- package/src/py/strands-agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +4 -19
- package/src/py/strands-agent/mcp-connection/generator.js +16 -19
- package/src/py/strands-agent/mcp-connection/generator.js.map +1 -1
- package/src/py/strands-agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -17
- package/src/py/strands-agent/react-connection/generator.js +12 -0
- package/src/py/strands-agent/react-connection/generator.js.map +1 -1
- package/src/py/strands-agent/schema.d.ts +2 -0
- package/src/py/strands-agent/schema.json +8 -0
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +3 -17
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/strands-agent/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/strands-agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +27 -0
- package/src/ts/strands-agent/a2a-connection/generator.d.ts +10 -0
- package/src/ts/strands-agent/a2a-connection/generator.js +119 -0
- package/src/ts/strands-agent/a2a-connection/generator.js.map +1 -0
- package/src/ts/strands-agent/a2a-connection/schema.d.ts +15 -0
- package/src/ts/strands-agent/a2a-connection/schema.json +26 -0
- package/src/ts/strands-agent/files/a2a/index.ts.template +28 -0
- package/src/ts/strands-agent/files/deploy/Dockerfile.template +4 -0
- package/src/ts/strands-agent/generator.js +30 -14
- package/src/ts/strands-agent/generator.js.map +1 -1
- package/src/ts/strands-agent/mcp-connection/__snapshots__/generator.spec.ts.snap +9 -31
- package/src/ts/strands-agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +2 -9
- package/src/ts/strands-agent/mcp-connection/generator.js +4 -2
- package/src/ts/strands-agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/strands-agent/react-connection/generator.js +12 -0
- package/src/ts/strands-agent/react-connection/generator.js.map +1 -1
- package/src/ts/strands-agent/schema.d.ts +2 -0
- package/src/ts/strands-agent/schema.json +8 -0
- package/src/utils/agent-connection/agent-connection.d.ts +31 -3
- package/src/utils/agent-connection/agent-connection.js +62 -30
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +134 -0
- package/src/utils/agent-connection/files/{core → core-mcp}/agentcore-mcp-client.ts.template +7 -22
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +40 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +91 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/__init__.py.template +3 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/sigv4.py.template +48 -0
- package/src/utils/agent-connection/files/{py-core → py-core-mcp}/agentcore_mcp_client.py.template +2 -36
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +44 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +3 -2
- package/src/utils/agent-core-constructs/agent-core-constructs.js +2 -2
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +8 -3
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +1 -1
- package/src/utils/ast.d.ts +18 -0
- package/src/utils/ast.js +58 -9
- package/src/utils/ast.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +3 -16
- package/src/utils/versions.d.ts +6 -3
- package/src/utils/versions.js +5 -2
- package/src/utils/versions.js.map +1 -1
- /package/src/py/strands-agent/files/{app → common}/__init__.py.template +0 -0
- /package/src/py/strands-agent/files/{app → http}/init.py.template +0 -0
- /package/src/py/strands-agent/files/{app → http}/main.py.template +0 -0
- /package/src/ts/strands-agent/files/{app → common}/agent.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/agent-core-trpc-client.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/client.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/index.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/init.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/router.ts.template +0 -0
- /package/src/ts/strands-agent/files/{app → http}/schema/z-async-iterable.ts.template +0 -0
|
@@ -40,21 +40,27 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
40
40
|
const targetSourceDir = (0, devkit_1.joinPathFragments)(project.sourceRoot, agentNameSnakeCase);
|
|
41
41
|
const computeType = options.computeType ?? 'BedrockAgentCoreRuntime';
|
|
42
42
|
const auth = options.auth ?? 'IAM';
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
const protocol = options.protocol ?? 'HTTP';
|
|
44
|
+
const templateContext = {
|
|
45
45
|
name,
|
|
46
46
|
agentNameSnakeCase,
|
|
47
47
|
agentNameClassName,
|
|
48
48
|
moduleName,
|
|
49
|
-
}
|
|
49
|
+
};
|
|
50
|
+
// Generate common files shared by both protocols
|
|
51
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'common'), targetSourceDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
52
|
+
// Generate protocol-specific files
|
|
53
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', protocol.toLowerCase()), targetSourceDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
50
54
|
(0, py_1.addDependenciesToPyProjectToml)(tree, project.root, [
|
|
51
55
|
'aws-lambda-powertools',
|
|
52
56
|
'aws-opentelemetry-distro',
|
|
53
57
|
'bedrock-agentcore',
|
|
54
|
-
'fastapi',
|
|
55
58
|
'boto3',
|
|
59
|
+
'fastapi',
|
|
56
60
|
'mcp',
|
|
57
|
-
'
|
|
61
|
+
...(protocol === 'A2A'
|
|
62
|
+
? ['strands-agents[a2a]']
|
|
63
|
+
: ['strands-agents']),
|
|
58
64
|
'strands-agents-tools',
|
|
59
65
|
'uvicorn',
|
|
60
66
|
]);
|
|
@@ -72,9 +78,10 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
72
78
|
agentNameSnakeCase,
|
|
73
79
|
moduleName,
|
|
74
80
|
bundleOutputDir,
|
|
81
|
+
protocol,
|
|
75
82
|
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
76
83
|
const dockerTargetName = `${agentTargetPrefix}-docker`;
|
|
77
|
-
// Add a docker target specific to this
|
|
84
|
+
// Add a docker target specific to this agent
|
|
78
85
|
project.targets[dockerTargetName] = {
|
|
79
86
|
cache: true,
|
|
80
87
|
executor: 'nx:run-commands',
|
|
@@ -99,12 +106,17 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
99
106
|
iacProvider,
|
|
100
107
|
projectName: project.name,
|
|
101
108
|
auth,
|
|
109
|
+
serverProtocol: protocol,
|
|
102
110
|
});
|
|
103
111
|
}
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
const localDevPort = (0, port_1.assignPort)(tree, project,
|
|
112
|
+
// A2A servers use port 9000 as per the Strands A2A SDK default and AgentCore A2A contract.
|
|
113
|
+
// HTTP agents use port 8081+ to avoid conflict with VS Code server on 8080.
|
|
114
|
+
const localDevPortStart = protocol === 'A2A' ? 9000 : 8081;
|
|
115
|
+
const localDevPort = (0, port_1.assignPort)(tree, project, localDevPortStart);
|
|
116
|
+
// Both protocols use fastapi dev for hot reload:
|
|
117
|
+
// - HTTP: FastAPI app directly defined in init.py
|
|
118
|
+
// - A2A: A2AServer.to_fastapi_app() creates a FastAPI app in main.py
|
|
119
|
+
const serveCommand = `uv run fastapi dev ${moduleName}/${agentNameSnakeCase}/main.py --port ${localDevPort}`;
|
|
108
120
|
(0, devkit_1.updateProjectConfiguration)(tree, project.name, {
|
|
109
121
|
...project,
|
|
110
122
|
targets: {
|
|
@@ -112,21 +124,21 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
112
124
|
[`${agentTargetPrefix}-serve`]: {
|
|
113
125
|
executor: 'nx:run-commands',
|
|
114
126
|
options: {
|
|
115
|
-
commands: [
|
|
116
|
-
`uv run fastapi dev ${moduleName}/${agentNameSnakeCase}/main.py --port ${localDevPort}`,
|
|
117
|
-
],
|
|
127
|
+
commands: [serveCommand],
|
|
118
128
|
cwd: '{projectRoot}',
|
|
129
|
+
env: {
|
|
130
|
+
PORT: `${localDevPort}`,
|
|
131
|
+
},
|
|
119
132
|
},
|
|
120
133
|
continuous: true,
|
|
121
134
|
},
|
|
122
135
|
[`${agentTargetPrefix}-serve-local`]: {
|
|
123
136
|
executor: 'nx:run-commands',
|
|
124
137
|
options: {
|
|
125
|
-
commands: [
|
|
126
|
-
`uv run fastapi dev ${moduleName}/${agentNameSnakeCase}/main.py --port ${localDevPort}`,
|
|
127
|
-
],
|
|
138
|
+
commands: [serveCommand],
|
|
128
139
|
cwd: '{projectRoot}',
|
|
129
140
|
env: {
|
|
141
|
+
PORT: `${localDevPort}`,
|
|
130
142
|
SERVE_LOCAL: 'true',
|
|
131
143
|
},
|
|
132
144
|
},
|
|
@@ -138,6 +150,7 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
138
150
|
port: localDevPort,
|
|
139
151
|
rc: agentNameClassName,
|
|
140
152
|
auth,
|
|
153
|
+
protocol,
|
|
141
154
|
});
|
|
142
155
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
143
156
|
exports.PY_STRANDS_AGENT_GENERATOR_INFO,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/strands-agent/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,uCAMwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,6CAAwE;AACxE,uCAGwB;AACxB,mGAAwF;AAExF,sDAAkE;AAClE,qDAAoD;AACpD,qEAA0E;AAC1E,yDAA6D;AAC7D,yCAAqD;AACrD,2CAA8C;AAC9C,6CAA0D;AAE7C,QAAA,+BAA+B,GAC1C,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,uBAAuB,GAAG,KAAK,EAC1C,IAAU,EACV,OAAsC,EACV,EAAE;IAC9B,MAAM,OAAO,GAAG,IAAA,wCAAmC,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3E,MAAM,aAAa,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAExE,iDAAiD;IACjD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,uBAAuB,OAAO,CAAC,OAAO,qDAAqD,CAC5F,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,gIAAgI,CACjI,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEvD,MAAM,IAAI,GAAG,IAAA,iBAAS,EACpB,OAAO,CAAC,IAAI,IAAI,GAAG,IAAA,iBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CACpE,CAAC;IACF,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;IAExD,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC;IAChE,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;IAE7C,MAAM,eAAe,GAAG,IAAA,0BAAiB,EACvC,OAAO,CAAC,UAAU,EAClB,kBAAkB,CACnB,CAAC;IAEF,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,yBAAyB,CAAC;IACrE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/strands-agent/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,uCAMwB;AACx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aACjB;SACF;KACF,CAAC,CAAC;IAEH,IAAA,kCAA6B,EAC3B,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,uCAA+B,EAC/B,IAAA,6BAAqB,EAAC,OAAO,EAAE,eAAe,CAAC,EAC/C,iBAAiB,EACjB;QACE,IAAI,EAAE,YAAY;QAClB,EAAE,EAAE,kBAAkB;QACtB,IAAI;QACJ,QAAQ;KACT,CACF,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,uCAA+B;KAChC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,KAAK,IAAI,EAAE;QAChB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC1B,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AA9MW,QAAA,uBAAuB,2BA8MlC;AAEF,kBAAe,+BAAuB,CAAC"}
|
|
@@ -10,50 +10,12 @@ __all__ = ["InventoryMcpClient"]
|
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
exports[`py#strands-agent#mcp-connection generator > should match snapshot for generated files > agentcore_mcp_client.py 1`] = `
|
|
13
|
-
"import
|
|
14
|
-
from collections.abc import Generator
|
|
15
|
-
from typing import Any
|
|
16
|
-
|
|
17
|
-
import boto3
|
|
13
|
+
"import boto3
|
|
18
14
|
import httpx
|
|
19
|
-
from botocore.auth import SigV4Auth
|
|
20
|
-
from botocore.awsrequest import AWSRequest
|
|
21
15
|
from mcp.client.streamable_http import streamablehttp_client
|
|
22
16
|
from strands.tools.mcp.mcp_client import MCPClient
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
class SigV4HTTPXAuth(httpx.Auth):
|
|
26
|
-
"""HTTPX Auth class that signs requests with AWS SigV4."""
|
|
27
|
-
|
|
28
|
-
def __init__(self, credentials: Any, region: str):
|
|
29
|
-
self.credentials = credentials
|
|
30
|
-
self.service = "bedrock-agentcore"
|
|
31
|
-
self.region = region
|
|
32
|
-
self.signer = SigV4Auth(credentials, self.service, region)
|
|
33
|
-
|
|
34
|
-
def auth_flow(
|
|
35
|
-
self, request: httpx.Request
|
|
36
|
-
) -> Generator[httpx.Request, httpx.Response, None]:
|
|
37
|
-
headers = dict(request.headers)
|
|
38
|
-
|
|
39
|
-
headers.pop("connection", None)
|
|
40
|
-
headers["x-amz-content-sha256"] = hashlib.sha256(
|
|
41
|
-
request.content if request.content else b""
|
|
42
|
-
).hexdigest()
|
|
43
|
-
|
|
44
|
-
aws_request = AWSRequest(
|
|
45
|
-
method=request.method,
|
|
46
|
-
url=str(request.url),
|
|
47
|
-
data=request.content,
|
|
48
|
-
headers=headers,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
self.signer.add_auth(aws_request)
|
|
52
|
-
|
|
53
|
-
request.headers.clear()
|
|
54
|
-
request.headers.update(dict(aws_request.headers))
|
|
55
|
-
|
|
56
|
-
yield request
|
|
18
|
+
from .auth import SigV4HTTPXAuth
|
|
57
19
|
|
|
58
20
|
|
|
59
21
|
class AgentCoreMCPClient:
|
|
@@ -104,7 +66,7 @@ class AgentCoreMCPClient:
|
|
|
104
66
|
return AgentCoreMCPClient._create(
|
|
105
67
|
agent_runtime_arn=agent_runtime_arn,
|
|
106
68
|
session_id=session_id,
|
|
107
|
-
auth_handler=SigV4HTTPXAuth(credentials, region),
|
|
69
|
+
auth_handler=SigV4HTTPXAuth(credentials, "bedrock-agentcore", region),
|
|
108
70
|
)
|
|
109
71
|
|
|
110
72
|
@staticmethod
|
|
@@ -132,12 +94,13 @@ class AgentCoreMCPClient:
|
|
|
132
94
|
exports[`py#strands-agent#mcp-connection generator > should match snapshot for generated files > inventory_mcp_client.py 1`] = `
|
|
133
95
|
"import os
|
|
134
96
|
|
|
135
|
-
from aws_lambda_powertools.utilities import parameters
|
|
136
|
-
from botocore.config import Config
|
|
137
97
|
from mcp.client.streamable_http import streamablehttp_client
|
|
138
98
|
from strands.tools.mcp.mcp_client import MCPClient
|
|
139
99
|
|
|
140
100
|
from proj_agent_connection.core.agentcore_mcp_client import AgentCoreMCPClient
|
|
101
|
+
from proj_agent_connection.core.runtime_config import (
|
|
102
|
+
get_connected_agent_runtime_arn,
|
|
103
|
+
)
|
|
141
104
|
|
|
142
105
|
|
|
143
106
|
class InventoryMcpClient:
|
|
@@ -155,33 +118,16 @@ class InventoryMcpClient:
|
|
|
155
118
|
if os.environ.get("SERVE_LOCAL") == "true":
|
|
156
119
|
return MCPClient(lambda: streamablehttp_client("http://localhost:8082/mcp"))
|
|
157
120
|
|
|
158
|
-
arn = InventoryMcpClient._get_arn()
|
|
159
121
|
return AgentCoreMCPClient.with_iam_auth(
|
|
160
|
-
agent_runtime_arn=
|
|
122
|
+
agent_runtime_arn=get_connected_agent_runtime_arn("InventoryMcp"),
|
|
161
123
|
session_id=session_id,
|
|
162
124
|
)
|
|
163
|
-
|
|
164
|
-
@staticmethod
|
|
165
|
-
def _get_arn() -> str:
|
|
166
|
-
"""Resolve the InventoryMcp ARN from runtime config (AppConfig)."""
|
|
167
|
-
region = os.environ.get("AWS_REGION", os.environ.get("AWS_DEFAULT_REGION"))
|
|
168
|
-
provider_kwargs = {}
|
|
169
|
-
if region:
|
|
170
|
-
provider_kwargs["config"] = Config(region_name=region)
|
|
171
|
-
provider = parameters.AppConfigProvider(
|
|
172
|
-
environment="default",
|
|
173
|
-
application=os.environ["RUNTIME_CONFIG_APP_ID"],
|
|
174
|
-
**provider_kwargs,
|
|
175
|
-
)
|
|
176
|
-
config = provider.get("connection", transform="json")
|
|
177
|
-
return config["agentRuntimes"]["InventoryMcp"]
|
|
178
125
|
"
|
|
179
126
|
`;
|
|
180
127
|
|
|
181
128
|
exports[`py#strands-agent#mcp-connection generator > should match snapshot for generated files > transformed-agent.py 1`] = `
|
|
182
|
-
"from
|
|
183
|
-
|
|
184
|
-
from proj_agent_connection import InventoryMcpClient
|
|
129
|
+
"from proj_agent_connection import InventoryMcpClient
|
|
130
|
+
from contextlib import contextmanager
|
|
185
131
|
|
|
186
132
|
from strands import Agent, tool
|
|
187
133
|
from strands_tools import current_time
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
-
from aws_lambda_powertools.utilities import parameters
|
|
4
|
-
from botocore.config import Config
|
|
5
3
|
from mcp.client.streamable_http import streamablehttp_client
|
|
6
4
|
from strands.tools.mcp.mcp_client import MCPClient
|
|
7
5
|
|
|
8
6
|
from <%- agentConnectionModuleName %>.core.agentcore_mcp_client import AgentCoreMCPClient
|
|
7
|
+
from <%- agentConnectionModuleName %>.core.runtime_config import (
|
|
8
|
+
get_connected_agent_runtime_arn,
|
|
9
|
+
)
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class <%- mcpServerClassName %>Client:
|
|
@@ -23,23 +24,7 @@ class <%- mcpServerClassName %>Client:
|
|
|
23
24
|
if os.environ.get("SERVE_LOCAL") == "true":
|
|
24
25
|
return MCPClient(lambda: streamablehttp_client("http://localhost:<%- mcpServerPort %>/mcp"))
|
|
25
26
|
|
|
26
|
-
arn = <%- mcpServerClassName %>Client._get_arn()
|
|
27
27
|
return AgentCoreMCPClient.with_iam_auth(
|
|
28
|
-
agent_runtime_arn=
|
|
28
|
+
agent_runtime_arn=get_connected_agent_runtime_arn("<%- mcpServerClassName %>"),
|
|
29
29
|
session_id=session_id,
|
|
30
30
|
)
|
|
31
|
-
|
|
32
|
-
@staticmethod
|
|
33
|
-
def _get_arn() -> str:
|
|
34
|
-
"""Resolve the <%- mcpServerClassName %> ARN from runtime config (AppConfig)."""
|
|
35
|
-
region = os.environ.get("AWS_REGION", os.environ.get("AWS_DEFAULT_REGION"))
|
|
36
|
-
provider_kwargs = {}
|
|
37
|
-
if region:
|
|
38
|
-
provider_kwargs["config"] = Config(region_name=region)
|
|
39
|
-
provider = parameters.AppConfigProvider(
|
|
40
|
-
environment="default",
|
|
41
|
-
application=os.environ["RUNTIME_CONFIG_APP_ID"],
|
|
42
|
-
**provider_kwargs,
|
|
43
|
-
)
|
|
44
|
-
config = provider.get("connection", transform="json")
|
|
45
|
-
return config["agentRuntimes"]["<%- mcpServerClassName %>"]
|
|
@@ -31,11 +31,21 @@ const pyStrandsAgentMcpConnectionGenerator = async (tree, options) => {
|
|
|
31
31
|
const mcpServerClassName = mcpComponent.rc;
|
|
32
32
|
const mcpServerSnakeCase = (0, names_1.snakeCase)(mcpServerClassName);
|
|
33
33
|
const mcpServerPort = mcpComponent.port ?? 8000;
|
|
34
|
-
// 1. Ensure the shared Python agent-connection project exists
|
|
34
|
+
// 1. Ensure the shared Python agent-connection project exists + has the
|
|
35
|
+
// MCP core client and its shared SigV4 auth helper.
|
|
35
36
|
await (0, agent_connection_1.ensurePythonAgentConnectionProject)(tree);
|
|
37
|
+
(0, agent_connection_1.addPythonCoreClient)(tree, 'auth');
|
|
38
|
+
(0, agent_connection_1.addPythonCoreClient)(tree, 'mcp');
|
|
36
39
|
const agentConnectionProjectDir = (0, agent_connection_1.getPythonAgentConnectionProjectDir)(tree);
|
|
37
40
|
const agentConnectionModuleName = (0, agent_connection_1.getPythonAgentConnectionModuleName)(tree);
|
|
38
41
|
const agentConnectionPackageName = (0, agent_connection_1.getPythonAgentConnectionPackageName)(tree);
|
|
42
|
+
// Python deps required by the MCP core client + shared auth helper.
|
|
43
|
+
(0, py_1.addDependenciesToPyProjectToml)(tree, agentConnectionProjectDir, [
|
|
44
|
+
'boto3',
|
|
45
|
+
'httpx',
|
|
46
|
+
'mcp',
|
|
47
|
+
'strands-agents',
|
|
48
|
+
]);
|
|
39
49
|
// 2. Generate the per-connection client into the shared agent-connection project
|
|
40
50
|
const appDir = (0, devkit_1.joinPathFragments)(agentConnectionProjectDir, agentConnectionModuleName, 'app');
|
|
41
51
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'agent-connection', 'app'), appDir, {
|
|
@@ -52,10 +62,6 @@ const pyStrandsAgentMcpConnectionGenerator = async (tree, options) => {
|
|
|
52
62
|
// Add re-export to module __init__.py
|
|
53
63
|
const moduleInitPath = (0, devkit_1.joinPathFragments)(agentConnectionProjectDir, agentConnectionModuleName, '__init__.py');
|
|
54
64
|
await (0, agent_connection_1.addPythonReExport)(tree, moduleInitPath, `.app.${mcpServerSnakeCase}_client`, `${mcpServerClassName}Client`);
|
|
55
|
-
// Add aws-lambda-powertools dependency to the agent-connection project
|
|
56
|
-
(0, py_1.addDependenciesToPyProjectToml)(tree, agentConnectionProjectDir, [
|
|
57
|
-
'aws-lambda-powertools',
|
|
58
|
-
]);
|
|
59
65
|
// 3. Transform agent.py to add MCP client import and usage
|
|
60
66
|
const agentSourceDir = (0, devkit_1.joinPathFragments)(sourceProject.root, agentComponent.path ?? 'src');
|
|
61
67
|
const agentFilePath = (0, devkit_1.joinPathFragments)(agentSourceDir, 'agent.py');
|
|
@@ -93,23 +99,14 @@ const pyStrandsAgentMcpConnectionGenerator = async (tree, options) => {
|
|
|
93
99
|
};
|
|
94
100
|
exports.pyStrandsAgentMcpConnectionGenerator = pyStrandsAgentMcpConnectionGenerator;
|
|
95
101
|
/**
|
|
96
|
-
* Add an import for the MCP client class to agent.py
|
|
102
|
+
* Add an import for the MCP client class to agent.py.
|
|
97
103
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
104
|
+
* Delegates to the shared `addPythonDestructuredImport` helper which either
|
|
105
|
+
* appends to an existing `from <module> import ...` line or prepends a new
|
|
106
|
+
* import statement (ruff sorts imports on the next format pass).
|
|
101
107
|
*/
|
|
102
108
|
const addImportToAgentFile = async (tree, filePath, agentConnectionModuleName, clientClassName) => {
|
|
103
|
-
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
// Try to append to existing import from the same module using +=
|
|
107
|
-
const appended = await (0, ast_1.applyGritQL)(tree, filePath, py(`\`from ${agentConnectionModuleName} import $names\` where { $names += \`, ${clientClassName}\` }`));
|
|
108
|
-
if (!appended) {
|
|
109
|
-
// No existing import — add a new one after the first import.
|
|
110
|
-
// Ruff will sort it into the correct position.
|
|
111
|
-
await (0, ast_1.applyGritQL)(tree, filePath, py(`\`from contextlib import contextmanager\` as $imp => \`$imp\nfrom ${agentConnectionModuleName} import ${clientClassName}\``));
|
|
112
|
-
}
|
|
109
|
+
await (0, ast_1.addPythonDestructuredImport)(tree, filePath, [clientClassName], agentConnectionModuleName);
|
|
113
110
|
};
|
|
114
111
|
/**
|
|
115
112
|
* Add MCP tools to the Agent's tools array using GritQL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/strands-agent/mcp-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,0CAI2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAiD;AACjD,0CAG2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/strands-agent/mcp-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AAEpB,0CAI2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAiD;AACjD,0CAG2B;AAC3B,uFAO0D;AAC1D,4CAI4B;AAE5B,qDAAqD;AACrD,MAAM,EAAE,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,oBAAoB,OAAO,EAAE,CAAC;AAEjD,QAAA,8CAA8C,GACzD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,oCAAoC,GAAG,KAAK,EACvD,IAAU,EACV,OAAmD,EACvB,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA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UAE9B,aAAa;;gBAEP,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,4CAAoC,CAAC"}
|
|
@@ -104,23 +104,9 @@ const useCreateTestAgentClient = (): TestAgent => {
|
|
|
104
104
|
const auth = useAuth();
|
|
105
105
|
const user = auth?.user;
|
|
106
106
|
const cognitoClient: typeof fetch = (url, init) => {
|
|
107
|
-
const headers =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return fetch(url, {
|
|
111
|
-
...init,
|
|
112
|
-
headers: !existingHeaders
|
|
113
|
-
? headers
|
|
114
|
-
: existingHeaders instanceof Headers
|
|
115
|
-
? (() => {
|
|
116
|
-
const h = new Headers(existingHeaders);
|
|
117
|
-
Object.entries(headers).forEach(([k, v]) => h.append(k, v));
|
|
118
|
-
return h;
|
|
119
|
-
})()
|
|
120
|
-
: Array.isArray(existingHeaders)
|
|
121
|
-
? [...existingHeaders, ...Object.entries(headers)]
|
|
122
|
-
: { ...existingHeaders, ...headers },
|
|
123
|
-
});
|
|
107
|
+
const headers = new Headers(init?.headers);
|
|
108
|
+
headers.set('Authorization', \`Bearer \${user?.id_token}\`);
|
|
109
|
+
return fetch(url, { ...init, headers });
|
|
124
110
|
};
|
|
125
111
|
return useMemo(
|
|
126
112
|
() =>
|
|
@@ -10,6 +10,7 @@ const format_1 = require("../../../utils/format");
|
|
|
10
10
|
const nx_1 = require("../../../utils/nx");
|
|
11
11
|
const metrics_1 = require("../../../utils/metrics");
|
|
12
12
|
const react_1 = require("../../../utils/connection/open-api/react");
|
|
13
|
+
const agent_runtime_config_1 = require("../../../connection/agent-runtime-config");
|
|
13
14
|
const names_1 = require("../../../utils/names");
|
|
14
15
|
const object_1 = require("../../../utils/object");
|
|
15
16
|
const serve_local_1 = require("./serve-local");
|
|
@@ -24,6 +25,10 @@ const pyStrandsAgentReactConnectionGenerator = async (tree, options) => {
|
|
|
24
25
|
const agentNameClassName = targetComponent?.rc ?? (0, names_1.toClassName)(agentName);
|
|
25
26
|
const agentPort = targetComponent?.port ?? metadata?.ports?.[0] ?? 8081;
|
|
26
27
|
const auth = targetComponent?.auth ?? metadata?.auth ?? 'IAM';
|
|
28
|
+
if (targetComponent?.protocol === 'A2A') {
|
|
29
|
+
throw new Error(`Cannot connect a React website to an A2A agent. ` +
|
|
30
|
+
`Consider generating an agent with the HTTP protocol instead.`);
|
|
31
|
+
}
|
|
27
32
|
// Determine the module name from the project source root
|
|
28
33
|
const moduleName = getModuleName(agentProjectConfig);
|
|
29
34
|
const agentNameSnakeCase = (0, names_1.toSnakeCase)(agentName);
|
|
@@ -79,6 +84,13 @@ const pyStrandsAgentReactConnectionGenerator = async (tree, options) => {
|
|
|
79
84
|
port: agentPort,
|
|
80
85
|
targetComponent,
|
|
81
86
|
});
|
|
87
|
+
// Expose the agent's runtime ARN to the frontend via the 'connection'
|
|
88
|
+
// namespace (which is published to runtime-config.json). The agent construct
|
|
89
|
+
// itself only registers to the 'agentcore' namespace by default.
|
|
90
|
+
await (0, agent_runtime_config_1.addAgentRuntimeToConnectionNamespace)(tree, {
|
|
91
|
+
agentNameKebabCase: (0, names_1.kebabCase)(agentNameClassName),
|
|
92
|
+
agentNameClassName,
|
|
93
|
+
});
|
|
82
94
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
83
95
|
exports.PY_STRANDS_AGENT_REACT_CONNECTION_GENERATOR_INFO,
|
|
84
96
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/strands-agent/react-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,kDAA6D;AAC7D,0CAK2B;AAC3B,oDAAyE;AACzE,oEAAiF;AAEjF,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/strands-agent/react-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCA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
|
9
|
+
export type StrandsAgentProtocol = 'HTTP' | 'A2A';
|
|
9
10
|
|
|
10
11
|
export type PyStrandsAgentAuth = 'IAM' | 'Cognito';
|
|
11
12
|
|
|
@@ -14,5 +15,6 @@ export interface PyStrandsAgentGeneratorSchema {
|
|
|
14
15
|
name?: string;
|
|
15
16
|
computeType?: PyStrandsAgentComputeType;
|
|
16
17
|
auth?: PyStrandsAgentAuth;
|
|
18
|
+
protocol?: StrandsAgentProtocol;
|
|
17
19
|
iacProvider: IacProviderOption;
|
|
18
20
|
}
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
"x-prompt": "How would you like to authenticate with your Strands Agent?",
|
|
37
37
|
"x-priority": "important"
|
|
38
38
|
},
|
|
39
|
+
"protocol": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The server protocol for your Strands Agent. HTTP exposes a FastAPI HTTP server. A2A exposes an Agent-to-Agent protocol server.",
|
|
42
|
+
"x-prompt": "Which protocol would you like to use for your Strands Agent?",
|
|
43
|
+
"enum": ["HTTP", "A2A"],
|
|
44
|
+
"default": "HTTP",
|
|
45
|
+
"x-priority": "important"
|
|
46
|
+
},
|
|
39
47
|
"iacProvider": {
|
|
40
48
|
"type": "string",
|
|
41
49
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
@@ -104,23 +104,9 @@ const useCreateTestApiClient = (): TestApi => {
|
|
|
104
104
|
const auth = useAuth();
|
|
105
105
|
const user = auth?.user;
|
|
106
106
|
const cognitoClient: typeof fetch = (url, init) => {
|
|
107
|
-
const headers =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return fetch(url, {
|
|
111
|
-
...init,
|
|
112
|
-
headers: !existingHeaders
|
|
113
|
-
? headers
|
|
114
|
-
: existingHeaders instanceof Headers
|
|
115
|
-
? (() => {
|
|
116
|
-
const h = new Headers(existingHeaders);
|
|
117
|
-
Object.entries(headers).forEach(([k, v]) => h.append(k, v));
|
|
118
|
-
return h;
|
|
119
|
-
})()
|
|
120
|
-
: Array.isArray(existingHeaders)
|
|
121
|
-
? [...existingHeaders, ...Object.entries(headers)]
|
|
122
|
-
: { ...existingHeaders, ...headers },
|
|
123
|
-
});
|
|
107
|
+
const headers = new Headers(init?.headers);
|
|
108
|
+
headers.set('Authorization', \`Bearer \${user?.id_token}\`);
|
|
109
|
+
return fetch(url, { ...init, headers });
|
|
124
110
|
};
|
|
125
111
|
return useMemo(
|
|
126
112
|
() =>
|
|
@@ -76,8 +76,8 @@ export class SnapshotBedrockServer extends Construct implements IGrantable {
|
|
|
76
76
|
|
|
77
77
|
rc.grantReadAppConfig(this.agentCoreRuntime);
|
|
78
78
|
|
|
79
|
-
rc.set('
|
|
80
|
-
...rc.get('
|
|
79
|
+
rc.set('agentcore', 'agentRuntimes', {
|
|
80
|
+
...rc.get('agentcore').agentRuntimes,
|
|
81
81
|
SnapshotBedrockServer: this.agentCoreRuntime.agentRuntimeArn,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -543,7 +543,7 @@ module "agent_core_runtime" {
|
|
|
543
543
|
module "add_agent_runtime_to_runtime_config" {
|
|
544
544
|
source = "../../../core/runtime-config/entry"
|
|
545
545
|
|
|
546
|
-
namespace = "
|
|
546
|
+
namespace = "agentcore"
|
|
547
547
|
key = "agentRuntimes"
|
|
548
548
|
value = { "TerraformSnapshotServer" = module.agent_core_runtime.agent_core_runtime_arn }
|
|
549
549
|
|
|
@@ -80,8 +80,8 @@ export class SnapshotBedrockAgent extends Construct implements IGrantable {
|
|
|
80
80
|
|
|
81
81
|
rc.grantReadAppConfig(this.agentCoreRuntime);
|
|
82
82
|
|
|
83
|
-
rc.set('
|
|
84
|
-
...rc.get('
|
|
83
|
+
rc.set('agentcore', 'agentRuntimes', {
|
|
84
|
+
...rc.get('agentcore').agentRuntimes,
|
|
85
85
|
SnapshotBedrockAgent: this.agentCoreRuntime.agentRuntimeArn,
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -188,7 +188,7 @@ module "agent_core_runtime" {
|
|
|
188
188
|
module "add_agent_runtime_to_runtime_config" {
|
|
189
189
|
source = "../../../core/runtime-config/entry"
|
|
190
190
|
|
|
191
|
-
namespace = "
|
|
191
|
+
namespace = "agentcore"
|
|
192
192
|
key = "agentRuntimes"
|
|
193
193
|
value = { "TerraformSnapshotAgent" = module.agent_core_runtime.agent_core_runtime_arn }
|
|
194
194
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { A2AAgent } from '@strands-agents/sdk/a2a';
|
|
2
|
+
import { AgentCoreA2aClient } from '../core/agentcore-a2a-client.js';
|
|
3
|
+
import { getConnectedAgentRuntimeArn } from '../core/runtime-config.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Client for connecting to the <%- targetAgentClassName %> A2A agent.
|
|
7
|
+
*
|
|
8
|
+
* In deployed mode: resolves the AgentCore runtime ARN from runtime config
|
|
9
|
+
* and uses a SigV4-authenticated A2A transport.
|
|
10
|
+
*
|
|
11
|
+
* In local mode (SERVE_LOCAL env var set): connects directly to the local
|
|
12
|
+
* A2A server over plain HTTP.
|
|
13
|
+
*/
|
|
14
|
+
export class <%- targetAgentClassName %>Client {
|
|
15
|
+
static async create(sessionId: string): Promise<A2AAgent> {
|
|
16
|
+
if (process.env.SERVE_LOCAL === 'true') {
|
|
17
|
+
return new A2AAgent({
|
|
18
|
+
url: 'http://localhost:<%- targetAgentPort %>/',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return AgentCoreA2aClient.withIamAuth({
|
|
23
|
+
agentRuntimeArn: await getConnectedAgentRuntimeArn('<%- targetAgentClassName %>'),
|
|
24
|
+
sessionId,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
+
import { TsStrandsAgentA2aConnectionGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_STRANDS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsStrandsAgentA2aConnectionGenerator: (tree: Tree, options: TsStrandsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsStrandsAgentA2aConnectionGenerator;
|