@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.
Files changed (84) hide show
  1. package/generators.json +17 -1
  2. package/package.json +1 -1
  3. package/src/connection/agent-runtime-config.d.ts +19 -0
  4. package/src/connection/agent-runtime-config.js +52 -0
  5. package/src/connection/agent-runtime-config.js.map +1 -0
  6. package/src/connection/generator.js +15 -5
  7. package/src/connection/generator.js.map +1 -1
  8. package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +3 -17
  9. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
  10. package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +8 -5
  11. package/src/py/strands-agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +29 -0
  12. package/src/py/strands-agent/a2a-connection/generator.d.ts +10 -0
  13. package/src/py/strands-agent/a2a-connection/generator.js +164 -0
  14. package/src/py/strands-agent/a2a-connection/generator.js.map +1 -0
  15. package/src/py/strands-agent/a2a-connection/schema.d.ts +15 -0
  16. package/src/py/strands-agent/a2a-connection/schema.json +26 -0
  17. package/src/py/strands-agent/files/a2a/main.py.template +33 -0
  18. package/src/py/strands-agent/files/{app → common}/agent.py.template +2 -0
  19. package/src/py/strands-agent/files/deploy/Dockerfile.template +9 -0
  20. package/src/py/strands-agent/generator.js +29 -16
  21. package/src/py/strands-agent/generator.js.map +1 -1
  22. package/src/py/strands-agent/mcp-connection/__snapshots__/generator.spec.ts.snap +9 -63
  23. package/src/py/strands-agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +4 -19
  24. package/src/py/strands-agent/mcp-connection/generator.js +16 -19
  25. package/src/py/strands-agent/mcp-connection/generator.js.map +1 -1
  26. package/src/py/strands-agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -17
  27. package/src/py/strands-agent/react-connection/generator.js +12 -0
  28. package/src/py/strands-agent/react-connection/generator.js.map +1 -1
  29. package/src/py/strands-agent/schema.d.ts +2 -0
  30. package/src/py/strands-agent/schema.json +8 -0
  31. package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +3 -17
  32. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
  33. package/src/ts/strands-agent/__snapshots__/generator.spec.ts.snap +3 -3
  34. package/src/ts/strands-agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +27 -0
  35. package/src/ts/strands-agent/a2a-connection/generator.d.ts +10 -0
  36. package/src/ts/strands-agent/a2a-connection/generator.js +119 -0
  37. package/src/ts/strands-agent/a2a-connection/generator.js.map +1 -0
  38. package/src/ts/strands-agent/a2a-connection/schema.d.ts +15 -0
  39. package/src/ts/strands-agent/a2a-connection/schema.json +26 -0
  40. package/src/ts/strands-agent/files/a2a/index.ts.template +28 -0
  41. package/src/ts/strands-agent/files/deploy/Dockerfile.template +4 -0
  42. package/src/ts/strands-agent/generator.js +30 -14
  43. package/src/ts/strands-agent/generator.js.map +1 -1
  44. package/src/ts/strands-agent/mcp-connection/__snapshots__/generator.spec.ts.snap +9 -31
  45. package/src/ts/strands-agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +2 -9
  46. package/src/ts/strands-agent/mcp-connection/generator.js +4 -2
  47. package/src/ts/strands-agent/mcp-connection/generator.js.map +1 -1
  48. package/src/ts/strands-agent/react-connection/generator.js +12 -0
  49. package/src/ts/strands-agent/react-connection/generator.js.map +1 -1
  50. package/src/ts/strands-agent/schema.d.ts +2 -0
  51. package/src/ts/strands-agent/schema.json +8 -0
  52. package/src/utils/agent-connection/agent-connection.d.ts +31 -3
  53. package/src/utils/agent-connection/agent-connection.js +62 -30
  54. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  55. package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +134 -0
  56. package/src/utils/agent-connection/files/{core → core-mcp}/agentcore-mcp-client.ts.template +7 -22
  57. package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +40 -0
  58. package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +91 -0
  59. package/src/utils/agent-connection/files/py-core-auth/auth/__init__.py.template +3 -0
  60. package/src/utils/agent-connection/files/py-core-auth/auth/sigv4.py.template +48 -0
  61. package/src/utils/agent-connection/files/{py-core → py-core-mcp}/agentcore_mcp_client.py.template +2 -36
  62. package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +44 -0
  63. package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +3 -2
  64. package/src/utils/agent-core-constructs/agent-core-constructs.js +2 -2
  65. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  66. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +8 -3
  67. package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +1 -1
  68. package/src/utils/ast.d.ts +18 -0
  69. package/src/utils/ast.js +58 -9
  70. package/src/utils/ast.js.map +1 -1
  71. package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +3 -16
  72. package/src/utils/versions.d.ts +6 -3
  73. package/src/utils/versions.js +5 -2
  74. package/src/utils/versions.js.map +1 -1
  75. /package/src/py/strands-agent/files/{app → common}/__init__.py.template +0 -0
  76. /package/src/py/strands-agent/files/{app → http}/init.py.template +0 -0
  77. /package/src/py/strands-agent/files/{app → http}/main.py.template +0 -0
  78. /package/src/ts/strands-agent/files/{app → common}/agent.ts.template +0 -0
  79. /package/src/ts/strands-agent/files/{app → http}/agent-core-trpc-client.ts.template +0 -0
  80. /package/src/ts/strands-agent/files/{app → http}/client.ts.template +0 -0
  81. /package/src/ts/strands-agent/files/{app → http}/index.ts.template +0 -0
  82. /package/src/ts/strands-agent/files/{app → http}/init.ts.template +0 -0
  83. /package/src/ts/strands-agent/files/{app → http}/router.ts.template +0 -0
  84. /package/src/ts/strands-agent/files/{app → http}/schema/z-async-iterable.ts.template +0 -0
package/generators.json CHANGED
@@ -16,7 +16,9 @@
16
16
  "connection/react-ts-strands-agent",
17
17
  "connection/react-py-strands-agent",
18
18
  "connection/py-strands-agent-mcp",
19
- "connection/ts-strands-agent-mcp"
19
+ "connection/ts-strands-agent-mcp",
20
+ "connection/py-strands-agent-a2a",
21
+ "connection/ts-strands-agent-a2a"
20
22
  ]
21
23
  },
22
24
  "license": {
@@ -214,6 +216,20 @@
214
216
  "metric": "g32",
215
217
  "hidden": true
216
218
  },
219
+ "ts#strands-agent#a2a-connection": {
220
+ "factory": "./src/ts/strands-agent/a2a-connection/generator",
221
+ "schema": "./src/ts/strands-agent/a2a-connection/schema.json",
222
+ "description": "Connect a TypeScript Strands Agent to an A2A agent",
223
+ "metric": "g35",
224
+ "hidden": true
225
+ },
226
+ "py#strands-agent#a2a-connection": {
227
+ "factory": "./src/py/strands-agent/a2a-connection/generator",
228
+ "schema": "./src/py/strands-agent/a2a-connection/schema.json",
229
+ "description": "Connect a Python Strands Agent to an A2A agent",
230
+ "metric": "g36",
231
+ "hidden": true
232
+ },
217
233
  "py#strands-agent#react-connection": {
218
234
  "factory": "./src/py/strands-agent/react-connection/generator",
219
235
  "schema": "./src/py/strands-agent/react-connection/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "0.97.1",
3
+ "version": "0.99.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { Tree } from '@nx/devkit';
6
+ /**
7
+ * Register the agent's runtime ARN in the 'connection' namespace so it is
8
+ * published to the website's runtime-config.json. Patches the generated CDK
9
+ * and Terraform constructs in-place; idempotent.
10
+ *
11
+ * Note: the 'connection' namespace is stage-scoped — every StaticWebsite in
12
+ * the stage will see this ARN, not just the one the user connected.
13
+ */
14
+ export declare const addAgentRuntimeToConnectionNamespace: (tree: Tree, options: {
15
+ /** The kebab-case directory name that holds the construct, e.g. 'story-agent'. */
16
+ agentNameKebabCase: string;
17
+ /** The class name of the agent, e.g. 'StoryAgent'. */
18
+ agentNameClassName: string;
19
+ }) => Promise<void>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAgentRuntimeToConnectionNamespace = void 0;
4
+ /**
5
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+ const devkit_1 = require("@nx/devkit");
9
+ const ast_1 = require("../utils/ast");
10
+ const shared_constructs_constants_1 = require("../utils/shared-constructs-constants");
11
+ const CONNECTION_TF_MODULE_NAME = 'add_agent_runtime_to_connection_runtime_config';
12
+ /**
13
+ * Register the agent's runtime ARN in the 'connection' namespace so it is
14
+ * published to the website's runtime-config.json. Patches the generated CDK
15
+ * and Terraform constructs in-place; idempotent.
16
+ *
17
+ * Note: the 'connection' namespace is stage-scoped — every StaticWebsite in
18
+ * the stage will see this ARN, not just the one the user connected.
19
+ */
20
+ const addAgentRuntimeToConnectionNamespace = async (tree, options) => {
21
+ const cdkConstructPath = (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR, 'src', 'app', 'agents', options.agentNameKebabCase, `${options.agentNameKebabCase}.ts`);
22
+ if (tree.exists(cdkConstructPath)) {
23
+ await (0, ast_1.applyGritQL)(tree, cdkConstructPath, `\`rc.set('agentcore', 'agentRuntimes', $args);\` => raw\`rc.set('agentcore', 'agentRuntimes', $args);
24
+
25
+ rc.set('connection', 'agentRuntimes', {
26
+ ...rc.get('connection').agentRuntimes,
27
+ ${options.agentNameClassName}: this.agentCoreRuntime.agentRuntimeArn,
28
+ });\` where { $program <: not contains \`rc.set('connection', 'agentRuntimes', $_)\` }`);
29
+ }
30
+ const terraformConstructPath = (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'src', 'app', 'agents', options.agentNameKebabCase, `${options.agentNameKebabCase}.tf`);
31
+ if (tree.exists(terraformConstructPath)) {
32
+ const alreadyPatched = await (0, ast_1.matchGritQL)(tree, terraformConstructPath, `language hcl\n\`module "${CONNECTION_TF_MODULE_NAME}" { $_ }\``);
33
+ if (!alreadyPatched) {
34
+ const source = tree.read(terraformConstructPath, 'utf-8');
35
+ tree.write(terraformConstructPath, `${source.trimEnd()}
36
+
37
+ # Also expose the agent runtime ARN to the frontend via the 'connection' namespace
38
+ module "${CONNECTION_TF_MODULE_NAME}" {
39
+ source = "../../../core/runtime-config/entry"
40
+
41
+ namespace = "connection"
42
+ key = "agentRuntimes"
43
+ value = { "${options.agentNameClassName}" = module.agent_core_runtime.agent_core_runtime_arn }
44
+
45
+ depends_on = [module.agent_core_runtime]
46
+ }
47
+ `);
48
+ }
49
+ }
50
+ };
51
+ exports.addAgentRuntimeToConnectionNamespace = addAgentRuntimeToConnectionNamespace;
52
+ //# sourceMappingURL=agent-runtime-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-runtime-config.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/agent-runtime-config.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAAqD;AACrD,sCAAwD;AACxD,sFAI8C;AAE9C,MAAM,yBAAyB,GAC7B,gDAAgD,CAAC;AAEnD;;;;;;;GAOG;AACI,MAAM,oCAAoC,GAAG,KAAK,EACvD,IAAU,EACV,OAKC,EACD,EAAE;IACF,MAAM,gBAAgB,GAAG,IAAA,0BAAiB,EACxC,0CAAY,EACZ,mDAAqB,EACrB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,CAAC,kBAAkB,EAC1B,GAAG,OAAO,CAAC,kBAAkB,KAAK,CACnC,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAClC,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,gBAAgB,EAChB;;;;QAIE,OAAO,CAAC,kBAAkB;2FACyD,CACtF,CAAC;IACJ,CAAC;IAED,MAAM,sBAAsB,GAAG,IAAA,0BAAiB,EAC9C,0CAAY,EACZ,kDAAoB,EACpB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,CAAC,kBAAkB,EAC1B,GAAG,OAAO,CAAC,kBAAkB,KAAK,CACnC,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACxC,MAAM,cAAc,GAAG,MAAM,IAAA,iBAAW,EACtC,IAAI,EACJ,sBAAsB,EACtB,2BAA2B,yBAAyB,YAAY,CACjE,CAAC;QACF,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAE,CAAC;YAC3D,IAAI,CAAC,KAAK,CACR,sBAAsB,EACtB,GAAG,MAAM,CAAC,OAAO,EAAE;;;UAGjB,yBAAyB;;;;;mBAKhB,OAAO,CAAC,kBAAkB;;;;CAI5C,CACM,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAlEW,QAAA,oCAAoC,wCAkE/C"}
@@ -17,8 +17,10 @@ const generator_4 = require("../smithy/ts/api/generator");
17
17
  const generator_5 = tslib_1.__importDefault(require("../smithy/react-connection/generator"));
18
18
  const generator_6 = tslib_1.__importDefault(require("../ts/strands-agent/mcp-connection/generator"));
19
19
  const generator_7 = tslib_1.__importDefault(require("../ts/strands-agent/react-connection/generator"));
20
- const generator_8 = tslib_1.__importDefault(require("../py/strands-agent/mcp-connection/generator"));
21
- const generator_9 = tslib_1.__importDefault(require("../py/strands-agent/react-connection/generator"));
20
+ const generator_8 = tslib_1.__importDefault(require("../ts/strands-agent/a2a-connection/generator"));
21
+ const generator_9 = tslib_1.__importDefault(require("../py/strands-agent/mcp-connection/generator"));
22
+ const generator_10 = tslib_1.__importDefault(require("../py/strands-agent/react-connection/generator"));
23
+ const generator_11 = tslib_1.__importDefault(require("../py/strands-agent/a2a-connection/generator"));
22
24
  /**
23
25
  * List of supported source and target project types for connections.
24
26
  * These can be project-level types (determined by introspection) or
@@ -49,6 +51,10 @@ const SUPPORTED_CONNECTIONS = [
49
51
  { source: 'ts#strands-agent', target: 'py#mcp-server' },
50
52
  { source: 'py#strands-agent', target: 'ts#mcp-server' },
51
53
  { source: 'py#strands-agent', target: 'py#mcp-server' },
54
+ { source: 'ts#strands-agent', target: 'ts#strands-agent' },
55
+ { source: 'ts#strands-agent', target: 'py#strands-agent' },
56
+ { source: 'py#strands-agent', target: 'ts#strands-agent' },
57
+ { source: 'py#strands-agent', target: 'py#strands-agent' },
52
58
  ];
53
59
  const CONNECTION_GENERATORS = {
54
60
  'react -> ts#trpc-api': (tree, options) => (0, generator_1.default)(tree, {
@@ -64,11 +70,15 @@ const CONNECTION_GENERATORS = {
64
70
  smithyModelOrBackendProjectName: options.targetProject,
65
71
  }),
66
72
  'react -> ts#strands-agent': (tree, options) => (0, generator_7.default)(tree, options),
67
- 'react -> py#strands-agent': (tree, options) => (0, generator_9.default)(tree, options),
73
+ 'react -> py#strands-agent': (tree, options) => (0, generator_10.default)(tree, options),
68
74
  'ts#strands-agent -> ts#mcp-server': (tree, options) => (0, generator_6.default)(tree, options),
69
75
  'ts#strands-agent -> py#mcp-server': (tree, options) => (0, generator_6.default)(tree, options),
70
- 'py#strands-agent -> ts#mcp-server': (tree, options) => (0, generator_8.default)(tree, options),
71
- 'py#strands-agent -> py#mcp-server': (tree, options) => (0, generator_8.default)(tree, options),
76
+ 'py#strands-agent -> ts#mcp-server': (tree, options) => (0, generator_9.default)(tree, options),
77
+ 'py#strands-agent -> py#mcp-server': (tree, options) => (0, generator_9.default)(tree, options),
78
+ 'ts#strands-agent -> ts#strands-agent': (tree, options) => (0, generator_8.default)(tree, options),
79
+ 'ts#strands-agent -> py#strands-agent': (tree, options) => (0, generator_8.default)(tree, options),
80
+ 'py#strands-agent -> ts#strands-agent': (tree, options) => (0, generator_11.default)(tree, options),
81
+ 'py#strands-agent -> py#strands-agent': (tree, options) => (0, generator_11.default)(tree, options),
72
82
  };
73
83
  /**
74
84
  * Generator for a connection between two projects
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAA2E;AAE3E,gFAAyD;AACzD,sCAAoD;AACpD,wCAAyC;AACzC,uFAAmE;AACnE,oCAGqB;AACrB,2DAA4E;AAC5E,0DAA0E;AAC1E,6FAAkF;AAClF,qGAAgG;AAChG,uGAAoG;AACpG,qGAAgG;AAChG,uGAAoG;AAEpG;;;;GAIG;AACH,MAAM,uBAAuB,GAAG;IAC9B,aAAa;IACb,aAAa;IACb,OAAO;IACP,QAAQ;CACA,CAAC;AAMX;;;GAGG;AACU,QAAA,0BAA0B,GAAG,GAAG,CAAC;AAY9C;;;GAGG;AACH,MAAM,qBAAqB,GAAG;IAC5B,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;IACrC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC/C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC/C,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;IACvD,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;IACvD,EAAE,MAAM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,OAAO,KAAK,UAAU,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,oBAAoB,CAAC,IAAI,EACzB,gBAAgB,CACjB,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAChD,IAAI,CAAE,SAAiB,EAAE,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,KAAW,EACX,oBAA0C,EACjC,EAAE;IACX,+DAA+D;IAC/D,OAAO;QACL,yCAA6B,CAAC,EAAE;QAChC,wCAA4B,CAAC,EAAE;KAChC,CAAC,QAAQ,CAAC,CAAE,oBAAoB,CAAC,QAAgB,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,kBAAe,2BAAmB,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAA2E;AAE3E,gFAAyD;AACzD,sCAAoD;AACpD,wCAAyC;AACzC,uFAAmE;AACnE,oCAGqB;AACrB,2DAA4E;AAC5E,0DAA0E;AAC1E,6FAAkF;AAClF,qGAAgG;AAChG,uGAAoG;AACpG,qGAAgG;AAChG,qGAAgG;AAChG,wGAAoG;AACpG,sGAAgG;AAEhG;;;;GAIG;AACH,MAAM,uBAAuB,GAAG;IAC9B,aAAa;IACb,aAAa;IACb,OAAO;IACP,QAAQ;CACA,CAAC;AAMX;;;GAGG;AACU,QAAA,0BAA0B,GAAG,G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ACnE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,oBAAoB,CAAC,IAAI,EACzB,gBAAgB,CACjB,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAChD,IAAI,CAAE,SAAiB,EAAE,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,KAAW,EACX,oBAA0C,EACjC,EAAE;IACX,+DAA+D;IAC/D,OAAO;QACL,yCAA6B,CAAC,EAAE;QAChC,wCAA4B,CAAC,EAAE;KAChC,CAAC,QAAQ,CAAC,CAAE,oBAAoB,CAAC,QAAgB,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,kBAAe,2BAAmB,CAAC"}
@@ -113,23 +113,9 @@ const useCreateTestApiClient = (): TestApi => {
113
113
  const auth = useAuth();
114
114
  const user = auth?.user;
115
115
  const cognitoClient: typeof fetch = (url, init) => {
116
- const headers = { Authorization: \`Bearer \${user?.id_token}\` };
117
- const existingHeaders = init?.headers;
118
-
119
- return fetch(url, {
120
- ...init,
121
- headers: !existingHeaders
122
- ? headers
123
- : existingHeaders instanceof Headers
124
- ? (() => {
125
- const h = new Headers(existingHeaders);
126
- Object.entries(headers).forEach(([k, v]) => h.append(k, v));
127
- return h;
128
- })()
129
- : Array.isArray(existingHeaders)
130
- ? [...existingHeaders, ...Object.entries(headers)]
131
- : { ...existingHeaders, ...headers },
132
- });
116
+ const headers = new Headers(init?.headers);
117
+ headers.set('Authorization', \`Bearer \${user?.id_token}\`);
118
+ return fetch(url, { ...init, headers });
133
119
  };
134
120
  return useMemo(
135
121
  () =>
@@ -76,8 +76,8 @@ export class SnapshotBedrockServer extends Construct implements IGrantable {
76
76
 
77
77
  rc.grantReadAppConfig(this.agentCoreRuntime);
78
78
 
79
- rc.set('connection', 'agentRuntimes', {
80
- ...rc.get('connection').agentRuntimes,
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 = "connection"
546
+ namespace = "agentcore"
547
547
  key = "agentRuntimes"
548
548
  value = { "TerraformSnapshotServer" = module.agent_core_runtime.agent_core_runtime_arn }
549
549
 
@@ -11,6 +11,7 @@ COPY --from=workspace dist/apps/test-project/bundle-arm /app
11
11
  EXPOSE 8080
12
12
 
13
13
  ENV PYTHONPATH=/app
14
+ ENV PATH="/app/bin:\${PATH}"
14
15
 
15
16
  # Auto-instrument with AWS Distro for OpenTelemetry
16
17
  # https://aws-otel.github.io/docs/getting-started/python-sdk/auto-instr
@@ -78,8 +79,8 @@ export class SnapshotBedrockAgent extends Construct implements IGrantable {
78
79
 
79
80
  rc.grantReadAppConfig(this.agentCoreRuntime);
80
81
 
81
- rc.set('connection', 'agentRuntimes', {
82
- ...rc.get('connection').agentRuntimes,
82
+ rc.set('agentcore', 'agentRuntimes', {
83
+ ...rc.get('agentcore').agentRuntimes,
83
84
  SnapshotBedrockAgent: this.agentCoreRuntime.agentRuntimeArn,
84
85
  });
85
86
  }
@@ -186,7 +187,7 @@ module "agent_core_runtime" {
186
187
  module "add_agent_runtime_to_runtime_config" {
187
188
  source = "../../../core/runtime-config/entry"
188
189
 
189
- namespace = "connection"
190
+ namespace = "agentcore"
190
191
  key = "agentRuntimes"
191
192
  value = { "TerraformSnapshotAgent" = module.agent_core_runtime.agent_core_runtime_arn }
192
193
 
@@ -599,6 +600,8 @@ def subtract(a: int, b: int) -> int:
599
600
  @contextmanager
600
601
  def get_agent(session_id: str):
601
602
  yield Agent(
603
+ name="SnapshotAgent",
604
+ description="SnapshotAgent Strands Agent",
602
605
  system_prompt="""
603
606
  You are a mathematical wizard.
604
607
  Use your tools for mathematical tasks.
@@ -683,10 +686,10 @@ dependencies = [
683
686
  "aws-lambda-powertools==3.27.0",
684
687
  "aws-opentelemetry-distro==0.17.0",
685
688
  "bedrock-agentcore==1.6.1",
686
- "fastapi==0.135.3",
687
689
  "boto3==1.42.88",
690
+ "fastapi==0.135.3",
688
691
  "mcp==1.27.0",
689
- "strands-agents==1.35.0",
692
+ "strands-agents==1.36.0",
690
693
  "strands-agents-tools==0.4.1",
691
694
  "uvicorn==0.44.0"
692
695
  ]
@@ -0,0 +1,29 @@
1
+ import os
2
+
3
+ from strands.agent.a2a_agent import A2AAgent
4
+
5
+ from <%- agentConnectionModuleName %>.core.agentcore_a2a_client import AgentCoreA2aClient
6
+ from <%- agentConnectionModuleName %>.core.runtime_config import (
7
+ get_connected_agent_runtime_arn,
8
+ )
9
+
10
+
11
+ class <%- targetAgentClassName %>Client:
12
+ """Client for connecting to the <%- targetAgentClassName %> A2A agent.
13
+
14
+ In deployed mode: resolves the AgentCore runtime ARN from runtime config
15
+ and uses a SigV4-authenticated A2A transport.
16
+
17
+ In local mode (SERVE_LOCAL env var set): connects directly to the local
18
+ A2A server over plain HTTP.
19
+ """
20
+
21
+ @staticmethod
22
+ def create(session_id: str) -> A2AAgent:
23
+ if os.environ.get("SERVE_LOCAL") == "true":
24
+ return A2AAgent(endpoint="http://localhost:<%- targetAgentPort %>/")
25
+
26
+ return AgentCoreA2aClient.with_iam_auth(
27
+ agent_runtime_arn=get_connected_agent_runtime_arn("<%- targetAgentClassName %>"),
28
+ session_id=session_id,
29
+ )
@@ -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 { PyStrandsAgentA2aConnectionGeneratorSchema } from './schema';
7
+ import { NxGeneratorInfo } from '../../../utils/nx';
8
+ export declare const PY_STRANDS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
9
+ export declare const pyStrandsAgentA2aConnectionGenerator: (tree: Tree, options: PyStrandsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
10
+ export default pyStrandsAgentA2aConnectionGenerator;
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pyStrandsAgentA2aConnectionGenerator = exports.PY_STRANDS_AGENT_A2A_CONNECTION_GENERATOR_INFO = void 0;
4
+ /**
5
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+ const devkit_1 = require("@nx/devkit");
9
+ const nx_1 = require("../../../utils/nx");
10
+ const metrics_1 = require("../../../utils/metrics");
11
+ const format_1 = require("../../../utils/format");
12
+ const names_1 = require("../../../utils/names");
13
+ const py_1 = require("../../../utils/py");
14
+ const agent_connection_1 = require("../../../utils/agent-connection/agent-connection");
15
+ const ast_1 = require("../../../utils/ast");
16
+ /** Prefix a GritQL pattern with `language python` */
17
+ const py = (pattern) => `language python\n${pattern}`;
18
+ exports.PY_STRANDS_AGENT_A2A_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
19
+ const pyStrandsAgentA2aConnectionGenerator = async (tree, options) => {
20
+ const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
21
+ const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
22
+ const agentComponent = options.sourceComponent;
23
+ const targetAgentComponent = options.targetComponent;
24
+ if (!agentComponent || !targetAgentComponent) {
25
+ throw new Error('Both sourceComponent and targetComponent must be provided for py#strands-agent -> a2a connections');
26
+ }
27
+ if (targetAgentComponent.protocol !== 'A2A') {
28
+ throw new Error(`Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'HTTP'} protocol — only A2A agents can be connected as tools.`);
29
+ }
30
+ if (targetAgentComponent.auth && targetAgentComponent.auth !== 'IAM') {
31
+ throw new Error(`A2A agent connection currently only supports IAM authentication, but '${targetAgentComponent.name}' uses '${targetAgentComponent.auth}' authentication.`);
32
+ }
33
+ const targetAgentComponentName = targetAgentComponent.name ?? 'agent';
34
+ const targetAgentClassName = targetAgentComponent.rc;
35
+ const targetAgentSnakeCase = (0, names_1.snakeCase)(targetAgentClassName);
36
+ const targetAgentPort = targetAgentComponent.port ?? 9000;
37
+ // 1. Ensure the shared Python agent-connection project exists + has the
38
+ // A2A core client and its shared SigV4 auth helper.
39
+ await (0, agent_connection_1.ensurePythonAgentConnectionProject)(tree);
40
+ (0, agent_connection_1.addPythonCoreClient)(tree, 'auth');
41
+ (0, agent_connection_1.addPythonCoreClient)(tree, 'a2a');
42
+ const agentConnectionProjectDir = (0, agent_connection_1.getPythonAgentConnectionProjectDir)(tree);
43
+ const agentConnectionModuleName = (0, agent_connection_1.getPythonAgentConnectionModuleName)(tree);
44
+ const agentConnectionPackageName = (0, agent_connection_1.getPythonAgentConnectionPackageName)(tree);
45
+ // Python deps required by the A2A core client + shared auth helper.
46
+ (0, py_1.addDependenciesToPyProjectToml)(tree, agentConnectionProjectDir, [
47
+ 'boto3',
48
+ 'httpx',
49
+ 'strands-agents[a2a]',
50
+ ]);
51
+ // 2. Generate the per-connection client into the shared agent-connection project
52
+ const appDir = (0, devkit_1.joinPathFragments)(agentConnectionProjectDir, agentConnectionModuleName, 'app');
53
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'agent-connection', 'app'), appDir, {
54
+ targetAgentSnakeCase,
55
+ targetAgentClassName,
56
+ targetAgentPort,
57
+ agentConnectionModuleName,
58
+ }, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
59
+ // Ensure app/__init__.py exists
60
+ const appInitPath = (0, devkit_1.joinPathFragments)(appDir, '__init__.py');
61
+ if (!tree.exists(appInitPath)) {
62
+ tree.write(appInitPath, '');
63
+ }
64
+ // Add re-export to module __init__.py
65
+ const moduleInitPath = (0, devkit_1.joinPathFragments)(agentConnectionProjectDir, agentConnectionModuleName, '__init__.py');
66
+ await (0, agent_connection_1.addPythonReExport)(tree, moduleInitPath, `.app.${targetAgentSnakeCase}_client`, `${targetAgentClassName}Client`);
67
+ // 3. Transform agent.py to add the A2A client import + wrap it as a tool
68
+ const agentSourceDir = (0, devkit_1.joinPathFragments)(sourceProject.root, agentComponent.path ?? 'src');
69
+ const agentFilePath = (0, devkit_1.joinPathFragments)(agentSourceDir, 'agent.py');
70
+ if (tree.exists(agentFilePath)) {
71
+ const clientClassName = `${targetAgentClassName}Client`;
72
+ const clientVarName = targetAgentSnakeCase;
73
+ const toolName = `ask_${targetAgentSnakeCase}`;
74
+ await addImportToAgentFile(tree, agentFilePath, agentConnectionModuleName, clientClassName);
75
+ await addToolToAgent(tree, agentFilePath, toolName);
76
+ await addClientToolToGetAgent(tree, agentFilePath, clientClassName, clientVarName, toolName, targetAgentClassName);
77
+ }
78
+ // 4. Add workspace dependency from agent project to agent-connection project
79
+ (0, py_1.addWorkspaceDependencyToPyProject)(tree, sourceProject.root, agentConnectionPackageName);
80
+ // 5. Set up serve-local target dependencies — chain onto the target agent
81
+ const agentName = agentComponent.name ?? 'agent';
82
+ const serveLocalTargetName = `${agentName}-serve-local`;
83
+ const targetServeLocalTargetName = `${targetAgentComponentName}-serve-local`;
84
+ if (sourceProject.targets?.[serveLocalTargetName]) {
85
+ const target = sourceProject.targets[serveLocalTargetName];
86
+ target.dependsOn = [
87
+ ...(target.dependsOn ?? []),
88
+ {
89
+ projects: [targetProject.name],
90
+ target: targetServeLocalTargetName,
91
+ },
92
+ ];
93
+ (0, devkit_1.updateProjectConfiguration)(tree, sourceProject.name, sourceProject);
94
+ }
95
+ await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
96
+ exports.PY_STRANDS_AGENT_A2A_CONNECTION_GENERATOR_INFO,
97
+ ]);
98
+ await (0, format_1.formatFilesInSubtree)(tree);
99
+ return () => {
100
+ (0, devkit_1.installPackagesTask)(tree);
101
+ };
102
+ };
103
+ exports.pyStrandsAgentA2aConnectionGenerator = pyStrandsAgentA2aConnectionGenerator;
104
+ /**
105
+ * Add imports to agent.py:
106
+ * - `tool` from `strands`
107
+ * - the per-connection client class from the shared agent-connection module
108
+ */
109
+ const addImportToAgentFile = async (tree, filePath, agentConnectionModuleName, clientClassName) => {
110
+ await (0, ast_1.addPythonDestructuredImport)(tree, filePath, ['tool'], 'strands');
111
+ await (0, ast_1.addPythonDestructuredImport)(tree, filePath, [clientClassName], agentConnectionModuleName);
112
+ };
113
+ /**
114
+ * Add the A2A tool to the Agent's tools array using GritQL.
115
+ *
116
+ * Scoped via `$old <: within \`yield Agent($_)\`` so unrelated `tools=`
117
+ * keyword arguments elsewhere in the file are not touched.
118
+ */
119
+ const addToolToAgent = async (tree, filePath, toolName) => {
120
+ await (0, ast_1.applyGritQL)(tree, filePath, py(`\`tools=$old\` where {
121
+ $old <: within \`yield Agent($_)\`,
122
+ $old <: not contains \`${toolName}\`,
123
+ if ($old <: \`[]\`) {
124
+ $old => \`[${toolName}]\`
125
+ } else {
126
+ $old <: \`[$items]\` where { $items += \`, ${toolName}\` }
127
+ }
128
+ }`));
129
+ };
130
+ /**
131
+ * Wrap the get_agent body so the remote A2A client is created and exposed
132
+ * as a `@tool`-decorated closure before yielding the Agent.
133
+ *
134
+ * Unlike MCP clients, A2A clients aren't context managers — we don't need
135
+ * a `with` block around them. Creation + tool definition happen at the
136
+ * top of the function body.
137
+ */
138
+ const addClientToolToGetAgent = async (tree, filePath, clientClassName, clientVarName, toolName, targetAgentClassName) => {
139
+ if (await (0, ast_1.matchGritQL)(tree, filePath, `\`${clientClassName}.create\``)) {
140
+ return;
141
+ }
142
+ // The tool function we'll insert. Strands tools in Python are just
143
+ // @tool-decorated callables, so we define them inline in get_agent.
144
+ // A2AAgent is directly callable (syncs over invoke_async internally).
145
+ const toolBlock = `${clientVarName} = ${clientClassName}.create(session_id=session_id)
146
+
147
+ @tool
148
+ def ${toolName}(prompt: str) -> str:
149
+ """Delegate a question to the remote ${targetAgentClassName} A2A agent and return its reply."""
150
+ return str(${clientVarName}(prompt))
151
+ `;
152
+ // Prepend client creation + tool definition to the function body.
153
+ // This works whether or not a prior MCP `with` block is present since we
154
+ // insert before any existing statements.
155
+ await (0, ast_1.applyGritQL)(tree, filePath, py(`\`def get_agent($params):
156
+ $body\` where {
157
+ $body <: contains \`yield Agent($_)\`,
158
+ $body <: not contains \`${clientClassName}.create\`
159
+ } => \`def get_agent($params):
160
+ ${toolBlock}
161
+ $body\``));
162
+ };
163
+ exports.default = exports.pyStrandsAgentA2aConnectionGenerator;
164
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/strands-agent/a2a-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,CAA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CAAyC;IACzC,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,QAAQ,EACR,EAAE,CAAC;;;4BAGqB,eAAe;;MAErC,SAAS;YACH,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,4CAAoC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { ComponentMetadata } from '../../../utils/nx';
6
+
7
+ /**
8
+ * TypeScript types for options defined in schema.json
9
+ */
10
+ export interface PyStrandsAgentA2aConnectionGeneratorSchema {
11
+ sourceProject: string;
12
+ targetProject: string;
13
+ sourceComponent?: ComponentMetadata;
14
+ targetComponent?: ComponentMetadata;
15
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "py#strands-agent#a2a-connection",
4
+ "title": "py#strands-agent#a2a-connection",
5
+ "description": "Connect a Python Strands Agent to an A2A agent",
6
+ "type": "object",
7
+ "properties": {
8
+ "sourceProject": {
9
+ "type": "string",
10
+ "description": "The project containing the host Strands Agent"
11
+ },
12
+ "targetProject": {
13
+ "type": "string",
14
+ "description": "The project containing the target A2A Strands Agent"
15
+ },
16
+ "sourceComponent": {
17
+ "type": "string",
18
+ "description": "The host agent component name"
19
+ },
20
+ "targetComponent": {
21
+ "type": "string",
22
+ "description": "The target A2A agent component name"
23
+ }
24
+ },
25
+ "required": ["sourceProject", "targetProject"]
26
+ }
@@ -0,0 +1,33 @@
1
+ import logging
2
+ import os
3
+
4
+ from fastapi import FastAPI
5
+ from strands.multiagent.a2a import A2AServer
6
+
7
+ from .agent import get_agent
8
+
9
+ logging.basicConfig(level=logging.INFO)
10
+
11
+ PORT = int(os.environ.get("PORT", "9000"))
12
+
13
+ RUNTIME_URL = os.environ.get("AGENTCORE_RUNTIME_URL", f"http://localhost:{PORT}/")
14
+
15
+ _agent_ctx = get_agent(session_id="default")
16
+ _agent = _agent_ctx.__enter__()
17
+
18
+ a2a_server = A2AServer(
19
+ agent=_agent,
20
+ port=PORT,
21
+ http_url=RUNTIME_URL,
22
+ serve_at_root=True,
23
+ )
24
+
25
+ app = FastAPI()
26
+
27
+
28
+ @app.get("/ping")
29
+ def ping() -> dict[str, str]:
30
+ return {"status": "Healthy"}
31
+
32
+
33
+ app.mount("/", a2a_server.to_fastapi_app())
@@ -13,6 +13,8 @@ def subtract(a: int, b: int) -> int:
13
13
  @contextmanager
14
14
  def get_agent(session_id: str):
15
15
  yield Agent(
16
+ name="<%= agentNameClassName %>",
17
+ description="<%= agentNameClassName %> Strands Agent",
16
18
  system_prompt="""
17
19
  You are a mathematical wizard.
18
20
  Use your tools for mathematical tasks.
@@ -5,10 +5,19 @@ WORKDIR /app
5
5
  # Copy bundled package
6
6
  COPY --from=workspace <%- bundleOutputDir %> /app
7
7
 
8
+ <%_ if (protocol === 'A2A') { _%>
9
+ EXPOSE 9000
10
+ <%_ } else { _%>
8
11
  EXPOSE 8080
12
+ <%_ } _%>
9
13
 
10
14
  ENV PYTHONPATH=/app
15
+ ENV PATH="/app/bin:${PATH}"
11
16
 
12
17
  # Auto-instrument with AWS Distro for OpenTelemetry
13
18
  # https://aws-otel.github.io/docs/getting-started/python-sdk/auto-instr
19
+ <%_ if (protocol === 'A2A') { _%>
20
+ CMD ["python", "bin/opentelemetry-instrument", "python", "-m", "uvicorn", "<%- moduleName %>.<%- agentNameSnakeCase %>.main:app", "--host", "0.0.0.0", "--port", "9000"]
21
+ <%_ } else { _%>
14
22
  CMD ["python", "bin/opentelemetry-instrument", "python", "-m", "<%- moduleName %>.<%- agentNameSnakeCase %>.main"]
23
+ <%_ } _%>