@aws/nx-plugin 1.0.0-rc.0 → 1.0.0-rc.10
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 +3399 -4104
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +44 -5
- package/package.json +16 -12
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +13 -0
- package/sdk/license.js.map +1 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +58 -39
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +49 -60
- package/src/infra/app/files/app/src/main.ts.template +2 -2
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +25 -23
- 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/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +111 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +76 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +75 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +121 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +122 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +43 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1280 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +113 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +7 -0
- package/src/license/known-exceptions.js +33 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +10 -12
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +5 -5
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- package/src/open-api/ts-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +5 -5
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +128 -14
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +24 -19
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +7 -5
- package/src/preset/schema.json +9 -4
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +10 -9
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +8 -7
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/deploy/Dockerfile.template +3 -3
- package/src/py/agent/files/http/init.py.template +2 -2
- package/src/py/agent/files/http/main.py.template +0 -1
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +45 -39
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +5 -5
- 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.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +8 -8
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.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.d.ts +3 -3
- 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.d.ts +3 -3
- package/src/py/fast-api/generator.js +73 -55
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +3 -3
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +5 -2
- package/src/py/fast-api/react/open-api.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.d.ts +3 -3
- package/src/py/lambda-function/generator.js +34 -31
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.ts +7 -4
- package/src/py/lambda-function/schema.json +15 -7
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +44 -37
- 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.d.ts +3 -3
- package/src/py/project/generator.js +88 -69
- 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/__snapshots__/generator.spec.ts.snap +18 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +31 -29
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +4 -4
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +12 -38
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +89 -66
- 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.d.ts +3 -3
- package/src/terraform/project/generator.js +14 -9
- 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.d.ts +3 -3
- package/src/trpc/backend/generator.js +80 -61
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +5 -5
- 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.d.ts +3 -3
- package/src/trpc/react/generator.js +11 -10
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -5
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +9 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/deploy/Dockerfile.template +1 -1
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +40 -35
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -2
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +6 -6
- 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.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +15 -15
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- 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.d.ts +3 -3
- package/src/ts/api/generator.js +10 -8
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +5 -4
- package/src/ts/api/schema.json +15 -15
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1502 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -0
- package/src/ts/dynamodb/files/scripts/create-local-table.ts.template +161 -0
- package/src/ts/dynamodb/files/scripts/start-container.ts.template +81 -0
- package/src/ts/dynamodb/files/src/client.ts.template +45 -0
- package/src/ts/dynamodb/files/src/constants.ts.template +9 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/gsi.ts.template +14 -0
- package/src/ts/dynamodb/files/src/index.ts.template +11 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +106 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +14 -0
- package/src/ts/dynamodb/schema.json +52 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- 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.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +41 -36
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/schema.d.ts +7 -4
- package/src/ts/lambda-function/schema.json +15 -7
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +27 -29
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -1
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +46 -24
- 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 +20 -15
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +23 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +12 -11
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +120 -60
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +1 -1
- package/src/ts/rdb/files/scripts/pull-image.ts.template +15 -0
- package/src/ts/rdb/files/scripts/{docker-start.ts.template → start-container.ts.template} +24 -24
- 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.d.ts +3 -3
- package/src/ts/rdb/generator.js +103 -82
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/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/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/files/src/middleware/__rdbNameKebab__.ts.template +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +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 +3 -3
- package/src/ts/react-website/agui/generator.js +13 -13
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +423 -386
- 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 +6 -6
- package/src/ts/react-website/app/generator.js +124 -114
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.ts +9 -6
- package/src/ts/react-website/app/schema.json +13 -13
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- 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 -23
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +19 -22
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -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/react-website/cognito-auth/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.ts +8 -6
- package/src/ts/website/app/schema.json +21 -13
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +2 -2
- 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.d.ts +1 -1
- package/src/utils/agent-connection/agent-connection.js +17 -11
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-runtime-config/model-errors.ts.template +36 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/model_errors.py.template +40 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +10 -10
- package/src/utils/agent-core-constructs/agent-core-constructs.js +14 -24
- 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 +4 -4
- package/src/utils/api-constructs/api-constructs.js +5 -7
- 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 +4 -4
- 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/ast/website.d.ts +5 -1
- package/src/utils/ast/website.js +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.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 +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +7 -7
- package/src/utils/connection/open-api/react.d.ts +2 -2
- package/src/utils/connection/open-api/react.js +7 -7
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +6 -6
- package/src/utils/containers.js +6 -6
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +30 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +65 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.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 +5 -5
- package/src/utils/function-constructs/function-constructs.js +6 -8
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.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 +3 -3
- package/src/utils/iac.js +6 -6
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +3 -3
- package/src/utils/identity-constructs/identity-constructs.js +4 -4
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +30 -3
- package/src/utils/port.js +72 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +18 -9
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -5
- package/src/utils/rdb-constructs/rdb-constructs.js +7 -17
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +3 -3
- package/src/utils/shared-constructs.js +10 -10
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +1 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-scripts.d.ts +1 -1
- package/src/utils/shared-scripts.js +2 -2
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +68 -72
- package/src/utils/versions.js +67 -71
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +52 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +38 -11
- package/src/utils/website-constructs/website-constructs.d.ts +3 -3
- package/src/utils/website-constructs/website-constructs.js +5 -7
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- /package/src/ts/{rdb/files/scripts/docker-pull.ts.template → dynamodb/files/scripts/pull-image.ts.template} +0 -0
|
@@ -43,53 +43,61 @@
|
|
|
43
43
|
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
44
44
|
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"ux": {
|
|
47
47
|
"type": "string",
|
|
48
48
|
"description": "The preferred UX provider.",
|
|
49
|
-
"enum": ["
|
|
49
|
+
"enum": ["none", "cloudscape", "shadcn"],
|
|
50
50
|
"x-priority": "important",
|
|
51
|
-
"default": "
|
|
51
|
+
"default": "cloudscape",
|
|
52
52
|
"x-prompt": {
|
|
53
53
|
"message": "Which UX provider should we scaffold for this app?",
|
|
54
54
|
"type": "list",
|
|
55
55
|
"items": [
|
|
56
56
|
{
|
|
57
|
-
"value": "
|
|
57
|
+
"value": "none",
|
|
58
58
|
"label": "None (plain React/Vite without a UI kit)"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
"value": "
|
|
61
|
+
"value": "cloudscape",
|
|
62
62
|
"label": "Cloudscape (AWS-first components with ready-made layouts)"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
"value": "
|
|
65
|
+
"value": "shadcn",
|
|
66
66
|
"label": "Shadcn (shared UI library under packages/common/shadcn)"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"default": "
|
|
69
|
+
"default": "cloudscape"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"tailwind": {
|
|
73
73
|
"description": "Enable TailwindCSS for utility-first styling.",
|
|
74
74
|
"type": "boolean",
|
|
75
75
|
"default": true,
|
|
76
76
|
"x-priority": "important",
|
|
77
77
|
"x-prompt": "Would you like to enable TailwindCSS for additional styling capabilities?"
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"tanstackRouter": {
|
|
80
80
|
"description": "Enable Tanstack router for type-safe routing.",
|
|
81
81
|
"type": "boolean",
|
|
82
82
|
"default": true,
|
|
83
83
|
"x-priority": "important",
|
|
84
84
|
"x-prompt": "Would you like to enable Tanstack Router for type-safe routing?"
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"infra": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The type of infrastructure to deploy your website with.",
|
|
89
|
+
"enum": ["cloudfront-s3", "none"],
|
|
90
|
+
"default": "cloudfront-s3",
|
|
91
|
+
"x-priority": "important",
|
|
92
|
+
"x-prompt": "What infrastructure would you like to deploy your website with?"
|
|
93
|
+
},
|
|
94
|
+
"iac": {
|
|
87
95
|
"type": "string",
|
|
88
96
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
89
|
-
"enum": ["
|
|
97
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
90
98
|
"x-priority": "important",
|
|
91
|
-
"default": "
|
|
92
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
99
|
+
"default": "inherit",
|
|
100
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
"required": ["name"],
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import type { Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../../utils/nx';
|
|
7
|
+
import type { TsWebsiteAuthGeneratorSchema } from './schema';
|
|
8
8
|
export declare const TS_WEBSITE_AUTH_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare function tsWebsiteAuthGenerator(tree: Tree, schema: TsWebsiteAuthGeneratorSchema): Promise<() => void>;
|
|
10
10
|
export default tsWebsiteAuthGenerator;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = void 0;
|
|
4
4
|
exports.tsWebsiteAuthGenerator = tsWebsiteAuthGenerator;
|
|
5
|
-
const generator_1 = require("../../react-website/cognito-auth/generator");
|
|
6
5
|
const nx_1 = require("../../../utils/nx");
|
|
6
|
+
const generator_1 = require("../../react-website/cognito-auth/generator");
|
|
7
7
|
exports.TS_WEBSITE_AUTH_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
8
8
|
async function tsWebsiteAuthGenerator(tree, schema) {
|
|
9
9
|
return (0, generator_1.tsReactWebsiteAuthGenerator)(tree, {
|
|
10
10
|
project: schema.project,
|
|
11
11
|
allowSignup: schema.allowSignup,
|
|
12
12
|
cognitoDomain: schema.cognitoDomain,
|
|
13
|
-
|
|
13
|
+
iac: schema.iac,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
exports.default = tsWebsiteAuthGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/auth/generator.ts"],"names":[],"mappings":";;;AAYA,wDAUC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/website/auth/generator.ts"],"names":[],"mappings":";;;AAYA,wDAUC;AAjBD,0CAA2E;AAC3E,0EAAyF;AAG5E,QAAA,8BAA8B,GACzC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,sBAAsB,CAC1C,IAAU,EACV,MAAoC;IAEpC,OAAO,IAAA,uCAA2B,EAAC,IAAI,EAAE;QACvC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IacOption } from '../../../utils/iac';
|
|
6
6
|
|
|
7
7
|
export interface TsWebsiteAuthGeneratorSchema {
|
|
8
8
|
project: string;
|
|
9
9
|
allowSignup: boolean;
|
|
10
10
|
cognitoDomain?: string;
|
|
11
|
-
|
|
11
|
+
iac: IacOption;
|
|
12
12
|
}
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"x-prompt": "Enable self signup?",
|
|
34
34
|
"x-priority": "important"
|
|
35
35
|
},
|
|
36
|
-
"
|
|
36
|
+
"iac": {
|
|
37
37
|
"type": "string",
|
|
38
38
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
39
|
-
"enum": ["
|
|
39
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
40
40
|
"x-priority": "important",
|
|
41
|
-
"default": "
|
|
42
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
41
|
+
"default": "inherit",
|
|
42
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"required": ["project"]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
6
|
export declare const AGENT_CONNECTION_PROJECT_DIR: string;
|
|
7
7
|
/**
|
|
8
8
|
* Get the directory of the shared Python agent-connection project.
|
|
@@ -15,10 +15,10 @@ const tslib_1 = require("tslib");
|
|
|
15
15
|
* SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
*/
|
|
17
17
|
const devkit_1 = require("@nx/devkit");
|
|
18
|
-
const generator_1 = tslib_1.
|
|
19
|
-
const generator_2 = tslib_1.
|
|
20
|
-
const py_1 = require("../py");
|
|
18
|
+
const generator_1 = tslib_1.__importStar(require("../../py/project/generator"));
|
|
19
|
+
const generator_2 = tslib_1.__importDefault(require("../../ts/lib/generator"));
|
|
21
20
|
const ast_1 = require("../ast");
|
|
21
|
+
const py_1 = require("../py");
|
|
22
22
|
/** Prefix a GritQL pattern with `language python` */
|
|
23
23
|
const py = (pattern) => `language python\n${pattern}`;
|
|
24
24
|
const AGENT_CONNECTION_DIR = 'agent-connection';
|
|
@@ -30,7 +30,7 @@ const PY_AGENT_CONNECTION_NAME = 'agent_connection';
|
|
|
30
30
|
* Get the directory of the shared Python agent-connection project.
|
|
31
31
|
*/
|
|
32
32
|
function getPythonAgentConnectionProjectDir(tree) {
|
|
33
|
-
const { dir } = (0,
|
|
33
|
+
const { dir } = (0, generator_1.getPyProjectDetails)(tree, {
|
|
34
34
|
name: PY_AGENT_CONNECTION_NAME,
|
|
35
35
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
36
36
|
});
|
|
@@ -40,7 +40,7 @@ function getPythonAgentConnectionProjectDir(tree) {
|
|
|
40
40
|
* Get the Python module name of the shared agent-connection project.
|
|
41
41
|
*/
|
|
42
42
|
function getPythonAgentConnectionModuleName(tree) {
|
|
43
|
-
const { normalizedModuleName } = (0,
|
|
43
|
+
const { normalizedModuleName } = (0, generator_1.getPyProjectDetails)(tree, {
|
|
44
44
|
name: PY_AGENT_CONNECTION_NAME,
|
|
45
45
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
46
46
|
});
|
|
@@ -50,7 +50,7 @@ function getPythonAgentConnectionModuleName(tree) {
|
|
|
50
50
|
* Get the fully qualified Python package name of the shared agent-connection project.
|
|
51
51
|
*/
|
|
52
52
|
function getPythonAgentConnectionPackageName(tree) {
|
|
53
|
-
const { fullyQualifiedName } = (0,
|
|
53
|
+
const { fullyQualifiedName } = (0, generator_1.getPyProjectDetails)(tree, {
|
|
54
54
|
name: PY_AGENT_CONNECTION_NAME,
|
|
55
55
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
56
56
|
});
|
|
@@ -79,7 +79,7 @@ exports.PY_CORE_TEMPLATES = {
|
|
|
79
79
|
async function ensureTypeScriptAgentConnectionProject(tree) {
|
|
80
80
|
const projectJsonPath = (0, devkit_1.joinPathFragments)(exports.AGENT_CONNECTION_PROJECT_DIR, 'project.json');
|
|
81
81
|
if (!tree.exists(projectJsonPath)) {
|
|
82
|
-
await (0,
|
|
82
|
+
await (0, generator_2.default)(tree, {
|
|
83
83
|
name: AGENT_CONNECTION_DIR,
|
|
84
84
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
85
85
|
});
|
|
@@ -92,6 +92,7 @@ async function ensureTypeScriptAgentConnectionProject(tree) {
|
|
|
92
92
|
// the agent-connection internals.
|
|
93
93
|
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(exports.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), './core/session-context.js');
|
|
94
94
|
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(exports.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), './core/with-session-id.js');
|
|
95
|
+
await (0, ast_1.addStarExport)(tree, (0, devkit_1.joinPathFragments)(exports.AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'), './core/model-errors.js');
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
97
98
|
* Emit one of the TypeScript core client templates (mcp or a2a) into the
|
|
@@ -112,10 +113,10 @@ async function ensurePythonAgentConnectionProject(tree) {
|
|
|
112
113
|
const projectJsonPath = (0, devkit_1.joinPathFragments)(projectDir, 'project.json');
|
|
113
114
|
if (!tree.exists(projectJsonPath)) {
|
|
114
115
|
// Create the Python project using the standard py#project generator
|
|
115
|
-
await (0,
|
|
116
|
+
await (0, generator_1.default)(tree, {
|
|
116
117
|
name: PY_AGENT_CONNECTION_NAME,
|
|
117
118
|
directory: (0, devkit_1.joinPathFragments)(PACKAGES_DIR, COMMON_DIR),
|
|
118
|
-
|
|
119
|
+
type: 'library',
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
const moduleDir = (0, devkit_1.joinPathFragments)(projectDir, moduleName);
|
|
@@ -139,8 +140,13 @@ async function ensurePythonAgentConnectionProject(tree) {
|
|
|
139
140
|
await addPythonReExport(tree, moduleInitPath, '.core.session_context', 'get_current_session_id');
|
|
140
141
|
await addPythonReExport(tree, moduleInitPath, '.core.session_context', 'session_id_context');
|
|
141
142
|
await addPythonReExport(tree, moduleInitPath, '.core.with_session_id', 'with_session_id');
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
await addPythonReExport(tree, moduleInitPath, '.core.model_errors', 'log_model_errors');
|
|
144
|
+
// Shared core helpers depend on aws-lambda-powertools for AppConfig access
|
|
145
|
+
// and strands-agents for the model error-logging hook.
|
|
146
|
+
(0, py_1.addDependenciesToPyProjectToml)(tree, projectDir, [
|
|
147
|
+
'aws-lambda-powertools',
|
|
148
|
+
'strands-agents',
|
|
149
|
+
]);
|
|
144
150
|
}
|
|
145
151
|
/**
|
|
146
152
|
* Emit a Python core client template (mcp / a2a / shared auth) into the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-connection.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-connection/agent-connection.ts"],"names":[],"mappings":";;;AAmCA,gFAMC;AAKD,gFAMC;AAKD,kFAMC;AAwBD,
|
|
1
|
+
{"version":3,"file":"agent-connection.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-connection/agent-connection.ts"],"names":[],"mappings":";;;AAmCA,gFAMC;AAKD,gFAMC;AAKD,kFAMC;AAwBD,wFA0CC;AAOD,0DAWC;AAOD,gFA2EC;AAMD,kDAcC;AAQD,8CAqEC;;AAtUD;;;GAGG;AACH,uCAKoB;AACpB,gFAEoC;AACpC,+EAAwD;AACxD,gCAAiE;AACjE,8BAAuD;AAEvD,qDAAqD;AACrD,MAAM,EAAE,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,oBAAoB,OAAO,EAAE,CAAC;AAE9D,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAChD,MAAM,YAAY,GAAG,UAAU,CAAC;A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,CAAC;QACpB,yDAAyD;QACzD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,UAAU,kBAAkB,QAAQ,KAAK,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AfterModelCallEvent, type LocalAgent } from '@strands-agents/sdk';
|
|
2
|
+
|
|
3
|
+
const NO_CREDENTIALS =
|
|
4
|
+
'Unable to invoke the model: no AWS credentials found. Configure credentials ' +
|
|
5
|
+
'(e.g. run `aws configure`, set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / ' +
|
|
6
|
+
'AWS_SESSION_TOKEN, or assume a role) before running the agent.';
|
|
7
|
+
const ACCESS_DENIED =
|
|
8
|
+
'Unable to invoke the model: access denied. Grant your AWS principal permission ' +
|
|
9
|
+
'to call bedrock:InvokeModelWithResponseStream for your model.';
|
|
10
|
+
|
|
11
|
+
// AWS SDK v3 errors are identified by their `name` rather than `instanceof`,
|
|
12
|
+
// since the SDK may be loaded from more than one place. Strands wraps them in a
|
|
13
|
+
// ModelError, so we check the error and its `cause` chain.
|
|
14
|
+
const hasErrorNamed = (error: unknown, name: string): boolean => {
|
|
15
|
+
let current: unknown = error;
|
|
16
|
+
while (current instanceof Error) {
|
|
17
|
+
if (current.name === name) return true;
|
|
18
|
+
current = current.cause;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Logs model invocation errors, calling out missing credentials or denied permissions. */
|
|
24
|
+
export const logModelErrors = (agent: LocalAgent): void => {
|
|
25
|
+
agent.addHook(AfterModelCallEvent, (event) => {
|
|
26
|
+
const error = event.error;
|
|
27
|
+
if (!error) return;
|
|
28
|
+
if (hasErrorNamed(error, 'CredentialsProviderError')) {
|
|
29
|
+
console.error(NO_CREDENTIALS);
|
|
30
|
+
} else if (hasErrorNamed(error, 'AccessDeniedException')) {
|
|
31
|
+
console.error(ACCESS_DENIED);
|
|
32
|
+
} else {
|
|
33
|
+
console.error(`Model invocation failed: ${error.message}`);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from botocore.exceptions import ClientError, NoCredentialsError, PartialCredentialsError
|
|
4
|
+
from strands.hooks import AfterModelCallEvent, HookRegistry
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger(__name__)
|
|
7
|
+
|
|
8
|
+
_NO_CREDENTIALS = (
|
|
9
|
+
"Unable to invoke the model: no AWS credentials found. Configure credentials "
|
|
10
|
+
"(e.g. run `aws configure`, set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / "
|
|
11
|
+
"AWS_SESSION_TOKEN, or assume a role) before running the agent."
|
|
12
|
+
)
|
|
13
|
+
_ACCESS_DENIED = (
|
|
14
|
+
"Unable to invoke the model: access denied. Grant your AWS principal permission "
|
|
15
|
+
"to call bedrock:InvokeModelWithResponseStream for your model."
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _is_access_denied(error: BaseException) -> bool:
|
|
20
|
+
return isinstance(error, ClientError) and error.response.get("Error", {}).get("Code") == "AccessDeniedException"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class _LogModelErrors:
|
|
24
|
+
def register_hooks(self, registry: HookRegistry, **_kwargs) -> None:
|
|
25
|
+
registry.add_callback(AfterModelCallEvent, self._on_after_model_call)
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def _on_after_model_call(event: AfterModelCallEvent) -> None:
|
|
29
|
+
error = event.exception
|
|
30
|
+
if error is None:
|
|
31
|
+
return
|
|
32
|
+
if isinstance(error, (NoCredentialsError, PartialCredentialsError)):
|
|
33
|
+
logger.error(_NO_CREDENTIALS)
|
|
34
|
+
elif _is_access_denied(error):
|
|
35
|
+
logger.error(_ACCESS_DENIED)
|
|
36
|
+
else:
|
|
37
|
+
logger.error("Model invocation failed: %s", error)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
log_model_errors = _LogModelErrors()
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
|
+
import type { Containers } from '../containers';
|
|
7
|
+
import type { Iac } from '../iac';
|
|
8
8
|
type IACProvider = {
|
|
9
|
-
|
|
9
|
+
iac: Iac;
|
|
10
10
|
};
|
|
11
|
-
export type AgentCoreAuth = '
|
|
11
|
+
export type AgentCoreAuth = 'iam' | 'cognito';
|
|
12
12
|
export interface AddAgentCoreInfraProps {
|
|
13
13
|
nameClassName: string;
|
|
14
14
|
nameKebabCase: string;
|
|
@@ -16,9 +16,9 @@ export interface AddAgentCoreInfraProps {
|
|
|
16
16
|
dockerImageTag: string;
|
|
17
17
|
dockerOutputDir: string;
|
|
18
18
|
appDirectory: string;
|
|
19
|
-
serverProtocol: '
|
|
19
|
+
serverProtocol: 'mcp' | 'http' | 'a2a';
|
|
20
20
|
auth: AgentCoreAuth;
|
|
21
|
-
|
|
21
|
+
containers: Containers;
|
|
22
22
|
}
|
|
23
23
|
export interface AddMcpServerInfraProps {
|
|
24
24
|
mcpServerNameClassName: string;
|
|
@@ -27,7 +27,7 @@ export interface AddMcpServerInfraProps {
|
|
|
27
27
|
dockerImageTag: string;
|
|
28
28
|
dockerOutputDir: string;
|
|
29
29
|
auth: AgentCoreAuth;
|
|
30
|
-
|
|
30
|
+
containers: Containers;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Add an MCP server CDK construct
|
|
@@ -40,8 +40,8 @@ export interface AddAgentInfraProps {
|
|
|
40
40
|
dockerImageTag: string;
|
|
41
41
|
dockerOutputDir: string;
|
|
42
42
|
auth: AgentCoreAuth;
|
|
43
|
-
serverProtocol?: '
|
|
44
|
-
|
|
43
|
+
serverProtocol?: 'http' | 'a2a';
|
|
44
|
+
containers: Containers;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Add an agent CDK construct
|
|
@@ -6,31 +6,21 @@ exports.addAgentInfra = exports.addMcpServerInfra = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const shared_constructs_constants_1 = require("../shared-constructs-constants");
|
|
10
9
|
const ast_1 = require("../ast");
|
|
10
|
+
const nx_1 = require("../nx");
|
|
11
|
+
const shared_constructs_constants_1 = require("../shared-constructs-constants");
|
|
11
12
|
const addAgentCoreInfra = async (tree, options) => {
|
|
12
|
-
switch (options.
|
|
13
|
-
case '
|
|
13
|
+
switch (options.iac) {
|
|
14
|
+
case 'cdk':
|
|
14
15
|
await addAgentCoreCDKInfra(tree, options);
|
|
15
16
|
break;
|
|
16
|
-
case '
|
|
17
|
+
case 'terraform':
|
|
17
18
|
addAgentCoreTerraformInfra(tree, options);
|
|
18
19
|
break;
|
|
19
20
|
}
|
|
20
21
|
// Update shared constructs/terraform project configuration to depend on this project
|
|
21
|
-
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.
|
|
22
|
-
|
|
23
|
-
: shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
24
|
-
if (!config.targets) {
|
|
25
|
-
config.targets = {};
|
|
26
|
-
}
|
|
27
|
-
if (!config.targets.build) {
|
|
28
|
-
config.targets.build = {};
|
|
29
|
-
}
|
|
30
|
-
config.targets.build.dependsOn = [
|
|
31
|
-
...(config.targets.build.dependsOn ?? []).filter((t) => t !== `${options.projectName}:build`),
|
|
32
|
-
`${options.projectName}:build`,
|
|
33
|
-
];
|
|
22
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, options.iac === 'cdk' ? shared_constructs_constants_1.SHARED_CONSTRUCTS_DIR : shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'project.json'), (config) => {
|
|
23
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(config, 'build', `${options.projectName}:build`);
|
|
34
24
|
return config;
|
|
35
25
|
});
|
|
36
26
|
};
|
|
@@ -45,7 +35,7 @@ const addAgentCoreCDKInfra = async (tree, options) => {
|
|
|
45
35
|
};
|
|
46
36
|
const addAgentCoreTerraformInfra = (tree, options) => {
|
|
47
37
|
// Add the AgentCore shared module
|
|
48
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'terraform', 'core', 'agent-core'), (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'src', 'core', 'agent-core'), {
|
|
38
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'terraform', 'core', 'agent-core'), (0, devkit_1.joinPathFragments)(shared_constructs_constants_1.PACKAGES_DIR, shared_constructs_constants_1.SHARED_TERRAFORM_DIR, 'src', 'core', 'agent-core'), { containers: options.containers }, {
|
|
49
39
|
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
50
40
|
});
|
|
51
41
|
// Generate app specific agent core configuration
|
|
@@ -64,10 +54,10 @@ const addMcpServerInfra = async (tree, options) => {
|
|
|
64
54
|
dockerOutputDir: options.dockerOutputDir,
|
|
65
55
|
projectName: options.projectName,
|
|
66
56
|
appDirectory: 'mcp-servers',
|
|
67
|
-
serverProtocol: '
|
|
68
|
-
|
|
57
|
+
serverProtocol: 'mcp',
|
|
58
|
+
iac: options.iac,
|
|
69
59
|
auth: options.auth,
|
|
70
|
-
|
|
60
|
+
containers: options.containers,
|
|
71
61
|
});
|
|
72
62
|
};
|
|
73
63
|
exports.addMcpServerInfra = addMcpServerInfra;
|
|
@@ -82,10 +72,10 @@ const addAgentInfra = async (tree, options) => {
|
|
|
82
72
|
dockerImageTag: options.dockerImageTag,
|
|
83
73
|
dockerOutputDir: options.dockerOutputDir,
|
|
84
74
|
appDirectory: 'agents',
|
|
85
|
-
serverProtocol: options.serverProtocol ?? '
|
|
86
|
-
|
|
75
|
+
serverProtocol: options.serverProtocol ?? 'http',
|
|
76
|
+
iac: options.iac,
|
|
87
77
|
auth: options.auth,
|
|
88
|
-
|
|
78
|
+
containers: options.containers,
|
|
89
79
|
});
|
|
90
80
|
};
|
|
91
81
|
exports.addAgentInfra = addAgentInfra;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-core-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,
|
|
1
|
+
{"version":3,"file":"agent-core-constructs.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,gCAAuC;AAGvC,8BAA0D;AAC1D,gFAIwC;AAkBxC,MAAM,iBAAiB,GAAG,KAAK,EAC7B,IAAU,EACV,OAA8C,EAC9C,EAAE;IACF,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC;QACpB,KAAK,KAAK;YACR,MAAM,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,WAAW;YACd,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1C,MAAM;IACV,CAAC;IAED,qFAAqF;IACrF,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EACf,0CAAY,EACZ,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,mDAAqB,CAAC,CAAC,C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AO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,YAAY,EAAE,QAAQ;QACtB,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM;QAChD,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB"}
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
ProtocolType,
|
|
10
10
|
Runtime,
|
|
11
11
|
RuntimeProps,
|
|
12
|
-
<%_ if (auth === '
|
|
12
|
+
<%_ if (auth === 'cognito') { _%>
|
|
13
13
|
RuntimeAuthorizerConfiguration,
|
|
14
14
|
<%_ } _%>
|
|
15
15
|
} from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
16
|
-
import { <%_ if (serverProtocol !== '
|
|
17
|
-
<%_ if (auth === '
|
|
16
|
+
import { <%_ if (serverProtocol !== 'mcp') { _%>PolicyStatement, <%_ } _%>IGrantable, IPrincipal<%_ if (auth === 'iam') { _%>, Grant<%_ } _%> } from 'aws-cdk-lib/aws-iam';
|
|
17
|
+
<%_ if (auth === 'cognito') { _%>
|
|
18
18
|
import { IUserPool, IUserPoolClient } from 'aws-cdk-lib/aws-cognito';
|
|
19
19
|
<%_ } _%>
|
|
20
20
|
import { RuntimeConfig } from '../../../core/runtime-config.js';
|
|
21
21
|
import { findWorkspaceRoot } from '../../../core/workspace.js';
|
|
22
22
|
|
|
23
|
-
<%_ if (auth === '
|
|
23
|
+
<%_ if (auth === 'iam') { _%>
|
|
24
24
|
export type <%- nameClassName %>Props = Omit<
|
|
25
25
|
RuntimeProps,
|
|
26
26
|
| 'runtimeName'
|
|
@@ -28,7 +28,7 @@ export type <%- nameClassName %>Props = Omit<
|
|
|
28
28
|
| 'agentRuntimeArtifact'
|
|
29
29
|
| 'authorizerConfiguration'
|
|
30
30
|
>;
|
|
31
|
-
<%_ } else if (auth === '
|
|
31
|
+
<%_ } else if (auth === 'cognito') { _%>
|
|
32
32
|
export type <%- nameClassName %>Props = Omit<
|
|
33
33
|
RuntimeProps,
|
|
34
34
|
| 'runtimeName'
|
|
@@ -50,7 +50,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
50
50
|
public readonly dockerImage: AgentRuntimeArtifact;
|
|
51
51
|
public readonly agentCoreRuntime: Runtime;
|
|
52
52
|
|
|
53
|
-
constructor(scope: Construct, id: string, props<%_ if (auth !== '
|
|
53
|
+
constructor(scope: Construct, id: string, props<%_ if (auth !== 'cognito') { _%>?<%_ } _%>: <%- nameClassName %>Props) {
|
|
54
54
|
super(scope, id);
|
|
55
55
|
|
|
56
56
|
const rc = RuntimeConfig.ensure(this);
|
|
@@ -65,7 +65,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
65
65
|
platform: Platform.LINUX_ARM64,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
<%_ if (auth === '
|
|
68
|
+
<%_ if (auth === 'cognito') { _%>
|
|
69
69
|
const { identity, ...restProps } = props;
|
|
70
70
|
|
|
71
71
|
<%_ } _%>
|
|
@@ -74,9 +74,9 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
74
74
|
produce: () =>
|
|
75
75
|
Names.uniqueResourceName(this.agentCoreRuntime, { maxLength: 40 }),
|
|
76
76
|
}),
|
|
77
|
-
protocolConfiguration: ProtocolType.<%- serverProtocol %>,
|
|
77
|
+
protocolConfiguration: ProtocolType.<%- serverProtocol.toUpperCase() %>,
|
|
78
78
|
agentRuntimeArtifact: this.dockerImage,
|
|
79
|
-
<%_ if (auth === '
|
|
79
|
+
<%_ if (auth === 'cognito') { _%>
|
|
80
80
|
authorizerConfiguration: RuntimeAuthorizerConfiguration.usingCognito(
|
|
81
81
|
identity.userPool,
|
|
82
82
|
[identity.userPoolClient],
|
|
@@ -87,7 +87,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
87
87
|
<%_ } _%>
|
|
88
88
|
environmentVariables: {
|
|
89
89
|
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
90
|
-
<%_ if (auth === '
|
|
90
|
+
<%_ if (auth === 'cognito') { _%>
|
|
91
91
|
...restProps?.environmentVariables,
|
|
92
92
|
<%_ } else { _%>
|
|
93
93
|
...props?.environmentVariables,
|
|
@@ -95,7 +95,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
95
95
|
},
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
<%_ if (serverProtocol !== '
|
|
98
|
+
<%_ if (serverProtocol !== 'mcp') { _%>
|
|
99
99
|
// Grant access for the agent to invoke bedrock models
|
|
100
100
|
this.agentCoreRuntime.addToRolePolicy(
|
|
101
101
|
new PolicyStatement({
|
|
@@ -132,7 +132,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
132
132
|
public get connections(): Connections {
|
|
133
133
|
return this.agentCoreRuntime.connections;
|
|
134
134
|
}
|
|
135
|
-
<%_ if (auth === '
|
|
135
|
+
<%_ if (auth === 'iam') { _%>
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Grants IAM permissions to invoke this agent runtime.
|
|
@@ -146,7 +146,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
146
146
|
grantee,
|
|
147
147
|
actions: [
|
|
148
148
|
'bedrock-agentcore:InvokeAgentRuntimeWithWebSocketStream',
|
|
149
|
-
<%_ if (serverProtocol === '
|
|
149
|
+
<%_ if (serverProtocol === 'a2a') { _%>
|
|
150
150
|
'bedrock-agentcore:GetAgentCard',
|
|
151
151
|
<%_ } _%>
|
|
152
152
|
],
|
|
@@ -30,7 +30,7 @@ variable "appconfig_application_arn" {
|
|
|
30
30
|
type = string
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
<%_ if (auth === '
|
|
33
|
+
<%_ if (auth === 'cognito') { _%>
|
|
34
34
|
variable "user_pool_id" {
|
|
35
35
|
description = "ID of the user pool for cognito authentication"
|
|
36
36
|
type = string
|
|
@@ -52,8 +52,8 @@ module "agent_core_runtime" {
|
|
|
52
52
|
source = "../../../core/agent-core"
|
|
53
53
|
agent_runtime_name = "<%= nameClassName %>"
|
|
54
54
|
docker_image_tag = "<%= dockerImageTag %>"
|
|
55
|
-
server_protocol = "<%= serverProtocol %>"
|
|
56
|
-
<%_ if (auth === '
|
|
55
|
+
server_protocol = "<%= serverProtocol.toUpperCase() %>"
|
|
56
|
+
<%_ if (auth === 'cognito') { _%>
|
|
57
57
|
authorizer_configuration = {
|
|
58
58
|
custom_jwt_authorizer = {
|
|
59
59
|
discovery_url = "https://cognito-idp.${local.aws_region}.amazonaws.com/${var.user_pool_id}/.well-known/openid-configuration"
|
|
@@ -73,7 +73,7 @@ module "agent_core_runtime" {
|
|
|
73
73
|
"appconfig:GetLatestConfiguration"
|
|
74
74
|
]
|
|
75
75
|
Resource = ["${var.appconfig_application_arn}/*"]
|
|
76
|
-
}<% if (serverProtocol !== '
|
|
76
|
+
}<% if (serverProtocol !== 'mcp') { %>,
|
|
77
77
|
# Grant access for the agent to invoke bedrock models
|
|
78
78
|
{
|
|
79
79
|
Effect = "Allow"
|