@aws/nx-plugin 1.0.0-rc.0 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/connection/generator.js +2 -2
- package/src/connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +11 -11
- package/src/infra/app/files/app/src/main.ts.template +2 -2
- package/src/infra/app/generator.js +9 -9
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +1 -1
- package/src/mcp-server/guide-pipeline.js +8 -10
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +1 -1
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.js +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +4 -6
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +5 -5
- package/src/preset/schema.json +4 -4
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/agent/a2a-connection/generator.js +4 -3
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/deploy/Dockerfile.template +3 -3
- package/src/py/agent/generator.js +23 -23
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/generator.js +1 -1
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/agent/react-connection/generator.js +4 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/schema.d.ts +8 -8
- package/src/py/agent/schema.json +18 -18
- package/src/py/api/generator.js +2 -2
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.ts +4 -6
- package/src/py/api/schema.json +15 -15
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/py/fast-api/generator.js +10 -10
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.js +1 -1
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +4 -6
- package/src/py/fast-api/schema.json +15 -15
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/lambda-function/files/handler/__lambdaFunctionSnakeCase__.py.template +6 -6
- package/src/py/lambda-function/generator.js +9 -9
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +4 -4
- package/src/py/lambda-function/schema.json +7 -7
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/mcp-server/generator.js +11 -11
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.ts +5 -9
- package/src/py/mcp-server/schema.json +15 -15
- package/src/py/project/generator.js +1 -1
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.ts +1 -1
- package/src/py/project/schema.json +2 -2
- package/src/smithy/project/generator.js +2 -2
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/generator.js +1 -1
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/smithy/ts/api/generator.js +8 -8
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +4 -6
- package/src/smithy/ts/api/schema.json +15 -15
- package/src/terraform/project/generator.js +1 -1
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/trpc/backend/files/src/client/index.ts.template +5 -5
- package/src/trpc/backend/files/src/handler.ts.template +2 -2
- package/src/trpc/backend/generator.js +22 -22
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +4 -4
- package/src/trpc/backend/schema.json +15 -15
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +14 -14
- package/src/trpc/react/generator.js +6 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/a2a-connection/generator.js +4 -3
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
- package/src/ts/agent/generator.js +22 -22
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.js +1 -1
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +8 -8
- package/src/ts/agent/react-connection/generator.js +6 -6
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.js +2 -2
- package/src/ts/agent/schema.d.ts +8 -8
- package/src/ts/agent/schema.json +18 -18
- package/src/ts/api/generator.js +4 -4
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +4 -4
- package/src/ts/api/schema.json +15 -15
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/lambda-function/files/handler/__lambdaFunctionKebabCase__.ts.template +10 -10
- package/src/ts/lambda-function/generator.js +12 -12
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +4 -4
- package/src/ts/lambda-function/schema.json +7 -7
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/mcp-server/generator.js +12 -12
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.ts +5 -9
- package/src/ts/mcp-server/schema.json +15 -15
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-plugin/generator.js +2 -2
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/rdb/files/prisma.config.ts.template +1 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +1 -1
- package/src/ts/rdb/files/scripts/docker-start.ts.template +3 -3
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +3 -3
- package/src/ts/rdb/files/src/create-db-user-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/migration-handler.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +2 -2
- package/src/ts/rdb/generator.js +18 -18
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/schema.d.ts +5 -5
- package/src/ts/rdb/schema.json +13 -13
- package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +9 -9
- package/src/ts/react-website/agui/generator.d.ts +2 -2
- package/src/ts/react-website/agui/generator.js +9 -9
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +23 -23
- package/src/ts/react-website/app/files/app/cloudscape/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/cloudscape/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/cloudscape/src/styles.css.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/components/AppLayout/index.tsx.template +5 -5
- package/src/ts/react-website/app/files/app/none/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/files/app/none/src/styles.css.template +2 -2
- package/src/ts/react-website/app/files/app/shadcn/src/components/AppLayout/index.tsx.template +6 -6
- package/src/ts/react-website/app/files/app/shadcn/src/main.tsx.template +1 -1
- package/src/ts/react-website/app/generator.d.ts +3 -3
- package/src/ts/react-website/app/generator.js +27 -27
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +6 -6
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +9 -9
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.ts +2 -2
- package/src/ts/react-website/cognito-auth/schema.json +4 -4
- package/src/ts/website/app/schema.d.ts +6 -6
- package/src/ts/website/app/schema.json +13 -13
- package/src/ts/website/auth/generator.js +1 -1
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.ts +2 -2
- package/src/ts/website/auth/schema.json +4 -4
- package/src/utils/agent-connection/agent-connection.js +1 -1
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +9 -9
- package/src/utils/agent-core-constructs/agent-core-constructs.js +11 -13
- 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 +13 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +5 -5
- package/src/utils/api-constructs/api-constructs.d.ts +3 -3
- package/src/utils/api-constructs/api-constructs.js +4 -6
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +12 -12
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +7 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +10 -10
- package/src/utils/api-constructs/open-api-metadata.d.ts +3 -3
- package/src/utils/api-constructs/open-api-metadata.js +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/commands.d.ts +1 -1
- package/src/utils/commands.js +2 -2
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/__snapshots__/utils.spec.ts.snap +6 -6
- package/src/utils/config/index.d.ts +2 -2
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
- package/src/utils/connection/open-api/react.d.ts +1 -1
- package/src/utils/connection/open-api/react.js +3 -3
- package/src/utils/containers.d.ts +5 -5
- package/src/utils/containers.js +6 -6
- package/src/utils/containers.js.map +1 -1
- package/src/utils/function-constructs/files/cdk/app/lambda-functions/{__functionNameKebabCase__.ts.template → __nameKebabCase__.ts.template} +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/{__functionNameKebabCase__/__functionNameKebabCase__.tf.template → __nameKebabCase__/__nameKebabCase__.tf.template} +7 -7
- package/src/utils/function-constructs/function-constructs.d.ts +4 -4
- package/src/utils/function-constructs/function-constructs.js +5 -7
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/iac-providers.d.ts +3 -3
- package/src/utils/iac-providers.js +1 -1
- package/src/utils/iac.d.ts +2 -2
- package/src/utils/iac.js +6 -6
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +3 -3
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +4 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +4 -6
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +3 -3
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +4 -6
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
package/src/ts/agent/schema.d.ts
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type AgentProtocol = '
|
|
8
|
+
export type TsAgentFramework = 'strands';
|
|
9
|
+
export type TsAgentInfra = 'agentcore' | 'none';
|
|
10
|
+
export type AgentProtocol = 'http' | 'a2a' | 'ag-ui';
|
|
11
11
|
|
|
12
|
-
export type TsAgentAuth = '
|
|
12
|
+
export type TsAgentAuth = 'iam' | 'cognito';
|
|
13
13
|
|
|
14
14
|
export interface TsAgentGeneratorSchema {
|
|
15
15
|
project: string;
|
|
16
|
-
|
|
16
|
+
framework?: TsAgentFramework;
|
|
17
17
|
name?: string;
|
|
18
|
-
|
|
18
|
+
infra?: TsAgentInfra;
|
|
19
19
|
auth?: TsAgentAuth;
|
|
20
20
|
protocol?: AgentProtocol;
|
|
21
|
-
|
|
21
|
+
iac: IacOption;
|
|
22
22
|
}
|
package/src/ts/agent/schema.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"x-prompt": "Select the TypeScript project to add the Agent to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
18
|
+
"framework": {
|
|
19
19
|
"type": "string",
|
|
20
20
|
"description": "The agent SDK to use.",
|
|
21
21
|
"x-prompt": "Which agent SDK would you like to use?",
|
|
@@ -23,14 +23,6 @@
|
|
|
23
23
|
"default": "strands",
|
|
24
24
|
"x-priority": "important"
|
|
25
25
|
},
|
|
26
|
-
"computeType": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"description": "The type of compute to host your Agent.",
|
|
29
|
-
"x-prompt": "How would you like to host your Agent server?",
|
|
30
|
-
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
31
|
-
"default": "BedrockAgentCoreRuntime",
|
|
32
|
-
"x-priority": "important"
|
|
33
|
-
},
|
|
34
26
|
"name": {
|
|
35
27
|
"type": "string",
|
|
36
28
|
"description": "The name of your Agent (default: agent)",
|
|
@@ -38,9 +30,9 @@
|
|
|
38
30
|
},
|
|
39
31
|
"auth": {
|
|
40
32
|
"type": "string",
|
|
41
|
-
"description": "The method used to authenticate with your Agent. Only applicable when
|
|
42
|
-
"default": "
|
|
43
|
-
"enum": ["
|
|
33
|
+
"description": "The method used to authenticate with your Agent. Only applicable when infra is set (ignored when infra is none).",
|
|
34
|
+
"default": "iam",
|
|
35
|
+
"enum": ["iam", "cognito"],
|
|
44
36
|
"x-prompt": "How would you like to authenticate with your Agent?",
|
|
45
37
|
"x-priority": "important"
|
|
46
38
|
},
|
|
@@ -48,17 +40,25 @@
|
|
|
48
40
|
"type": "string",
|
|
49
41
|
"description": "The server protocol for your Agent. HTTP exposes a tRPC/WebSocket server. A2A exposes an Agent-to-Agent protocol server. AG-UI exposes an AG-UI protocol server for direct frontend integration with CopilotKit.",
|
|
50
42
|
"x-prompt": "Which protocol would you like to use for your Agent?",
|
|
51
|
-
"enum": ["
|
|
52
|
-
"default": "
|
|
43
|
+
"enum": ["http", "a2a", "ag-ui"],
|
|
44
|
+
"default": "http",
|
|
53
45
|
"x-priority": "important"
|
|
54
46
|
},
|
|
55
|
-
"
|
|
47
|
+
"iac": {
|
|
56
48
|
"type": "string",
|
|
57
49
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
58
|
-
"enum": ["
|
|
50
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
59
51
|
"x-priority": "important",
|
|
60
|
-
"default": "
|
|
61
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
52
|
+
"default": "inherit",
|
|
53
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
54
|
+
},
|
|
55
|
+
"infra": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "The type of infrastructure to host your Agent.",
|
|
58
|
+
"x-prompt": "How would you like to host your Agent server?",
|
|
59
|
+
"enum": ["agentcore", "none"],
|
|
60
|
+
"default": "agentcore",
|
|
61
|
+
"x-priority": "important"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"required": ["project"]
|
package/src/ts/api/generator.js
CHANGED
|
@@ -12,23 +12,23 @@ async function tsApiGenerator(tree, options) {
|
|
|
12
12
|
case 'trpc':
|
|
13
13
|
return (0, generator_1.tsTrpcApiGenerator)(tree, {
|
|
14
14
|
name: options.name,
|
|
15
|
-
|
|
15
|
+
infra: options.infra,
|
|
16
16
|
integrationPattern: options.integrationPattern,
|
|
17
17
|
auth: options.auth,
|
|
18
18
|
directory: options.directory,
|
|
19
19
|
subDirectory: options.subDirectory,
|
|
20
|
-
|
|
20
|
+
iac: options.iac,
|
|
21
21
|
});
|
|
22
22
|
case 'smithy':
|
|
23
23
|
return (0, generator_2.tsSmithyApiGenerator)(tree, {
|
|
24
24
|
name: options.name,
|
|
25
25
|
namespace: options.namespace,
|
|
26
|
-
|
|
26
|
+
infra: 'rest-lambda',
|
|
27
27
|
integrationPattern: options.integrationPattern,
|
|
28
28
|
auth: options.auth,
|
|
29
29
|
directory: options.directory,
|
|
30
30
|
subDirectory: options.subDirectory,
|
|
31
|
-
|
|
31
|
+
iac: options.iac,
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/api/generator.ts"],"names":[],"mappings":";;;AAaA,wCA6BC;AApCD,uCAAmE;AACnE,4DAAkE;AAClE,6DAAqE;AAExD,QAAA,qBAAqB,GAChC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,cAAc,CAClC,IAAU,EACV,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;IAE9C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,IAAA,8BAAkB,EAAC,IAAI,EAAE;gBAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/api/generator.ts"],"names":[],"mappings":";;;AAaA,wCA6BC;AApCD,uCAAmE;AACnE,4DAAkE;AAClE,6DAAqE;AAExD,QAAA,qBAAqB,GAChC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,cAAc,CAClC,IAAU,EACV,OAA6B;IAE7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;IAE9C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,IAAA,8BAAkB,EAAC,IAAI,EAAE;gBAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,GAAG,EAAE,OAAO,CAAC,GAAG;aACjB,CAAC,CAAC;QACL,KAAK,QAAQ;YACX,OAAO,IAAA,gCAAoB,EAAC,IAAI,EAAE;gBAChC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,KAAK,EAAE,aAAa;gBACpB,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,GAAG,EAAE,OAAO,CAAC,GAAG;aACjB,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
package/src/ts/api/schema.d.ts
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { TsProjectGeneratorSchema } from '../lib/schema';
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
8
|
export interface TsApiGeneratorSchema {
|
|
9
9
|
name: string;
|
|
10
10
|
framework?: 'trpc' | 'smithy';
|
|
11
11
|
namespace?: string;
|
|
12
|
-
|
|
12
|
+
infra: 'rest-lambda' | 'http-lambda';
|
|
13
13
|
integrationPattern?: 'isolated' | 'shared';
|
|
14
|
-
auth: '
|
|
14
|
+
auth: 'iam' | 'cognito' | 'custom';
|
|
15
15
|
directory?: TsProjectGeneratorSchema['directory'];
|
|
16
16
|
subDirectory?: TsProjectGeneratorSchema['subDirectory'];
|
|
17
|
-
|
|
17
|
+
iac: IacOption;
|
|
18
18
|
}
|
package/src/ts/api/schema.json
CHANGED
|
@@ -41,14 +41,6 @@
|
|
|
41
41
|
"description": "The namespace for the Smithy API (only applicable for the smithy framework). Defaults to your monorepo scope",
|
|
42
42
|
"x-prompt": "What namespace would you like your API to have? i.e: com.example"
|
|
43
43
|
},
|
|
44
|
-
"computeType": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "The type of compute to use to deploy this API.",
|
|
47
|
-
"default": "ServerlessApiGatewayRestApi",
|
|
48
|
-
"enum": ["ServerlessApiGatewayRestApi", "ServerlessApiGatewayHttpApi"],
|
|
49
|
-
"x-prompt": "What compute type would you like to deploy your API with?",
|
|
50
|
-
"x-priority": "important"
|
|
51
|
-
},
|
|
52
44
|
"integrationPattern": {
|
|
53
45
|
"type": "string",
|
|
54
46
|
"description": "How API Gateway integrations are generated for the API. Choose between isolated (default) and shared.",
|
|
@@ -73,9 +65,9 @@
|
|
|
73
65
|
},
|
|
74
66
|
"auth": {
|
|
75
67
|
"type": "string",
|
|
76
|
-
"description": "The method used to authenticate with your API. Choose between
|
|
77
|
-
"default": "
|
|
78
|
-
"enum": ["
|
|
68
|
+
"description": "The method used to authenticate with your API. Choose between iam (default), cognito or custom.",
|
|
69
|
+
"default": "iam",
|
|
70
|
+
"enum": ["iam", "cognito", "custom"],
|
|
79
71
|
"x-prompt": "How would you like users to authenticate with your API?",
|
|
80
72
|
"x-priority": "important"
|
|
81
73
|
},
|
|
@@ -92,13 +84,21 @@
|
|
|
92
84
|
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
93
85
|
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
94
86
|
},
|
|
95
|
-
"
|
|
87
|
+
"iac": {
|
|
96
88
|
"type": "string",
|
|
97
89
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
98
|
-
"enum": ["
|
|
90
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
99
91
|
"x-priority": "important",
|
|
100
|
-
"default": "
|
|
101
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
92
|
+
"default": "inherit",
|
|
93
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
94
|
+
},
|
|
95
|
+
"infra": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "The type of infrastructure to use to deploy this API.",
|
|
98
|
+
"default": "rest-lambda",
|
|
99
|
+
"enum": ["rest-lambda", "http-lambda"],
|
|
100
|
+
"x-prompt": "What infrastructure would you like to deploy your API with?",
|
|
101
|
+
"x-priority": "important"
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"required": ["name"]
|
|
@@ -133,7 +133,7 @@ export const handler = middy()
|
|
|
133
133
|
"
|
|
134
134
|
`;
|
|
135
135
|
|
|
136
|
-
exports[`ts-lambda-function generator > terraform
|
|
136
|
+
exports[`ts-lambda-function generator > terraform iac > should generate terraform files for lambda function and snapshot them > terraform-lambda-files 1`] = `
|
|
137
137
|
{
|
|
138
138
|
"test-project-test-function.tf": "terraform {
|
|
139
139
|
required_providers {
|
|
@@ -315,7 +315,7 @@ output "role_name" {
|
|
|
315
315
|
}
|
|
316
316
|
`;
|
|
317
317
|
|
|
318
|
-
exports[`ts-lambda-function generator > terraform
|
|
318
|
+
exports[`ts-lambda-function generator > terraform iac > should match snapshot for terraform generated files with different configurations > terraform-lambda-snapshot-function.tf 1`] = `
|
|
319
319
|
"terraform {
|
|
320
320
|
required_providers {
|
|
321
321
|
aws = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%_ if (
|
|
1
|
+
<%_ if (event !== 'Any') { _%>
|
|
2
2
|
import { parser } from '@aws-lambda-powertools/parser/middleware';
|
|
3
|
-
import { <%=
|
|
3
|
+
import { <%= event %> } from '@aws-lambda-powertools/parser/schemas';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
<%_ } _%>
|
|
6
6
|
import middy from '@middy/core';
|
|
@@ -22,19 +22,19 @@ process.env.POWERTOOLS_SERVICE_NAME = "<%= lambdaFunctionClassName %>";
|
|
|
22
22
|
const tracer = new Tracer();
|
|
23
23
|
const logger = new Logger();
|
|
24
24
|
const metrics = new Metrics();
|
|
25
|
-
<%_ const inputType =
|
|
25
|
+
<%_ const inputType = event === 'Any' ? 'any' : `z.infer<typeof ${event}>`; _%>
|
|
26
26
|
<%_ const outputType = `Promise<${returnType.type}>`; %>
|
|
27
27
|
|
|
28
28
|
export const <%= lambdaFunctionCamelCase %> = async (event: <%- inputType %>): <%- outputType %> => {
|
|
29
29
|
logger.info("Received event", event);
|
|
30
30
|
|
|
31
31
|
// TODO: implement
|
|
32
|
-
<%_ if (['APIGatewayProxyEventSchema', 'APIGatewayProxyEventV2Schema', 'APIGatewayProxyWebsocketEventSchema', 'AlbSchema', 'LambdaFunctionUrlSchema'].includes(
|
|
32
|
+
<%_ if (['APIGatewayProxyEventSchema', 'APIGatewayProxyEventV2Schema', 'APIGatewayProxyWebsocketEventSchema', 'AlbSchema', 'LambdaFunctionUrlSchema'].includes(event)) { _%>
|
|
33
33
|
return {
|
|
34
34
|
statusCode: 200,
|
|
35
35
|
body: ''
|
|
36
36
|
};
|
|
37
|
-
<%_ } else if (['APIGatewayRequestAuthorizerEventSchema', 'APIGatewayTokenAuthorizerEventSchema', 'APIGatewayRequestAuthorizerEventV2Schema'].includes(
|
|
37
|
+
<%_ } else if (['APIGatewayRequestAuthorizerEventSchema', 'APIGatewayTokenAuthorizerEventSchema', 'APIGatewayRequestAuthorizerEventV2Schema'].includes(event)) { _%>
|
|
38
38
|
return {
|
|
39
39
|
principalId: 'user',
|
|
40
40
|
policyDocument: {
|
|
@@ -48,17 +48,17 @@ export const <%= lambdaFunctionCamelCase %> = async (event: <%- inputType %>): <
|
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
<%_ } else if (['KinesisFirehoseSchema', 'KinesisFirehoseSqsSchema'].includes(
|
|
51
|
+
<%_ } else if (['KinesisFirehoseSchema', 'KinesisFirehoseSqsSchema'].includes(event)) { _%>
|
|
52
52
|
return {
|
|
53
53
|
records: []
|
|
54
54
|
};
|
|
55
|
-
<%_ } else if (
|
|
55
|
+
<%_ } else if (event === 'TransferFamilySchema') { _%>
|
|
56
56
|
return {
|
|
57
57
|
Role: '',
|
|
58
58
|
Policy: '',
|
|
59
59
|
HomeDirectory: '/'
|
|
60
60
|
};
|
|
61
|
-
<%_ } else if (['PreSignupTriggerSchema', 'PostConfirmationTriggerSchema', 'CustomMessageTriggerSchema', 'MigrateUserTriggerSchema', 'CustomSMSSenderTriggerSchema', 'CustomEmailSenderTriggerSchema', 'DefineAuthChallengeTriggerSchema', 'CreateAuthChallengeTriggerSchema', 'VerifyAuthChallengeTriggerSchema', 'PreTokenGenerationTriggerSchemaV1', 'PreTokenGenerationTriggerSchemaV2AndV3'].includes(
|
|
61
|
+
<%_ } else if (['PreSignupTriggerSchema', 'PostConfirmationTriggerSchema', 'CustomMessageTriggerSchema', 'MigrateUserTriggerSchema', 'CustomSMSSenderTriggerSchema', 'CustomEmailSenderTriggerSchema', 'DefineAuthChallengeTriggerSchema', 'CreateAuthChallengeTriggerSchema', 'VerifyAuthChallengeTriggerSchema', 'PreTokenGenerationTriggerSchemaV1', 'PreTokenGenerationTriggerSchemaV2AndV3'].includes(event)) { _%>
|
|
62
62
|
return event;
|
|
63
63
|
<%_ } else { /* Event sources which don't need to return a response */ _%>
|
|
64
64
|
<%_ } _%>
|
|
@@ -68,7 +68,7 @@ export const handler = middy()
|
|
|
68
68
|
.use(captureLambdaHandler(tracer))
|
|
69
69
|
.use(injectLambdaContext(logger))
|
|
70
70
|
.use(logMetrics(metrics))
|
|
71
|
-
<%_ if (
|
|
72
|
-
.use(parser({ schema: <%=
|
|
71
|
+
<%_ if (event !== 'Any') { _%>
|
|
72
|
+
.use(parser({ schema: <%= event %> }))
|
|
73
73
|
<%_ } _%>
|
|
74
74
|
.handler(<%= lambdaFunctionCamelCase %>);
|
|
@@ -36,38 +36,38 @@ const tsLambdaFunctionGenerator = async (tree, schema) => {
|
|
|
36
36
|
const dir = projectConfig.root;
|
|
37
37
|
const projectNameWithOutScope = projectConfig.name.split('/').pop();
|
|
38
38
|
const projectNameKebabCase = (0, names_1.toKebabCase)(projectNameWithOutScope);
|
|
39
|
-
const
|
|
40
|
-
const constructFunctionNameKebabCase = `${projectNameKebabCase}-${
|
|
39
|
+
const nameKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
40
|
+
const constructFunctionNameKebabCase = `${projectNameKebabCase}-${nameKebabCase}`;
|
|
41
41
|
const constructFunctionClassName = (0, names_1.toClassName)(constructFunctionNameKebabCase);
|
|
42
|
-
const lambdaFunctionCamelCase = (0, lodash_camelcase_1.default)(schema.
|
|
43
|
-
const lambdaFunctionClassName = (0, names_1.pascalCase)(schema.
|
|
44
|
-
const lambdaFunctionKebabCase = (0, names_1.toKebabCase)(schema.
|
|
42
|
+
const lambdaFunctionCamelCase = (0, lodash_camelcase_1.default)(schema.name);
|
|
43
|
+
const lambdaFunctionClassName = (0, names_1.pascalCase)(schema.name);
|
|
44
|
+
const lambdaFunctionKebabCase = (0, names_1.toKebabCase)(schema.name);
|
|
45
45
|
const functionPathFromProjectRoot = (0, devkit_1.joinPathFragments)('src', schema.functionPath ?? '', `${lambdaFunctionKebabCase}.ts`);
|
|
46
46
|
const functionPath = (0, devkit_1.joinPathFragments)(projectConfig.root, functionPathFromProjectRoot);
|
|
47
47
|
// Check that the project does not already have a lambda handler
|
|
48
48
|
if (tree.exists(functionPath)) {
|
|
49
|
-
throw new Error(`This project already has a lambda function with the name ${
|
|
49
|
+
throw new Error(`This project already has a lambda function with the name ${nameKebabCase}. Please remove the lambda function before running this generator or use a different name.`);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const iac = await (0, iac_1.resolveIac)(tree, schema.iac);
|
|
52
52
|
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
53
|
-
|
|
53
|
+
iac,
|
|
54
54
|
});
|
|
55
55
|
const bundleOutputDir = (0, devkit_1.joinPathFragments)('lambda', lambdaFunctionKebabCase);
|
|
56
56
|
await (0, function_constructs_1.addLambdaFunctionInfra)(tree, {
|
|
57
57
|
functionProjectName: projectConfig.name,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
nameClassName: constructFunctionClassName,
|
|
59
|
+
nameKebabCase: constructFunctionNameKebabCase,
|
|
60
60
|
handler: 'index.handler',
|
|
61
61
|
runtime: 'node',
|
|
62
62
|
bundlePathFromRoot: (0, devkit_1.joinPathFragments)('dist', dir, 'bundle', bundleOutputDir),
|
|
63
|
-
|
|
63
|
+
iac,
|
|
64
64
|
});
|
|
65
65
|
const enhancedOptions = {
|
|
66
66
|
...schema,
|
|
67
67
|
lambdaFunctionCamelCase,
|
|
68
68
|
lambdaFunctionClassName,
|
|
69
69
|
lambdaFunctionKebabCase,
|
|
70
|
-
returnType: io_1.TS_HANDLER_RETURN_TYPES[schema.
|
|
70
|
+
returnType: io_1.TS_HANDLER_RETURN_TYPES[schema.event],
|
|
71
71
|
};
|
|
72
72
|
// Add a bundle target for the function
|
|
73
73
|
await (0, bundle_1.addTypeScriptBundleTarget)(tree, projectConfig, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/lambda-function/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,qEAA0E;AAC1E,6CAAyE;AACzE,+CAA0D;AAC1D,+CAAoD;AACpD,uCAKwB;AACxB,iDAAsE;AACtE,mDAAoD;AACpD,gFAAyC;AACzC,6BAA+C;AAC/C,6FAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/lambda-function/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,qEAA0E;AAC1E,6CAAyE;AACzE,+CAA0D;AAC1D,+CAAoD;AACpD,uCAKwB;AACxB,iDAAsE;AACtE,mDAAoD;AACpD,gFAAyC;AACzC,6BAA+C;AAC/C,6FAA6F;AAC7F,yCAA6C;AAC7C,sDAAsE;AAEzD,QAAA,iCAAiC,GAC5C,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAE/B;;GAEG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAC5C,IAAU,EACV,MAAuC,EACX,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,MAAM,CAAC,OAAO,CACf,CAAC;IAEF,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,aAAa,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAE5E,g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AAa,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,EACtE,eAAe,EACf,EAAE,iBAAiB,EAAE,0BAAiB,CAAC,YAAY,EAAE,CACtD,CAAC;IAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,+BAA+B;QAC/B,+BAA+B;QAC/B,gCAAgC;QAChC,mCAAmC;QACnC,+BAA+B;QAC/B,+BAA+B;QAC/B,aAAa;QACb,KAAK;KACN,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,mBAAmB,CAAC,CAAC,CACpC,CAAC;IAEF,IAAA,kCAA6B,EAC3B,IAAI,EACJ,aAAa,CAAC,IAAI,EAClB,yCAAiC,EACjC,2BAA2B,EAC3B,uBAAuB,CACxB,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,yCAAiC;KAClC,CAAC,CAAC;IAEH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IAEjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAxIW,QAAA,yBAAyB,6BAwIpC;AAEF,kBAAe,iCAAyB,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
8
|
export type EventSource =
|
|
9
9
|
| 'Any'
|
|
@@ -51,8 +51,8 @@ export type EventSource =
|
|
|
51
51
|
|
|
52
52
|
export interface TsLambdaFunctionGeneratorSchema {
|
|
53
53
|
readonly project: string;
|
|
54
|
-
readonly
|
|
54
|
+
readonly name: string;
|
|
55
55
|
readonly functionPath?: string;
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
56
|
+
readonly event?: EventSource;
|
|
57
|
+
readonly iac: IacOption;
|
|
58
58
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"x-prompt": "Select the project to add the lambda function to",
|
|
12
12
|
"x-dropdown": "projects"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
14
|
+
"name": {
|
|
15
15
|
"type": "string",
|
|
16
16
|
"description": "The name of the function to add",
|
|
17
17
|
"$default": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"description": "Optional subdirectory within the project source directory to add the function to",
|
|
27
27
|
"x-prompt": "Enter the path within the project source directory to add the function to (e.g. 'lambda-functions/')"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
29
|
+
"event": {
|
|
30
30
|
"type": "string",
|
|
31
31
|
"description": "Optional event source schema to use for the lambda function",
|
|
32
32
|
"x-priority": "important",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"default": "Any",
|
|
78
78
|
"x-prompt": "Enter the event source schema to use for the lambda function"
|
|
79
79
|
},
|
|
80
|
-
"
|
|
80
|
+
"iac": {
|
|
81
81
|
"type": "string",
|
|
82
82
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
83
|
-
"enum": ["
|
|
83
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
84
84
|
"x-priority": "important",
|
|
85
|
-
"default": "
|
|
86
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
85
|
+
"default": "inherit",
|
|
86
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
"required": ["project", "
|
|
89
|
+
"required": ["project", "name"]
|
|
90
90
|
}
|
|
@@ -162,7 +162,7 @@ variable "server_protocol" {
|
|
|
162
162
|
default = "HTTP"
|
|
163
163
|
validation {
|
|
164
164
|
condition = contains(["MCP", "HTTP", "A2A"], var.server_protocol)
|
|
165
|
-
error_message = "Protocol type must be either '
|
|
165
|
+
error_message = "Protocol type must be either 'mcp', 'http', or 'a2a'."
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -33,11 +33,11 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
33
33
|
const targetSourceDir = (0, devkit_1.joinPathFragments)(project.root, targetSourceDirRelativeToProjectRoot);
|
|
34
34
|
const relativeSourceDir = targetSourceDir.replace(project.root + '/', './');
|
|
35
35
|
const distDir = (0, devkit_1.joinPathFragments)('dist', project.root);
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
console.warn('Warning: auth is ignored when no
|
|
36
|
+
const infra = options.infra ?? 'agentcore';
|
|
37
|
+
if (infra === 'none' && options.auth && options.auth !== 'iam') {
|
|
38
|
+
console.warn('Warning: auth is ignored when no infrastructure is configured (no infrastructure is generated)');
|
|
39
39
|
}
|
|
40
|
-
const auth = options.auth ?? '
|
|
40
|
+
const auth = options.auth ?? 'iam';
|
|
41
41
|
// Create a package.json if one doesn't exist, since we want to add the server as a bin target
|
|
42
42
|
const projectPackageJsonPath = (0, devkit_1.joinPathFragments)(project.root, 'package.json');
|
|
43
43
|
if (!tree.exists(projectPackageJsonPath)) {
|
|
@@ -79,9 +79,9 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
79
79
|
'@types/express',
|
|
80
80
|
'@modelcontextprotocol/inspector',
|
|
81
81
|
]);
|
|
82
|
-
// Add hosting based on
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
82
|
+
// Add hosting based on infra
|
|
83
|
+
if (infra === 'agentcore') {
|
|
84
|
+
const containers = await (0, containers_1.resolveContainers)(tree, 'inherit');
|
|
85
85
|
const dockerImageTag = `${(0, npm_scope_1.getNpmScope)(tree)}-${name}:latest`;
|
|
86
86
|
// Add bundle target
|
|
87
87
|
await (0, bundle_1.addTypeScriptBundleTarget)(tree, project, {
|
|
@@ -98,7 +98,7 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
98
98
|
options: {
|
|
99
99
|
commands: [
|
|
100
100
|
fs.cp(`${targetSourceDir}/Dockerfile`, `${dockerOutputDir}/Dockerfile`),
|
|
101
|
-
`${
|
|
101
|
+
`${containers} build --platform linux/arm64 -t ${dockerImageTag} ${dockerOutputDir}`,
|
|
102
102
|
],
|
|
103
103
|
parallel: false,
|
|
104
104
|
},
|
|
@@ -107,8 +107,8 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
107
107
|
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'docker', dockerTargetName);
|
|
108
108
|
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'build', 'docker');
|
|
109
109
|
// Add shared constructs
|
|
110
|
-
const
|
|
111
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
110
|
+
const iac = await (0, iac_1.resolveIac)(tree, options.iac);
|
|
111
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iac });
|
|
112
112
|
// Add the construct to deploy the mcp server
|
|
113
113
|
await (0, agent_core_constructs_1.addMcpServerInfra)(tree, {
|
|
114
114
|
mcpServerNameKebabCase: name,
|
|
@@ -116,9 +116,9 @@ const tsMcpServerGenerator = async (tree, options) => {
|
|
|
116
116
|
projectName: project.name,
|
|
117
117
|
dockerImageTag,
|
|
118
118
|
dockerOutputDir,
|
|
119
|
-
|
|
119
|
+
iac,
|
|
120
120
|
auth,
|
|
121
|
-
|
|
121
|
+
containers,
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/mcp-server/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAaoB;AAEpB,uCAMwB;AACxB,iDAAsE;AACtE,+CAA0D;AAC1D,mDAAiE;AACjE,6CAA2D;AAC3D,qEAA0E;AAC1E,mGAA4F;AAE5F,qDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/ts/mcp-server/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AAE;wBACvB,WAAW,EAAE,MAAM;qBACpB;iBACF;gBACD,UAAU,EAAE,IAAI;aACjB;YACD,CAAC,GAAG,eAAe,UAAU,CAAC,EAAE;gBAC9B,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,EAAE;oBACP,QAAQ,EAAE;wBACR,gCAAgC,iBAAiB,WAAW;qBAC7D;oBACD,GAAG,EAAE,eAAe;iBACrB;gBACD,UAAU,EAAE,IAAI;aACjB;SACF;KACF,CAAC,CAAC;IAEH,IAAA,kCAA6B,EAC3B,IAAI,EACJ,OAAO,CAAC,IAAI,EACZ,oCAA4B,EAC5B,oCAAoC,EACpC,eAAe,EACf;QACE,IAAI,EAAE,YAAY;QAClB,EAAE,EAAE,sBAAsB;QAC1B,IAAI;KACL,CACF,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAnPW,QAAA,oBAAoB,wBAmP/B;AAEF,kBAAe,4BAAoB,CAAC"}
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type TsMcpServerInfra = 'none' | 'agentcore';
|
|
9
9
|
|
|
10
|
-
export type TsMcpServerAuth = '
|
|
10
|
+
export type TsMcpServerAuth = 'iam' | 'cognito';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* TypeScript types for options defined in schema.json
|
|
14
|
-
* Update this to match schema.json if you make changes.
|
|
15
|
-
*/
|
|
16
12
|
export interface TsMcpServerGeneratorSchema {
|
|
17
13
|
project: string;
|
|
18
14
|
name?: string;
|
|
19
|
-
|
|
15
|
+
infra?: TsMcpServerInfra;
|
|
20
16
|
auth?: TsMcpServerAuth;
|
|
21
|
-
|
|
17
|
+
iac: IacOption;
|
|
22
18
|
}
|
|
@@ -15,14 +15,6 @@
|
|
|
15
15
|
"x-prompt": "Select the TypeScript project to add the MCP server to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
-
"computeType": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The type of compute to host your MCP server. Select None for no hosting.",
|
|
21
|
-
"x-prompt": "How would you like to host your MCP server?",
|
|
22
|
-
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
23
|
-
"default": "BedrockAgentCoreRuntime",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
18
|
"name": {
|
|
27
19
|
"type": "string",
|
|
28
20
|
"description": "The name of your MCP server (default: mcp-server)",
|
|
@@ -30,19 +22,27 @@
|
|
|
30
22
|
},
|
|
31
23
|
"auth": {
|
|
32
24
|
"type": "string",
|
|
33
|
-
"description": "The method used to authenticate with your MCP server. Only applicable when
|
|
34
|
-
"default": "
|
|
35
|
-
"enum": ["
|
|
25
|
+
"description": "The method used to authenticate with your MCP server. Only applicable when infra is set (ignored when infra is none).",
|
|
26
|
+
"default": "iam",
|
|
27
|
+
"enum": ["iam", "cognito"],
|
|
36
28
|
"x-prompt": "How would you like to authenticate with your MCP server?",
|
|
37
29
|
"x-priority": "important"
|
|
38
30
|
},
|
|
39
|
-
"
|
|
31
|
+
"iac": {
|
|
40
32
|
"type": "string",
|
|
41
33
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
42
|
-
"enum": ["
|
|
34
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
43
35
|
"x-priority": "important",
|
|
44
|
-
"default": "
|
|
45
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
36
|
+
"default": "inherit",
|
|
37
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
38
|
+
},
|
|
39
|
+
"infra": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The type of infrastructure to host your MCP server. Select none for no hosting.",
|
|
42
|
+
"x-prompt": "How would you like to host your MCP server?",
|
|
43
|
+
"enum": ["agentcore", "none"],
|
|
44
|
+
"default": "agentcore",
|
|
45
|
+
"x-priority": "important"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"required": ["project"]
|
|
@@ -93,7 +93,7 @@ describe('foo#bar generator', () => {
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
it('should add generator metric to app.ts', async () => {
|
|
96
|
-
await sharedConstructsGenerator(tree, {
|
|
96
|
+
await sharedConstructsGenerator(tree, { iac: 'cdk' });
|
|
97
97
|
|
|
98
98
|
await fooBarGenerator(tree, { exampleOption: 'example' });
|
|
99
99
|
|
|
@@ -18,7 +18,7 @@ describe('<%- name %> generator', () => {
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it('should add generator metric to app.ts', async () => {
|
|
21
|
-
await sharedConstructsGenerator(tree, {
|
|
21
|
+
await sharedConstructsGenerator(tree, { iac: 'cdk' });
|
|
22
22
|
|
|
23
23
|
await <%- nameCamelCase %>Generator(tree, { exampleOption: 'example' });
|
|
24
24
|
|