@aws/nx-plugin 0.116.0 → 0.118.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/LICENSE-THIRD-PARTY +557 -327
- package/README.md +3 -3
- package/generators.json +43 -43
- package/package.json +9 -9
- package/sdk/py.d.ts +2 -2
- package/sdk/py.js +3 -3
- package/sdk/py.js.map +1 -1
- package/sdk/ts.d.ts +2 -2
- package/sdk/ts.js +4 -4
- package/sdk/ts.js.map +1 -1
- package/src/connection/generator.js +29 -29
- package/src/connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +20 -20
- package/src/preset/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +18 -18
- package/src/py/agent/a2a-connection/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/a2a-connection/generator.js +7 -7
- package/src/py/agent/a2a-connection/generator.js.map +1 -0
- package/src/py/{strands-agent → agent}/a2a-connection/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/a2a-connection/schema.json +5 -5
- package/src/py/agent/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/generator.js +7 -9
- package/src/py/agent/generator.js.map +1 -0
- package/src/py/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/agent/mcp-connection/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/mcp-connection/generator.js +7 -7
- package/src/py/agent/mcp-connection/generator.js.map +1 -0
- package/src/{ts/strands-agent/a2a-connection → py/agent/mcp-connection}/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/mcp-connection/schema.json +4 -4
- package/src/{ts/strands-agent → py/agent}/react-connection/generator.d.ts +3 -3
- package/src/py/{strands-agent → agent}/react-connection/generator.js +7 -7
- package/src/py/agent/react-connection/generator.js.map +1 -0
- package/src/py/{strands-agent/mcp-connection → agent/react-connection}/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/react-connection/schema.json +4 -4
- package/src/py/{strands-agent → agent}/react-connection/serve-local.d.ts +2 -2
- package/src/py/{strands-agent → agent}/react-connection/serve-local.js +3 -3
- package/src/py/agent/react-connection/serve-local.js.map +1 -0
- package/src/py/agent/schema.d.ts +22 -0
- package/src/{ts/strands-agent → py/agent}/schema.json +21 -13
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +15 -15
- package/src/ts/agent/a2a-connection/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/a2a-connection/generator.js +7 -7
- package/src/ts/agent/a2a-connection/generator.js.map +1 -0
- package/src/ts/{strands-agent/mcp-connection → agent/a2a-connection}/schema.d.ts +1 -1
- package/src/ts/{strands-agent → agent}/a2a-connection/schema.json +5 -5
- package/src/ts/agent/files/ag-ui/index.ts.template +37 -0
- package/src/ts/agent/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/generator.js +34 -27
- package/src/ts/agent/generator.js.map +1 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/agent/mcp-connection/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/generator.js +7 -7
- package/src/ts/agent/mcp-connection/generator.js.map +1 -0
- package/src/ts/agent/mcp-connection/schema.d.ts +15 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/schema.json +4 -4
- package/src/{py/strands-agent → ts/agent}/react-connection/generator.d.ts +3 -3
- package/src/ts/{strands-agent → agent}/react-connection/generator.js +30 -8
- package/src/ts/agent/react-connection/generator.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.ts +15 -0
- package/src/ts/{strands-agent → agent}/react-connection/schema.json +5 -5
- package/src/ts/agent/react-connection/serve-local.d.ts +13 -0
- package/src/ts/agent/react-connection/serve-local.js +19 -0
- package/src/ts/agent/react-connection/serve-local.js.map +1 -0
- package/src/ts/agent/schema.d.ts +22 -0
- package/src/{py/strands-agent → ts/agent}/schema.json +21 -13
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/ts/rdb/agent-connection/generator.d.ts +10 -0
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/generator.js +6 -6
- package/src/ts/rdb/agent-connection/generator.js.map +1 -0
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.d.ts +1 -1
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.json +4 -4
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +43 -43
- package/src/utils/agent-connection/agent-connection.js +2 -2
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +1 -4
- package/src/utils/files/common/shadcn/src/components/ui/sidebar.tsx.template +1 -1
- package/src/utils/versions.d.ts +57 -54
- package/src/utils/versions.js +56 -53
- package/src/utils/versions.js.map +1 -1
- package/src/py/strands-agent/a2a-connection/generator.d.ts +0 -10
- package/src/py/strands-agent/a2a-connection/generator.js.map +0 -1
- package/src/py/strands-agent/generator.d.ts +0 -10
- package/src/py/strands-agent/generator.js.map +0 -1
- package/src/py/strands-agent/mcp-connection/generator.d.ts +0 -10
- package/src/py/strands-agent/mcp-connection/generator.js.map +0 -1
- package/src/py/strands-agent/react-connection/generator.js.map +0 -1
- package/src/py/strands-agent/react-connection/schema.d.ts +0 -15
- package/src/py/strands-agent/react-connection/serve-local.js.map +0 -1
- package/src/py/strands-agent/schema.d.ts +0 -20
- package/src/ts/rdb/strands-agent-connection/generator.d.ts +0 -10
- package/src/ts/rdb/strands-agent-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/a2a-connection/generator.d.ts +0 -10
- package/src/ts/strands-agent/a2a-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/generator.d.ts +0 -10
- package/src/ts/strands-agent/generator.js.map +0 -1
- package/src/ts/strands-agent/mcp-connection/generator.d.ts +0 -10
- package/src/ts/strands-agent/mcp-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/react-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/react-connection/schema.d.ts +0 -15
- package/src/ts/strands-agent/react-connection/serve-local.d.ts +0 -17
- package/src/ts/strands-agent/react-connection/serve-local.js +0 -19
- package/src/ts/strands-agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/strands-agent/schema.d.ts +0 -20
- /package/src/py/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/a2a/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/ag-ui/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/common/__init__.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/common/agent.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
- /package/src/py/{strands-agent → agent}/files/http/init.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/http/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -0
- /package/src/py/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
- /package/src/py/{strands-agent → agent}/react-connection/files/agent/scripts/__agentNameSnakeCase___openapi.py.template +0 -0
- /package/src/py/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/a2a/index.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/common/agent.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/agent-core-trpc-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/index.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/init.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/router.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/schema/z-async-iterable.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/files/src/hooks/use__agentNameClassName__Agent.tsx.template +0 -0
- /package/src/ts/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
|
@@ -1,45 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "Add
|
|
3
|
+
"$id": "py#agent",
|
|
4
|
+
"title": "py#agent",
|
|
5
|
+
"description": "Add an AI Agent to a Python project",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"project": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The project to add the
|
|
10
|
+
"description": "The project to add the Agent to",
|
|
11
11
|
"$default": {
|
|
12
12
|
"$source": "argv",
|
|
13
13
|
"index": 0
|
|
14
14
|
},
|
|
15
|
-
"x-prompt": "Select the
|
|
15
|
+
"x-prompt": "Select the Python project to add the Agent to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
+
"sdk": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The agent SDK to use.",
|
|
21
|
+
"x-prompt": "Which agent SDK would you like to use?",
|
|
22
|
+
"enum": ["strands"],
|
|
23
|
+
"default": "strands",
|
|
24
|
+
"x-priority": "important"
|
|
25
|
+
},
|
|
18
26
|
"computeType": {
|
|
19
27
|
"type": "string",
|
|
20
|
-
"description": "The type of compute to host your
|
|
21
|
-
"x-prompt": "How would you like to host your
|
|
28
|
+
"description": "The type of compute to host your Agent.",
|
|
29
|
+
"x-prompt": "How would you like to host your Agent server?",
|
|
22
30
|
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
23
31
|
"default": "BedrockAgentCoreRuntime",
|
|
24
32
|
"x-priority": "important"
|
|
25
33
|
},
|
|
26
34
|
"name": {
|
|
27
35
|
"type": "string",
|
|
28
|
-
"description": "The name of your
|
|
29
|
-
"x-prompt": "What would you like to call your
|
|
36
|
+
"description": "The name of your Agent (default: agent)",
|
|
37
|
+
"x-prompt": "What would you like to call your Agent? (default: agent)"
|
|
30
38
|
},
|
|
31
39
|
"auth": {
|
|
32
40
|
"type": "string",
|
|
33
|
-
"description": "The method used to authenticate with your
|
|
41
|
+
"description": "The method used to authenticate with your Agent. Choose between IAM (default) or Cognito.",
|
|
34
42
|
"default": "IAM",
|
|
35
43
|
"enum": ["IAM", "Cognito"],
|
|
36
|
-
"x-prompt": "How would you like to authenticate with your
|
|
44
|
+
"x-prompt": "How would you like to authenticate with your Agent?",
|
|
37
45
|
"x-priority": "important"
|
|
38
46
|
},
|
|
39
47
|
"protocol": {
|
|
40
48
|
"type": "string",
|
|
41
|
-
"description": "The server protocol for your
|
|
42
|
-
"x-prompt": "Which protocol would you like to use for your
|
|
49
|
+
"description": "The server protocol for your Agent. HTTP exposes a FastAPI HTTP server. A2A exposes an Agent-to-Agent protocol server. AG-UI exposes an Agent-User Interaction protocol server for direct frontend integration.",
|
|
50
|
+
"x-prompt": "Which protocol would you like to use for your Agent?",
|
|
43
51
|
"enum": ["HTTP", "A2A", "AG-UI"],
|
|
44
52
|
"default": "HTTP",
|
|
45
53
|
"x-priority": "important"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`ts#
|
|
3
|
+
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > agent-Dockerfile 1`] = `
|
|
4
4
|
"FROM public.ecr.aws/docker/library/node:lts-jod
|
|
5
5
|
|
|
6
6
|
WORKDIR /app
|
|
@@ -20,7 +20,7 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
|
|
|
20
20
|
"
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
|
-
exports[`ts#
|
|
23
|
+
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > agent-construct.ts 1`] = `
|
|
24
24
|
"import { Lazy, Names } from 'aws-cdk-lib';
|
|
25
25
|
import { Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
|
26
26
|
import { Connections, IConnectable } from 'aws-cdk-lib/aws-ec2';
|
|
@@ -143,17 +143,17 @@ export class SnapshotBedrockAgent
|
|
|
143
143
|
"
|
|
144
144
|
`;
|
|
145
145
|
|
|
146
|
-
exports[`ts#
|
|
146
|
+
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > agents-index.ts 1`] = `
|
|
147
147
|
"export * from './snapshot-bedrock-agent/snapshot-bedrock-agent.js';
|
|
148
148
|
"
|
|
149
149
|
`;
|
|
150
150
|
|
|
151
|
-
exports[`ts#
|
|
151
|
+
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > app-index.ts 1`] = `
|
|
152
152
|
"export * from './agents/index.js';
|
|
153
153
|
"
|
|
154
154
|
`;
|
|
155
155
|
|
|
156
|
-
exports[`ts#
|
|
156
|
+
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > core-index.ts 1`] = `
|
|
157
157
|
"export * from './app.js';
|
|
158
158
|
export * from './checkov.js';
|
|
159
159
|
export * from './runtime-config.js';
|
|
@@ -161,7 +161,7 @@ export * from './workspace.js';
|
|
|
161
161
|
"
|
|
162
162
|
`;
|
|
163
163
|
|
|
164
|
-
exports[`ts#
|
|
164
|
+
exports[`ts#agent generator > should match snapshot for Terraform generated files > terraform-agent.tf 1`] = `
|
|
165
165
|
"variable "env" {
|
|
166
166
|
description = "Environment variables to pass to the agent core runtime"
|
|
167
167
|
type = map(string)
|
|
@@ -256,7 +256,7 @@ output "appconfig_application_id" {
|
|
|
256
256
|
"
|
|
257
257
|
`;
|
|
258
258
|
|
|
259
|
-
exports[`ts#
|
|
259
|
+
exports[`ts#agent generator > should match snapshot for Terraform generated files > terraform-agent-core-runtime.tf 1`] = `
|
|
260
260
|
"terraform {
|
|
261
261
|
required_version = ">= 1.0"
|
|
262
262
|
|
|
@@ -627,7 +627,7 @@ output "agent_runtime_version" {
|
|
|
627
627
|
"
|
|
628
628
|
`;
|
|
629
629
|
|
|
630
|
-
exports[`ts#
|
|
630
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-agent.ts 1`] = `
|
|
631
631
|
"import { Agent, tool } from '@strands-agents/sdk';
|
|
632
632
|
import { z } from 'zod';
|
|
633
633
|
|
|
@@ -651,9 +651,9 @@ export const getAgent = async () =>
|
|
|
651
651
|
"
|
|
652
652
|
`;
|
|
653
653
|
|
|
654
|
-
exports[`ts#
|
|
654
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-agent-core-mcp-client.ts 1`] = `null`;
|
|
655
655
|
|
|
656
|
-
exports[`ts#
|
|
656
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-agent-core-trpc-client.ts 1`] = `
|
|
657
657
|
"import { randomUUID } from 'node:crypto';
|
|
658
658
|
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
659
659
|
import {
|
|
@@ -809,7 +809,7 @@ export class AgentCoreTrpcClient {
|
|
|
809
809
|
"
|
|
810
810
|
`;
|
|
811
811
|
|
|
812
|
-
exports[`ts#
|
|
812
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-client.ts 1`] = `
|
|
813
813
|
"import { AppRouter } from './router.js';
|
|
814
814
|
import {
|
|
815
815
|
AgentCoreTrpcClient,
|
|
@@ -844,7 +844,7 @@ export class SnapshotAgentClient {
|
|
|
844
844
|
"
|
|
845
845
|
`;
|
|
846
846
|
|
|
847
|
-
exports[`ts#
|
|
847
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-index.ts 1`] = `
|
|
848
848
|
"import { randomUUID } from 'node:crypto';
|
|
849
849
|
import { createServer } from 'http';
|
|
850
850
|
import {
|
|
@@ -911,7 +911,7 @@ console.log(\`TRPC server listening on port \${PORT}\`);
|
|
|
911
911
|
"
|
|
912
912
|
`;
|
|
913
913
|
|
|
914
|
-
exports[`ts#
|
|
914
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-init.ts 1`] = `
|
|
915
915
|
"import { initTRPC } from '@trpc/server';
|
|
916
916
|
|
|
917
917
|
export interface Context {
|
|
@@ -924,7 +924,7 @@ export const publicProcedure = t.procedure;
|
|
|
924
924
|
"
|
|
925
925
|
`;
|
|
926
926
|
|
|
927
|
-
exports[`ts#
|
|
927
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-router.ts 1`] = `
|
|
928
928
|
"import { publicProcedure, t } from './init.js';
|
|
929
929
|
import { z } from 'zod';
|
|
930
930
|
import { zAsyncIterable } from './schema/z-async-iterable.js';
|
|
@@ -966,7 +966,7 @@ export type AppRouter = typeof appRouter;
|
|
|
966
966
|
"
|
|
967
967
|
`;
|
|
968
968
|
|
|
969
|
-
exports[`ts#
|
|
969
|
+
exports[`ts#agent generator > should match snapshot for generated files > agent-z-async-iterable.ts 1`] = `
|
|
970
970
|
"import { isTrackedEnvelope, tracked, TrackedEnvelope } from '@trpc/server';
|
|
971
971
|
import { z } from 'zod';
|
|
972
972
|
|
|
@@ -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 { TsAgentA2aConnectionGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsAgentA2aConnectionGenerator: (tree: Tree, options: TsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsAgentA2aConnectionGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.tsAgentA2aConnectionGenerator = exports.TS_AGENT_A2A_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -14,14 +14,14 @@ const versions_1 = require("../../../utils/versions");
|
|
|
14
14
|
const npm_scope_1 = require("../../../utils/npm-scope");
|
|
15
15
|
const ast_1 = require("../../../utils/ast");
|
|
16
16
|
const agent_connection_1 = require("../../../utils/agent-connection/agent-connection");
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
17
|
+
exports.TS_AGENT_A2A_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
18
|
+
const tsAgentA2aConnectionGenerator = async (tree, options) => {
|
|
19
19
|
const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
|
|
20
20
|
const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
21
21
|
const agentComponent = options.sourceComponent;
|
|
22
22
|
const targetAgentComponent = options.targetComponent;
|
|
23
23
|
if (!agentComponent || !targetAgentComponent) {
|
|
24
|
-
throw new Error('Both sourceComponent and targetComponent must be provided for ts#
|
|
24
|
+
throw new Error('Both sourceComponent and targetComponent must be provided for ts#agent -> a2a connections');
|
|
25
25
|
}
|
|
26
26
|
if (targetAgentComponent.protocol !== 'A2A') {
|
|
27
27
|
throw new Error(`Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'HTTP'} protocol — only A2A agents can be connected as tools.`);
|
|
@@ -102,13 +102,13 @@ const tsStrandsAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
102
102
|
'zod',
|
|
103
103
|
]), {});
|
|
104
104
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
105
|
-
exports.
|
|
105
|
+
exports.TS_AGENT_A2A_CONNECTION_GENERATOR_INFO,
|
|
106
106
|
]);
|
|
107
107
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
108
108
|
return () => {
|
|
109
109
|
(0, devkit_1.installPackagesTask)(tree);
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
exports.
|
|
113
|
-
exports.default = exports.
|
|
112
|
+
exports.tsAgentA2aConnectionGenerator = tsAgentA2aConnectionGenerator;
|
|
113
|
+
exports.default = exports.tsAgentA2aConnectionGenerator;
|
|
114
114
|
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/a2a-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,0CAK2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAiD;AACjD,sDAAuD;AACvD,wDAAuD;AACvD,4CAI4B;AAC5B,uFAI0D;AAE7C,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,aA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EH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AApKW,QAAA,6BAA6B,iCAoKxC;AAEF,kBAAe,qCAA6B,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { ComponentMetadata } from '../../../utils/nx';
|
|
|
7
7
|
/**
|
|
8
8
|
* TypeScript types for options defined in schema.json
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface TsAgentA2aConnectionGeneratorSchema {
|
|
11
11
|
sourceProject: string;
|
|
12
12
|
targetProject: string;
|
|
13
13
|
sourceComponent?: ComponentMetadata;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "ts#
|
|
4
|
-
"title": "ts#
|
|
5
|
-
"description": "Connect a TypeScript
|
|
3
|
+
"$id": "ts#agent#a2a-connection",
|
|
4
|
+
"title": "ts#agent#a2a-connection",
|
|
5
|
+
"description": "Connect a TypeScript Agent to an A2A agent",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"sourceProject": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The project containing the host
|
|
10
|
+
"description": "The project containing the host Agent"
|
|
11
11
|
},
|
|
12
12
|
"targetProject": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"description": "The project containing the target A2A
|
|
14
|
+
"description": "The project containing the target A2A Agent"
|
|
15
15
|
},
|
|
16
16
|
"sourceComponent": {
|
|
17
17
|
"type": "string",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StrandsAgent } from '@ag-ui/aws-strands';
|
|
2
|
+
import { createStrandsApp } from '@ag-ui/aws-strands/server';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import type { Request, Response, NextFunction } from 'express';
|
|
5
|
+
import { runWithSessionId } from '<%- agentConnectionImport %>';
|
|
6
|
+
import { getAgent } from './agent.js';
|
|
7
|
+
|
|
8
|
+
const PORT = parseInt(process.env.PORT || '8080');
|
|
9
|
+
const HOST = '0.0.0.0';
|
|
10
|
+
|
|
11
|
+
const SESSION_ID_HEADER = 'x-amzn-bedrock-agentcore-runtime-session-id';
|
|
12
|
+
|
|
13
|
+
void (async () => {
|
|
14
|
+
const agent = await getAgent();
|
|
15
|
+
|
|
16
|
+
// Connect MCP clients and register their tools so StrandsAgent can discover them.
|
|
17
|
+
await agent.initialize();
|
|
18
|
+
|
|
19
|
+
const aguiAgent = new StrandsAgent({
|
|
20
|
+
agent,
|
|
21
|
+
name: '<%= agentNameClassName %>',
|
|
22
|
+
description: 'A Strands Agent exposed via the AG-UI protocol.',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const app = await createStrandsApp(aguiAgent, { path: '/invocations' });
|
|
26
|
+
|
|
27
|
+
// Bind the inbound session (or a fresh UUID) for downstream MCP / A2A calls.
|
|
28
|
+
app.use((req: Request, _res: Response, next: NextFunction) => {
|
|
29
|
+
const header = req.headers[SESSION_ID_HEADER];
|
|
30
|
+
const sessionId = (Array.isArray(header) ? header[0] : header) ?? randomUUID();
|
|
31
|
+
runWithSessionId(sessionId, () => next());
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
app.listen(PORT, HOST, () => {
|
|
35
|
+
console.log(`AG-UI server listening on ${HOST}:${PORT}`);
|
|
36
|
+
});
|
|
37
|
+
})();
|
|
@@ -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 { TsAgentGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../utils/nx';
|
|
8
|
+
export declare const TS_AGENT_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsAgentGenerator: (tree: Tree, options: TsAgentGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsAgentGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.tsAgentGenerator = exports.TS_AGENT_GENERATOR_INFO = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -19,8 +19,8 @@ const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent
|
|
|
19
19
|
const port_1 = require("../../utils/port");
|
|
20
20
|
const fs_1 = require("../../utils/fs");
|
|
21
21
|
const agent_connection_1 = require("../../utils/agent-connection/agent-connection");
|
|
22
|
-
exports.
|
|
23
|
-
const
|
|
22
|
+
exports.TS_AGENT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
23
|
+
const tsAgentGenerator = async (tree, options) => {
|
|
24
24
|
const project = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.project);
|
|
25
25
|
if (!tree.exists((0, devkit_1.joinPathFragments)(project.root, 'tsconfig.json'))) {
|
|
26
26
|
throw new Error(`Unsupported project ${options.project}. Expected a TypeScript project (with a tsconfig.json)`);
|
|
@@ -36,11 +36,6 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
36
36
|
const computeType = options.computeType ?? 'BedrockAgentCoreRuntime';
|
|
37
37
|
const auth = options.auth ?? 'IAM';
|
|
38
38
|
const protocol = options.protocol ?? 'HTTP';
|
|
39
|
-
if (protocol === 'AG-UI') {
|
|
40
|
-
throw new Error(`The AG-UI protocol is not yet supported for TypeScript Strands Agents. ` +
|
|
41
|
-
`Use a Python Strands Agent with protocol='AG-UI' instead, or choose 'HTTP' or 'A2A' for TypeScript. ` +
|
|
42
|
-
`Track TypeScript support at https://github.com/strands-agents/sdk-typescript/issues/347`);
|
|
43
|
-
}
|
|
44
39
|
// Ensure the shared agent-connection project exists so the server entry
|
|
45
40
|
// point can import `runWithSessionId` and propagate the AgentCore session
|
|
46
41
|
// ID to any downstream MCP / A2A clients a later connection generator
|
|
@@ -91,6 +86,8 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
91
86
|
// Add shared constructs
|
|
92
87
|
const iacProvider = await (0, iac_1.resolveIacProvider)(tree, options.iacProvider);
|
|
93
88
|
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iacProvider });
|
|
89
|
+
// AG-UI uses HTTP as the AgentCore protocol type (AG-UI is HTTP-based with SSE over POST).
|
|
90
|
+
const infraProtocol = protocol === 'AG-UI' ? 'HTTP' : protocol;
|
|
94
91
|
await (0, agent_core_constructs_1.addAgentInfra)(tree, {
|
|
95
92
|
agentNameKebabCase: name,
|
|
96
93
|
agentNameClassName,
|
|
@@ -99,7 +96,7 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
99
96
|
dockerOutputDir,
|
|
100
97
|
iacProvider,
|
|
101
98
|
auth,
|
|
102
|
-
serverProtocol:
|
|
99
|
+
serverProtocol: infraProtocol,
|
|
103
100
|
});
|
|
104
101
|
}
|
|
105
102
|
// Add dependencies
|
|
@@ -112,23 +109,31 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
112
109
|
'@modelcontextprotocol/sdk',
|
|
113
110
|
...(protocol === 'A2A'
|
|
114
111
|
? ['express', '@a2a-js/sdk']
|
|
115
|
-
:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
112
|
+
: protocol === 'AG-UI'
|
|
113
|
+
? [
|
|
114
|
+
'@ag-ui/aws-strands',
|
|
115
|
+
'@ag-ui/core',
|
|
116
|
+
'@ag-ui/encoder',
|
|
117
|
+
'express',
|
|
118
|
+
'cors',
|
|
119
|
+
]
|
|
120
|
+
: [
|
|
121
|
+
'@trpc/server',
|
|
122
|
+
'@trpc/client',
|
|
123
|
+
'ws',
|
|
124
|
+
'cors',
|
|
125
|
+
'aws4fetch',
|
|
126
|
+
]),
|
|
122
127
|
]), (0, versions_1.withVersions)([
|
|
123
128
|
'tsx',
|
|
124
129
|
'@types/node',
|
|
125
130
|
'agent-chat-cli',
|
|
126
|
-
...(protocol === 'A2A'
|
|
127
|
-
? ['@types/express']
|
|
131
|
+
...(protocol === 'A2A' || protocol === 'AG-UI'
|
|
132
|
+
? ['@types/express', '@types/cors']
|
|
128
133
|
: ['@types/ws', '@types/cors']),
|
|
129
134
|
]));
|
|
130
135
|
// A2A servers use port 9000 as per the Strands A2A SDK default and AgentCore A2A contract.
|
|
131
|
-
// HTTP agents use port 8081+ to avoid conflict with VS Code server on 8080.
|
|
136
|
+
// HTTP and AG-UI agents use port 8081+ to avoid conflict with VS Code server on 8080.
|
|
132
137
|
const localDevPortStart = protocol === 'A2A' ? 9000 : 8081;
|
|
133
138
|
const localDevPort = (0, port_1.assignPort)(tree, project, localDevPortStart);
|
|
134
139
|
// HTTP chat needs a tiny generated script to wrap the project's tRPC
|
|
@@ -146,10 +151,14 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
146
151
|
}
|
|
147
152
|
const chatUrl = protocol === 'HTTP'
|
|
148
153
|
? `ws://localhost:${localDevPort}/ws`
|
|
149
|
-
:
|
|
154
|
+
: protocol === 'AG-UI'
|
|
155
|
+
? `http://localhost:${localDevPort}/invocations`
|
|
156
|
+
: `http://localhost:${localDevPort}`;
|
|
150
157
|
const chatCommand = protocol === 'HTTP'
|
|
151
158
|
? `tsx ./scripts/${agentTargetPrefix}/chat.ts`
|
|
152
|
-
:
|
|
159
|
+
: protocol === 'AG-UI'
|
|
160
|
+
? `agent-chat-cli agui ${chatUrl}`
|
|
161
|
+
: `agent-chat-cli a2a ${chatUrl}`;
|
|
153
162
|
(0, devkit_1.updateProjectConfiguration)(tree, project.name, {
|
|
154
163
|
...project,
|
|
155
164
|
targets: {
|
|
@@ -190,15 +199,13 @@ const tsStrandsAgentGenerator = async (tree, options) => {
|
|
|
190
199
|
},
|
|
191
200
|
},
|
|
192
201
|
});
|
|
193
|
-
(0, nx_1.addComponentGeneratorMetadata)(tree, project.name, exports.
|
|
194
|
-
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
195
|
-
exports.TS_STRANDS_AGENT_GENERATOR_INFO,
|
|
196
|
-
]);
|
|
202
|
+
(0, nx_1.addComponentGeneratorMetadata)(tree, project.name, exports.TS_AGENT_GENERATOR_INFO, targetSourceDirRelativeToProjectRoot, agentTargetPrefix, { port: localDevPort, rc: agentNameClassName, auth, protocol });
|
|
203
|
+
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_AGENT_GENERATOR_INFO]);
|
|
197
204
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
198
205
|
return () => {
|
|
199
206
|
(0, devkit_1.installPackagesTask)(tree);
|
|
200
207
|
};
|
|
201
208
|
};
|
|
202
|
-
exports.
|
|
203
|
-
exports.default = exports.
|
|
209
|
+
exports.tsAgentGenerator = tsAgentGenerator;
|
|
210
|
+
exports.default = exports.tsAgentGenerator;
|
|
204
211
|
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/agent/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,uCAMwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,6CAA2D;AAC3D,mDAAiE;AACjE,qDAAoD;AACpD,sDAAsE;AACtE,yCAAqD;AACrD,qEAA0E;AAC1E,mGAAwF;AAExF,2CAA8C;AAC9C,uCAA4C;AAC5C,oFAAuG;AAE1F,QAAA,uBAAuB,GAClC,IAAA,qBAAgB,EAAC,UAA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B;gBAC3B,OAAO,EAAE;oBACP,QAAQ,EAAE,CAAC,eAAe,iBAAiB,WAAW,CAAC;oBACvD,GAAG,EAAE,eAAe;oBACpB,GAAG,EAAE;wBACH,IAAI,EAAE,GAAG,YAAY,EAAE;wBACvB,WAAW,EAAE,MAAM;qBACpB;iBACF;gBACD,UAAU,EAAE,IAAI;aACjB;YACD,CAAC,GAAG,iBAAiB,OAAO,CAAC,EAAE;gBAC7B,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,EAAE;oBACP,QAAQ,EAAE,CAAC,WAAW,CAAC;oBACvB,GAAG,EAAE,eAAe;oBACpB,GAAG,EAAE;wBACH,GAAG,EAAE,OAAO;qBACb;iBACF;gBACD,SAAS,EAAE,CAAC,GAAG,iBAAiB,cAAc,CAAC;aAChD;SACF;KACF,CAAC,CAAC;IAEH,IAAA,kCAA6B,EAC3B,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,+BAAuB,EACvB,oCAAoC,EACpC,iBAAiB,EACjB,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAC/D,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,+BAAuB,CAAC,CAAC,CAAC;IAEvE,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAhRW,QAAA,gBAAgB,oBAgR3B;AAEF,kBAAe,wBAAgB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`ts#
|
|
3
|
+
exports[`ts#agent#mcp-connection generator > should match snapshot for agent-connection src files > agent-connection-index.ts 1`] = `
|
|
4
4
|
"export * from './app/inventory-mcp-client.js';
|
|
5
5
|
export * from './core/with-session-id.js';
|
|
6
6
|
export * from './core/session-context.js';
|
|
@@ -8,7 +8,7 @@ export * from './core/session-context.js';
|
|
|
8
8
|
"
|
|
9
9
|
`;
|
|
10
10
|
|
|
11
|
-
exports[`ts#
|
|
11
|
+
exports[`ts#agent#mcp-connection generator > should match snapshot for agent-connection src files > agentcore-mcp-client.ts 1`] = `
|
|
12
12
|
"import { McpClient } from '@strands-agents/sdk';
|
|
13
13
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
14
14
|
import { AwsClient } from 'aws4fetch';
|
|
@@ -140,7 +140,7 @@ export class AgentCoreMcpClient {
|
|
|
140
140
|
"
|
|
141
141
|
`;
|
|
142
142
|
|
|
143
|
-
exports[`ts#
|
|
143
|
+
exports[`ts#agent#mcp-connection generator > should match snapshot for agent-connection src files > inventory-mcp-client.ts 1`] = `
|
|
144
144
|
"import { McpClient } from '@strands-agents/sdk';
|
|
145
145
|
import { AgentCoreMcpClient } from '../core/agentcore-mcp-client.js';
|
|
146
146
|
import { getConnectedAgentRuntimeArn } from '../core/runtime-config.js';
|
|
@@ -161,7 +161,7 @@ export class InventoryMcpClient {
|
|
|
161
161
|
"
|
|
162
162
|
`;
|
|
163
163
|
|
|
164
|
-
exports[`ts#
|
|
164
|
+
exports[`ts#agent#mcp-connection generator > should match snapshot for agent-connection src files > transformed-agent.ts 1`] = `
|
|
165
165
|
"import { InventoryMcpClient } from ':proj/agent-connection';
|
|
166
166
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
167
167
|
import { z } from 'zod';
|
|
@@ -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 { TsAgentMcpConnectionGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_AGENT_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsAgentMcpConnectionGenerator: (tree: Tree, options: TsAgentMcpConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
|
+
export default tsAgentMcpConnectionGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.tsAgentMcpConnectionGenerator = exports.TS_AGENT_MCP_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -14,14 +14,14 @@ const versions_1 = require("../../../utils/versions");
|
|
|
14
14
|
const npm_scope_1 = require("../../../utils/npm-scope");
|
|
15
15
|
const ast_1 = require("../../../utils/ast");
|
|
16
16
|
const agent_connection_1 = require("../../../utils/agent-connection/agent-connection");
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
17
|
+
exports.TS_AGENT_MCP_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
18
|
+
const tsAgentMcpConnectionGenerator = async (tree, options) => {
|
|
19
19
|
const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
|
|
20
20
|
const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
21
21
|
const agentComponent = options.sourceComponent;
|
|
22
22
|
const mcpComponent = options.targetComponent;
|
|
23
23
|
if (!agentComponent || !mcpComponent) {
|
|
24
|
-
throw new Error('Both sourceComponent and targetComponent must be provided for ts#
|
|
24
|
+
throw new Error('Both sourceComponent and targetComponent must be provided for ts#agent -> mcp connections');
|
|
25
25
|
}
|
|
26
26
|
if (mcpComponent.auth && mcpComponent.auth !== 'IAM') {
|
|
27
27
|
throw new Error(`MCP server connection currently only supports IAM authentication, but '${mcpComponent.name}' uses '${mcpComponent.auth}' authentication.`);
|
|
@@ -85,13 +85,13 @@ const tsStrandsAgentMcpConnectionGenerator = async (tree, options) => {
|
|
|
85
85
|
'@aws-sdk/credential-providers',
|
|
86
86
|
]), {});
|
|
87
87
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
88
|
-
exports.
|
|
88
|
+
exports.TS_AGENT_MCP_CONNECTION_GENERATOR_INFO,
|
|
89
89
|
]);
|
|
90
90
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
91
91
|
return () => {
|
|
92
92
|
(0, devkit_1.installPackagesTask)(tree);
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
|
-
exports.
|
|
96
|
-
exports.default = exports.
|
|
95
|
+
exports.tsAgentMcpConnectionGenerator = tsAgentMcpConnectionGenerator;
|
|
96
|
+
exports.default = exports.tsAgentMcpConnectionGenerator;
|
|
97
97
|
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/mcp-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,0CAK2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAiD;AACjD,sDAAuD;AACvD,wDAAuD;AACvD,4CAI4B;AAC5B,uFAI0D;AAE7C,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,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oBAAoB,CAAC,EAAE,CAAC;QAClD,IAAA,sCAAiC,EAAC,aAAa,EAAE,oBAAoB,EAAE;YACrE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,uBAAuB;SAChC,CAAC,CAAC;QACH,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,sEAAsE;IACtE,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,2BAA2B;QAC3B,qBAAqB;QACrB,mCAAmC;QACnC,+BAA+B;QAC/B,WAAW;QACX,+BAA+B;KAChC,CAAC,EACF,EAAE,CACH,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,8CAAsC;KACvC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AA3IW,QAAA,6BAA6B,iCA2IxC;AAEF,kBAAe,qCAA6B,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 TsAgentMcpConnectionGeneratorSchema {
|
|
11
|
+
sourceProject: string;
|
|
12
|
+
targetProject: string;
|
|
13
|
+
sourceComponent?: ComponentMetadata;
|
|
14
|
+
targetComponent?: ComponentMetadata;
|
|
15
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "ts#
|
|
4
|
-
"title": "ts#
|
|
5
|
-
"description": "Connect a TypeScript
|
|
3
|
+
"$id": "ts#agent#mcp-connection",
|
|
4
|
+
"title": "ts#agent#mcp-connection",
|
|
5
|
+
"description": "Connect a TypeScript Agent to an MCP server",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"sourceProject": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The project containing the
|
|
10
|
+
"description": "The project containing the Agent"
|
|
11
11
|
},
|
|
12
12
|
"targetProject": {
|
|
13
13
|
"type": "string",
|