@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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"x-prompt": "Select the project to add the lambda function to",
|
|
12
12
|
"x-dropdown": "projects"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
14
|
+
"name": {
|
|
15
15
|
"type": "string",
|
|
16
16
|
"description": "The name of the function to add",
|
|
17
17
|
"x-priority": "important",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"description": "The path within the project source directory to add the function to",
|
|
27
27
|
"x-prompt": "Enter the path within the project source directory to add the function to (e.g. 'lambda_functions/')"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
29
|
+
"event": {
|
|
30
30
|
"type": "string",
|
|
31
31
|
"description": "Optional event source model to use for the lambda function",
|
|
32
32
|
"x-priority": "important",
|
|
@@ -75,14 +75,22 @@
|
|
|
75
75
|
"default": "Any",
|
|
76
76
|
"x-prompt": "Enter the event source model to use for the lambda function"
|
|
77
77
|
},
|
|
78
|
-
"
|
|
78
|
+
"infra": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "The type of infrastructure to deploy your Lambda function with.",
|
|
81
|
+
"enum": ["lambda", "none"],
|
|
82
|
+
"default": "lambda",
|
|
83
|
+
"x-priority": "important",
|
|
84
|
+
"x-prompt": "What infrastructure would you like to deploy your Lambda function with?"
|
|
85
|
+
},
|
|
86
|
+
"iac": {
|
|
79
87
|
"type": "string",
|
|
80
88
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
81
|
-
"enum": ["
|
|
89
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
82
90
|
"x-priority": "important",
|
|
83
|
-
"default": "
|
|
84
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
91
|
+
"default": "inherit",
|
|
92
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
85
93
|
}
|
|
86
94
|
},
|
|
87
|
-
"required": ["project", "
|
|
95
|
+
"required": ["project", "name"]
|
|
88
96
|
}
|
|
@@ -162,7 +162,7 @@ variable "server_protocol" {
|
|
|
162
162
|
default = "HTTP"
|
|
163
163
|
validation {
|
|
164
164
|
condition = contains(["MCP", "HTTP", "A2A"], var.server_protocol)
|
|
165
|
-
error_message = "Protocol type must be either '
|
|
165
|
+
error_message = "Protocol type must be either 'mcp', 'http', or 'a2a'."
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -647,10 +647,10 @@ name = "proj.test_project"
|
|
|
647
647
|
version = "0.1.0"
|
|
648
648
|
dependencies = [
|
|
649
649
|
"aws-lambda-powertools==3.29.0",
|
|
650
|
-
"mcp==1.27.
|
|
651
|
-
"uvicorn==0.
|
|
652
|
-
"boto3==1.43.
|
|
653
|
-
"aws-opentelemetry-distro==0.17.
|
|
650
|
+
"mcp==1.27.2",
|
|
651
|
+
"uvicorn==0.49.0",
|
|
652
|
+
"boto3==1.43.24",
|
|
653
|
+
"aws-opentelemetry-distro==0.17.1"
|
|
654
654
|
]
|
|
655
655
|
|
|
656
656
|
[dependency-groups]
|
|
@@ -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 { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { PyMcpServerGeneratorSchema } from './schema';
|
|
8
8
|
export declare const PY_MCP_SERVER_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare const pyMcpServerGenerator: (tree: Tree, options: PyMcpServerGeneratorSchema) => Promise<GeneratorCallback>;
|
|
10
10
|
export default pyMcpServerGenerator;
|
|
@@ -6,22 +6,24 @@ exports.pyMcpServerGenerator = exports.PY_MCP_SERVER_GENERATOR_INFO = void 0;
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const format_1 = require("../../utils/format");
|
|
12
|
-
const names_1 = require("../../utils/names");
|
|
13
|
-
const py_1 = require("../../utils/py");
|
|
14
|
-
const npm_scope_1 = require("../../utils/npm-scope");
|
|
9
|
+
const config_1 = require("../../license/config");
|
|
10
|
+
const known_exceptions_1 = require("../../license/known-exceptions");
|
|
15
11
|
const agent_core_constructs_1 = require("../../utils/agent-core-constructs/agent-core-constructs");
|
|
16
|
-
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
17
12
|
const bundle_1 = require("../../utils/bundle/bundle");
|
|
13
|
+
const containers_1 = require("../../utils/containers");
|
|
14
|
+
const format_1 = require("../../utils/format");
|
|
18
15
|
const fs_1 = require("../../utils/fs");
|
|
19
|
-
const versions_1 = require("../../utils/versions");
|
|
20
|
-
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
21
16
|
const iac_1 = require("../../utils/iac");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
17
|
+
const metrics_1 = require("../../utils/metrics");
|
|
18
|
+
const names_1 = require("../../utils/names");
|
|
19
|
+
const npm_scope_1 = require("../../utils/npm-scope");
|
|
20
|
+
const nx_1 = require("../../utils/nx");
|
|
21
|
+
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
24
22
|
const paths_1 = require("../../utils/paths");
|
|
23
|
+
const port_1 = require("../../utils/port");
|
|
24
|
+
const py_1 = require("../../utils/py");
|
|
25
|
+
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
26
|
+
const versions_1 = require("../../utils/versions");
|
|
25
27
|
exports.PY_MCP_SERVER_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
26
28
|
const pyMcpServerGenerator = async (tree, options) => {
|
|
27
29
|
const project = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.project);
|
|
@@ -41,11 +43,11 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
41
43
|
const mcpServerNameSnakeCase = (0, names_1.toSnakeCase)(options.name || 'mcp-server');
|
|
42
44
|
const mcpServerNameClassName = (0, names_1.toClassName)(name);
|
|
43
45
|
const targetSourceDir = (0, devkit_1.joinPathFragments)(project.sourceRoot, mcpServerNameSnakeCase);
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
console.warn('Warning: auth is ignored when no
|
|
46
|
+
const infra = options.infra ?? 'agentcore';
|
|
47
|
+
if (infra === 'none' && options.auth && options.auth !== 'iam') {
|
|
48
|
+
console.warn('Warning: auth is ignored when no infrastructure is configured (no infrastructure is generated)');
|
|
47
49
|
}
|
|
48
|
-
const auth = options.auth ?? '
|
|
50
|
+
const auth = options.auth ?? 'iam';
|
|
49
51
|
// Generate example server
|
|
50
52
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'app'), targetSourceDir, {
|
|
51
53
|
name,
|
|
@@ -60,8 +62,8 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
60
62
|
'boto3',
|
|
61
63
|
'aws-opentelemetry-distro',
|
|
62
64
|
]);
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
+
if (infra === 'agentcore') {
|
|
66
|
+
const containers = await (0, containers_1.resolveContainers)(tree, 'inherit');
|
|
65
67
|
const dockerImageTag = `${(0, npm_scope_1.getNpmScope)(tree)}-${name}:latest`;
|
|
66
68
|
// Add bundle target
|
|
67
69
|
const { bundleTargetName, bundleOutputDir } = (0, bundle_1.addPythonBundleTarget)(project, {
|
|
@@ -85,29 +87,17 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
85
87
|
fs.mkdir(dockerOutputDir),
|
|
86
88
|
fs.cp(bundleOutputDir, dockerOutputDir),
|
|
87
89
|
fs.cp(`${targetSourceDir}/Dockerfile`, `${dockerOutputDir}/Dockerfile`),
|
|
88
|
-
`${
|
|
90
|
+
`${containers} build --platform linux/arm64 -t ${dockerImageTag} ${dockerOutputDir}`,
|
|
89
91
|
],
|
|
90
92
|
parallel: false,
|
|
91
93
|
},
|
|
92
94
|
dependsOn: [bundleTargetName],
|
|
93
95
|
};
|
|
94
|
-
project
|
|
95
|
-
|
|
96
|
-
dependsOn: [
|
|
97
|
-
...(project.targets.docker?.dependsOn ?? []).filter((t) => t !== dockerTargetName),
|
|
98
|
-
dockerTargetName,
|
|
99
|
-
],
|
|
100
|
-
};
|
|
101
|
-
project.targets.build = {
|
|
102
|
-
...project.targets.build,
|
|
103
|
-
dependsOn: [
|
|
104
|
-
...(project.targets.build?.dependsOn ?? []).filter((t) => t !== 'docker'),
|
|
105
|
-
'docker',
|
|
106
|
-
],
|
|
107
|
-
};
|
|
96
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'docker', dockerTargetName);
|
|
97
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(project, 'build', 'docker');
|
|
108
98
|
// Add shared constructs
|
|
109
|
-
const
|
|
110
|
-
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
99
|
+
const iac = await (0, iac_1.resolveIac)(tree, options.iac);
|
|
100
|
+
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, { iac });
|
|
111
101
|
// Add the construct to deploy the mcp server
|
|
112
102
|
await (0, agent_core_constructs_1.addMcpServerInfra)(tree, {
|
|
113
103
|
mcpServerNameKebabCase: name,
|
|
@@ -115,12 +105,14 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
115
105
|
projectName: project.name,
|
|
116
106
|
dockerImageTag,
|
|
117
107
|
dockerOutputDir,
|
|
118
|
-
|
|
108
|
+
iac,
|
|
119
109
|
auth,
|
|
120
|
-
|
|
110
|
+
containers,
|
|
121
111
|
});
|
|
122
112
|
}
|
|
123
|
-
const localDevPort = (0, port_1.assignPort)(tree, project, 8000
|
|
113
|
+
const localDevPort = (0, port_1.assignPort)(tree, project, 8000, {
|
|
114
|
+
component: { info: exports.PY_MCP_SERVER_GENERATOR_INFO, name: mcpTargetPrefix },
|
|
115
|
+
});
|
|
124
116
|
(0, devkit_1.updateProjectConfiguration)(tree, project.name, {
|
|
125
117
|
...project,
|
|
126
118
|
targets: {
|
|
@@ -162,6 +154,20 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
162
154
|
continuous: true,
|
|
163
155
|
},
|
|
164
156
|
[`${mcpTargetPrefix}-inspect`]: {
|
|
157
|
+
executor: 'nx:run-commands',
|
|
158
|
+
// Launch the inspector against the locally served (serve-local) HTTP
|
|
159
|
+
// server. serve-local starts the server and any connected dependencies
|
|
160
|
+
// (e.g. a local database).
|
|
161
|
+
dependsOn: [`${mcpTargetPrefix}-serve-local`],
|
|
162
|
+
options: {
|
|
163
|
+
commands: [
|
|
164
|
+
`mcp-inspector --transport http --server-url http://localhost:${localDevPort}/mcp`,
|
|
165
|
+
],
|
|
166
|
+
cwd: '{projectRoot}',
|
|
167
|
+
},
|
|
168
|
+
continuous: true,
|
|
169
|
+
},
|
|
170
|
+
[`${mcpTargetPrefix}-inspect-stdio`]: {
|
|
165
171
|
executor: 'nx:run-commands',
|
|
166
172
|
options: {
|
|
167
173
|
commands: [
|
|
@@ -180,6 +186,7 @@ const pyMcpServerGenerator = async (tree, options) => {
|
|
|
180
186
|
auth,
|
|
181
187
|
});
|
|
182
188
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.PY_MCP_SERVER_GENERATOR_INFO]);
|
|
189
|
+
await (0, config_1.ensureLicenseExceptions)(tree, known_exceptions_1.MCP_INSPECTOR_EXCEPTIONS);
|
|
183
190
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
184
191
|
return async () => {
|
|
185
192
|
(0, devkit_1.installPackagesTask)(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/mcp-server/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/mcp-server/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCASoB;AACpB,iDAA+D;AAC/D,qEAA0E;AAC1E,mGAA4F;AAC5F,sDAAkE;AAClE,uDAA2D;AAC3D,+CAA0D;AAC1D,uCAA4C;AAC5C,yCAA6C;AAC7C,iDAAsE;AACtE,6CAAwE;AACxE,qDAAoD;AACpD,uCAMwB;AACxB,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AC1B,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AAlPW,QAAA,oBAAoB,wBAkP/B;AAEF,kBAAe,4BAAoB,CAAC"}
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IacOption } from '../../utils/iac';
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type PyMcpServerInfra = 'none' | 'agentcore';
|
|
9
9
|
|
|
10
|
-
export type PyMcpServerAuth = '
|
|
10
|
+
export type PyMcpServerAuth = 'iam' | 'cognito';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* TypeScript types for options defined in schema.json
|
|
14
|
-
* Update this to match schema.json if you make changes.
|
|
15
|
-
*/
|
|
16
12
|
export interface PyMcpServerGeneratorSchema {
|
|
17
13
|
project: string;
|
|
18
14
|
name?: string;
|
|
19
|
-
|
|
15
|
+
infra?: PyMcpServerInfra;
|
|
20
16
|
auth?: PyMcpServerAuth;
|
|
21
|
-
|
|
17
|
+
iac: IacOption;
|
|
22
18
|
}
|
|
@@ -15,14 +15,6 @@
|
|
|
15
15
|
"x-prompt": "Select the Python project to add the MCP server to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
-
"computeType": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The type of compute to host your MCP server. Select None for no hosting.",
|
|
21
|
-
"x-prompt": "How would you like to host your MCP server?",
|
|
22
|
-
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
23
|
-
"default": "BedrockAgentCoreRuntime",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
18
|
"name": {
|
|
27
19
|
"type": "string",
|
|
28
20
|
"description": "The name of your MCP server (default: mcp-server)",
|
|
@@ -30,19 +22,27 @@
|
|
|
30
22
|
},
|
|
31
23
|
"auth": {
|
|
32
24
|
"type": "string",
|
|
33
|
-
"description": "The method used to authenticate with your MCP server. Only applicable when
|
|
34
|
-
"default": "
|
|
35
|
-
"enum": ["
|
|
25
|
+
"description": "The method used to authenticate with your MCP server. Only applicable when infra is set (ignored when infra is none).",
|
|
26
|
+
"default": "iam",
|
|
27
|
+
"enum": ["iam", "cognito"],
|
|
36
28
|
"x-prompt": "How would you like to authenticate with your MCP server?",
|
|
37
29
|
"x-priority": "important"
|
|
38
30
|
},
|
|
39
|
-
"
|
|
31
|
+
"iac": {
|
|
40
32
|
"type": "string",
|
|
41
33
|
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
42
|
-
"enum": ["
|
|
34
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
43
35
|
"x-priority": "important",
|
|
44
|
-
"default": "
|
|
45
|
-
"x-prompt": "Which provider would you like to manage your infrastructure? (default:
|
|
36
|
+
"default": "inherit",
|
|
37
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
|
|
38
|
+
},
|
|
39
|
+
"infra": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The type of infrastructure to host your MCP server. Select none for no hosting.",
|
|
42
|
+
"x-prompt": "How would you like to host your MCP server?",
|
|
43
|
+
"enum": ["agentcore", "none"],
|
|
44
|
+
"default": "agentcore",
|
|
45
|
+
"x-priority": "important"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"required": ["project"]
|
|
@@ -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 { GeneratorCallback, Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { PyProjectGeneratorSchema } from './schema';
|
|
8
8
|
export declare const PY_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export interface PyProjectDetails {
|
|
10
10
|
/**
|
|
@@ -6,16 +6,17 @@ exports.pyProjectGenerator = exports.getPyProjectDetails = exports.PY_PROJECT_GE
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const
|
|
10
|
-
const versions_1 = require("../../utils/versions");
|
|
11
|
-
const npm_scope_1 = require("../../utils/npm-scope");
|
|
12
|
-
const names_1 = require("../../utils/names");
|
|
13
|
-
const object_1 = require("../../utils/object");
|
|
9
|
+
const config_1 = require("../../license/config");
|
|
14
10
|
const git_1 = require("../../utils/git");
|
|
15
|
-
const nx_1 = require("../../utils/nx");
|
|
16
11
|
const metrics_1 = require("../../utils/metrics");
|
|
17
|
-
const
|
|
12
|
+
const names_1 = require("../../utils/names");
|
|
13
|
+
const npm_scope_1 = require("../../utils/npm-scope");
|
|
14
|
+
const nx_1 = require("../../utils/nx");
|
|
15
|
+
const nxlv_python_1 = require("../../utils/nxlv-python");
|
|
16
|
+
const object_1 = require("../../utils/object");
|
|
18
17
|
const py_1 = require("../../utils/py");
|
|
18
|
+
const toml_1 = require("../../utils/toml");
|
|
19
|
+
const versions_1 = require("../../utils/versions");
|
|
19
20
|
exports.PY_PROJECT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
20
21
|
/**
|
|
21
22
|
* Returns details about the Python project to be created
|
|
@@ -39,6 +40,8 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
39
40
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, pythonPlugin);
|
|
40
41
|
Object.entries(pythonPlugin).forEach(([name, version]) => (0, devkit_1.ensurePackage)(name, version));
|
|
41
42
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
43
|
+
// Only rewrite nx.json when the plugin needs adding, so re-running does not
|
|
44
|
+
// reserialize (and reformat) the file when nothing has changed.
|
|
42
45
|
if (!nxJson.plugins?.find((p) => typeof p === 'string'
|
|
43
46
|
? p === '@nxlv/python'
|
|
44
47
|
: p.plugin === '@nxlv/python')) {
|
|
@@ -51,60 +54,84 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
51
54
|
},
|
|
52
55
|
},
|
|
53
56
|
];
|
|
57
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
54
58
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
// Only scaffold the project when it does not already exist so re-running with
|
|
60
|
+
// the same name does not throw. The rest of the generator still runs to apply
|
|
61
|
+
// any changed options to the existing project.
|
|
62
|
+
if (!(0, nx_1.projectExists)(tree, fullyQualifiedName)) {
|
|
63
|
+
if (!tree.exists('uv.lock')) {
|
|
64
|
+
await (0, nxlv_python_1.migrateToSharedVenvGenerator)(tree, {
|
|
65
|
+
autoActivate: true,
|
|
66
|
+
packageManager: 'uv',
|
|
67
|
+
moveDevDependencies: false,
|
|
68
|
+
pyenvPythonVersion: '3.14.0',
|
|
69
|
+
pyprojectPythonDependency: '>=3.14',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
await (0, nxlv_python_1.uvProjectGenerator)(tree, {
|
|
73
|
+
name: fullyQualifiedName,
|
|
74
|
+
publishable: false,
|
|
75
|
+
buildLockedVersions: true,
|
|
76
|
+
buildBundleLocalDependencies: true,
|
|
77
|
+
linter: 'ruff',
|
|
78
|
+
rootPyprojectDependencyGroup: 'main',
|
|
61
79
|
pyenvPythonVersion: '3.14.0',
|
|
62
80
|
pyprojectPythonDependency: '>=3.14',
|
|
81
|
+
projectType: schema.type,
|
|
82
|
+
projectNameAndRootFormat: 'as-provided',
|
|
83
|
+
moduleName: normalizedModuleName,
|
|
84
|
+
directory: dir,
|
|
85
|
+
unitTestRunner: 'pytest',
|
|
86
|
+
codeCoverage: true,
|
|
87
|
+
codeCoverageHtmlReport: true,
|
|
88
|
+
codeCoverageXmlReport: true,
|
|
89
|
+
unitTestHtmlReport: true,
|
|
90
|
+
unitTestJUnitReport: true,
|
|
91
|
+
buildSystem: 'hatch',
|
|
92
|
+
srcDir: false,
|
|
63
93
|
});
|
|
94
|
+
// Remove generated hello.py and test_hello.py as they are not needed
|
|
95
|
+
[
|
|
96
|
+
(0, devkit_1.joinPathFragments)(dir, normalizedModuleName, 'hello.py'),
|
|
97
|
+
(0, devkit_1.joinPathFragments)(dir, 'tests', 'test_hello.py'),
|
|
98
|
+
].forEach((f) => tree.delete(f));
|
|
99
|
+
// Add a placeholder test so pytest doesn't fail with "no tests collected"
|
|
100
|
+
tree.write((0, devkit_1.joinPathFragments)(dir, 'tests', 'test_noop.py'), 'def test_noop():\n pass\n');
|
|
64
101
|
}
|
|
65
|
-
await (0, nxlv_python_1.uvProjectGenerator)(tree, {
|
|
66
|
-
name: fullyQualifiedName,
|
|
67
|
-
publishable: false,
|
|
68
|
-
buildLockedVersions: true,
|
|
69
|
-
buildBundleLocalDependencies: true,
|
|
70
|
-
linter: 'ruff',
|
|
71
|
-
rootPyprojectDependencyGroup: 'main',
|
|
72
|
-
pyenvPythonVersion: '3.14.0',
|
|
73
|
-
pyprojectPythonDependency: '>=3.14',
|
|
74
|
-
projectType: schema.projectType,
|
|
75
|
-
projectNameAndRootFormat: 'as-provided',
|
|
76
|
-
moduleName: normalizedModuleName,
|
|
77
|
-
directory: dir,
|
|
78
|
-
unitTestRunner: 'pytest',
|
|
79
|
-
codeCoverage: true,
|
|
80
|
-
codeCoverageHtmlReport: true,
|
|
81
|
-
codeCoverageXmlReport: true,
|
|
82
|
-
unitTestHtmlReport: true,
|
|
83
|
-
unitTestJUnitReport: true,
|
|
84
|
-
buildSystem: 'hatch',
|
|
85
|
-
srcDir: false,
|
|
86
|
-
});
|
|
87
|
-
// Remove generated hello.py and test_hello.py as they are not needed
|
|
88
|
-
[
|
|
89
|
-
(0, devkit_1.joinPathFragments)(dir, normalizedModuleName, 'hello.py'),
|
|
90
|
-
(0, devkit_1.joinPathFragments)(dir, 'tests', 'test_hello.py'),
|
|
91
|
-
].forEach((f) => tree.delete(f));
|
|
92
|
-
// Add a placeholder test so pytest doesn't fail with "no tests collected"
|
|
93
|
-
tree.write((0, devkit_1.joinPathFragments)(dir, 'tests', 'test_noop.py'), 'def test_noop():\n pass\n');
|
|
94
102
|
const outputPath = '{workspaceRoot}/dist/{projectRoot}';
|
|
95
103
|
const buildOutputPath = (0, devkit_1.joinPathFragments)(outputPath, 'build');
|
|
96
104
|
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, fullyQualifiedName);
|
|
97
105
|
projectConfiguration.name = fullyQualifiedName;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
// Derive the compile target from the uv build target, and rewrite build to
|
|
107
|
+
// orchestrate the other targets. This only runs on first creation: on re-run
|
|
108
|
+
// build has already been transformed, so re-deriving would corrupt compile
|
|
109
|
+
// and duplicate the build dependencies.
|
|
110
|
+
if (!projectConfiguration.targets.compile) {
|
|
111
|
+
const buildTarget = projectConfiguration.targets.build;
|
|
112
|
+
projectConfiguration.targets.compile = {
|
|
113
|
+
...buildTarget,
|
|
114
|
+
inputs: ['default', '^production'],
|
|
115
|
+
outputs: [buildOutputPath],
|
|
116
|
+
options: {
|
|
117
|
+
...buildTarget.options,
|
|
118
|
+
outputPath: buildOutputPath,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
projectConfiguration.targets.build = {
|
|
122
|
+
inputs: ['default', '^production'],
|
|
123
|
+
dependsOn: [
|
|
124
|
+
'lint',
|
|
125
|
+
'compile',
|
|
126
|
+
'test',
|
|
127
|
+
'typecheck',
|
|
128
|
+
...(buildTarget.dependsOn ?? []),
|
|
129
|
+
],
|
|
130
|
+
options: {
|
|
131
|
+
outputPath,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
108
135
|
projectConfiguration.targets.typecheck = {
|
|
109
136
|
cache: true,
|
|
110
137
|
inputs: ['default', '^production'],
|
|
@@ -114,19 +141,6 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
114
141
|
cwd: '{projectRoot}',
|
|
115
142
|
},
|
|
116
143
|
};
|
|
117
|
-
projectConfiguration.targets.build = {
|
|
118
|
-
inputs: ['default', '^production'],
|
|
119
|
-
dependsOn: [
|
|
120
|
-
'lint',
|
|
121
|
-
'compile',
|
|
122
|
-
'test',
|
|
123
|
-
'typecheck',
|
|
124
|
-
...(buildTarget.dependsOn ?? []),
|
|
125
|
-
],
|
|
126
|
-
options: {
|
|
127
|
-
outputPath,
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
144
|
// Set the default line length to 120, as 88 is a little too strict
|
|
131
145
|
(0, toml_1.updateToml)(tree, (0, devkit_1.joinPathFragments)(dir, 'pyproject.toml'), (pyProjectToml) => {
|
|
132
146
|
if (pyProjectToml.tool?.ruff) {
|
|
@@ -141,10 +155,6 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
141
155
|
...projectConfiguration.targets.lint,
|
|
142
156
|
cache: true,
|
|
143
157
|
inputs: ['default', '^production'],
|
|
144
|
-
dependsOn: [
|
|
145
|
-
...(projectConfiguration.targets.lint?.dependsOn ?? []).filter((d) => d !== 'format'),
|
|
146
|
-
'format',
|
|
147
|
-
],
|
|
148
158
|
configurations: {
|
|
149
159
|
...projectConfiguration.targets.lint?.configurations,
|
|
150
160
|
fix: {
|
|
@@ -155,6 +165,9 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
155
165
|
},
|
|
156
166
|
},
|
|
157
167
|
};
|
|
168
|
+
// Append `format` without moving an existing entry, so re-running does not
|
|
169
|
+
// reorder lint dependencies (e.g. relative to a later-added license-check).
|
|
170
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(projectConfiguration, 'lint', 'format');
|
|
158
171
|
projectConfiguration.targets = (0, object_1.sortObjectKeys)(projectConfiguration.targets);
|
|
159
172
|
(0, devkit_1.updateProjectConfiguration)(tree, fullyQualifiedName, projectConfiguration);
|
|
160
173
|
(0, nx_1.addGeneratorMetadata)(tree, fullyQualifiedName, exports.PY_PROJECT_GENERATOR_INFO);
|
|
@@ -167,6 +180,12 @@ const pyProjectGenerator = async (tree, schema) => {
|
|
|
167
180
|
'.coverage',
|
|
168
181
|
]);
|
|
169
182
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.PY_PROJECT_GENERATOR_INFO]);
|
|
183
|
+
await (0, config_1.ensurePythonLicenseCollector)(tree);
|
|
184
|
+
// If license checking is configured, make this project's lint target depend
|
|
185
|
+
// on the root license-check target. No-op if license checking isn't set up;
|
|
186
|
+
// the license generator wires up existing projects itself, so the dependency
|
|
187
|
+
// is added regardless of which generator runs first.
|
|
188
|
+
(0, config_1.addLicenseCheckToLintTarget)(tree, fullyQualifiedName);
|
|
170
189
|
return async () => {
|
|
171
190
|
(0, devkit_1.installPackagesTask)(tree);
|
|
172
191
|
await new nxlv_python_1.UVProvider(tree.root, new nxlv_python_1.Logger(), tree).install();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/project/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAWoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/project/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAWoB;AACpB,iDAG8B;AAC9B,yCAAkD;AAClD,iDAAsE;AACtE,6CAAgD;AAChD,qDAAoD;AACpD,uCAMwB;AAExB,yDAKiC;AACjC,+CAAoD;AACpD,uCAAiF;AAC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EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AAtMW,QAAA,kBAAkB,sBAsM7B;AACF,kBAAe,0BAAkB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
export interface PyProjectGeneratorSchema {
|
|
7
7
|
readonly name: string;
|
|
8
|
-
readonly
|
|
8
|
+
readonly type: 'application' | 'library';
|
|
9
9
|
readonly directory?: string;
|
|
10
10
|
readonly subDirectory?: string;
|
|
11
11
|
readonly moduleName?: string;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"description": "The sub directory the project is placed in. By default this is the project name.",
|
|
28
28
|
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
30
|
+
"type": {
|
|
31
31
|
"type": "string",
|
|
32
32
|
"description": "Whether the project is an application or library",
|
|
33
33
|
"default": "application",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"description": "Python module name"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"required": ["name", "
|
|
41
|
+
"required": ["name", "type"]
|
|
42
42
|
}
|