@aws/nx-plugin 1.0.0-rc.22 → 1.0.0-rc.24
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 +2088 -971
- package/package.json +25 -10
- package/src/agentcore-gateway/attach-upstream.d.ts +7 -7
- package/src/agentcore-gateway/attach-upstream.js +19 -22
- package/src/agentcore-gateway/attach-upstream.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +3 -3
- package/src/agentcore-gateway/gateway-connection/generator.js +42 -45
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/gateway-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/generator.js +89 -72
- package/src/agentcore-gateway/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +2 -2
- package/src/agentcore-gateway/mcp-connection/generator.js +24 -30
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/schema.d.js +6 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/bin/aws-nx-mcp.js +14 -0
- package/src/bin/aws-nx-mcp.js.map +1 -0
- package/src/connection/{agent-serve-local.d.ts → agent-local-dev.d.ts} +5 -5
- package/src/connection/agent-local-dev.js +42 -0
- package/src/connection/agent-local-dev.js.map +1 -0
- package/src/connection/agent-runtime-config.js +9 -14
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/generator.js +262 -207
- package/src/connection/generator.js.map +1 -1
- package/src/connection/{serve-local.d.ts → local-dev.d.ts} +3 -3
- package/src/connection/local-dev.js +37 -0
- package/src/connection/local-dev.js.map +1 -0
- package/src/connection/schema.d.js +6 -0
- package/src/connection/schema.d.js.map +1 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +4 -26
- package/src/infra/app/generator.js +133 -123
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.js +6 -0
- package/src/infra/app/schema.d.js.map +1 -0
- package/src/license/config-types.js +5 -3
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +1 -1
- package/src/license/config.js +267 -242
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.js +51 -46
- package/src/license/dependency-check/check.js.map +1 -1
- package/src/license/dependency-check/collectors/collector.js +41 -71
- package/src/license/dependency-check/collectors/collector.js.map +1 -1
- package/src/license/dependency-check/collectors/npm-collector.js +34 -41
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -1
- package/src/license/dependency-check/collectors/python-collector.js +55 -62
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -1
- package/src/license/dependency-check/evaluator.js +40 -68
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/license/dependency-check/executor.js +30 -22
- package/src/license/dependency-check/executor.js.map +1 -1
- package/src/license/dependency-check/pre-approved.js +949 -336
- package/src/license/dependency-check/pre-approved.js.map +1 -1
- package/src/license/dependency-check/types.js +2 -3
- package/src/license/dependency-check/types.js.map +1 -1
- package/src/license/generator.js +55 -60
- package/src/license/generator.js.map +1 -1
- package/src/license/index.js +3 -9
- package/src/license/index.js.map +1 -1
- package/src/license/known-exceptions.js +14 -13
- package/src/license/known-exceptions.js.map +1 -1
- package/src/license/schema.d.js +6 -0
- package/src/license/schema.d.js.map +1 -0
- package/src/license/sync/generator.js +94 -119
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.js +28 -35
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.js +130 -160
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.js +184 -206
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/guide-render.js +10 -25
- package/src/mcp-server/guide-render.js.map +1 -1
- package/src/mcp-server/index.js +6 -10
- package/src/mcp-server/index.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +39 -57
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/option-filter.js +33 -47
- package/src/mcp-server/option-filter.js.map +1 -1
- package/src/mcp-server/schema-registry.js +27 -40
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/schema.js +9 -7
- package/src/mcp-server/schema.js.map +1 -1
- package/src/mcp-server/server.js +20 -24
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +23 -24
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.js +28 -25
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.js +29 -37
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.js +19 -25
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/generator.js +16 -26
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-client/schema.d.js +6 -0
- package/src/open-api/ts-client/schema.d.js.map +1 -0
- package/src/open-api/ts-hooks/generator.js +13 -21
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/schema.d.js +6 -0
- package/src/open-api/ts-hooks/schema.d.js.map +1 -0
- package/src/open-api/ts-metadata/generator.js +12 -20
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/ts-metadata/schema.d.js +6 -0
- package/src/open-api/ts-metadata/schema.d.js.map +1 -0
- package/src/open-api/utils/codegen-data/languages.js +42 -60
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.js +31 -30
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.js +253 -269
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +242 -241
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.js +8 -14
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.js +12 -22
- package/src/open-api/utils/refs.js.map +1 -1
- package/src/open-api/utils/types.js +5 -2
- package/src/open-api/utils/types.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +31 -6
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +130 -112
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.js +6 -0
- package/src/preset/schema.d.js.map +1 -0
- package/src/preset/schema.d.ts +0 -1
- package/src/preset/schema.json +0 -5
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +304 -0
- package/src/py/agent/__snapshots__/{generator.spec.ts.snap → generator.frameworks.spec.ts.snap} +18 -845
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +535 -0
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -2
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/a2a-connection/files/langchain/agent-connection/app/__targetAgentSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/a2a-connection/generator.js +70 -75
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/a2a-connection/schema.d.js +8 -0
- package/src/py/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/py/agent/files/ag-ui-langchain/main.py.template +10 -0
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +6 -8
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +3 -3
- package/src/py/agent/gateway-connection/files/langchain/agent-connection/app/__gatewaySnakeCase___client_langchain.py.template +3 -3
- package/src/py/agent/gateway-connection/generator.js +61 -58
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/gateway-connection/schema.d.js +6 -0
- package/src/py/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/py/agent/generator.js +227 -194
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +5 -12
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +1 -1
- package/src/py/agent/mcp-connection/files/langchain/agent-connection/app/__mcpServerSnakeCase___client_langchain.py.template +1 -1
- package/src/py/agent/mcp-connection/generator.js +53 -52
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/schema.d.js +8 -0
- package/src/py/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/agent/react-connection/generator.js +51 -58
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +4 -4
- package/src/py/agent/react-connection/local-dev.js +36 -0
- package/src/py/agent/react-connection/local-dev.js.map +1 -0
- package/src/py/agent/react-connection/schema.d.js +8 -0
- package/src/py/agent/react-connection/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/api/generator.js +12 -12
- package/src/py/api/generator.js.map +1 -1
- package/src/py/api/schema.d.js +6 -0
- package/src/py/api/schema.d.js.map +1 -0
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +68 -28
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/agent-connection/generator.js +27 -29
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/py/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/py/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/dynamodb/fast-api-connection/generator.js +26 -28
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -1
- package/src/py/dynamodb/fast-api-connection/schema.d.js +8 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/files/__name__/client.py.template +5 -5
- package/src/py/dynamodb/files/__name__/entities/base.py.template +2 -2
- package/src/py/dynamodb/files/config.json.template +1 -1
- package/src/py/dynamodb/generator.js +63 -62
- package/src/py/dynamodb/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/dynamodb/mcp-server-connection/generator.js +27 -29
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/py/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +45 -4632
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +4833 -0
- package/src/py/fast-api/generator.js +79 -85
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/fast-api/react/generator.js +22 -24
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.js +28 -29
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/fast-api/react/schema.d.js +6 -0
- package/src/py/fast-api/react/schema.d.js.map +1 -0
- package/src/py/fast-api/schema.d.js +6 -0
- package/src/py/fast-api/schema.d.js.map +1 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.js +57 -58
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/lambda-function/schema.d.js +6 -0
- package/src/py/lambda-function/schema.d.js.map +1 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/generator.js +149 -131
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.d.js +6 -0
- package/src/py/mcp-server/schema.d.js.map +1 -0
- package/src/py/project/generator.d.ts +14 -1
- package/src/py/project/generator.js +137 -88
- package/src/py/project/generator.js.map +1 -1
- package/src/py/project/schema.d.js +6 -0
- package/src/py/project/schema.d.js.map +1 -0
- package/src/sdk/agentcore-gateway.d.ts +6 -0
- package/src/sdk/agentcore-gateway.js +7 -0
- package/src/sdk/agentcore-gateway.js.map +1 -0
- package/src/sdk/connection.d.ts +6 -0
- package/src/sdk/connection.js +6 -0
- package/src/sdk/connection.js.map +1 -0
- package/{sdk → src/sdk}/license.d.ts +4 -4
- package/src/sdk/license.js +7 -0
- package/src/sdk/license.js.map +1 -0
- package/src/sdk/open-api.d.ts +10 -0
- package/src/sdk/open-api.js +8 -0
- package/src/sdk/open-api.js.map +1 -0
- package/src/sdk/py.d.ts +14 -0
- package/src/sdk/py.js +10 -0
- package/src/sdk/py.js.map +1 -0
- package/src/sdk/terraform.d.ts +6 -0
- package/src/sdk/terraform.js +7 -0
- package/src/sdk/terraform.js.map +1 -0
- package/src/sdk/ts.d.ts +33 -0
- package/src/sdk/ts.js +35 -0
- package/src/sdk/ts.js.map +1 -0
- package/{sdk → src/sdk}/utils/ast.d.ts +2 -2
- package/src/sdk/utils/ast.js +7 -0
- package/src/sdk/utils/ast.js.map +1 -0
- package/{sdk → src/sdk}/utils/format.d.ts +1 -1
- package/src/sdk/utils/format.js +6 -0
- package/src/sdk/utils/format.js.map +1 -0
- package/{sdk → src/sdk}/utils/test.d.ts +1 -1
- package/src/sdk/utils/test.js +6 -0
- package/src/sdk/utils/test.js.map +1 -0
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +2 -8
- package/src/smithy/project/files/build.Dockerfile.template +1 -4
- package/src/smithy/project/generator.js +44 -42
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/project/schema.d.js +6 -0
- package/src/smithy/project/schema.d.js.map +1 -0
- package/src/smithy/react-connection/generator.js +35 -46
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/react-connection/schema.d.js +6 -0
- package/src/smithy/react-connection/schema.d.js.map +1 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +395 -72
- package/src/smithy/ts/api/generator.js +121 -111
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.js +6 -0
- package/src/smithy/ts/api/schema.d.js.map +1 -0
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.js +141 -103
- package/src/terraform/project/generator.js.map +1 -1
- package/src/terraform/project/schema.d.js +9 -0
- package/src/terraform/project/schema.d.js.map +1 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +336 -92
- package/src/trpc/backend/generator.js +93 -86
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.js +6 -0
- package/src/trpc/backend/schema.d.js.map +1 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/react/generator.js +59 -58
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.d.js +6 -0
- package/src/trpc/react/schema.d.js.map +1 -0
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +11 -11
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/a2a-connection/generator.js +58 -54
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/a2a-connection/schema.d.js +8 -0
- package/src/ts/agent/a2a-connection/schema.d.js.map +1 -0
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +3 -3
- package/src/ts/agent/gateway-connection/generator.js +57 -52
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/gateway-connection/schema.d.js +6 -0
- package/src/ts/agent/gateway-connection/schema.d.js.map +1 -0
- package/src/ts/agent/generator.js +165 -136
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +1 -1
- package/src/ts/agent/mcp-connection/generator.js +48 -46
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/schema.d.js +8 -0
- package/src/ts/agent/mcp-connection/schema.d.js.map +1 -0
- package/src/ts/agent/react-connection/generator.js +79 -79
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/{serve-local.d.ts → local-dev.d.ts} +2 -2
- package/src/ts/agent/react-connection/local-dev.js +17 -0
- package/src/ts/agent/react-connection/local-dev.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.js +8 -0
- package/src/ts/agent/react-connection/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/api/generator.js +16 -18
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.js +6 -0
- package/src/ts/api/schema.d.js.map +1 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/ts/astro-docs/generator.js +59 -48
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/astro-docs/schema.d.js +6 -0
- package/src/ts/astro-docs/schema.d.js.map +1 -0
- package/src/ts/docs/generator.js +10 -10
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/docs/schema.d.js +6 -0
- package/src/ts/docs/schema.d.js.map +1 -0
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +68 -30
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/agent-connection/generator.js +21 -23
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/agent-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/files/config.json.template +1 -1
- package/src/ts/dynamodb/files/src/client.ts.template +7 -7
- package/src/ts/dynamodb/generator.js +64 -63
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/dynamodb/mcp-server-connection/generator.js +21 -23
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/smithy-connection/generator.js +20 -22
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/smithy-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/dynamodb/trpc-connection/generator.js +20 -22
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -1
- package/src/ts/dynamodb/trpc-connection/schema.d.js +8 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.js +55 -55
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lambda-function/io.js +83 -52
- package/src/ts/lambda-function/io.js.map +1 -1
- package/src/ts/lambda-function/schema.d.js +6 -0
- package/src/ts/lambda-function/schema.d.js.map +1 -0
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +23 -36
- package/src/ts/lib/biome.js +37 -37
- package/src/ts/lib/biome.js.map +1 -1
- package/src/ts/lib/generator.js +75 -77
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/schema.d.js +6 -0
- package/src/ts/lib/schema.d.js.map +1 -0
- package/src/ts/lib/ts-project-utils.js +65 -70
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/types.js +5 -2
- package/src/ts/lib/types.js.map +1 -1
- package/src/ts/lib/vitest.js +29 -26
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/ts/mcp-server/generator.js +157 -138
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.d.js +6 -0
- package/src/ts/mcp-server/schema.d.js.map +1 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +14 -9
- package/src/ts/nx-generator/files/local/generator.ts.template +3 -3
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.ts.template +4 -4
- package/src/ts/nx-generator/generator.js +84 -83
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-generator/schema.d.js +6 -0
- package/src/ts/nx-generator/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +30 -18
- package/src/ts/nx-plugin/files/mcp-server/server.ts.template +5 -5
- package/src/ts/nx-plugin/files/mcp-server/tools/create-workspace-command.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/general-guidance.ts.template +1 -1
- package/src/ts/nx-plugin/files/mcp-server/tools/generator-guide.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/tools/list-generators.ts.template +2 -2
- package/src/ts/nx-plugin/files/mcp-server/utils.ts.template +3 -3
- package/src/ts/nx-plugin/generator.js +49 -48
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/schema.d.js +9 -0
- package/src/ts/nx-plugin/schema.d.js.map +1 -0
- package/src/ts/nx-plugin/utils.js +32 -44
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +34 -30
- package/src/ts/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/agent-connection/generator.js +38 -39
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/agent-connection/schema.d.js +8 -0
- package/src/ts/rdb/agent-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/files/config.json.template +1 -1
- package/src/ts/rdb/files/prisma.config.ts.template +2 -2
- package/src/ts/rdb/files/src/prisma.ts.template +7 -7
- package/src/ts/rdb/files/src/utils.ts.template +3 -0
- package/src/ts/rdb/generator.js +130 -117
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +6 -6
- package/src/ts/rdb/mcp-server-connection/generator.js +36 -37
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/schema.d.js +8 -0
- package/src/ts/rdb/mcp-server-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/smithy-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +46 -43
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/schema.d.js +8 -0
- package/src/ts/rdb/smithy-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/trpc-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +36 -31
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/schema.d.js +8 -0
- package/src/ts/rdb/trpc-connection/schema.d.js.map +1 -0
- package/src/ts/rdb/utils.js +9 -11
- package/src/ts/rdb/utils.js.map +1 -1
- package/src/ts/react-website/agui/generator.js +69 -61
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +179 -332
- package/src/ts/react-website/app/generator.js +197 -188
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/app/schema.d.js +6 -0
- package/src/ts/react-website/app/schema.d.js.map +1 -0
- package/src/ts/react-website/app/schema.json +6 -6
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +118 -4
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +27 -7
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.js +60 -60
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/schema.d.js +6 -0
- package/src/ts/react-website/cognito-auth/schema.d.js.map +1 -0
- package/src/ts/react-website/cognito-auth/utils.js +34 -32
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +2 -2
- package/src/ts/react-website/runtime-config/generator.js +29 -31
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/react-website/runtime-config/schema.d.js +6 -0
- package/src/ts/react-website/runtime-config/schema.d.js.map +1 -0
- package/src/ts/sync/generator.js +60 -59
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.js +10 -10
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/app/schema.d.js +6 -0
- package/src/ts/website/app/schema.d.js.map +1 -0
- package/src/ts/website/app/schema.json +6 -6
- package/src/ts/website/auth/generator.js +11 -11
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/ts/website/auth/schema.d.js +6 -0
- package/src/ts/website/auth/schema.d.js.map +1 -0
- package/src/utils/agent-chat/agent-chat.d.ts +1 -1
- package/src/utils/agent-chat/agent-chat.js +11 -12
- package/src/utils/agent-chat/agent-chat.js.map +1 -1
- package/src/utils/agent-chat/files/a2a/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-py/chat.ts.template +1 -1
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +1 -1
- package/src/utils/agent-connection/agent-connection.d.ts +9 -3
- package/src/utils/agent-connection/agent-connection.js +133 -147
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +1 -1
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +1 -1
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-langchain/gateway/agentcore_gateway_mcp_client_langchain.py.template +1 -1
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js +53 -50
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__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/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +2 -2
- package/src/utils/api-constructs/api-constructs.js +30 -31
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +14 -6
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account/index.js.template +58 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/api-gateway-account.ts.template +82 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +28 -14
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +1 -8
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +91 -4
- package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template +1 -1
- package/src/utils/api-constructs/files/terraform/core/api/rest/api-gateway-account/api-gateway-account.tf.template +83 -0
- package/src/utils/api-constructs/files/terraform/core/api/rest/rest-api/rest-api.tf.template +5 -11
- package/src/utils/api-constructs/open-api-metadata.js +22 -22
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.js +17 -19
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.js +72 -97
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.js +50 -47
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/commands.js +47 -26
- package/src/utils/commands.js.map +1 -1
- package/src/utils/config/index.d.ts +2 -2
- package/src/utils/config/index.js +5 -4
- package/src/utils/config/index.js.map +1 -1
- package/src/utils/config/utils.js +48 -58
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/react.d.ts +5 -5
- package/src/utils/connection/open-api/react.js +81 -77
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.js +22 -23
- package/src/utils/containers.js.map +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +32 -33
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +12 -2
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +2 -2
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +1 -1
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +17 -2
- package/src/utils/files/common/scripts/src/rdb/mysql/wait-for-mysql-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/postgres/wait-for-postgres-db.ts.template +32 -0
- package/src/utils/files/common/scripts/src/rdb/{pull-image.ts.template → shared/pull-image.ts.template} +1 -1
- package/src/utils/files/common/scripts/src/rdb/{start-container.ts.template → shared/start-container.ts.template} +16 -1
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +2 -2
- package/src/utils/files/terraform/src/core/runtime-config/appconfig/appconfig.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +3 -3
- package/src/utils/files/terraform/src/core/runtime-config/entry/entry.tf.template +1 -1
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +2 -2
- package/src/utils/files/website/hooks/sigv4/useSigV4.tsx.template +1 -1
- package/src/utils/format.js +153 -99
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.js +14 -13
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__nameKebabCase__/__nameKebabCase__.tf.template +2 -2
- package/src/utils/function-constructs/function-constructs.js +21 -26
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.js +18 -20
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.js +19 -34
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac-providers.js +5 -5
- package/src/utils/iac-providers.js.map +1 -1
- package/src/utils/iac.js +12 -14
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +112 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +19 -6
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +104 -2
- package/src/utils/identity-constructs/files/terraform/core/user-identity/main.tf.template +7 -0
- package/src/utils/identity-constructs/identity-constructs.js +24 -28
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.js +27 -20
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.js +34 -41
- package/src/utils/mcp.js.map +1 -1
- package/src/utils/metrics.js +30 -45
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/mock-project-graph.js +8 -12
- package/src/utils/mock-project-graph.js.map +1 -1
- package/src/utils/names.d.ts +16 -0
- package/src/utils/names.js +39 -48
- package/src/utils/names.js.map +1 -1
- package/src/utils/npm-scope.js +9 -17
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +18 -2
- package/src/utils/nx.js +111 -74
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.js +27 -15
- package/src/utils/nxlv-python.js.map +1 -1
- package/src/utils/object.js +5 -11
- package/src/utils/object.js.map +1 -1
- package/src/utils/paths.js +11 -15
- package/src/utils/paths.js.map +1 -1
- package/src/utils/pkg-manager.js +4 -9
- package/src/utils/pkg-manager.js.map +1 -1
- package/src/utils/pnpm-workspace.js +22 -22
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.js +26 -36
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +14 -1
- package/src/utils/py.js +63 -45
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +4 -4
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +3 -3
- package/src/utils/rdb-constructs/rdb-constructs.js +31 -33
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.js +16 -16
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.js +57 -54
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.js +16 -14
- package/src/utils/shared-dynamodb-scripts.js.map +1 -1
- package/src/utils/shared-infra-config.js +30 -31
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.js +30 -25
- package/src/utils/shared-infra-scripts.js.map +1 -1
- package/src/utils/shared-rdb-scripts.d.ts +8 -3
- package/src/utils/shared-rdb-scripts.js +21 -13
- package/src/utils/shared-rdb-scripts.js.map +1 -1
- package/src/utils/shared-scripts.js +12 -17
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.js +64 -60
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +8 -0
- package/src/utils/test.js +33 -25
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.js +7 -15
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +31 -4
- package/src/utils/versions.js +40 -23
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/terraform/app/static-websites/__websiteNameKebabCase__/__websiteNameKebabCase__.tf.template +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +4 -4
- package/src/utils/website-constructs/website-constructs.js +31 -30
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/bin/aws-nx-mcp.js +0 -17
- package/bin/aws-nx-mcp.js.map +0 -1
- package/sdk/agentcore-gateway.d.ts +0 -6
- package/sdk/agentcore-gateway.js +0 -11
- package/sdk/agentcore-gateway.js.map +0 -1
- package/sdk/connection.d.ts +0 -6
- package/sdk/connection.js +0 -10
- package/sdk/connection.js.map +0 -1
- package/sdk/license.js +0 -14
- package/sdk/license.js.map +0 -1
- package/sdk/open-api.d.ts +0 -10
- package/sdk/open-api.js +0 -15
- package/sdk/open-api.js.map +0 -1
- package/sdk/py.d.ts +0 -14
- package/sdk/py.js +0 -18
- package/sdk/py.js.map +0 -1
- package/sdk/terraform.d.ts +0 -6
- package/sdk/terraform.js +0 -11
- package/sdk/terraform.js.map +0 -1
- package/sdk/ts.d.ts +0 -33
- package/sdk/ts.js +0 -53
- package/sdk/ts.js.map +0 -1
- package/sdk/utils/ast.js +0 -12
- package/sdk/utils/ast.js.map +0 -1
- package/sdk/utils/format.js +0 -10
- package/sdk/utils/format.js.map +0 -1
- package/sdk/utils/test.js +0 -10
- package/sdk/utils/test.js.map +0 -1
- package/src/connection/agent-serve-local.js +0 -48
- package/src/connection/agent-serve-local.js.map +0 -1
- package/src/connection/serve-local.js +0 -41
- package/src/connection/serve-local.js.map +0 -1
- package/src/py/agent/react-connection/serve-local.js +0 -38
- package/src/py/agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/agent/react-connection/serve-local.js +0 -19
- package/src/ts/agent/react-connection/serve-local.js.map +0 -1
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +0 -59
- /package/src/agentcore-gateway/files/project/{serve-local.ts.template → local-dev.ts.template} +0 -0
- /package/{bin → src/bin}/aws-nx-mcp.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws/nx-plugin",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.24",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/awslabs/nx-plugin-for-aws.git",
|
|
7
7
|
"directory": "packages/nx-plugin"
|
|
8
8
|
},
|
|
9
9
|
"private": false,
|
|
10
|
-
"type": "
|
|
10
|
+
"type": "module",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"main": "./src/index.js",
|
|
13
|
+
"module": "./src/index.js",
|
|
14
|
+
"types": "./src/index.d.ts",
|
|
13
15
|
"typings": "./src/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./src/index.d.ts",
|
|
19
|
+
"default": "./src/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./sdk/*": {
|
|
22
|
+
"types": "./src/sdk/*.d.ts",
|
|
23
|
+
"default": "./src/sdk/*.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
14
27
|
"publishConfig": {
|
|
15
28
|
"access": "public"
|
|
16
29
|
},
|
|
17
30
|
"bin": {
|
|
18
|
-
"aws-nx-mcp": "./bin/aws-nx-mcp.js"
|
|
31
|
+
"aws-nx-mcp": "./src/bin/aws-nx-mcp.js"
|
|
19
32
|
},
|
|
20
33
|
"generators": "./generators.json",
|
|
21
34
|
"executors": "./executors.json",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.19.0"
|
|
37
|
+
},
|
|
22
38
|
"peerDependencies": {
|
|
23
|
-
"nx": "
|
|
39
|
+
"nx": "23.0.1"
|
|
24
40
|
},
|
|
25
41
|
"dependencies": {
|
|
26
42
|
"@apidevtools/swagger-parser": "12.1.0",
|
|
@@ -30,10 +46,10 @@
|
|
|
30
46
|
"@hey-api/openapi-ts": "0.64.13",
|
|
31
47
|
"@iarna/toml": "2.2.5",
|
|
32
48
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
33
|
-
"@nx/devkit": "
|
|
34
|
-
"@nx/js": "
|
|
35
|
-
"@nx/react": "
|
|
36
|
-
"@nx/vite": "
|
|
49
|
+
"@nx/devkit": "23.0.1",
|
|
50
|
+
"@nx/js": "23.0.1",
|
|
51
|
+
"@nx/react": "23.0.1",
|
|
52
|
+
"@nx/vite": "23.0.1",
|
|
37
53
|
"@types/estree": "1.0.9",
|
|
38
54
|
"@types/js-yaml": "4.0.9",
|
|
39
55
|
"@types/mdast": "4.0.4",
|
|
@@ -65,6 +81,5 @@
|
|
|
65
81
|
"vite": "8.0.16",
|
|
66
82
|
"vitest": "4.1.8",
|
|
67
83
|
"zod": "4.4.3"
|
|
68
|
-
}
|
|
69
|
-
"types": "./src/index.d.ts"
|
|
84
|
+
}
|
|
70
85
|
}
|
|
@@ -14,20 +14,20 @@ export interface LocalGatewayUpstream {
|
|
|
14
14
|
*/
|
|
15
15
|
port: number;
|
|
16
16
|
/**
|
|
17
|
-
* Project providing the upstream's
|
|
17
|
+
* Project providing the upstream's dev target.
|
|
18
18
|
*/
|
|
19
19
|
upstreamProjectName: string;
|
|
20
20
|
/**
|
|
21
|
-
* Name of the upstream's
|
|
21
|
+
* Name of the upstream's dev target.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
upstreamDevTargetName: string;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Attach an upstream MCP endpoint (an MCP server or another gateway's local
|
|
27
27
|
* gateway) to a gateway's local gateway.
|
|
28
28
|
*
|
|
29
|
-
* Chains the gateway's
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Chains the gateway's dev target onto the upstream's dev target, and
|
|
30
|
+
* registers the upstream in the gateway's local-dev.ts so the local gateway
|
|
31
|
+
* aggregates its tools.
|
|
32
32
|
*/
|
|
33
|
-
export declare const attachUpstreamToLocalGateway: (tree: Tree, gatewayProject: ProjectConfiguration,
|
|
33
|
+
export declare const attachUpstreamToLocalGateway: (tree: Tree, gatewayProject: ProjectConfiguration, gatewayDevTargetName: string, upstream: LocalGatewayUpstream) => Promise<void>;
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.attachUpstreamToLocalGateway = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const nx_1 = require("../utils/nx");
|
|
4
|
+
*/ import { joinPathFragments, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { applyGritQL } from "../utils/ast.js";
|
|
6
|
+
import { addDependencyToTargetIfNotPresent } from "../utils/nx.js";
|
|
11
7
|
/**
|
|
12
8
|
* Attach an upstream MCP endpoint (an MCP server or another gateway's local
|
|
13
9
|
* gateway) to a gateway's local gateway.
|
|
14
10
|
*
|
|
15
|
-
* Chains the gateway's
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
* Chains the gateway's dev target onto the upstream's dev target, and
|
|
12
|
+
* registers the upstream in the gateway's local-dev.ts so the local gateway
|
|
13
|
+
* aggregates its tools.
|
|
14
|
+
*/ export const attachUpstreamToLocalGateway = async (tree, gatewayProject, gatewayDevTargetName, upstream)=>{
|
|
15
|
+
// 1. Wire dev chain
|
|
16
|
+
if (gatewayProject.targets?.[gatewayDevTargetName]) {
|
|
17
|
+
addDependencyToTargetIfNotPresent(gatewayProject, gatewayDevTargetName, {
|
|
18
|
+
projects: [
|
|
19
|
+
upstream.upstreamProjectName
|
|
20
|
+
],
|
|
21
|
+
target: upstream.upstreamDevTargetName
|
|
25
22
|
});
|
|
26
|
-
|
|
23
|
+
updateProjectConfiguration(tree, gatewayProject.name, gatewayProject);
|
|
27
24
|
}
|
|
28
|
-
// 2. Register the upstream in the gateway's local
|
|
29
|
-
const serveTsPath =
|
|
25
|
+
// 2. Register the upstream in the gateway's local local-dev.ts
|
|
26
|
+
const serveTsPath = joinPathFragments(gatewayProject.root, 'local-dev.ts');
|
|
30
27
|
if (tree.exists(serveTsPath)) {
|
|
31
28
|
const entry = `{ name: '${upstream.targetName}', url: 'http://localhost:${upstream.port}/mcp' }`;
|
|
32
|
-
await
|
|
29
|
+
await applyGritQL(tree, serveTsPath, `or {
|
|
33
30
|
\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = []\` => \`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [${entry}]\`,
|
|
34
31
|
\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [$items]\` => \`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [${entry}, $items]\` where {
|
|
35
32
|
$items <: not contains \`'${upstream.targetName}'\`
|
|
@@ -37,5 +34,5 @@ const attachUpstreamToLocalGateway = async (tree, gatewayProject, gatewayServeLo
|
|
|
37
34
|
}`);
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
|
-
|
|
37
|
+
|
|
41
38
|
//# sourceMappingURL=attach-upstream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/agentcore-gateway/attach-upstream.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n joinPathFragments,\n type ProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { applyGritQL } from '../utils/ast';\nimport { addDependencyToTargetIfNotPresent } from '../utils/nx';\n\nexport interface LocalGatewayUpstream {\n /**\n * Gateway target name for the upstream — prefixes its tools as\n * `<targetName>___<toolName>` both locally and deployed.\n */\n targetName: string;\n /**\n * Local port the upstream MCP endpoint listens on.\n */\n port: number;\n /**\n * Project providing the upstream's dev target.\n */\n upstreamProjectName: string;\n /**\n * Name of the upstream's dev target.\n */\n upstreamDevTargetName: string;\n}\n\n/**\n * Attach an upstream MCP endpoint (an MCP server or another gateway's local\n * gateway) to a gateway's local gateway.\n *\n * Chains the gateway's dev target onto the upstream's dev target, and\n * registers the upstream in the gateway's local-dev.ts so the local gateway\n * aggregates its tools.\n */\nexport const attachUpstreamToLocalGateway = async (\n tree: Tree,\n gatewayProject: ProjectConfiguration,\n gatewayDevTargetName: string,\n upstream: LocalGatewayUpstream,\n): Promise<void> => {\n // 1. Wire dev chain\n if (gatewayProject.targets?.[gatewayDevTargetName]) {\n addDependencyToTargetIfNotPresent(gatewayProject, gatewayDevTargetName, {\n projects: [upstream.upstreamProjectName],\n target: upstream.upstreamDevTargetName,\n });\n updateProjectConfiguration(tree, gatewayProject.name, gatewayProject);\n }\n\n // 2. Register the upstream in the gateway's local local-dev.ts\n const serveTsPath = joinPathFragments(gatewayProject.root, 'local-dev.ts');\n if (tree.exists(serveTsPath)) {\n const entry = `{ name: '${upstream.targetName}', url: 'http://localhost:${upstream.port}/mcp' }`;\n await applyGritQL(\n tree,\n serveTsPath,\n `or {\n \\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = []\\` => \\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [${entry}]\\`,\n \\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [$items]\\` => \\`const ATTACHED_MCP_SERVERS: AttachedMcpServer[] = [${entry}, $items]\\` where {\n $items <: not contains \\`'${upstream.targetName}'\\`\n }\n}`,\n );\n }\n};\n"],"names":["joinPathFragments","updateProjectConfiguration","applyGritQL","addDependencyToTargetIfNotPresent","attachUpstreamToLocalGateway","tree","gatewayProject","gatewayDevTargetName","upstream","targets","projects","upstreamProjectName","target","upstreamDevTargetName","name","serveTsPath","root","exists","entry","targetName","port"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SAASC,iCAAiC,QAAQ,iBAAc;AAsBhE;;;;;;;CAOC,GACD,OAAO,MAAMC,+BAA+B,OAC1CC,MACAC,gBACAC,sBACAC;IAEA,oBAAoB;IACpB,IAAIF,eAAeG,OAAO,EAAE,CAACF,qBAAqB,EAAE;QAClDJ,kCAAkCG,gBAAgBC,sBAAsB;YACtEG,UAAU;gBAACF,SAASG,mBAAmB;aAAC;YACxCC,QAAQJ,SAASK,qBAAqB;QACxC;QACAZ,2BAA2BI,MAAMC,eAAeQ,IAAI,EAAER;IACxD;IAEA,+DAA+D;IAC/D,MAAMS,cAAcf,kBAAkBM,eAAeU,IAAI,EAAE;IAC3D,IAAIX,KAAKY,MAAM,CAACF,cAAc;QAC5B,MAAMG,QAAQ,CAAC,SAAS,EAAEV,SAASW,UAAU,CAAC,0BAA0B,EAAEX,SAASY,IAAI,CAAC,OAAO,CAAC;QAChG,MAAMlB,YACJG,MACAU,aACA,CAAC;mHAC4G,EAAEG,MAAM;yHACF,EAAEA,MAAM;8BACnG,EAAEV,SAASW,UAAU,CAAC;;CAEnD,CAAC;IAEA;AACF,EAAE"}
|
|
@@ -9,9 +9,9 @@ export declare const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO: NxGene
|
|
|
9
9
|
/**
|
|
10
10
|
* Connect an AgentCore Gateway to another AgentCore Gateway.
|
|
11
11
|
*
|
|
12
|
-
* Chains the source gateway's
|
|
13
|
-
*
|
|
14
|
-
* gateway's local
|
|
12
|
+
* Chains the source gateway's dev target to the target gateway's
|
|
13
|
+
* dev target, and registers the target gateway in the source
|
|
14
|
+
* gateway's local local-dev.ts so the local gateway aggregates its tools
|
|
15
15
|
* (already prefixed by the target gateway) under
|
|
16
16
|
* `<targetGateway>___<targetName>___<toolName>`. Users must still call
|
|
17
17
|
* `gateway.addGateway(...)` in their application stack to create the
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.agentcoreGatewayGatewayConnectionGenerator = exports.AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
exports.AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
4
|
+
*/ import { installPackagesTask } from "@nx/devkit";
|
|
5
|
+
import { formatFilesInSubtree } from "../../utils/format.js";
|
|
6
|
+
import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
|
|
7
|
+
import { kebabCase } from "../../utils/names.js";
|
|
8
|
+
import { getGeneratorInfo, readProjectConfigurationUnqualified } from "../../utils/nx.js";
|
|
9
|
+
import { attachUpstreamToLocalGateway } from "../attach-upstream.js";
|
|
10
|
+
import { AGENTCORE_GATEWAY_GENERATOR_INFO, readAgentCoreGatewayMetadata } from "../generator.js";
|
|
11
|
+
export const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
16
12
|
/**
|
|
17
13
|
* Connect an AgentCore Gateway to another AgentCore Gateway.
|
|
18
14
|
*
|
|
19
|
-
* Chains the source gateway's
|
|
20
|
-
*
|
|
21
|
-
* gateway's local
|
|
15
|
+
* Chains the source gateway's dev target to the target gateway's
|
|
16
|
+
* dev target, and registers the target gateway in the source
|
|
17
|
+
* gateway's local local-dev.ts so the local gateway aggregates its tools
|
|
22
18
|
* (already prefixed by the target gateway) under
|
|
23
19
|
* `<targetGateway>___<targetName>___<toolName>`. Users must still call
|
|
24
20
|
* `gateway.addGateway(...)` in their application stack to create the
|
|
25
21
|
* actual CDK/Terraform resource.
|
|
26
|
-
*/
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const targetGateway = (0, generator_1.readAgentCoreGatewayMetadata)(targetProject);
|
|
22
|
+
*/ export const agentcoreGatewayGatewayConnectionGenerator = async (tree, options)=>{
|
|
23
|
+
const sourceProject = readProjectConfigurationUnqualified(tree, options.sourceProject);
|
|
24
|
+
const targetProject = readProjectConfigurationUnqualified(tree, options.targetProject);
|
|
25
|
+
const sourceGateway = readAgentCoreGatewayMetadata(sourceProject);
|
|
26
|
+
const targetGateway = readAgentCoreGatewayMetadata(targetProject);
|
|
32
27
|
if (sourceProject.name === targetProject.name) {
|
|
33
28
|
throw new Error(`Cannot connect gateway '${sourceGateway.name}' to itself.`);
|
|
34
29
|
}
|
|
35
|
-
for (const gateway of [
|
|
30
|
+
for (const gateway of [
|
|
31
|
+
sourceGateway,
|
|
32
|
+
targetGateway
|
|
33
|
+
]){
|
|
36
34
|
if (gateway.protocol !== 'mcp') {
|
|
37
35
|
throw new Error(`Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Gateway->Gateway connections are only supported between MCP-protocol gateways.`);
|
|
38
36
|
}
|
|
@@ -44,38 +42,37 @@ const agentcoreGatewayGatewayConnectionGenerator = async (tree, options) => {
|
|
|
44
42
|
throw new Error(`Gateway '${targetGateway.name}' uses auth='${targetGateway.auth}'. Gateway->Gateway connections currently require the target gateway to use IAM authentication.`);
|
|
45
43
|
}
|
|
46
44
|
assertNoCycle(tree, sourceProject.name, targetProject.name);
|
|
47
|
-
const sourceServeLocalTargetName = `${(0, names_1.kebabCase)(sourceGateway.rc)}-serve-local`;
|
|
48
45
|
// The target name must match the deployed Gateway target (`gatewayName` on
|
|
49
46
|
// the gateway construct, the project's class name in kebab-case) so
|
|
50
47
|
// `<targetGateway>___<target>___<tool>` resolves identically locally and
|
|
51
48
|
// deployed.
|
|
52
|
-
const targetGatewayKebabCase =
|
|
53
|
-
await
|
|
49
|
+
const targetGatewayKebabCase = kebabCase(targetGateway.rc);
|
|
50
|
+
await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {
|
|
54
51
|
targetName: targetGatewayKebabCase,
|
|
55
52
|
port: targetGateway.port,
|
|
56
53
|
upstreamProjectName: targetProject.name,
|
|
57
|
-
|
|
54
|
+
upstreamDevTargetName: 'dev'
|
|
58
55
|
});
|
|
59
|
-
await
|
|
60
|
-
|
|
56
|
+
await addGeneratorMetricsIfApplicable(tree, [
|
|
57
|
+
AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO
|
|
61
58
|
]);
|
|
62
|
-
await
|
|
63
|
-
return ()
|
|
64
|
-
|
|
59
|
+
await formatFilesInSubtree(tree);
|
|
60
|
+
return ()=>{
|
|
61
|
+
installPackagesTask(tree);
|
|
65
62
|
};
|
|
66
63
|
};
|
|
67
|
-
exports.agentcoreGatewayGatewayConnectionGenerator = agentcoreGatewayGatewayConnectionGenerator;
|
|
68
64
|
/**
|
|
69
65
|
* Reject connections that would make the local gateway graph cyclic — a
|
|
70
66
|
* cycle would recurse infinitely on tools/list both locally and deployed.
|
|
71
67
|
*
|
|
72
|
-
* Walks gateway
|
|
68
|
+
* Walks gateway dev dependsOn edges from the target gateway; the
|
|
73
69
|
* source gateway must not be reachable.
|
|
74
|
-
*/
|
|
75
|
-
const assertNoCycle = (tree, sourceProjectName, targetProjectName) => {
|
|
70
|
+
*/ const assertNoCycle = (tree, sourceProjectName, targetProjectName)=>{
|
|
76
71
|
const visited = new Set();
|
|
77
|
-
const stack = [
|
|
78
|
-
|
|
72
|
+
const stack = [
|
|
73
|
+
targetProjectName
|
|
74
|
+
];
|
|
75
|
+
while(stack.length > 0){
|
|
79
76
|
const current = stack.pop();
|
|
80
77
|
if (current === sourceProjectName) {
|
|
81
78
|
throw new Error(`Connecting '${sourceProjectName}' to '${targetProjectName}' would create a cycle: '${targetProjectName}' already routes to '${sourceProjectName}'.`);
|
|
@@ -84,19 +81,19 @@ const assertNoCycle = (tree, sourceProjectName, targetProjectName) => {
|
|
|
84
81
|
continue;
|
|
85
82
|
}
|
|
86
83
|
visited.add(current);
|
|
87
|
-
const project =
|
|
88
|
-
if (project.metadata?.generator !==
|
|
89
|
-
generator_1.AGENTCORE_GATEWAY_GENERATOR_INFO.id) {
|
|
84
|
+
const project = readProjectConfigurationUnqualified(tree, current);
|
|
85
|
+
if (project.metadata?.generator !== AGENTCORE_GATEWAY_GENERATOR_INFO.id) {
|
|
90
86
|
continue;
|
|
91
87
|
}
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
for (const dep of
|
|
88
|
+
readAgentCoreGatewayMetadata(project);
|
|
89
|
+
const devTarget = project.targets?.['dev'];
|
|
90
|
+
for (const dep of devTarget?.dependsOn ?? []){
|
|
95
91
|
if (typeof dep !== 'string') {
|
|
96
|
-
stack.push(...
|
|
92
|
+
stack.push(...dep.projects ?? []);
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
}
|
|
100
96
|
};
|
|
101
|
-
|
|
97
|
+
export default agentcoreGatewayGatewayConnectionGenerator;
|
|
98
|
+
|
|
102
99
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n installPackagesTask,\n type Tree,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase } from '../../utils/names';\nimport {\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../utils/nx';\nimport { attachUpstreamToLocalGateway } from '../attach-upstream';\nimport {\n AGENTCORE_GATEWAY_GENERATOR_INFO,\n readAgentCoreGatewayMetadata,\n} from '../generator';\nimport type { AgentcoreGatewayGatewayConnectionGeneratorSchema } from './schema';\n\nexport const AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\n/**\n * Connect an AgentCore Gateway to another AgentCore Gateway.\n *\n * Chains the source gateway's dev target to the target gateway's\n * dev target, and registers the target gateway in the source\n * gateway's local local-dev.ts so the local gateway aggregates its tools\n * (already prefixed by the target gateway) under\n * `<targetGateway>___<targetName>___<toolName>`. Users must still call\n * `gateway.addGateway(...)` in their application stack to create the\n * actual CDK/Terraform resource.\n */\nexport const agentcoreGatewayGatewayConnectionGenerator = async (\n tree: Tree,\n options: AgentcoreGatewayGatewayConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const sourceGateway = readAgentCoreGatewayMetadata(sourceProject);\n const targetGateway = readAgentCoreGatewayMetadata(targetProject);\n\n if (sourceProject.name === targetProject.name) {\n throw new Error(\n `Cannot connect gateway '${sourceGateway.name}' to itself.`,\n );\n }\n\n for (const gateway of [sourceGateway, targetGateway]) {\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Gateway->Gateway connections are only supported between MCP-protocol gateways.`,\n );\n }\n }\n\n // The source gateway invokes the target signing with its own IAM role, so\n // only the target's inbound auth must be IAM. The source's inbound auth (how\n // its own callers reach it) is irrelevant to this hop.\n if (targetGateway.auth !== 'iam') {\n throw new Error(\n `Gateway '${targetGateway.name}' uses auth='${targetGateway.auth}'. Gateway->Gateway connections currently require the target gateway to use IAM authentication.`,\n );\n }\n\n assertNoCycle(tree, sourceProject.name, targetProject.name);\n\n // The target name must match the deployed Gateway target (`gatewayName` on\n // the gateway construct, the project's class name in kebab-case) so\n // `<targetGateway>___<target>___<tool>` resolves identically locally and\n // deployed.\n const targetGatewayKebabCase = kebabCase(targetGateway.rc);\n\n await attachUpstreamToLocalGateway(tree, sourceProject, 'dev', {\n targetName: targetGatewayKebabCase,\n port: targetGateway.port,\n upstreamProjectName: targetProject.name,\n upstreamDevTargetName: 'dev',\n });\n\n await addGeneratorMetricsIfApplicable(tree, [\n AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n\n return () => {\n installPackagesTask(tree);\n };\n};\n\n/**\n * Reject connections that would make the local gateway graph cyclic — a\n * cycle would recurse infinitely on tools/list both locally and deployed.\n *\n * Walks gateway dev dependsOn edges from the target gateway; the\n * source gateway must not be reachable.\n */\nconst assertNoCycle = (\n tree: Tree,\n sourceProjectName: string,\n targetProjectName: string,\n) => {\n const visited = new Set<string>();\n const stack = [targetProjectName];\n while (stack.length > 0) {\n const current = stack.pop();\n if (current === sourceProjectName) {\n throw new Error(\n `Connecting '${sourceProjectName}' to '${targetProjectName}' would create a cycle: '${targetProjectName}' already routes to '${sourceProjectName}'.`,\n );\n }\n if (visited.has(current)) {\n continue;\n }\n visited.add(current);\n const project = readProjectConfigurationUnqualified(tree, current);\n if (\n (project.metadata as any)?.generator !==\n AGENTCORE_GATEWAY_GENERATOR_INFO.id\n ) {\n continue;\n }\n readAgentCoreGatewayMetadata(project);\n const devTarget = project.targets?.['dev'];\n for (const dep of devTarget?.dependsOn ?? []) {\n if (typeof dep !== 'string') {\n stack.push(...(dep.projects ?? []));\n }\n }\n }\n};\n\nexport default agentcoreGatewayGatewayConnectionGenerator;\n"],"names":["installPackagesTask","formatFilesInSubtree","addGeneratorMetricsIfApplicable","kebabCase","getGeneratorInfo","readProjectConfigurationUnqualified","attachUpstreamToLocalGateway","AGENTCORE_GATEWAY_GENERATOR_INFO","readAgentCoreGatewayMetadata","AGENTCORE_GATEWAY_GATEWAY_CONNECTION_GENERATOR_INFO","filename","agentcoreGatewayGatewayConnectionGenerator","tree","options","sourceProject","targetProject","sourceGateway","targetGateway","name","Error","gateway","protocol","auth","assertNoCycle","targetGatewayKebabCase","rc","targetName","port","upstreamProjectName","upstreamDevTargetName","sourceProjectName","targetProjectName","visited","Set","stack","length","current","pop","has","add","project","metadata","generator","id","devTarget","targets","dep","dependsOn","push","projects"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,mBAAmB,QAEd,aAAa;AACpB,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,QAAQ,uBAAoB;AAC9C,SACEC,gBAAgB,EAEhBC,mCAAmC,QAC9B,oBAAiB;AACxB,SAASC,4BAA4B,QAAQ,wBAAqB;AAClE,SACEC,gCAAgC,EAChCC,4BAA4B,QACvB,kBAAe;AAGtB,OAAO,MAAMC,sDACXL,iBAAiB,YAAYM,QAAQ,EAAE;AAEzC;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,6CAA6C,OACxDC,MACAC;IAEA,MAAMC,gBAAgBT,oCACpBO,MACAC,QAAQC,aAAa;IAEvB,MAAMC,gBAAgBV,oCACpBO,MACAC,QAAQE,aAAa;IAGvB,MAAMC,gBAAgBR,6BAA6BM;IACnD,MAAMG,gBAAgBT,6BAA6BO;IAEnD,IAAID,cAAcI,IAAI,KAAKH,cAAcG,IAAI,EAAE;QAC7C,MAAM,IAAIC,MACR,CAAC,wBAAwB,EAAEH,cAAcE,IAAI,CAAC,YAAY,CAAC;IAE/D;IAEA,KAAK,MAAME,WAAW;QAACJ;QAAeC;KAAc,CAAE;QACpD,IAAIG,QAAQC,QAAQ,KAAK,OAAO;YAC9B,MAAM,IAAIF,MACR,CAAC,SAAS,EAAEC,QAAQF,IAAI,CAAC,gBAAgB,EAAEE,QAAQC,QAAQ,CAAC,iFAAiF,CAAC;QAElJ;IACF;IAEA,0EAA0E;IAC1E,6EAA6E;IAC7E,uDAAuD;IACvD,IAAIJ,cAAcK,IAAI,KAAK,OAAO;QAChC,MAAM,IAAIH,MACR,CAAC,SAAS,EAAEF,cAAcC,IAAI,CAAC,aAAa,EAAED,cAAcK,IAAI,CAAC,+FAA+F,CAAC;IAErK;IAEAC,cAAcX,MAAME,cAAcI,IAAI,EAAEH,cAAcG,IAAI;IAE1D,2EAA2E;IAC3E,oEAAoE;IACpE,yEAAyE;IACzE,YAAY;IACZ,MAAMM,yBAAyBrB,UAAUc,cAAcQ,EAAE;IAEzD,MAAMnB,6BAA6BM,MAAME,eAAe,OAAO;QAC7DY,YAAYF;QACZG,MAAMV,cAAcU,IAAI;QACxBC,qBAAqBb,cAAcG,IAAI;QACvCW,uBAAuB;IACzB;IAEA,MAAM3B,gCAAgCU,MAAM;QAC1CH;KACD;IAED,MAAMR,qBAAqBW;IAE3B,OAAO;QACLZ,oBAAoBY;IACtB;AACF,EAAE;AAEF;;;;;;CAMC,GACD,MAAMW,gBAAgB,CACpBX,MACAkB,mBACAC;IAEA,MAAMC,UAAU,IAAIC;IACpB,MAAMC,QAAQ;QAACH;KAAkB;IACjC,MAAOG,MAAMC,MAAM,GAAG,EAAG;QACvB,MAAMC,UAAUF,MAAMG,GAAG;QACzB,IAAID,YAAYN,mBAAmB;YACjC,MAAM,IAAIX,MACR,CAAC,YAAY,EAAEW,kBAAkB,MAAM,EAAEC,kBAAkB,yBAAyB,EAAEA,kBAAkB,qBAAqB,EAAED,kBAAkB,EAAE,CAAC;QAExJ;QACA,IAAIE,QAAQM,GAAG,CAACF,UAAU;YACxB;QACF;QACAJ,QAAQO,GAAG,CAACH;QACZ,MAAMI,UAAUnC,oCAAoCO,MAAMwB;QAC1D,IACE,AAACI,QAAQC,QAAQ,EAAUC,cAC3BnC,iCAAiCoC,EAAE,EACnC;YACA;QACF;QACAnC,6BAA6BgC;QAC7B,MAAMI,YAAYJ,QAAQK,OAAO,EAAE,CAAC,MAAM;QAC1C,KAAK,MAAMC,OAAOF,WAAWG,aAAa,EAAE,CAAE;YAC5C,IAAI,OAAOD,QAAQ,UAAU;gBAC3BZ,MAAMc,IAAI,IAAKF,IAAIG,QAAQ,IAAI,EAAE;YACnC;QACF;IACF;AACF;AAEA,eAAetC,2CAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/agentcore-gateway/gateway-connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { ComponentMetadata } from '../../utils/nx';\n\nexport interface AgentcoreGatewayGatewayConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD,WAKC"}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readAgentCoreGatewayMetadata = exports.agentcoreGatewayGenerator = exports.AGENTCORE_GATEWAY_GENERATOR_INFO = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const nameClassName = (0, names_1.toClassName)(name);
|
|
4
|
+
*/ import { addDependenciesToPackageJson, addProjectConfiguration, generateFiles, installPackagesTask, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { addAgentCoreGatewayInfra } from "../utils/agent-core-constructs/agent-core-constructs.js";
|
|
6
|
+
import { formatFilesInSubtree } from "../utils/format.js";
|
|
7
|
+
import { resolveIac } from "../utils/iac.js";
|
|
8
|
+
import { addGeneratorMetricsIfApplicable } from "../utils/metrics.js";
|
|
9
|
+
import { kebabCase, toClassName } from "../utils/names.js";
|
|
10
|
+
import { getNpmScopePrefix } from "../utils/npm-scope.js";
|
|
11
|
+
import { addGeneratorMetadata, getGeneratorInfo, projectExists, readProjectConfigurationUnqualified } from "../utils/nx.js";
|
|
12
|
+
import { assignPort } from "../utils/port.js";
|
|
13
|
+
import { sharedConstructsGenerator } from "../utils/shared-constructs.js";
|
|
14
|
+
import { withVersions } from "../utils/versions.js";
|
|
15
|
+
export const AGENTCORE_GATEWAY_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
16
|
+
export const agentcoreGatewayGenerator = async (tree, options)=>{
|
|
17
|
+
const name = kebabCase(options.name);
|
|
18
|
+
const nameClassName = toClassName(name);
|
|
23
19
|
const parentDir = options.directory ?? 'packages';
|
|
24
20
|
const subDir = options.subDirectory ?? name;
|
|
25
|
-
const projectRoot =
|
|
26
|
-
const fullyQualifiedName = `${
|
|
21
|
+
const projectRoot = joinPathFragments(parentDir, subDir);
|
|
22
|
+
const fullyQualifiedName = `${getNpmScopePrefix(tree)}${name}`;
|
|
27
23
|
// Protocol / auth are fixed to mcp / iam in v1 — the enums accept only
|
|
28
24
|
// these values, but we still persist the resolved value in metadata so
|
|
29
25
|
// that connection generators can read it uniformly (and future additions
|
|
@@ -32,30 +28,31 @@ const agentcoreGatewayGenerator = async (tree, options) => {
|
|
|
32
28
|
const auth = options.auth ?? 'iam';
|
|
33
29
|
const cedarPolicy = options.cedarPolicy ?? true;
|
|
34
30
|
const infra = options.infra ?? 'agentcore';
|
|
35
|
-
//
|
|
36
|
-
// onto attached MCP servers'
|
|
37
|
-
//
|
|
38
|
-
//
|
|
31
|
+
// local-dev.ts is the local gateway: a continuous MCP aggregator chaining
|
|
32
|
+
// onto attached MCP servers' dev targets (added by the mcp-connection
|
|
33
|
+
// generator), so a single `nx dev <gateway>` boots the gateway and every
|
|
34
|
+
// attached MCP server together.
|
|
39
35
|
//
|
|
40
36
|
// `serve` exists for parity with other generators; the deployed Gateway is
|
|
41
37
|
// a managed AWS resource, so `serve`-mode agents talk to it via runtime
|
|
42
38
|
// config and the local gateway sits idle.
|
|
43
|
-
const localGatewayTarget = (port)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
const localGatewayTarget = (port)=>({
|
|
40
|
+
executor: 'nx:run-commands',
|
|
41
|
+
continuous: true,
|
|
42
|
+
options: {
|
|
43
|
+
command: 'tsx local-dev.ts',
|
|
44
|
+
cwd: '{projectRoot}',
|
|
45
|
+
env: {
|
|
46
|
+
PORT: `${port}`
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
dependsOn: []
|
|
50
|
+
});
|
|
53
51
|
let project;
|
|
54
|
-
if (
|
|
55
|
-
project =
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
(0, devkit_1.addProjectConfiguration)(tree, fullyQualifiedName, {
|
|
52
|
+
if (projectExists(tree, fullyQualifiedName)) {
|
|
53
|
+
project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);
|
|
54
|
+
} else {
|
|
55
|
+
addProjectConfiguration(tree, fullyQualifiedName, {
|
|
59
56
|
name: fullyQualifiedName,
|
|
60
57
|
root: projectRoot,
|
|
61
58
|
projectType: 'library',
|
|
@@ -63,67 +60,87 @@ const agentcoreGatewayGenerator = async (tree, options) => {
|
|
|
63
60
|
tags: [],
|
|
64
61
|
targets: {},
|
|
65
62
|
metadata: {
|
|
66
|
-
generator:
|
|
67
|
-
}
|
|
63
|
+
generator: AGENTCORE_GATEWAY_GENERATOR_INFO.id
|
|
64
|
+
}
|
|
68
65
|
});
|
|
69
|
-
project =
|
|
66
|
+
project = readProjectConfigurationUnqualified(tree, fullyQualifiedName);
|
|
70
67
|
}
|
|
71
|
-
const port =
|
|
72
|
-
//
|
|
73
|
-
//
|
|
68
|
+
const port = assignPort(tree, project, 8100);
|
|
69
|
+
// A gateway is its own standalone project, so it uses plain `serve` / `dev`
|
|
70
|
+
// targets. Re-run: keep existing targets (their dependsOn may have been
|
|
71
|
+
// populated by the mcp-connection generator), just ensure both exist.
|
|
74
72
|
project.targets ??= {};
|
|
75
|
-
project.targets[
|
|
76
|
-
project.targets[
|
|
77
|
-
|
|
78
|
-
// Scaffold the gateway project:
|
|
79
|
-
|
|
73
|
+
project.targets['serve'] ??= localGatewayTarget(port);
|
|
74
|
+
project.targets['dev'] ??= localGatewayTarget(port);
|
|
75
|
+
updateProjectConfiguration(tree, project.name, project);
|
|
76
|
+
// Scaffold the gateway project: local-dev.ts (+ Cedar policies if requested)
|
|
77
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', 'project'), projectRoot, {
|
|
78
|
+
nameClassName,
|
|
79
|
+
nameKebabCase: name,
|
|
80
|
+
port,
|
|
81
|
+
attachedMcpServers: []
|
|
82
|
+
}, {
|
|
83
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
84
|
+
});
|
|
80
85
|
if (cedarPolicy) {
|
|
81
|
-
|
|
86
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', 'cedar'), projectRoot, {
|
|
87
|
+
nameClassName
|
|
88
|
+
}, {
|
|
89
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
90
|
+
});
|
|
82
91
|
}
|
|
83
|
-
|
|
92
|
+
addGeneratorMetadata(tree, fullyQualifiedName, AGENTCORE_GATEWAY_GENERATOR_INFO, {
|
|
84
93
|
name,
|
|
85
94
|
rc: nameClassName,
|
|
86
95
|
protocol,
|
|
87
96
|
auth,
|
|
88
|
-
port
|
|
97
|
+
port
|
|
89
98
|
});
|
|
90
|
-
//
|
|
99
|
+
// local-dev.ts dependencies (+ ejs for Cedar policy rendering in the
|
|
91
100
|
// shared gateway construct)
|
|
92
|
-
|
|
101
|
+
addDependenciesToPackageJson(tree, withVersions([
|
|
102
|
+
'@modelcontextprotocol/sdk',
|
|
103
|
+
'express'
|
|
104
|
+
]), withVersions([
|
|
105
|
+
'tsx',
|
|
106
|
+
'@types/express',
|
|
107
|
+
'ejs',
|
|
108
|
+
'@types/ejs'
|
|
109
|
+
]));
|
|
93
110
|
// Wire up infra (CDK or Terraform); re-running with infra=agentcore adds
|
|
94
111
|
// the infrastructure to a previously infra-less gateway.
|
|
95
112
|
if (infra === 'agentcore') {
|
|
96
|
-
const iac = await
|
|
97
|
-
await
|
|
98
|
-
|
|
113
|
+
const iac = await resolveIac(tree, options.iac);
|
|
114
|
+
await sharedConstructsGenerator(tree, {
|
|
115
|
+
iac
|
|
116
|
+
});
|
|
117
|
+
await addAgentCoreGatewayInfra(tree, {
|
|
99
118
|
gatewayNameClassName: nameClassName,
|
|
100
119
|
gatewayNameKebabCase: name,
|
|
101
120
|
projectName: fullyQualifiedName,
|
|
102
121
|
projectDirectory: projectRoot,
|
|
103
122
|
cedarPolicy,
|
|
104
|
-
iac
|
|
123
|
+
iac
|
|
105
124
|
});
|
|
106
125
|
}
|
|
107
|
-
await
|
|
108
|
-
|
|
126
|
+
await addGeneratorMetricsIfApplicable(tree, [
|
|
127
|
+
AGENTCORE_GATEWAY_GENERATOR_INFO
|
|
109
128
|
]);
|
|
110
|
-
await
|
|
111
|
-
return ()
|
|
112
|
-
|
|
129
|
+
await formatFilesInSubtree(tree);
|
|
130
|
+
return ()=>{
|
|
131
|
+
installPackagesTask(tree);
|
|
113
132
|
};
|
|
114
133
|
};
|
|
115
|
-
exports.agentcoreGatewayGenerator = agentcoreGatewayGenerator;
|
|
116
134
|
/**
|
|
117
135
|
* Read a gateway project's metadata, validating it was generated by the
|
|
118
136
|
* agentcore-gateway generator.
|
|
119
|
-
*/
|
|
120
|
-
const readAgentCoreGatewayMetadata = (project) => {
|
|
137
|
+
*/ export const readAgentCoreGatewayMetadata = (project)=>{
|
|
121
138
|
const metadata = project.metadata;
|
|
122
|
-
if (metadata?.generator !==
|
|
123
|
-
throw new Error(`Project '${project.name}' was not generated by the '${
|
|
139
|
+
if (metadata?.generator !== AGENTCORE_GATEWAY_GENERATOR_INFO.id) {
|
|
140
|
+
throw new Error(`Project '${project.name}' was not generated by the '${AGENTCORE_GATEWAY_GENERATOR_INFO.id}' generator.`);
|
|
124
141
|
}
|
|
125
142
|
return metadata;
|
|
126
143
|
};
|
|
127
|
-
|
|
128
|
-
|
|
144
|
+
export default agentcoreGatewayGenerator;
|
|
145
|
+
|
|
129
146
|
//# sourceMappingURL=generator.js.map
|