@aws/nx-plugin 0.115.1 → 0.117.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 (143) hide show
  1. package/LICENSE-THIRD-PARTY +557 -327
  2. package/README.md +3 -3
  3. package/generators.json +43 -43
  4. package/package.json +9 -9
  5. package/sdk/py.d.ts +2 -2
  6. package/sdk/py.js +3 -3
  7. package/sdk/py.js.map +1 -1
  8. package/sdk/ts.d.ts +2 -2
  9. package/sdk/ts.js +4 -4
  10. package/sdk/ts.js.map +1 -1
  11. package/src/connection/generator.js +31 -31
  12. package/src/connection/generator.js.map +1 -1
  13. package/src/infra/app/__snapshots__/generator.spec.ts.snap +22 -22
  14. package/src/preset/__snapshots__/generator.spec.ts.snap +7 -5
  15. package/src/py/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +19 -19
  16. package/src/py/agent/a2a-connection/generator.d.ts +10 -0
  17. package/src/py/{strands-agent → agent}/a2a-connection/generator.js +7 -7
  18. package/src/py/agent/a2a-connection/generator.js.map +1 -0
  19. package/src/py/{strands-agent → agent}/a2a-connection/schema.d.ts +1 -1
  20. package/src/py/{strands-agent → agent}/a2a-connection/schema.json +5 -5
  21. package/src/py/agent/generator.d.ts +10 -0
  22. package/src/py/{strands-agent → agent}/generator.js +7 -9
  23. package/src/py/agent/generator.js.map +1 -0
  24. package/src/py/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
  25. package/src/py/agent/mcp-connection/generator.d.ts +10 -0
  26. package/src/py/{strands-agent → agent}/mcp-connection/generator.js +7 -7
  27. package/src/py/agent/mcp-connection/generator.js.map +1 -0
  28. package/src/{ts/strands-agent/a2a-connection → py/agent/mcp-connection}/schema.d.ts +1 -1
  29. package/src/py/{strands-agent → agent}/mcp-connection/schema.json +4 -4
  30. package/src/{ts/strands-agent → py/agent}/react-connection/generator.d.ts +3 -3
  31. package/src/py/{strands-agent → agent}/react-connection/generator.js +7 -7
  32. package/src/py/agent/react-connection/generator.js.map +1 -0
  33. package/src/py/{strands-agent/mcp-connection → agent/react-connection}/schema.d.ts +1 -1
  34. package/src/py/{strands-agent → agent}/react-connection/schema.json +4 -4
  35. package/src/py/{strands-agent → agent}/react-connection/serve-local.d.ts +2 -2
  36. package/src/py/{strands-agent → agent}/react-connection/serve-local.js +3 -3
  37. package/src/py/agent/react-connection/serve-local.js.map +1 -0
  38. package/src/py/agent/schema.d.ts +22 -0
  39. package/src/py/{strands-agent → agent}/schema.json +21 -13
  40. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
  41. package/src/ts/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +16 -16
  42. package/src/ts/agent/a2a-connection/generator.d.ts +10 -0
  43. package/src/ts/{strands-agent → agent}/a2a-connection/generator.js +7 -7
  44. package/src/ts/agent/a2a-connection/generator.js.map +1 -0
  45. package/src/ts/{strands-agent/mcp-connection → agent/a2a-connection}/schema.d.ts +1 -1
  46. package/src/ts/{strands-agent → agent}/a2a-connection/schema.json +5 -5
  47. package/src/ts/agent/generator.d.ts +10 -0
  48. package/src/ts/{strands-agent → agent}/generator.js +9 -11
  49. package/src/ts/agent/generator.js.map +1 -0
  50. package/src/ts/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
  51. package/src/ts/agent/mcp-connection/generator.d.ts +10 -0
  52. package/src/ts/{strands-agent → agent}/mcp-connection/generator.js +7 -7
  53. package/src/ts/agent/mcp-connection/generator.js.map +1 -0
  54. package/src/ts/agent/mcp-connection/schema.d.ts +15 -0
  55. package/src/ts/{strands-agent → agent}/mcp-connection/schema.json +4 -4
  56. package/src/{py/strands-agent → ts/agent}/react-connection/generator.d.ts +3 -3
  57. package/src/ts/{strands-agent → agent}/react-connection/generator.js +7 -7
  58. package/src/ts/agent/react-connection/generator.js.map +1 -0
  59. package/src/ts/agent/react-connection/schema.d.ts +15 -0
  60. package/src/ts/{strands-agent → agent}/react-connection/schema.json +5 -5
  61. package/src/ts/agent/react-connection/serve-local.d.ts +13 -0
  62. package/src/ts/{strands-agent → agent}/react-connection/serve-local.js +3 -7
  63. package/src/ts/agent/react-connection/serve-local.js.map +1 -0
  64. package/src/ts/agent/schema.d.ts +22 -0
  65. package/src/ts/{strands-agent → agent}/schema.json +21 -13
  66. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
  67. package/src/ts/rdb/{strands-agent-connection → agent-connection}/__snapshots__/generator.spec.ts.snap +12 -12
  68. package/src/ts/rdb/agent-connection/generator.d.ts +10 -0
  69. package/src/ts/rdb/{strands-agent-connection → agent-connection}/generator.js +6 -6
  70. package/src/ts/rdb/agent-connection/generator.js.map +1 -0
  71. package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.d.ts +1 -1
  72. package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.json +4 -4
  73. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +45 -43
  74. package/src/ts/react-website/cognito-auth/generator.js +5 -4
  75. package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
  76. package/src/ts/react-website/cognito-auth/schema.d.ts +1 -1
  77. package/src/ts/react-website/cognito-auth/schema.json +3 -3
  78. package/src/ts/react-website/cognito-auth/utils.d.ts +1 -0
  79. package/src/ts/react-website/cognito-auth/utils.js +23 -0
  80. package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
  81. package/src/utils/agent-connection/agent-connection.js +2 -2
  82. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  83. package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +1 -4
  84. package/src/utils/agent-core-constructs/agent-core-constructs.js +0 -3
  85. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  86. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +1 -1
  87. package/src/utils/ast.d.ts +1 -1
  88. package/src/utils/ast.js +13 -1
  89. package/src/utils/ast.js.map +1 -1
  90. package/src/utils/files/common/shadcn/src/components/ui/sidebar.tsx.template +1 -1
  91. package/src/utils/versions.d.ts +55 -56
  92. package/src/utils/versions.js +54 -55
  93. package/src/utils/versions.js.map +1 -1
  94. package/src/py/strands-agent/a2a-connection/generator.d.ts +0 -10
  95. package/src/py/strands-agent/a2a-connection/generator.js.map +0 -1
  96. package/src/py/strands-agent/generator.d.ts +0 -10
  97. package/src/py/strands-agent/generator.js.map +0 -1
  98. package/src/py/strands-agent/mcp-connection/generator.d.ts +0 -10
  99. package/src/py/strands-agent/mcp-connection/generator.js.map +0 -1
  100. package/src/py/strands-agent/react-connection/generator.js.map +0 -1
  101. package/src/py/strands-agent/react-connection/schema.d.ts +0 -15
  102. package/src/py/strands-agent/react-connection/serve-local.js.map +0 -1
  103. package/src/py/strands-agent/schema.d.ts +0 -20
  104. package/src/ts/rdb/strands-agent-connection/generator.d.ts +0 -10
  105. package/src/ts/rdb/strands-agent-connection/generator.js.map +0 -1
  106. package/src/ts/strands-agent/a2a-connection/generator.d.ts +0 -10
  107. package/src/ts/strands-agent/a2a-connection/generator.js.map +0 -1
  108. package/src/ts/strands-agent/generator.d.ts +0 -10
  109. package/src/ts/strands-agent/generator.js.map +0 -1
  110. package/src/ts/strands-agent/mcp-connection/generator.d.ts +0 -10
  111. package/src/ts/strands-agent/mcp-connection/generator.js.map +0 -1
  112. package/src/ts/strands-agent/react-connection/generator.js.map +0 -1
  113. package/src/ts/strands-agent/react-connection/schema.d.ts +0 -15
  114. package/src/ts/strands-agent/react-connection/serve-local.d.ts +0 -17
  115. package/src/ts/strands-agent/react-connection/serve-local.js.map +0 -1
  116. package/src/ts/strands-agent/schema.d.ts +0 -20
  117. /package/src/py/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -0
  118. /package/src/py/{strands-agent → agent}/files/a2a/main.py.template +0 -0
  119. /package/src/py/{strands-agent → agent}/files/ag-ui/main.py.template +0 -0
  120. /package/src/py/{strands-agent → agent}/files/common/__init__.py.template +0 -0
  121. /package/src/py/{strands-agent → agent}/files/common/agent.py.template +0 -0
  122. /package/src/py/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
  123. /package/src/py/{strands-agent → agent}/files/http/init.py.template +0 -0
  124. /package/src/py/{strands-agent → agent}/files/http/main.py.template +0 -0
  125. /package/src/py/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -0
  126. /package/src/py/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
  127. /package/src/py/{strands-agent → agent}/react-connection/files/agent/scripts/__agentNameSnakeCase___openapi.py.template +0 -0
  128. /package/src/py/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
  129. /package/src/ts/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -0
  130. /package/src/ts/{strands-agent → agent}/files/a2a/index.ts.template +0 -0
  131. /package/src/ts/{strands-agent → agent}/files/common/agent.ts.template +0 -0
  132. /package/src/ts/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
  133. /package/src/ts/{strands-agent → agent}/files/http/agent-core-trpc-client.ts.template +0 -0
  134. /package/src/ts/{strands-agent → agent}/files/http/client.ts.template +0 -0
  135. /package/src/ts/{strands-agent → agent}/files/http/index.ts.template +0 -0
  136. /package/src/ts/{strands-agent → agent}/files/http/init.ts.template +0 -0
  137. /package/src/ts/{strands-agent → agent}/files/http/router.ts.template +0 -0
  138. /package/src/ts/{strands-agent → agent}/files/http/schema/z-async-iterable.ts.template +0 -0
  139. /package/src/ts/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -0
  140. /package/src/ts/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
  141. /package/src/ts/{strands-agent → agent}/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +0 -0
  142. /package/src/ts/{strands-agent → agent}/react-connection/files/src/hooks/use__agentNameClassName__Agent.tsx.template +0 -0
  143. /package/src/ts/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
- "$id": "ts#strands-agent#react-connection",
4
- "title": "ts#strands-agent#react-connection",
5
- "description": "Connect a React website to a TypeScript Strands Agent",
3
+ "$id": "ts#agent#react-connection",
4
+ "title": "ts#agent#react-connection",
5
+ "description": "Connect a React website to a TypeScript Agent",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "sourceProject": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "targetProject": {
13
13
  "type": "string",
14
- "description": "The project containing the Strands Agent"
14
+ "description": "The project containing the Agent"
15
15
  },
16
16
  "sourceComponent": {
17
17
  "type": "string",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "targetComponent": {
21
21
  "type": "string",
22
- "description": "The Strands Agent component name"
22
+ "description": "The Agent component name"
23
23
  }
24
24
  },
25
25
  "required": ["sourceProject", "targetProject"]
@@ -0,0 +1,13 @@
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
+ import { ComponentMetadata } from '../../../utils/nx';
7
+ export interface TsAgentServeLocalOptions {
8
+ agentName: string;
9
+ agentNameClassName: string;
10
+ port: number;
11
+ targetComponent?: ComponentMetadata;
12
+ }
13
+ export declare const addTsAgentTargetToServeLocal: (tree: Tree, sourceProjectName: string, targetProjectName: string, options: TsAgentServeLocalOptions) => Promise<void>;
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addStrandsAgentTargetToServeLocal = void 0;
3
+ exports.addTsAgentTargetToServeLocal = void 0;
4
4
  const agent_serve_local_1 = require("../../../connection/agent-serve-local");
5
- /**
6
- * Adds the given strands agent target project to the source project's serve-local target
7
- * Updates the runtime config provider (if it exists) to point to the local WebSocket URL
8
- */
9
- const addStrandsAgentTargetToServeLocal = async (tree, sourceProjectName, targetProjectName, options) => {
5
+ const addTsAgentTargetToServeLocal = async (tree, sourceProjectName, targetProjectName, options) => {
10
6
  await (0, agent_serve_local_1.addAgentTargetToServeLocal)(tree, sourceProjectName, targetProjectName, {
11
7
  agentNameClassName: options.agentNameClassName,
12
8
  port: options.port,
@@ -15,5 +11,5 @@ const addStrandsAgentTargetToServeLocal = async (tree, sourceProjectName, target
15
11
  localUrl: `ws://localhost:${options.port}/ws`,
16
12
  });
17
13
  };
18
- exports.addStrandsAgentTargetToServeLocal = addStrandsAgentTargetToServeLocal;
14
+ exports.addTsAgentTargetToServeLocal = addTsAgentTargetToServeLocal;
19
15
  //# sourceMappingURL=serve-local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-local.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/react-connection/serve-local.ts"],"names":[],"mappings":";;;AAKA,6EAAmF;AAU5E,MAAM,4BAA4B,GAAG,KAAK,EAC/C,IAAU,EACV,iBAAyB,EACzB,iBAAyB,EACzB,OAAiC,EACjC,EAAE;IACF,MAAM,IAAA,8CAA0B,EAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE;QAC3E,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,sBAAsB,EAAE,eAAe;QACvC,QAAQ,EAAE,kBAAkB,OAAO,CAAC,IAAI,KAAK;KAC9C,CAAC,CAAC;AACL,CAAC,CAAC;AAbW,QAAA,4BAA4B,gCAavC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ import { IacProviderOption } from '../../utils/iac';
7
+
8
+ export type TsAgentSdk = 'strands';
9
+ export type TsAgentComputeType = 'BedrockAgentCoreRuntime' | 'None';
10
+ export type AgentProtocol = 'HTTP' | 'A2A' | 'AG-UI';
11
+
12
+ export type TsAgentAuth = 'IAM' | 'Cognito';
13
+
14
+ export interface TsAgentGeneratorSchema {
15
+ project: string;
16
+ sdk?: TsAgentSdk;
17
+ name?: string;
18
+ computeType?: TsAgentComputeType;
19
+ auth?: TsAgentAuth;
20
+ protocol?: AgentProtocol;
21
+ iacProvider: IacProviderOption;
22
+ }
@@ -1,45 +1,53 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
- "$id": "ts#strands-agent",
4
- "title": "ts#strands-agent",
5
- "description": "Add a Strands Agent to a TypeScript project",
3
+ "$id": "ts#agent",
4
+ "title": "ts#agent",
5
+ "description": "Add an AI Agent to a TypeScript project",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "project": {
9
9
  "type": "string",
10
- "description": "The project to add the Strands Agent to",
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 TypeScript project to add the Strands Agent to",
15
+ "x-prompt": "Select the TypeScript 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 Strands Agent.",
21
- "x-prompt": "How would you like to host your Strands Agent server?",
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 Strands Agent (default: agent)",
29
- "x-prompt": "What would you like to call your Strands Agent? (default: agent)"
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 Strands Agent. Choose between IAM (default) or Cognito.",
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 Strands Agent?",
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 Strands Agent. HTTP exposes a tRPC/WebSocket server. A2A exposes an Agent-to-Agent protocol server. AG-UI is not yet supported for TypeScript agents.",
42
- "x-prompt": "Which protocol would you like to use for your Strands Agent?",
49
+ "description": "The server protocol for your Agent. HTTP exposes a tRPC/WebSocket server. A2A exposes an Agent-to-Agent protocol server. AG-UI is not yet supported for TypeScript agents.",
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"
@@ -25,7 +25,7 @@ import {
25
25
  ProtocolType,
26
26
  Runtime,
27
27
  RuntimeProps,
28
- } from '@aws-cdk/aws-bedrock-agentcore-alpha';
28
+ } from 'aws-cdk-lib/aws-bedrockagentcore';
29
29
  import { IGrantable, IPrincipal, Grant } from 'aws-cdk-lib/aws-iam';
30
30
  import { RuntimeConfig } from '../../../core/runtime-config.js';
31
31
  import { findWorkspaceRoot } from '../../../core/workspace.js';
@@ -727,7 +727,7 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
727
727
  },
728
728
  "dependencies": {
729
729
  "@aws-lambda-powertools/parameters": "2.33.0",
730
- "@aws-sdk/client-appconfigdata": "3.1048.0",
730
+ "@aws-sdk/client-appconfigdata": "3.1053.0",
731
731
  "@modelcontextprotocol/sdk": "1.29.0",
732
732
  "express": "5.2.1",
733
733
  "zod": "4.4.3"
@@ -735,7 +735,7 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
735
735
  "devDependencies": {
736
736
  "@modelcontextprotocol/inspector": "0.19.0",
737
737
  "@types/express": "5.0.6",
738
- "tsx": "4.22.1"
738
+ "tsx": "4.22.3"
739
739
  }
740
740
  }
741
741
  "
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`ts#rdb strands-agent-connection generator > should add RDS CA bundle to Dockerfile (A2A) 1`] = `
3
+ exports[`ts#rdb agent-connection generator > should add RDS CA bundle to Dockerfile (A2A) 1`] = `
4
4
  "FROM public.ecr.aws/docker/library/node:lts-jod
5
5
 
6
6
  WORKDIR /app
@@ -21,7 +21,7 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
21
21
  "
22
22
  `;
23
23
 
24
- exports[`ts#rdb strands-agent-connection generator > should add RDS CA bundle to Dockerfile (HTTP) 1`] = `
24
+ exports[`ts#rdb agent-connection generator > should add RDS CA bundle to Dockerfile (HTTP) 1`] = `
25
25
  "FROM public.ecr.aws/docker/library/node:lts-jod
26
26
 
27
27
  WORKDIR /app
@@ -42,13 +42,13 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
42
42
  "
43
43
  `;
44
44
 
45
- exports[`ts#rdb strands-agent-connection generator > should add rdb serve-local dependency to the agent prefixed serve-local 1`] = `
45
+ exports[`ts#rdb agent-connection generator > should add rdb serve-local dependency to the agent prefixed serve-local 1`] = `
46
46
  {
47
47
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
48
48
  "metadata": {
49
49
  "components": [
50
50
  {
51
- "generator": "ts#strands-agent",
51
+ "generator": "ts#agent",
52
52
  "name": "my-agent",
53
53
  "path": "src/my-agent",
54
54
  "protocol": "HTTP",
@@ -74,7 +74,7 @@ exports[`ts#rdb strands-agent-connection generator > should add rdb serve-local
74
74
  }
75
75
  `;
76
76
 
77
- exports[`ts#rdb strands-agent-connection generator > should be idempotent for A2A agent.ts injection 1`] = `
77
+ exports[`ts#rdb agent-connection generator > should be idempotent for A2A agent.ts injection 1`] = `
78
78
  "import { getPrisma as getDb } from 'db';
79
79
  import { Agent, tool } from '@strands-agents/sdk';
80
80
  import { z } from 'zod';
@@ -97,7 +97,7 @@ export const getAgent = async () => {
97
97
  "
98
98
  `;
99
99
 
100
- exports[`ts#rdb strands-agent-connection generator > should be idempotent for Dockerfile 1`] = `
100
+ exports[`ts#rdb agent-connection generator > should be idempotent for Dockerfile 1`] = `
101
101
  "FROM public.ecr.aws/docker/library/node:lts-jod
102
102
 
103
103
  WORKDIR /app
@@ -118,7 +118,7 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
118
118
  "
119
119
  `;
120
120
 
121
- exports[`ts#rdb strands-agent-connection generator > should be idempotent for agent.ts injection 1`] = `
121
+ exports[`ts#rdb agent-connection generator > should be idempotent for agent.ts injection 1`] = `
122
122
  "import { getPrisma as getDb } from 'db';
123
123
  import { Agent, tool } from '@strands-agents/sdk';
124
124
  import { z } from 'zod';
@@ -141,13 +141,13 @@ export const getAgent = async () => {
141
141
  "
142
142
  `;
143
143
 
144
- exports[`ts#rdb strands-agent-connection generator > should fall back to agent-serve-local when no component name 1`] = `
144
+ exports[`ts#rdb agent-connection generator > should fall back to agent-serve-local when no component name 1`] = `
145
145
  {
146
146
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
147
147
  "metadata": {
148
148
  "components": [
149
149
  {
150
- "generator": "ts#strands-agent",
150
+ "generator": "ts#agent",
151
151
  "name": "agent",
152
152
  "path": "src/agent",
153
153
  "protocol": "HTTP",
@@ -173,7 +173,7 @@ exports[`ts#rdb strands-agent-connection generator > should fall back to agent-s
173
173
  }
174
174
  `;
175
175
 
176
- exports[`ts#rdb strands-agent-connection generator > should inject db into agent.ts 1`] = `
176
+ exports[`ts#rdb agent-connection generator > should inject db into agent.ts 1`] = `
177
177
  "import { getPrisma as getDb } from 'db';
178
178
  import { Agent, tool } from '@strands-agents/sdk';
179
179
  import { z } from 'zod';
@@ -196,7 +196,7 @@ export const getAgent = async () => {
196
196
  "
197
197
  `;
198
198
 
199
- exports[`ts#rdb strands-agent-connection generator > should inject db into agent.ts for A2A 1`] = `
199
+ exports[`ts#rdb agent-connection generator > should inject db into agent.ts for A2A 1`] = `
200
200
  "import { getPrisma as getDb } from 'db';
201
201
  import { Agent, tool } from '@strands-agents/sdk';
202
202
  import { z } from 'zod';
@@ -219,7 +219,7 @@ export const getAgent = async () => {
219
219
  "
220
220
  `;
221
221
 
222
- exports[`ts#rdb strands-agent-connection generator > should support multiple rdb connections in agent.ts 1`] = `
222
+ exports[`ts#rdb agent-connection generator > should support multiple rdb connections in agent.ts 1`] = `
223
223
  "import { getPrisma as getMysqlDb } from 'mysql-db';
224
224
  import { getPrisma as getPostgresDb } from 'postgres-db';
225
225
  import { Agent, tool } from '@strands-agents/sdk';
@@ -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 { Tree } from '@nx/devkit';
6
+ import { TsRdbAgentConnectionGeneratorSchema } from './schema';
7
+ import { NxGeneratorInfo } from '../../../utils/nx';
8
+ export declare const TS_RDB_AGENT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
9
+ export declare const tsRdbAgentConnectionGenerator: (tree: Tree, options: TsRdbAgentConnectionGeneratorSchema) => Promise<void>;
10
+ export default tsRdbAgentConnectionGenerator;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tsRdbStrandsAgentConnectionGenerator = exports.TS_RDB_STRANDS_AGENT_CONNECTION_GENERATOR_INFO = void 0;
3
+ exports.tsRdbAgentConnectionGenerator = exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /**
6
6
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -15,8 +15,8 @@ const lodash_camelcase_1 = tslib_1.__importDefault(require("lodash.camelcase"));
15
15
  const npm_scope_1 = require("../../../utils/npm-scope");
16
16
  const ast_1 = require("../../../utils/ast");
17
17
  const utils_1 = require("../utils");
18
- exports.TS_RDB_STRANDS_AGENT_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
19
- const tsRdbStrandsAgentConnectionGenerator = async (tree, options) => {
18
+ exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
19
+ const tsRdbAgentConnectionGenerator = async (tree, options) => {
20
20
  const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
21
21
  const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
22
22
  const agentName = options.sourceComponent?.name ?? 'agent';
@@ -60,10 +60,10 @@ const tsRdbStrandsAgentConnectionGenerator = async (tree, options) => {
60
60
  }
61
61
  }
62
62
  await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
63
- exports.TS_RDB_STRANDS_AGENT_CONNECTION_GENERATOR_INFO,
63
+ exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO,
64
64
  ]);
65
65
  await (0, format_1.formatFilesInSubtree)(tree);
66
66
  };
67
- exports.tsRdbStrandsAgentConnectionGenerator = tsRdbStrandsAgentConnectionGenerator;
68
- exports.default = exports.tsRdbStrandsAgentConnectionGenerator;
67
+ exports.tsRdbAgentConnectionGenerator = tsRdbAgentConnectionGenerator;
68
+ exports.default = exports.tsRdbAgentConnectionGenerator;
69
69
  //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/rdb/agent-connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAIoB;AAE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AC1C,8CAAsC;KACvC,CAAC,CAAC;IACH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAnFW,QAAA,6BAA6B,iCAmFxC;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 TsRdbStrandsAgentConnectionGeneratorSchema {
10
+ export interface TsRdbAgentConnectionGeneratorSchema {
11
11
  sourceProject: string;
12
12
  targetProject: string;
13
13
  sourceComponent?: ComponentMetadata;
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
- "$id": "ts#rdb#strands-agent-connection",
4
- "title": "ts#rdb#strands-agent-connection",
5
- "description": "Connect a ts#strands-agent to a ts#rdb project",
3
+ "$id": "ts#rdb#agent-connection",
4
+ "title": "ts#rdb#agent-connection",
5
+ "description": "Connect a ts#agent to a ts#rdb project",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "sourceProject": {
9
9
  "type": "string",
10
- "description": "The project containing the ts#strands-agent to connect from"
10
+ "description": "The project containing the ts#agent to connect from"
11
11
  },
12
12
  "targetProject": {
13
13
  "type": "string",
@@ -900,6 +900,7 @@ output "cloudfront_domain_name" {
900
900
  exports[`react-website generator > Tanstack router integration > should generate website with no router correctly > .gitignore 1`] = `
901
901
  "vite.config.*.timestamp*
902
902
  vitest.config.*.timestamp*
903
+ .grit
903
904
 
904
905
  runtime-config.json"
905
906
  `;
@@ -1064,37 +1065,37 @@ exports[`react-website generator > Tanstack router integration > should generate
1064
1065
  "{
1065
1066
  "name": "@proj/source",
1066
1067
  "dependencies": {
1067
- "@cloudscape-design/board-components": "3.0.180",
1068
- "@cloudscape-design/components": "3.0.1297",
1068
+ "@cloudscape-design/board-components": "3.0.183",
1069
+ "@cloudscape-design/components": "3.0.1300",
1069
1070
  "@cloudscape-design/global-styles": "1.0.59",
1070
- "aws-cdk-lib": "2.254.0",
1071
+ "aws-cdk-lib": "2.257.0",
1071
1072
  "constructs": "10.6.0",
1072
1073
  "react": "19.2.6",
1073
1074
  "react-dom": "19.2.6",
1074
- "tailwindcss": "4.2.2"
1075
+ "tailwindcss": "4.3.0"
1075
1076
  },
1076
1077
  "devDependencies": {
1077
1078
  "@eslint/js": "^9.8.0",
1078
- "@nx/eslint": "22.7.2",
1079
- "@nx/eslint-plugin": "22.7.2",
1080
- "@nx/js": "22.7.2",
1081
- "@nx/react": "22.7.2",
1082
- "@nx/vite": "22.7.2",
1083
- "@nx/vitest": "22.7.2",
1084
- "@nx/web": "22.7.2",
1079
+ "@nx/eslint": "22.7.3",
1080
+ "@nx/eslint-plugin": "22.7.3",
1081
+ "@nx/js": "22.7.3",
1082
+ "@nx/react": "22.7.3",
1083
+ "@nx/vite": "22.7.3",
1084
+ "@nx/vitest": "22.7.3",
1085
+ "@nx/web": "22.7.3",
1085
1086
  "@swc-node/register": "~1.11.1",
1086
1087
  "@swc/cli": "~0.8.0",
1087
1088
  "@swc/core": "~1.15.5",
1088
1089
  "@swc/helpers": "~0.5.18",
1089
- "@tailwindcss/vite": "4.2.2",
1090
+ "@tailwindcss/vite": "4.3.0",
1090
1091
  "@testing-library/dom": "10.4.0",
1091
1092
  "@testing-library/react": "16.3.0",
1092
- "@types/node": "25.8.0",
1093
+ "@types/node": "25.9.1",
1093
1094
  "@types/react": "^19.0.0",
1094
1095
  "@types/react-dom": "^19.0.0",
1095
1096
  "@vitejs/plugin-react": "^6.0.0",
1096
- "@vitest/coverage-v8": "4.1.6",
1097
- "@vitest/ui": "4.1.6",
1097
+ "@vitest/coverage-v8": "4.1.7",
1098
+ "@vitest/ui": "4.1.7",
1098
1099
  "eslint": "^9.8.0",
1099
1100
  "eslint-config-prettier": "^10.0.0",
1100
1101
  "eslint-plugin-import": "2.31.0",
@@ -1108,8 +1109,8 @@ exports[`react-website generator > Tanstack router integration > should generate
1108
1109
  "prettier": "3.8.3",
1109
1110
  "typescript": "~5.9.2",
1110
1111
  "typescript-eslint": "^8.40.0",
1111
- "vite": "8.0.8",
1112
- "vitest": "4.1.6"
1112
+ "vite": "8.0.14",
1113
+ "vitest": "4.1.7"
1113
1114
  },
1114
1115
  "type": "module",
1115
1116
  "scripts": {
@@ -2520,6 +2521,7 @@ exports[`react-website generator > Tanstack router integration > should generate
2520
2521
  exports[`react-website generator > Tanstack router integration > should generate website with router correctly > .gitignore 1`] = `
2521
2522
  "vite.config.*.timestamp*
2522
2523
  vitest.config.*.timestamp*
2524
+ .grit
2523
2525
 
2524
2526
  runtime-config.json"
2525
2527
  `;
@@ -2684,42 +2686,42 @@ exports[`react-website generator > Tanstack router integration > should generate
2684
2686
  "{
2685
2687
  "name": "@proj/source",
2686
2688
  "dependencies": {
2687
- "@cloudscape-design/board-components": "3.0.180",
2688
- "@cloudscape-design/components": "3.0.1297",
2689
+ "@cloudscape-design/board-components": "3.0.183",
2690
+ "@cloudscape-design/components": "3.0.1300",
2689
2691
  "@cloudscape-design/global-styles": "1.0.59",
2690
- "@tanstack/react-router": "1.170.4",
2691
- "aws-cdk-lib": "2.254.0",
2692
+ "@tanstack/react-router": "1.170.8",
2693
+ "aws-cdk-lib": "2.257.0",
2692
2694
  "constructs": "10.6.0",
2693
2695
  "react": "19.2.6",
2694
2696
  "react-dom": "19.2.6",
2695
- "tailwindcss": "4.2.2"
2697
+ "tailwindcss": "4.3.0"
2696
2698
  },
2697
2699
  "devDependencies": {
2698
2700
  "@eslint/js": "^9.8.0",
2699
- "@nx/eslint": "22.7.2",
2700
- "@nx/eslint-plugin": "22.7.2",
2701
- "@nx/js": "22.7.2",
2702
- "@nx/react": "22.7.2",
2703
- "@nx/vite": "22.7.2",
2704
- "@nx/vitest": "22.7.2",
2705
- "@nx/web": "22.7.2",
2701
+ "@nx/eslint": "22.7.3",
2702
+ "@nx/eslint-plugin": "22.7.3",
2703
+ "@nx/js": "22.7.3",
2704
+ "@nx/react": "22.7.3",
2705
+ "@nx/vite": "22.7.3",
2706
+ "@nx/vitest": "22.7.3",
2707
+ "@nx/web": "22.7.3",
2706
2708
  "@swc-node/register": "~1.11.1",
2707
2709
  "@swc/cli": "~0.8.0",
2708
2710
  "@swc/core": "~1.15.5",
2709
2711
  "@swc/helpers": "~0.5.18",
2710
- "@tailwindcss/vite": "4.2.2",
2711
- "@tanstack/router-generator": "1.167.5",
2712
- "@tanstack/router-plugin": "1.168.6",
2713
- "@tanstack/router-utils": "1.162.0",
2712
+ "@tailwindcss/vite": "4.3.0",
2713
+ "@tanstack/router-generator": "1.167.10",
2714
+ "@tanstack/router-plugin": "1.168.11",
2715
+ "@tanstack/router-utils": "1.162.1",
2714
2716
  "@tanstack/virtual-file-routes": "1.162.0",
2715
2717
  "@testing-library/dom": "10.4.0",
2716
2718
  "@testing-library/react": "16.3.0",
2717
- "@types/node": "25.8.0",
2719
+ "@types/node": "25.9.1",
2718
2720
  "@types/react": "^19.0.0",
2719
2721
  "@types/react-dom": "^19.0.0",
2720
2722
  "@vitejs/plugin-react": "^6.0.0",
2721
- "@vitest/coverage-v8": "4.1.6",
2722
- "@vitest/ui": "4.1.6",
2723
+ "@vitest/coverage-v8": "4.1.7",
2724
+ "@vitest/ui": "4.1.7",
2723
2725
  "eslint": "^9.8.0",
2724
2726
  "eslint-config-prettier": "^10.0.0",
2725
2727
  "eslint-plugin-import": "2.31.0",
@@ -2733,8 +2735,8 @@ exports[`react-website generator > Tanstack router integration > should generate
2733
2735
  "prettier": "3.8.3",
2734
2736
  "typescript": "~5.9.2",
2735
2737
  "typescript-eslint": "^8.40.0",
2736
- "vite": "8.0.8",
2737
- "vitest": "4.1.6"
2738
+ "vite": "8.0.14",
2739
+ "vitest": "4.1.7"
2738
2740
  },
2739
2741
  "type": "module",
2740
2742
  "scripts": {
@@ -4969,15 +4971,15 @@ root &&
4969
4971
 
4970
4972
  exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `
4971
4973
  {
4972
- "@cloudscape-design/board-components": "3.0.180",
4973
- "@cloudscape-design/components": "3.0.1297",
4974
+ "@cloudscape-design/board-components": "3.0.183",
4975
+ "@cloudscape-design/components": "3.0.1300",
4974
4976
  "@cloudscape-design/global-styles": "1.0.59",
4975
- "@tanstack/react-router": "1.170.4",
4976
- "aws-cdk-lib": "2.254.0",
4977
+ "@tanstack/react-router": "1.170.8",
4978
+ "aws-cdk-lib": "2.257.0",
4977
4979
  "constructs": "10.6.0",
4978
4980
  "react": "19.2.6",
4979
4981
  "react-dom": "19.2.6",
4980
- "tailwindcss": "4.2.2",
4982
+ "tailwindcss": "4.3.0",
4981
4983
  }
4982
4984
  `;
4983
4985
 
@@ -21,6 +21,7 @@ const identity_constructs_1 = require("../../../utils/identity-constructs/identi
21
21
  const iac_1 = require("../../../utils/iac");
22
22
  const utils_1 = require("./utils");
23
23
  const paths_1 = require("../../../utils/paths");
24
+ const npm_scope_1 = require("../../../utils/npm-scope");
24
25
  const readGritPattern = (name) => (0, fs_1.readFileSync)((0, path_1.join)(__dirname, 'grit', `${name}.grit`), 'utf-8').trim();
25
26
  exports.COGNITO_AUTH_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
26
27
  async function tsReactWebsiteAuthGenerator(tree, options) {
@@ -29,9 +30,9 @@ async function tsReactWebsiteAuthGenerator(tree, options) {
29
30
  if (tree.exists((0, devkit_1.joinPathFragments)(srcRoot, 'components/CognitoAuth/index.tsx'))) {
30
31
  throw new Error(`This generator has already been run on ${options.project}.`);
31
32
  }
32
- if (!options.cognitoDomain) {
33
- throw new Error('A Cognito domain must be specified!');
34
- }
33
+ const cognitoDomain = options.cognitoDomain && options.cognitoDomain.length > 0
34
+ ? options.cognitoDomain
35
+ : (0, utils_1.deriveCognitoDomainPrefix)((0, npm_scope_1.getNpmScope)(tree), projectConfig.name);
35
36
  await (0, generator_1.runtimeConfigGenerator)(tree, {
36
37
  project: options.project,
37
38
  });
@@ -42,7 +43,7 @@ async function tsReactWebsiteAuthGenerator(tree, options) {
42
43
  await (0, identity_constructs_1.addIdentityInfra)(tree, {
43
44
  iacProvider,
44
45
  allowSignup: options.allowSignup,
45
- cognitoDomain: options.cognitoDomain,
46
+ cognitoDomain,
46
47
  });
47
48
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'app'), srcRoot, options, {
48
49
  overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
@@ -1 +1 @@
1
- {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/cognito-auth/generator.ts"],"names":[],"mappings":";;;AA+CA,kEAwIC;AAvLD;;;GAGG;AACH,uCAOoB;AACpB,wEAA6E;AAE7E,2DAAqE;AACrE,sDAAuD;AACvD,4CAI4B;AAC5B,2BAAkC;AAClC,+BAA4B;AAC5B,kDAA6D;AAC7D,0CAK2B;AAC3B,oDAAyE;AACzE,wDAAkF;AAClF,gGAA0F;AAC1F,4CAAwD;AACxD,mCAIiB;AACjB,gDAA6D;AAE7D,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE,CAC/C,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAE3D,QAAA,2BAA2B,GACtC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,2BAA2B,CAC/C,IAAU,EACV,OAA0C;IAE1C,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC;IACzC,IACE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC,EAC3E,CAAC;QACD,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,CAAC,OAAO,GAAG,CAC7D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EAAE,YAAY,EAAE,aAAa,CAAC,CACxD,CACF,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAE3E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/cognito-auth/generator.ts"],"names":[],"mappings":";;;AAiDA,kEAyIC;AA1LD;;;GAGG;AACH,uCAOoB;AACpB,wEAA6E;AAE7E,2DAAqE;AACrE,sDAAuD;AACvD,4CAI4B;AAC5B,2BAAkC;AAClC,+BAA4B;AAC5B,kDAA6D;AAC7D,0CAK2B;AAC3B,oDAAyE;AACzE,wDAAkF;AAClF,gGAA0F;AAC1F,4CAAwD;AACxD,mCAKiB;AACjB,gDAA6D;AAC7D,wDAAuD;AAEvD,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE,CAC/C,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAE3D,QAAA,2BAA2B,GACtC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,2BAA2B,CAC/C,IAAU,EACV,OAA0C;IAE1C,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC;IACzC,IACE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC,EAC3E,CAAC;QACD,MAAM,IAAI,KA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BAAwB;IAExB,IAAA,kCAA6B,EAC3B,IAAI,EACJ,OAAO,CAAC,OAAO,EACf,mCAA2B,EAC3B,IAAA,6BAAqB,EACnB,aAAa,EACb,IAAA,0BAAiB,EAAC,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,CACxD,CACF,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,mCAA2B,CAAC,CAAC,CAAC;IAE3E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,2BAA2B,CAAC"}
@@ -8,6 +8,6 @@ import { IacProviderOption } from '../../../utils/iac';
8
8
  export interface TsReactWebsiteAuthGeneratorSchema {
9
9
  project: string;
10
10
  allowSignup: boolean;
11
- cognitoDomain: string;
11
+ cognitoDomain?: string;
12
12
  iacProvider: IacProviderOption;
13
13
  }
@@ -25,10 +25,10 @@
25
25
  "x-dropdown": "projects"
26
26
  },
27
27
  "cognitoDomain": {
28
- "description": "The cognito domain prefix to use",
28
+ "description": "The cognito domain prefix to use. If omitted, a value is derived from the npm scope and website project name.",
29
29
  "type": "string",
30
30
  "x-priority": "important",
31
- "x-prompt": "the cognito domain prefix to use i.e: https://{{cognitoDomain}}-123456789.auth.ap-southeast-2.amazoncognito.com"
31
+ "x-prompt": "the cognito domain prefix to use i.e: https://{{cognitoDomain}}-123456789.auth.ap-southeast-2.amazoncognito.com (leave blank to derive from scope and project name)"
32
32
  },
33
33
  "allowSignup": {
34
34
  "description": "Whether to allow self-signup",
@@ -46,5 +46,5 @@
46
46
  "x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
47
47
  }
48
48
  },
49
- "required": ["project", "cognitoDomain"]
49
+ "required": ["project"]
50
50
  }
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { Tree } from '@nx/devkit';
6
+ export declare const deriveCognitoDomainPrefix: (npmScope: string | undefined, projectName: string) => string;
6
7
  export declare function addNoneAuthMenu(tree: Tree, appLayoutTsxPath: string): Promise<void>;
7
8
  export declare function addCloudscapeAuthMenu(tree: Tree, appLayoutTsxPath: string): Promise<void>;
8
9
  export declare function addShadcnAuthMenu(tree: Tree, appLayoutTsxPath: string): Promise<void>;