@aws/nx-plugin 1.0.0-rc.23 → 1.0.0-rc.25
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 +3643 -1208
- package/package.json +30 -15
- 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 +4 -4
- package/src/agentcore-gateway/gateway-connection/generator.js +45 -46
- 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/gateway-connection/schema.d.ts +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +5 -0
- package/src/agentcore-gateway/generator.js +93 -73
- package/src/agentcore-gateway/generator.js.map +1 -1
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +3 -3
- package/src/agentcore-gateway/mcp-connection/generator.js +27 -31
- 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/mcp-connection/schema.d.ts +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +5 -0
- package/src/agentcore-gateway/schema.d.js +6 -0
- package/src/agentcore-gateway/schema.d.js.map +1 -0
- package/src/agentcore-gateway/schema.d.ts +1 -0
- package/src/agentcore-gateway/schema.json +5 -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.d.ts +1 -0
- package/src/connection/generator.js +265 -206
- 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/connection/schema.d.ts +1 -0
- package/src/connection/schema.json +5 -0
- package/src/index.js +2 -5
- package/src/index.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +33 -47
- package/src/infra/app/generator.js +140 -124
- 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/infra/app/schema.d.ts +1 -1
- package/src/infra/app/schema.json +5 -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/schema.d.ts +2 -0
- package/src/license/schema.json +5 -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 +45 -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 +32 -7
- package/src/preset/generator.d.ts +1 -1
- package/src/preset/generator.js +134 -113
- 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 +1 -1
- package/src/preset/schema.json +5 -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} +16 -853
- 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 +74 -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/a2a-connection/schema.d.ts +1 -0
- package/src/py/agent/a2a-connection/schema.json +5 -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 +65 -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/gateway-connection/schema.d.ts +1 -0
- package/src/py/agent/gateway-connection/schema.json +5 -0
- package/src/py/agent/generator.js +230 -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 +57 -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/mcp-connection/schema.d.ts +1 -0
- package/src/py/agent/mcp-connection/schema.json +5 -0
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +3 -2
- package/src/py/agent/react-connection/generator.d.ts +1 -1
- package/src/py/agent/react-connection/generator.js +55 -59
- 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/react-connection/schema.d.ts +1 -0
- package/src/py/agent/react-connection/schema.json +5 -0
- package/src/py/agent/schema.d.js +6 -0
- package/src/py/agent/schema.d.js.map +1 -0
- package/src/py/agent/schema.d.ts +1 -0
- package/src/py/agent/schema.json +5 -0
- package/src/py/api/generator.js +12 -11
- 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/api/schema.d.ts +1 -0
- package/src/py/api/schema.json +5 -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 +30 -30
- 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/agent-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/agent-connection/schema.json +5 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/dynamodb/fast-api-connection/generator.js +29 -29
- 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/fast-api-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +5 -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 +66 -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 +30 -30
- 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/mcp-server-connection/schema.d.ts +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +5 -0
- package/src/py/dynamodb/schema.d.js +6 -0
- package/src/py/dynamodb/schema.d.js.map +1 -0
- package/src/py/dynamodb/schema.d.ts +1 -0
- package/src/py/dynamodb/schema.json +5 -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 +82 -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.d.ts +2 -2
- package/src/py/fast-api/react/generator.js +25 -25
- 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/react/schema.d.ts +1 -0
- package/src/py/fast-api/react/schema.json +5 -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/fast-api/schema.d.ts +1 -0
- package/src/py/fast-api/schema.json +5 -0
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/lambda-function/generator.js +60 -59
- 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/lambda-function/schema.d.ts +1 -0
- package/src/py/lambda-function/schema.json +5 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/py/mcp-server/generator.js +152 -132
- 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/mcp-server/schema.d.ts +1 -0
- package/src/py/mcp-server/schema.json +5 -0
- package/src/py/project/generator.js +132 -90
- 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/py/project/schema.d.ts +1 -0
- package/src/py/project/schema.json +5 -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 +1 -2
- package/src/sdk/utils/ast.js +6 -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 +48 -43
- 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/project/schema.d.ts +1 -0
- package/src/smithy/project/schema.json +5 -0
- package/src/smithy/react-connection/generator.js +39 -47
- 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/react-connection/schema.d.ts +1 -0
- package/src/smithy/react-connection/schema.json +5 -0
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +395 -72
- package/src/smithy/ts/api/generator.js +125 -110
- 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/smithy/ts/api/schema.d.ts +1 -0
- package/src/smithy/ts/api/schema.json +5 -0
- package/src/terraform/project/files/application/src/providers.tf.template +1 -1
- package/src/terraform/project/generator.js +151 -104
- 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/terraform/project/schema.d.ts +1 -0
- package/src/terraform/project/schema.json +5 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +336 -92
- package/src/trpc/backend/generator.d.ts +1 -1
- package/src/trpc/backend/generator.js +97 -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/backend/schema.d.ts +1 -0
- package/src/trpc/backend/schema.json +5 -0
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/react/generator.d.ts +1 -1
- package/src/trpc/react/generator.js +63 -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/trpc/react/schema.d.ts +1 -0
- package/src/trpc/react/schema.json +5 -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 +62 -55
- 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/a2a-connection/schema.d.ts +1 -0
- package/src/ts/agent/a2a-connection/schema.json +5 -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 +61 -53
- 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/gateway-connection/schema.d.ts +1 -0
- package/src/ts/agent/gateway-connection/schema.json +5 -0
- package/src/ts/agent/generator.js +169 -137
- 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 +52 -47
- 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/mcp-connection/schema.d.ts +1 -0
- package/src/ts/agent/mcp-connection/schema.json +5 -0
- package/src/ts/agent/react-connection/generator.d.ts +1 -1
- package/src/ts/agent/react-connection/generator.js +86 -80
- 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/react-connection/schema.d.ts +1 -0
- package/src/ts/agent/react-connection/schema.json +5 -0
- package/src/ts/agent/schema.d.js +6 -0
- package/src/ts/agent/schema.d.js.map +1 -0
- package/src/ts/agent/schema.d.ts +1 -0
- package/src/ts/agent/schema.json +5 -0
- package/src/ts/api/generator.js +16 -16
- 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/api/schema.d.ts +1 -0
- package/src/ts/api/schema.json +5 -0
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/ts/astro-docs/generator.js +63 -51
- 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/astro-docs/schema.d.ts +2 -2
- package/src/ts/astro-docs/schema.json +3 -3
- 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/docs/schema.d.ts +1 -4
- package/src/ts/docs/schema.json +3 -3
- 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/agent-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/agent-connection/schema.json +5 -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 +68 -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/mcp-server-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +5 -0
- package/src/ts/dynamodb/schema.d.js +6 -0
- package/src/ts/dynamodb/schema.d.js.map +1 -0
- package/src/ts/dynamodb/schema.d.ts +1 -0
- package/src/ts/dynamodb/schema.json +5 -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/smithy-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +5 -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/dynamodb/trpc-connection/schema.d.ts +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +5 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/lambda-function/generator.js +59 -56
- 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/lambda-function/schema.d.ts +1 -0
- package/src/ts/lambda-function/schema.json +5 -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 +82 -80
- 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/schema.d.ts +1 -1
- package/src/ts/lib/schema.json +5 -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 +161 -139
- 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/mcp-server/schema.d.ts +1 -0
- package/src/ts/mcp-server/schema.json +5 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +27 -12
- package/src/ts/nx-generator/files/common/schema.d.ts.template +1 -0
- package/src/ts/nx-generator/files/common/schema.json.template +5 -0
- 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 +6 -7
- package/src/ts/nx-generator/generator.js +88 -84
- 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-generator/schema.d.ts +1 -0
- package/src/ts/nx-generator/schema.json +5 -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 +57 -49
- 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/schema.json +5 -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 +30 -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/agent-connection/schema.d.ts +1 -0
- package/src/ts/rdb/agent-connection/schema.json +5 -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 +1 -0
- package/src/ts/rdb/generator.js +134 -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/mcp-server-connection/schema.d.ts +1 -0
- package/src/ts/rdb/mcp-server-connection/schema.json +5 -0
- package/src/ts/rdb/schema.d.js +6 -0
- package/src/ts/rdb/schema.d.js.map +1 -0
- package/src/ts/rdb/schema.d.ts +1 -0
- package/src/ts/rdb/schema.json +5 -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/smithy-connection/schema.d.ts +1 -0
- package/src/ts/rdb/smithy-connection/schema.json +5 -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/trpc-connection/schema.d.ts +1 -0
- package/src/ts/rdb/trpc-connection/schema.json +5 -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 +178 -284
- package/src/ts/react-website/app/generator.d.ts +1 -1
- package/src/ts/react-website/app/generator.js +212 -191
- 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.d.ts +1 -1
- package/src/ts/react-website/app/schema.json +11 -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 +10 -3
- package/src/ts/react-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +2 -2
- package/src/ts/react-website/cognito-auth/generator.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/generator.js +64 -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/schema.d.ts +1 -0
- package/src/ts/react-website/cognito-auth/schema.json +5 -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/react-website/runtime-config/schema.d.ts +1 -0
- package/src/ts/react-website/runtime-config/schema.json +5 -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.d.ts +1 -1
- package/src/ts/website/app/schema.json +11 -6
- package/src/ts/website/auth/generator.d.ts +1 -1
- package/src/ts/website/auth/generator.js +11 -10
- 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/ts/website/auth/schema.d.ts +1 -0
- package/src/ts/website/auth/schema.json +5 -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.js +129 -146
- 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 +4 -4
- 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/infra/stage-credentials/cdk-command.ts.template +11 -3
- 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 +2 -2
- 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/install.d.ts +32 -0
- package/src/utils/install.js +56 -0
- package/src/utils/install.js.map +1 -0
- 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.js +25 -51
- 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.js +43 -52
- 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 +93 -66
- package/src/utils/versions.js +102 -85
- 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
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pyAgentA2aConnectionGenerator = exports.PY_AGENT_A2A_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
|
-
|
|
15
|
-
|
|
16
|
-
/** Prefix a GritQL pattern with `language python` */
|
|
17
|
-
|
|
18
|
-
/** The module each framework imports the `tool` decorator from. */
|
|
19
|
-
const TOOL_IMPORT_MODULE = {
|
|
4
|
+
*/ import { generateFiles, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { addPythonCoreClient, addPythonReExport, ensurePythonAgentConnectionProject, getPythonAgentConnectionModuleName, getPythonAgentConnectionProject, getPythonAgentConnectionProjectDir, PY_CLIENT_NAMING, resolveAgentFramework } from "../../../utils/agent-connection/agent-connection.js";
|
|
6
|
+
import { addPythonDestructuredImport, applyGritQL, matchGritQL } from "../../../utils/ast.js";
|
|
7
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
8
|
+
import { installDependencies } from "../../../utils/install.js";
|
|
9
|
+
import { addGeneratorMetricsIfApplicable } from "../../../utils/metrics.js";
|
|
10
|
+
import { snakeCase } from "../../../utils/names.js";
|
|
11
|
+
import { addDependencyToTargetIfNotPresent, getGeneratorInfo, readProjectConfigurationUnqualified } from "../../../utils/nx.js";
|
|
12
|
+
import { addDependenciesToPyProjectToml, addWorkspaceDependencyToPyProject } from "../../../utils/py.js";
|
|
13
|
+
/** Prefix a GritQL pattern with `language python` */ const py = (pattern)=>`language python\n${pattern}`;
|
|
14
|
+
/** The module each framework imports the `tool` decorator from. */ const TOOL_IMPORT_MODULE = {
|
|
20
15
|
strands: 'strands',
|
|
21
|
-
langchain: 'langchain_core.tools'
|
|
16
|
+
langchain: 'langchain_core.tools'
|
|
22
17
|
};
|
|
23
|
-
/** The GritQL pattern matching each framework's agent constructor. */
|
|
24
|
-
const AGENT_CONSTRUCTOR = {
|
|
18
|
+
/** The GritQL pattern matching each framework's agent constructor. */ const AGENT_CONSTRUCTOR = {
|
|
25
19
|
strands: 'yield Agent($_)',
|
|
26
|
-
langchain: 'create_agent($_)'
|
|
20
|
+
langchain: 'create_agent($_)'
|
|
27
21
|
};
|
|
28
22
|
/**
|
|
29
23
|
* The A2A transport dependency each framework's Layer-2 client needs. Strands
|
|
30
24
|
* wraps strands' `A2AAgent` (strands-agents[a2a]); LangChain drives the a2a SDK
|
|
31
25
|
* directly (a2a-sdk) and must not pull Strands in.
|
|
32
|
-
*/
|
|
33
|
-
const A2A_TRANSPORT_DEP = {
|
|
26
|
+
*/ const A2A_TRANSPORT_DEP = {
|
|
34
27
|
strands: 'strands-agents[a2a]',
|
|
35
|
-
langchain: 'a2a-sdk'
|
|
28
|
+
langchain: 'a2a-sdk'
|
|
36
29
|
};
|
|
37
|
-
|
|
38
|
-
const pyAgentA2aConnectionGenerator = async (tree, options)
|
|
39
|
-
const sourceProject =
|
|
40
|
-
const targetProject =
|
|
30
|
+
export const PY_AGENT_A2A_CONNECTION_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
31
|
+
export const pyAgentA2aConnectionGenerator = async (tree, options)=>{
|
|
32
|
+
const sourceProject = readProjectConfigurationUnqualified(tree, options.sourceProject);
|
|
33
|
+
const targetProject = readProjectConfigurationUnqualified(tree, options.targetProject);
|
|
41
34
|
const agentComponent = options.sourceComponent;
|
|
42
35
|
const targetAgentComponent = options.targetComponent;
|
|
43
36
|
if (!agentComponent || !targetAgentComponent) {
|
|
@@ -46,13 +39,12 @@ const pyAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
46
39
|
if ((targetAgentComponent.protocol ?? '').toLowerCase() !== 'a2a') {
|
|
47
40
|
throw new Error(`Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'http'} protocol — only A2A agents can be connected as tools.`);
|
|
48
41
|
}
|
|
49
|
-
if (targetAgentComponent.auth &&
|
|
50
|
-
targetAgentComponent.auth.toLowerCase() !== 'iam') {
|
|
42
|
+
if (targetAgentComponent.auth && targetAgentComponent.auth.toLowerCase() !== 'iam') {
|
|
51
43
|
throw new Error(`A2A agent connection currently only supports IAM authentication, but '${targetAgentComponent.name}' uses '${targetAgentComponent.auth}' authentication.`);
|
|
52
44
|
}
|
|
53
45
|
const targetAgentComponentName = targetAgentComponent.name ?? 'agent';
|
|
54
46
|
const targetAgentClassName = targetAgentComponent.rc;
|
|
55
|
-
const targetAgentSnakeCase =
|
|
47
|
+
const targetAgentSnakeCase = snakeCase(targetAgentClassName);
|
|
56
48
|
const targetAgentPort = targetAgentComponent.port ?? 9000;
|
|
57
49
|
// The source agent's framework drives everything that varies: the client
|
|
58
50
|
// naming + app template (shared with the mcp/gateway generators via
|
|
@@ -61,40 +53,42 @@ const pyAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
61
53
|
// (Strands' A2AAgent vs an a2a-sdk-only client) over the shared,
|
|
62
54
|
// framework-agnostic A2A client config. Keyed on the framework, not a
|
|
63
55
|
// boolean, so a third framework stays additive.
|
|
64
|
-
const framework =
|
|
65
|
-
const naming =
|
|
56
|
+
const framework = resolveAgentFramework(agentComponent.framework);
|
|
57
|
+
const naming = PY_CLIENT_NAMING[framework];
|
|
66
58
|
// 1. Ensure the shared Python agent-connection project exists + has the
|
|
67
59
|
// A2A core client (framework Layer-2) and its shared SigV4 auth helper.
|
|
68
|
-
await
|
|
69
|
-
await
|
|
70
|
-
const agentConnectionProjectDir =
|
|
71
|
-
const agentConnectionModuleName =
|
|
60
|
+
await ensurePythonAgentConnectionProject(tree);
|
|
61
|
+
await addPythonCoreClient(tree, 'a2a', framework);
|
|
62
|
+
const agentConnectionProjectDir = getPythonAgentConnectionProjectDir(tree);
|
|
63
|
+
const agentConnectionModuleName = getPythonAgentConnectionModuleName(tree);
|
|
72
64
|
// A2A client config + shared auth helper deps, plus the framework's A2A
|
|
73
65
|
// transport dep (see A2A_TRANSPORT_DEP).
|
|
74
|
-
|
|
66
|
+
addDependenciesToPyProjectToml(tree, agentConnectionProjectDir, [
|
|
75
67
|
'boto3',
|
|
76
68
|
'httpx',
|
|
77
|
-
A2A_TRANSPORT_DEP[framework]
|
|
69
|
+
A2A_TRANSPORT_DEP[framework]
|
|
78
70
|
]);
|
|
79
71
|
// 2. Generate the per-connection client into the shared agent-connection project
|
|
80
|
-
const appDir =
|
|
81
|
-
|
|
72
|
+
const appDir = joinPathFragments(agentConnectionProjectDir, agentConnectionModuleName, 'app');
|
|
73
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', naming.appTemplateSubdir), appDir, {
|
|
82
74
|
targetAgentSnakeCase,
|
|
83
75
|
targetAgentClassName,
|
|
84
76
|
targetAgentPort,
|
|
85
|
-
agentConnectionModuleName
|
|
86
|
-
}, {
|
|
77
|
+
agentConnectionModuleName
|
|
78
|
+
}, {
|
|
79
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
80
|
+
});
|
|
87
81
|
// Ensure app/__init__.py exists
|
|
88
|
-
const appInitPath =
|
|
82
|
+
const appInitPath = joinPathFragments(appDir, '__init__.py');
|
|
89
83
|
if (!tree.exists(appInitPath)) {
|
|
90
84
|
tree.write(appInitPath, '');
|
|
91
85
|
}
|
|
92
86
|
// Add re-export to module __init__.py
|
|
93
|
-
const moduleInitPath =
|
|
94
|
-
await
|
|
87
|
+
const moduleInitPath = joinPathFragments(agentConnectionProjectDir, agentConnectionModuleName, '__init__.py');
|
|
88
|
+
await addPythonReExport(tree, moduleInitPath, `.app.${targetAgentSnakeCase}_client_${naming.clientModuleSuffix}`, `${targetAgentClassName}Client${naming.clientClassSuffix}`);
|
|
95
89
|
// 3. Transform agent.py to add the A2A client import + wrap it as a tool
|
|
96
|
-
const agentSourceDir =
|
|
97
|
-
const agentFilePath =
|
|
90
|
+
const agentSourceDir = joinPathFragments(sourceProject.root, agentComponent.path ?? 'src');
|
|
91
|
+
const agentFilePath = joinPathFragments(agentSourceDir, 'agent.py');
|
|
98
92
|
if (tree.exists(agentFilePath)) {
|
|
99
93
|
const clientClassName = `${targetAgentClassName}Client${naming.clientClassSuffix}`;
|
|
100
94
|
const clientVarName = targetAgentSnakeCase;
|
|
@@ -104,45 +98,50 @@ const pyAgentA2aConnectionGenerator = async (tree, options) => {
|
|
|
104
98
|
await addClientToolToGetAgent(tree, agentFilePath, clientClassName, clientVarName, toolName, targetAgentClassName, framework);
|
|
105
99
|
}
|
|
106
100
|
// 4. Add workspace dependency from agent project to agent-connection project
|
|
107
|
-
|
|
108
|
-
// 5. Set up
|
|
101
|
+
addWorkspaceDependencyToPyProject(tree, sourceProject, getPythonAgentConnectionProject(tree));
|
|
102
|
+
// 5. Set up dev target dependencies — chain onto the target agent
|
|
109
103
|
const agentName = agentComponent.name ?? 'agent';
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
if (sourceProject.targets?.[
|
|
113
|
-
|
|
114
|
-
projects: [
|
|
115
|
-
|
|
104
|
+
const devTargetName = `${agentName}-dev`;
|
|
105
|
+
const targetDevTargetName = `${targetAgentComponentName}-dev`;
|
|
106
|
+
if (sourceProject.targets?.[devTargetName]) {
|
|
107
|
+
addDependencyToTargetIfNotPresent(sourceProject, devTargetName, {
|
|
108
|
+
projects: [
|
|
109
|
+
targetProject.name
|
|
110
|
+
],
|
|
111
|
+
target: targetDevTargetName
|
|
116
112
|
});
|
|
117
|
-
|
|
113
|
+
updateProjectConfiguration(tree, sourceProject.name, sourceProject);
|
|
118
114
|
}
|
|
119
|
-
await
|
|
120
|
-
|
|
115
|
+
await addGeneratorMetricsIfApplicable(tree, [
|
|
116
|
+
PY_AGENT_A2A_CONNECTION_GENERATOR_INFO
|
|
121
117
|
]);
|
|
122
|
-
await
|
|
123
|
-
return ()
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
await formatFilesInSubtree(tree);
|
|
119
|
+
return ()=>installDependencies(tree, options.preferInstallDependencies, {
|
|
120
|
+
languages: [
|
|
121
|
+
'typescript'
|
|
122
|
+
]
|
|
123
|
+
});
|
|
126
124
|
};
|
|
127
|
-
exports.pyAgentA2aConnectionGenerator = pyAgentA2aConnectionGenerator;
|
|
128
125
|
/**
|
|
129
126
|
* Add imports to agent.py:
|
|
130
127
|
* - `tool` (from `strands`, or `langchain_core.tools` for LangChain agents)
|
|
131
128
|
* - the per-connection client class from the shared agent-connection module
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
*/ const addImportToAgentFile = async (tree, filePath, agentConnectionModuleName, clientClassName, framework)=>{
|
|
130
|
+
await addPythonDestructuredImport(tree, filePath, [
|
|
131
|
+
'tool'
|
|
132
|
+
], TOOL_IMPORT_MODULE[framework]);
|
|
133
|
+
await addPythonDestructuredImport(tree, filePath, [
|
|
134
|
+
clientClassName
|
|
135
|
+
], agentConnectionModuleName);
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
138
|
* Add the A2A tool to the Agent's tools array using GritQL.
|
|
139
139
|
*
|
|
140
140
|
* Scoped to the framework's agent constructor so unrelated `tools=` keyword
|
|
141
141
|
* arguments elsewhere in the file are not touched.
|
|
142
|
-
*/
|
|
143
|
-
const addToolToAgent = async (tree, filePath, toolName, framework) => {
|
|
142
|
+
*/ const addToolToAgent = async (tree, filePath, toolName, framework)=>{
|
|
144
143
|
const scope = AGENT_CONSTRUCTOR[framework];
|
|
145
|
-
await
|
|
144
|
+
await applyGritQL(tree, filePath, py(`\`tools=$old\` where {
|
|
146
145
|
$old <: within \`${scope}\`,
|
|
147
146
|
$old <: not contains \`${toolName}\`,
|
|
148
147
|
if ($old <: \`[]\`) {
|
|
@@ -159,9 +158,8 @@ const addToolToAgent = async (tree, filePath, toolName, framework) => {
|
|
|
159
158
|
* Unlike MCP clients, A2A clients aren't context managers — we don't need
|
|
160
159
|
* a `with` block around them. Creation + tool definition happen at the
|
|
161
160
|
* top of the function body, anchored on the framework's agent constructor.
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
if (await (0, ast_1.matchGritQL)(tree, filePath, py(`\`${clientClassName}.create\``))) {
|
|
161
|
+
*/ const addClientToolToGetAgent = async (tree, filePath, clientClassName, clientVarName, toolName, targetAgentClassName, framework)=>{
|
|
162
|
+
if (await matchGritQL(tree, filePath, py(`\`${clientClassName}.create\``))) {
|
|
165
163
|
return;
|
|
166
164
|
}
|
|
167
165
|
// Both frameworks' tools are @tool-decorated callables (the decorator's
|
|
@@ -178,7 +176,7 @@ const addClientToolToGetAgent = async (tree, filePath, clientClassName, clientVa
|
|
|
178
176
|
// the framework's agent constructor. This works whether or not a prior MCP
|
|
179
177
|
// block is present since we insert before any existing statements.
|
|
180
178
|
const anchor = AGENT_CONSTRUCTOR[framework];
|
|
181
|
-
await
|
|
179
|
+
await applyGritQL(tree, filePath, py(`\`def get_agent($params):
|
|
182
180
|
$body\` where {
|
|
183
181
|
$body <: contains \`${anchor}\`,
|
|
184
182
|
$body <: not contains \`${clientClassName}.create\`
|
|
@@ -186,5 +184,6 @@ const addClientToolToGetAgent = async (tree, filePath, clientClassName, clientVa
|
|
|
186
184
|
${toolBlock}
|
|
187
185
|
$body\``));
|
|
188
186
|
};
|
|
189
|
-
|
|
187
|
+
export default pyAgentA2aConnectionGenerator;
|
|
188
|
+
|
|
190
189
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/agent/a2a-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAQoB;AACpB,uFAU0D;AAC1D,4CAI4B;AAC5B,kDAA6D;AAC7D,oDAAyE;AACzE,gDAAiD;AACjD,0CAK2B;AAC3B,0CAG2B;AAI3B,qDAAqD;AACrD,MAAM,EAAE,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,oBAAoB,OAAO,EAAE,CAAC;AAE9D,mEAAmE;AACnE,MAAM,kBAAkB,GAAmC;IACzD,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,sEAAsE;AACtE,MAAM,iBAAiB,GAAmC;IACxD,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,iBAAiB,GAA0C;IAC/D,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,SAAS;CACrB,CAAC;AAEW,QAAA,sCAAsC,GACjD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,6BAA6B,GAAG,KAAK,EAChD,IAAU,EACV,OAA4C,EAChB,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IAEF,MAAM,cA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QAAQ,EAAE,EAAE,CAAC,KAAK,eAAe,WAAW,CAAC,CAAC,EAAE,CAAC;QAC3E,OAAO;IACT,CAAC;IAED,wEAAwE;IACxE,sEAAsE;IACtE,4EAA4E;IAC5E,MAAM,SAAS,GAAG,GAAG,aAAa,MAAM,eAAe;;;UAG/C,QAAQ;+CAC6B,oBAAoB;qBAC9C,aAAa;CACjC,CAAC;IAEA,8EAA8E;IAC9E,2EAA2E;IAC3E,mEAAmE;IACnE,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,QAAQ,EACR,EAAE,CAAC;;wBAEiB,MAAM;4BACF,eAAe;;MAErC,SAAS;YACH,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,qCAA6B,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/agent/a2a-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 generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport {\n type AgentFramework,\n addPythonCoreClient,\n addPythonReExport,\n ensurePythonAgentConnectionProject,\n getPythonAgentConnectionModuleName,\n getPythonAgentConnectionProject,\n getPythonAgentConnectionProjectDir,\n PY_CLIENT_NAMING,\n resolveAgentFramework,\n} from '../../../utils/agent-connection/agent-connection';\nimport {\n addPythonDestructuredImport,\n applyGritQL,\n matchGritQL,\n} from '../../../utils/ast';\nimport { formatFilesInSubtree } from '../../../utils/format';\nimport { installDependencies } from '../../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics';\nimport { snakeCase } from '../../../utils/names';\nimport {\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx';\nimport {\n addDependenciesToPyProjectToml,\n addWorkspaceDependencyToPyProject,\n} from '../../../utils/py';\nimport type { IPyDepVersion } from '../../../utils/versions';\nimport type { PyAgentA2aConnectionGeneratorSchema } from './schema';\n\n/** Prefix a GritQL pattern with `language python` */\nconst py = (pattern: string) => `language python\\n${pattern}`;\n\n/** The module each framework imports the `tool` decorator from. */\nconst TOOL_IMPORT_MODULE: Record<AgentFramework, string> = {\n strands: 'strands',\n langchain: 'langchain_core.tools',\n};\n\n/** The GritQL pattern matching each framework's agent constructor. */\nconst AGENT_CONSTRUCTOR: Record<AgentFramework, string> = {\n strands: 'yield Agent($_)',\n langchain: 'create_agent($_)',\n};\n\n/**\n * The A2A transport dependency each framework's Layer-2 client needs. Strands\n * wraps strands' `A2AAgent` (strands-agents[a2a]); LangChain drives the a2a SDK\n * directly (a2a-sdk) and must not pull Strands in.\n */\nconst A2A_TRANSPORT_DEP: Record<AgentFramework, IPyDepVersion> = {\n strands: 'strands-agents[a2a]',\n langchain: 'a2a-sdk',\n};\n\nexport const PY_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const pyAgentA2aConnectionGenerator = async (\n tree: Tree,\n options: PyAgentA2aConnectionGeneratorSchema,\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 agentComponent = options.sourceComponent;\n const targetAgentComponent = options.targetComponent;\n\n if (!agentComponent || !targetAgentComponent) {\n throw new Error(\n 'Both sourceComponent and targetComponent must be provided for py#agent -> a2a connections',\n );\n }\n\n if ((targetAgentComponent.protocol ?? '').toLowerCase() !== 'a2a') {\n throw new Error(\n `Target agent '${targetAgentComponent.name}' uses the ${targetAgentComponent.protocol ?? 'http'} protocol — only A2A agents can be connected as tools.`,\n );\n }\n\n if (\n targetAgentComponent.auth &&\n targetAgentComponent.auth.toLowerCase() !== 'iam'\n ) {\n throw new Error(\n `A2A agent connection currently only supports IAM authentication, but '${targetAgentComponent.name}' uses '${targetAgentComponent.auth}' authentication.`,\n );\n }\n\n const targetAgentComponentName = targetAgentComponent.name ?? 'agent';\n const targetAgentClassName = targetAgentComponent.rc as string;\n const targetAgentSnakeCase = snakeCase(targetAgentClassName);\n const targetAgentPort = targetAgentComponent.port ?? 9000;\n\n // The source agent's framework drives everything that varies: the client\n // naming + app template (shared with the mcp/gateway generators via\n // PY_CLIENT_NAMING), the A2A transport dep (see A2A_TRANSPORT_DEP), and the\n // agent.py transform below. Each framework wraps its own A2A Layer-2 client\n // (Strands' A2AAgent vs an a2a-sdk-only client) over the shared,\n // framework-agnostic A2A client config. Keyed on the framework, not a\n // boolean, so a third framework stays additive.\n const framework = resolveAgentFramework(agentComponent.framework);\n const naming = PY_CLIENT_NAMING[framework];\n\n // 1. Ensure the shared Python agent-connection project exists + has the\n // A2A core client (framework Layer-2) and its shared SigV4 auth helper.\n await ensurePythonAgentConnectionProject(tree);\n await addPythonCoreClient(tree, 'a2a', framework);\n\n const agentConnectionProjectDir = getPythonAgentConnectionProjectDir(tree);\n const agentConnectionModuleName = getPythonAgentConnectionModuleName(tree);\n\n // A2A client config + shared auth helper deps, plus the framework's A2A\n // transport dep (see A2A_TRANSPORT_DEP).\n addDependenciesToPyProjectToml(tree, agentConnectionProjectDir, [\n 'boto3',\n 'httpx',\n A2A_TRANSPORT_DEP[framework],\n ]);\n\n // 2. Generate the per-connection client into the shared agent-connection project\n const appDir = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n 'app',\n );\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', naming.appTemplateSubdir),\n appDir,\n {\n targetAgentSnakeCase,\n targetAgentClassName,\n targetAgentPort,\n agentConnectionModuleName,\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // Ensure app/__init__.py exists\n const appInitPath = joinPathFragments(appDir, '__init__.py');\n if (!tree.exists(appInitPath)) {\n tree.write(appInitPath, '');\n }\n\n // Add re-export to module __init__.py\n const moduleInitPath = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n '__init__.py',\n );\n await addPythonReExport(\n tree,\n moduleInitPath,\n `.app.${targetAgentSnakeCase}_client_${naming.clientModuleSuffix}`,\n `${targetAgentClassName}Client${naming.clientClassSuffix}`,\n );\n\n // 3. Transform agent.py to add the A2A client import + wrap it as a tool\n const agentSourceDir = joinPathFragments(\n sourceProject.root,\n agentComponent.path ?? 'src',\n );\n const agentFilePath = joinPathFragments(agentSourceDir, 'agent.py');\n\n if (tree.exists(agentFilePath)) {\n const clientClassName = `${targetAgentClassName}Client${naming.clientClassSuffix}`;\n const clientVarName = targetAgentSnakeCase;\n const toolName = `ask_${targetAgentSnakeCase}`;\n\n await addImportToAgentFile(\n tree,\n agentFilePath,\n agentConnectionModuleName,\n clientClassName,\n framework,\n );\n await addToolToAgent(tree, agentFilePath, toolName, framework);\n await addClientToolToGetAgent(\n tree,\n agentFilePath,\n clientClassName,\n clientVarName,\n toolName,\n targetAgentClassName,\n framework,\n );\n }\n\n // 4. Add workspace dependency from agent project to agent-connection project\n addWorkspaceDependencyToPyProject(\n tree,\n sourceProject,\n getPythonAgentConnectionProject(tree),\n );\n\n // 5. Set up dev target dependencies — chain onto the target agent\n const agentName = agentComponent.name ?? 'agent';\n const devTargetName = `${agentName}-dev`;\n const targetDevTargetName = `${targetAgentComponentName}-dev`;\n\n if (sourceProject.targets?.[devTargetName]) {\n addDependencyToTargetIfNotPresent(sourceProject, devTargetName, {\n projects: [targetProject.name],\n target: targetDevTargetName,\n });\n updateProjectConfiguration(tree, sourceProject.name, sourceProject);\n }\n\n await addGeneratorMetricsIfApplicable(tree, [\n PY_AGENT_A2A_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\n/**\n * Add imports to agent.py:\n * - `tool` (from `strands`, or `langchain_core.tools` for LangChain agents)\n * - the per-connection client class from the shared agent-connection module\n */\nconst addImportToAgentFile = async (\n tree: Tree,\n filePath: string,\n agentConnectionModuleName: string,\n clientClassName: string,\n framework: AgentFramework,\n): Promise<void> => {\n await addPythonDestructuredImport(\n tree,\n filePath,\n ['tool'],\n TOOL_IMPORT_MODULE[framework],\n );\n await addPythonDestructuredImport(\n tree,\n filePath,\n [clientClassName],\n agentConnectionModuleName,\n );\n};\n\n/**\n * Add the A2A tool to the Agent's tools array using GritQL.\n *\n * Scoped to the framework's agent constructor so unrelated `tools=` keyword\n * arguments elsewhere in the file are not touched.\n */\nconst addToolToAgent = async (\n tree: Tree,\n filePath: string,\n toolName: string,\n framework: AgentFramework,\n): Promise<void> => {\n const scope = AGENT_CONSTRUCTOR[framework];\n await applyGritQL(\n tree,\n filePath,\n py(`\\`tools=$old\\` where {\n $old <: within \\`${scope}\\`,\n $old <: not contains \\`${toolName}\\`,\n if ($old <: \\`[]\\`) {\n $old => \\`[${toolName}]\\`\n } else {\n $old <: \\`[$items]\\` where { $items += \\`, ${toolName}\\` }\n }\n}`),\n );\n};\n\n/**\n * Wrap the get_agent body so the remote A2A client is created and exposed\n * as a `@tool`-decorated closure before constructing the Agent.\n *\n * Unlike MCP clients, A2A clients aren't context managers — we don't need\n * a `with` block around them. Creation + tool definition happen at the\n * top of the function body, anchored on the framework's agent constructor.\n */\nconst addClientToolToGetAgent = async (\n tree: Tree,\n filePath: string,\n clientClassName: string,\n clientVarName: string,\n toolName: string,\n targetAgentClassName: string,\n framework: AgentFramework,\n): Promise<void> => {\n if (await matchGritQL(tree, filePath, py(`\\`${clientClassName}.create\\``))) {\n return;\n }\n\n // Both frameworks' tools are @tool-decorated callables (the decorator's\n // import differs, handled in addImportToAgentFile), defined inline in\n // get_agent. The client is directly callable, returning the remote's reply.\n const toolBlock = `${clientVarName} = ${clientClassName}.create()\n\n @tool\n def ${toolName}(prompt: str) -> str:\n \"\"\"Delegate a question to the remote ${targetAgentClassName} A2A agent and return its reply.\"\"\"\n return str(${clientVarName}(prompt))\n`;\n\n // Prepend client creation + tool definition to the function body, anchored on\n // the framework's agent constructor. This works whether or not a prior MCP\n // block is present since we insert before any existing statements.\n const anchor = AGENT_CONSTRUCTOR[framework];\n await applyGritQL(\n tree,\n filePath,\n py(`\\`def get_agent($params):\n $body\\` where {\n $body <: contains \\`${anchor}\\`,\n $body <: not contains \\`${clientClassName}.create\\`\n} => \\`def get_agent($params):\n ${toolBlock}\n $body\\``),\n );\n};\n\nexport default pyAgentA2aConnectionGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addPythonCoreClient","addPythonReExport","ensurePythonAgentConnectionProject","getPythonAgentConnectionModuleName","getPythonAgentConnectionProject","getPythonAgentConnectionProjectDir","PY_CLIENT_NAMING","resolveAgentFramework","addPythonDestructuredImport","applyGritQL","matchGritQL","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","snakeCase","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","addDependenciesToPyProjectToml","addWorkspaceDependencyToPyProject","py","pattern","TOOL_IMPORT_MODULE","strands","langchain","AGENT_CONSTRUCTOR","A2A_TRANSPORT_DEP","PY_AGENT_A2A_CONNECTION_GENERATOR_INFO","filename","pyAgentA2aConnectionGenerator","tree","options","sourceProject","targetProject","agentComponent","sourceComponent","targetAgentComponent","targetComponent","Error","protocol","toLowerCase","name","auth","targetAgentComponentName","targetAgentClassName","rc","targetAgentSnakeCase","targetAgentPort","port","framework","naming","agentConnectionProjectDir","agentConnectionModuleName","appDir","dirname","appTemplateSubdir","overwriteStrategy","KeepExisting","appInitPath","exists","write","moduleInitPath","clientModuleSuffix","clientClassSuffix","agentSourceDir","root","path","agentFilePath","clientClassName","clientVarName","toolName","addImportToAgentFile","addToolToAgent","addClientToolToGetAgent","agentName","devTargetName","targetDevTargetName","targets","projects","target","preferInstallDependencies","languages","filePath","scope","toolBlock","anchor"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,0BAA0B,QACrB,aAAa;AACpB,SAEEC,mBAAmB,EACnBC,iBAAiB,EACjBC,kCAAkC,EAClCC,kCAAkC,EAClCC,+BAA+B,EAC/BC,kCAAkC,EAClCC,gBAAgB,EAChBC,qBAAqB,QAChB,sDAAmD;AAC1D,SACEC,2BAA2B,EAC3BC,WAAW,EACXC,WAAW,QACN,wBAAqB;AAC5B,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAAyB;AAC7D,SAASC,+BAA+B,QAAQ,4BAAyB;AACzE,SAASC,SAAS,QAAQ,0BAAuB;AACjD,SACEC,iCAAiC,EACjCC,gBAAgB,EAEhBC,mCAAmC,QAC9B,uBAAoB;AAC3B,SACEC,8BAA8B,EAC9BC,iCAAiC,QAC5B,uBAAoB;AAI3B,mDAAmD,GACnD,MAAMC,KAAK,CAACC,UAAoB,CAAC,iBAAiB,EAAEA,SAAS;AAE7D,iEAAiE,GACjE,MAAMC,qBAAqD;IACzDC,SAAS;IACTC,WAAW;AACb;AAEA,oEAAoE,GACpE,MAAMC,oBAAoD;IACxDF,SAAS;IACTC,WAAW;AACb;AAEA;;;;CAIC,GACD,MAAME,oBAA2D;IAC/DH,SAAS;IACTC,WAAW;AACb;AAEA,OAAO,MAAMG,yCACXX,iBAAiB,YAAYY,QAAQ,EAAE;AAEzC,OAAO,MAAMC,gCAAgC,OAC3CC,MACAC;IAEA,MAAMC,gBAAgBf,oCACpBa,MACAC,QAAQC,aAAa;IAEvB,MAAMC,gBAAgBhB,oCACpBa,MACAC,QAAQE,aAAa;IAGvB,MAAMC,iBAAiBH,QAAQI,eAAe;IAC9C,MAAMC,uBAAuBL,QAAQM,eAAe;IAEpD,IAAI,CAACH,kBAAkB,CAACE,sBAAsB;QAC5C,MAAM,IAAIE,M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YACJqB,MACAoD,UACA9D,GAAG,CAAC;;sBAEc,EAAEiE,OAAO;0BACL,EAAEjB,gBAAgB;;IAExC,EAAEgB,UAAU;WACL,CAAC;AAEZ;AAEA,eAAevD,8BAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/agent/a2a-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 { ComponentMetadata } from '../../../utils/nx';\n\n/**\n * TypeScript types for options defined in schema.json\n */\nexport interface PyAgentA2aConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n targetComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD;;CAEC,GACD,WAMC"}
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"targetComponent": {
|
|
21
21
|
"type": "string",
|
|
22
22
|
"description": "The target A2A agent component name"
|
|
23
|
+
},
|
|
24
|
+
"preferInstallDependencies": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
|
|
27
|
+
"default": true
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
"required": ["sourceProject", "targetProject"]
|
|
@@ -21,7 +21,7 @@ class AgentCoreGatewayMCPClientStrands:
|
|
|
21
21
|
|
|
22
22
|
@staticmethod
|
|
23
23
|
def without_auth(gateway_url: str) -> MCPClient:
|
|
24
|
-
"""Plain-HTTP gateway client, for the local gateway started by
|
|
24
|
+
"""Plain-HTTP gateway client, for the local gateway started by the dev target."""
|
|
25
25
|
return MCPClient(AgentCoreGatewayMCPTransport.without_auth(gateway_url))
|
|
26
26
|
"
|
|
27
27
|
`;
|
|
@@ -53,7 +53,7 @@ class AgentCoreGatewayMCPTransport:
|
|
|
53
53
|
|
|
54
54
|
@staticmethod
|
|
55
55
|
def without_auth(gateway_url: str) -> TransportFactory:
|
|
56
|
-
"""Plain-HTTP gateway transport, for the local gateway started by
|
|
56
|
+
"""Plain-HTTP gateway transport, for the local gateway started by the dev target."""
|
|
57
57
|
return no_auth_transport(gateway_url)
|
|
58
58
|
"
|
|
59
59
|
`;
|
|
@@ -63,7 +63,6 @@ exports[`py#agent#gateway-connection generator > should match snapshot for agent
|
|
|
63
63
|
from typing import Any
|
|
64
64
|
|
|
65
65
|
import boto3
|
|
66
|
-
|
|
67
66
|
from mcp.client.streamable_http import streamablehttp_client
|
|
68
67
|
|
|
69
68
|
from .auth.session import jwt_auth, plain_auth, sigv4_auth
|
|
@@ -105,29 +104,28 @@ def no_auth_transport(url: str) -> TransportFactory:
|
|
|
105
104
|
exports[`py#agent#gateway-connection generator > should match snapshot for agent-connection core files > my_gateway_client_strands.py 1`] = `
|
|
106
105
|
"import os
|
|
107
106
|
|
|
108
|
-
from strands.tools.mcp.mcp_client import MCPClient
|
|
109
|
-
|
|
110
107
|
from proj_agent_connection.core.agentcore_gateway_mcp_client_strands import (
|
|
111
108
|
AgentCoreGatewayMCPClientStrands,
|
|
112
109
|
)
|
|
113
110
|
from proj_agent_connection.core.runtime_config import (
|
|
114
111
|
get_agentcore_runtime_config,
|
|
115
112
|
)
|
|
113
|
+
from strands.tools.mcp.mcp_client import MCPClient
|
|
116
114
|
|
|
117
115
|
|
|
118
116
|
class MyGatewayClientStrands:
|
|
119
117
|
"""Strands client for the MyGateway AgentCore Gateway.
|
|
120
118
|
|
|
121
119
|
Deployed: a SigV4-signed MCP client pointing at the gateway URL.
|
|
122
|
-
Local (\`\`
|
|
123
|
-
gateway started by the gateway project's
|
|
120
|
+
Local (\`\`LOCAL_DEV=true\`\`): a plain-HTTP client pointing at the local
|
|
121
|
+
gateway started by the gateway project's dev target. The local
|
|
124
122
|
gateway aggregates every attached MCP server but does not evaluate
|
|
125
123
|
Cedar policies.
|
|
126
124
|
"""
|
|
127
125
|
|
|
128
126
|
@staticmethod
|
|
129
127
|
def create() -> MCPClient:
|
|
130
|
-
if os.environ.get("
|
|
128
|
+
if os.environ.get("LOCAL_DEV") == "true":
|
|
131
129
|
return AgentCoreGatewayMCPClientStrands.without_auth(
|
|
132
130
|
gateway_url="http://localhost:8100/mcp"
|
|
133
131
|
)
|
|
@@ -14,15 +14,15 @@ class <%- gatewayClassName %>ClientStrands:
|
|
|
14
14
|
"""Strands client for the <%- gatewayClassName %> AgentCore Gateway.
|
|
15
15
|
|
|
16
16
|
Deployed: a SigV4-signed MCP client pointing at the gateway URL.
|
|
17
|
-
Local (``
|
|
18
|
-
gateway started by the gateway project's
|
|
17
|
+
Local (``LOCAL_DEV=true``): a plain-HTTP client pointing at the local
|
|
18
|
+
gateway started by the gateway project's dev target. The local
|
|
19
19
|
gateway aggregates every attached MCP server but does not evaluate
|
|
20
20
|
Cedar policies.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
@staticmethod
|
|
24
24
|
def create() -> MCPClient:
|
|
25
|
-
if os.environ.get("
|
|
25
|
+
if os.environ.get("LOCAL_DEV") == "true":
|
|
26
26
|
return AgentCoreGatewayMCPClientStrands.without_auth(
|
|
27
27
|
gateway_url="http://localhost:<%- gatewayPort %>/mcp"
|
|
28
28
|
)
|
|
@@ -14,14 +14,14 @@ class <%- gatewayClassName %>ClientLangChain:
|
|
|
14
14
|
"""Loads LangChain tools from the <%- gatewayClassName %> AgentCore Gateway.
|
|
15
15
|
|
|
16
16
|
Deployed: SigV4-signed tools pointing at the gateway URL. Local
|
|
17
|
-
(``
|
|
18
|
-
started by the gateway project's
|
|
17
|
+
(``LOCAL_DEV=true``): plain-HTTP tools pointing at the local gateway
|
|
18
|
+
started by the gateway project's dev target. The local gateway
|
|
19
19
|
aggregates every attached MCP server but does not evaluate Cedar policies.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
@staticmethod
|
|
23
23
|
def create() -> list[BaseTool]:
|
|
24
|
-
if os.environ.get("
|
|
24
|
+
if os.environ.get("LOCAL_DEV") == "true":
|
|
25
25
|
return AgentCoreGatewayMCPClientLangChain.without_auth(
|
|
26
26
|
gateway_url="http://localhost:<%- gatewayPort %>/mcp"
|
|
27
27
|
)
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pyAgentGatewayConnectionGenerator = exports.PY_AGENT_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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const pyAgentGatewayConnectionGenerator = async (tree, options)
|
|
19
|
-
const sourceProject =
|
|
20
|
-
const targetProject =
|
|
4
|
+
*/ import { generateFiles, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
|
|
5
|
+
import { readAgentCoreGatewayMetadata } from "../../../agentcore-gateway/generator.js";
|
|
6
|
+
import { addPythonCoreClient, addPythonReExport, ensurePythonAgentConnectionProject, getPythonAgentConnectionModuleName, getPythonAgentConnectionProject, getPythonAgentConnectionProjectDir, PY_MCP_FAMILY_CONNECTIONS, resolveAgentFramework } from "../../../utils/agent-connection/agent-connection.js";
|
|
7
|
+
import { addPythonDestructuredImport } from "../../../utils/ast.js";
|
|
8
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
9
|
+
import { installDependencies } from "../../../utils/install.js";
|
|
10
|
+
import { addGeneratorMetricsIfApplicable } from "../../../utils/metrics.js";
|
|
11
|
+
import { snakeCase } from "../../../utils/names.js";
|
|
12
|
+
import { addDependencyToTargetIfNotPresent, getGeneratorInfo, readProjectConfigurationUnqualified } from "../../../utils/nx.js";
|
|
13
|
+
import { addDependenciesToPyProjectToml, addWorkspaceDependencyToPyProject } from "../../../utils/py.js";
|
|
14
|
+
export const PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
|
|
15
|
+
export const pyAgentGatewayConnectionGenerator = async (tree, options)=>{
|
|
16
|
+
const sourceProject = readProjectConfigurationUnqualified(tree, options.sourceProject);
|
|
17
|
+
const targetProject = readProjectConfigurationUnqualified(tree, options.targetProject);
|
|
21
18
|
const agentComponent = options.sourceComponent;
|
|
22
19
|
if (!agentComponent) {
|
|
23
20
|
throw new Error('sourceComponent must be provided for py#agent -> agentcore-gateway connections');
|
|
24
21
|
}
|
|
25
|
-
const gateway =
|
|
22
|
+
const gateway = readAgentCoreGatewayMetadata(targetProject);
|
|
26
23
|
if (gateway.protocol !== 'mcp') {
|
|
27
24
|
throw new Error(`Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Only MCP-protocol gateways are supported.`);
|
|
28
25
|
}
|
|
@@ -33,80 +30,90 @@ const pyAgentGatewayConnectionGenerator = async (tree, options) => {
|
|
|
33
30
|
throw new Error(`Agent '${agentComponent.name}' uses auth='${agentComponent.auth}'. Only IAM-authenticated agents can connect to IAM gateways.`);
|
|
34
31
|
}
|
|
35
32
|
const gatewayClassName = gateway.rc;
|
|
36
|
-
const gatewaySnakeCase =
|
|
37
|
-
|
|
38
|
-
const gatewayServeTargetName =
|
|
39
|
-
const
|
|
33
|
+
const gatewaySnakeCase = snakeCase(gatewayClassName);
|
|
34
|
+
// A gateway is its own standalone project, so it exposes plain serve / dev.
|
|
35
|
+
const gatewayServeTargetName = 'serve';
|
|
36
|
+
const gatewayDevTargetName = 'dev';
|
|
40
37
|
// The source agent's framework selects the client shape, dependencies and the
|
|
41
38
|
// agent.py transform — see PY_MCP_FAMILY_CONNECTIONS (keyed by framework, not a
|
|
42
39
|
// boolean, so a third framework is an additive entry there). A Gateway exposes
|
|
43
40
|
// its tools over MCP, so it reuses the same wiring as an MCP server connection.
|
|
44
|
-
const framework =
|
|
45
|
-
const connection =
|
|
46
|
-
await
|
|
47
|
-
await
|
|
48
|
-
const agentConnectionProjectDir =
|
|
49
|
-
const agentConnectionModuleName =
|
|
41
|
+
const framework = resolveAgentFramework(agentComponent.framework);
|
|
42
|
+
const connection = PY_MCP_FAMILY_CONNECTIONS[framework];
|
|
43
|
+
await ensurePythonAgentConnectionProject(tree);
|
|
44
|
+
await addPythonCoreClient(tree, 'gateway', framework);
|
|
45
|
+
const agentConnectionProjectDir = getPythonAgentConnectionProjectDir(tree);
|
|
46
|
+
const agentConnectionModuleName = getPythonAgentConnectionModuleName(tree);
|
|
50
47
|
// Shared MCP transport + signed httpx auth deps, plus whatever extra deps the
|
|
51
48
|
// framework's MCP client needs (e.g. langchain-mcp-adapters for LangChain).
|
|
52
|
-
|
|
49
|
+
addDependenciesToPyProjectToml(tree, agentConnectionProjectDir, [
|
|
53
50
|
'boto3',
|
|
54
51
|
'httpx',
|
|
55
52
|
'mcp',
|
|
56
|
-
...connection.deps
|
|
53
|
+
...connection.deps
|
|
57
54
|
]);
|
|
58
|
-
const appDir =
|
|
55
|
+
const appDir = joinPathFragments(agentConnectionProjectDir, agentConnectionModuleName, 'app');
|
|
59
56
|
// Local mode points at the gateway project's local gateway port.
|
|
60
|
-
|
|
57
|
+
generateFiles(tree, joinPathFragments(import.meta.dirname, 'files', connection.appTemplateSubdir), appDir, {
|
|
61
58
|
gatewaySnakeCase,
|
|
62
59
|
gatewayClassName,
|
|
63
60
|
agentConnectionModuleName,
|
|
64
|
-
gatewayPort: gateway.port
|
|
65
|
-
}, {
|
|
66
|
-
|
|
61
|
+
gatewayPort: gateway.port
|
|
62
|
+
}, {
|
|
63
|
+
overwriteStrategy: OverwriteStrategy.KeepExisting
|
|
64
|
+
});
|
|
65
|
+
const appInitPath = joinPathFragments(appDir, '__init__.py');
|
|
67
66
|
if (!tree.exists(appInitPath)) {
|
|
68
67
|
tree.write(appInitPath, '');
|
|
69
68
|
}
|
|
70
|
-
const moduleInitPath =
|
|
71
|
-
await
|
|
72
|
-
const agentSourceDir =
|
|
73
|
-
const agentFilePath =
|
|
69
|
+
const moduleInitPath = joinPathFragments(agentConnectionProjectDir, agentConnectionModuleName, '__init__.py');
|
|
70
|
+
await addPythonReExport(tree, moduleInitPath, `.app.${gatewaySnakeCase}_client_${connection.clientModuleSuffix}`, `${gatewayClassName}Client${connection.clientClassSuffix}`);
|
|
71
|
+
const agentSourceDir = joinPathFragments(sourceProject.root, agentComponent.path ?? 'src');
|
|
72
|
+
const agentFilePath = joinPathFragments(agentSourceDir, 'agent.py');
|
|
74
73
|
if (tree.exists(agentFilePath)) {
|
|
75
74
|
const clientClassName = `${gatewayClassName}Client${connection.clientClassSuffix}`;
|
|
76
75
|
const clientVarName = gatewaySnakeCase;
|
|
77
|
-
await
|
|
76
|
+
await addPythonDestructuredImport(tree, agentFilePath, [
|
|
77
|
+
clientClassName
|
|
78
|
+
], agentConnectionModuleName);
|
|
78
79
|
await connection.wireClientIntoAgent(tree, agentFilePath, clientClassName, clientVarName);
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
addWorkspaceDependencyToPyProject(tree, sourceProject, getPythonAgentConnectionProject(tree));
|
|
81
82
|
const agentName = agentComponent.name ?? 'agent';
|
|
82
83
|
const serveTargetName = `${agentName}-serve`;
|
|
83
|
-
const
|
|
84
|
+
const devTargetName = `${agentName}-dev`;
|
|
84
85
|
let projectConfigChanged = false;
|
|
85
86
|
if (sourceProject.targets?.[serveTargetName]) {
|
|
86
|
-
|
|
87
|
-
projects: [
|
|
88
|
-
|
|
87
|
+
addDependencyToTargetIfNotPresent(sourceProject, serveTargetName, {
|
|
88
|
+
projects: [
|
|
89
|
+
targetProject.name
|
|
90
|
+
],
|
|
91
|
+
target: gatewayServeTargetName
|
|
89
92
|
});
|
|
90
93
|
projectConfigChanged = true;
|
|
91
94
|
}
|
|
92
|
-
if (sourceProject.targets?.[
|
|
93
|
-
|
|
94
|
-
projects: [
|
|
95
|
-
|
|
95
|
+
if (sourceProject.targets?.[devTargetName]) {
|
|
96
|
+
addDependencyToTargetIfNotPresent(sourceProject, devTargetName, {
|
|
97
|
+
projects: [
|
|
98
|
+
targetProject.name
|
|
99
|
+
],
|
|
100
|
+
target: gatewayDevTargetName
|
|
96
101
|
});
|
|
97
102
|
projectConfigChanged = true;
|
|
98
103
|
}
|
|
99
104
|
if (projectConfigChanged) {
|
|
100
|
-
|
|
105
|
+
updateProjectConfiguration(tree, sourceProject.name, sourceProject);
|
|
101
106
|
}
|
|
102
|
-
await
|
|
103
|
-
|
|
107
|
+
await addGeneratorMetricsIfApplicable(tree, [
|
|
108
|
+
PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO
|
|
104
109
|
]);
|
|
105
|
-
await
|
|
106
|
-
return ()
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
await formatFilesInSubtree(tree);
|
|
111
|
+
return ()=>installDependencies(tree, options.preferInstallDependencies, {
|
|
112
|
+
languages: [
|
|
113
|
+
'typescript'
|
|
114
|
+
]
|
|
115
|
+
});
|
|
109
116
|
};
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
export default pyAgentGatewayConnectionGenerator;
|
|
118
|
+
|
|
112
119
|
//# sourceMappingURL=generator.js.map
|