@aws/nx-plugin 1.0.0-rc.71 → 1.0.0-rc.73
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 +210 -730
- package/migrations.json +34 -19
- package/package.json +4 -4
- package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/agentcore-harness/generator.d.ts +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/infra/app/generator.d.ts +1 -1
- package/src/init/generator.d.ts +1 -1
- package/src/license/config.d.ts +9 -0
- package/src/license/config.js +28 -0
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/collectors/collector.js.map +1 -1
- package/src/license/dependency-check/evaluator.js +55 -10
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/license/generator.js +3 -17
- package/src/license/generator.js.map +1 -1
- package/src/license/known-exceptions.d.ts +0 -1
- package/src/license/known-exceptions.js +1 -23
- package/src/license/known-exceptions.js.map +1 -1
- package/src/migrations/latest/apt-security-updates-in-container-images/__snapshots__/migration.spec.ts.snap +90 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/metadata.json +3 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/migration.js +90 -0
- package/src/migrations/latest/apt-security-updates-in-container-images/migration.js.map +1 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/metadata.json +3 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.d.ts +6 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.js +38 -0
- package/src/migrations/latest/remove-mcp-inspector-license-exceptions/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.67/0001-smithy-server-package-rename/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.68/0001-translate-script-whole-file-writes/migration.js.map +1 -0
- package/src/migrations/{latest/py-agent-a2a-lifespan-construction → v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction}/migration.js +14 -2
- package/src/migrations/v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/migration.d.ts +6 -0
- package/src/migrations/v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call/migration.js.map +1 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/metadata.json +3 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.d.ts +2 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.js +308 -0
- package/src/migrations/v1.0.0-rc.72/0001-py-agent-session-management-support/migration.js.map +1 -0
- package/src/preset/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/preset/generator.d.ts +1 -1
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +626 -10
- package/src/py/agent/__snapshots__/generator.core.spec.ts.snap +186 -0
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +55 -11
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +669 -4
- package/src/py/agent/a2a-connection/generator.js +5 -11
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/deploy/Dockerfile.template +7 -0
- package/src/py/agent/files/langchain/common/__init__.py.template +0 -0
- package/src/py/agent/files/langchain/common/agent.py.template +3 -3
- package/src/py/agent/files/langchain/common/session.py.template +61 -0
- package/src/py/agent/files/strands/ag-ui/main.py.template +5 -1
- package/src/py/agent/files/strands/common/agent.py.template +9 -2
- package/src/py/agent/files/strands/common/session.py.template +36 -0
- package/src/py/agent/generator.d.ts +11 -1
- package/src/py/agent/generator.js +78 -28
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +2 -0
- package/src/py/agent/react-connection/generator.d.ts +1 -1
- package/src/py/agent/schema.d.js.map +1 -1
- package/src/py/agent/schema.d.ts +1 -1
- package/src/py/agent/schema.json +3 -3
- package/src/py/fast-api/react/generator.d.ts +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/mcp-server/files/deploy/Dockerfile.template +7 -0
- package/src/py/mcp-server/generator.js +8 -3
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +7 -5
- package/src/py/rdb/generator.js +36 -2
- package/src/py/rdb/generator.js.map +1 -1
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +14 -14
- package/src/smithy/project/generator.d.ts +1 -1
- package/src/smithy/react-connection/generator.d.ts +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/terraform/project/generator.d.ts +1 -1
- package/src/trpc/react/generator.d.ts +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +36 -8
- package/src/ts/agent/a2a-connection/generator.d.ts +1 -1
- package/src/ts/agent/a2a-connection/generator.js +4 -2
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/deploy/Dockerfile.template +7 -0
- package/src/ts/agent/gateway-connection/generator.d.ts +1 -1
- package/src/ts/agent/mcp-connection/generator.d.ts +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +1 -1
- package/src/ts/astro-docs/generator.d.ts +1 -1
- package/src/ts/dcr-proxy/generator.d.ts +1 -1
- package/src/ts/dynamodb/generator.d.ts +1 -1
- package/src/ts/lambda-function/generator.d.ts +1 -1
- package/src/ts/lib/generator.d.ts +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/mcp-server/files/Dockerfile.template +7 -0
- package/src/ts/mcp-server/generator.js +8 -3
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/generator.d.ts +1 -1
- package/src/ts/nx-migration/generator.d.ts +1 -1
- package/src/ts/nx-plugin/generator.d.ts +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +8 -6
- package/src/ts/rdb/generator.d.ts +1 -1
- package/src/ts/rdb/generator.js +29 -2
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +15 -15
- package/src/ts/react-website/app/generator.js +4 -2
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
- package/src/utils/agent-connection/agent-connection.d.ts +10 -0
- package/src/utils/agent-connection/agent-connection.js +20 -9
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +5 -3
- package/src/utils/agent-connection/files/py-core-langchain/s3/s3_checkpoint_saver_langchain.py.template +360 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +2 -4
- package/src/utils/agent-connection/files/py-core-strands/base/tool_errors_strands.py.template +24 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +113 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +76 -7
- package/src/utils/ast.d.ts +29 -0
- package/src/utils/ast.js +31 -0
- package/src/utils/ast.js.map +1 -1
- package/src/utils/metrics.js +2 -2
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/versions.d.ts +75 -72
- package/src/utils/versions.js +72 -69
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/latest/py-agent-a2a-httpx-client-per-call/migration.js.map +0 -1
- package/src/migrations/latest/py-agent-a2a-lifespan-construction/migration.js.map +0 -1
- package/src/migrations/latest/smithy-server-package-rename/migration.js.map +0 -1
- package/src/migrations/latest/translate-script-whole-file-writes/migration.js.map +0 -1
- package/src/py/rdb/files/__name__/__init__.py.template +0 -3
- package/src/py/rdb/files/config.json.template +0 -14
- package/src/ts/rdb/files/config.json.template +0 -14
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- /package/src/migrations/latest/{py-agent-a2a-httpx-client-per-call → apt-security-updates-in-container-images}/migration.d.ts +0 -0
- /package/src/migrations/{latest/smithy-server-package-rename → v1.0.0-rc.67/0001-smithy-server-package-rename}/metadata.json +0 -0
- /package/src/migrations/{latest/py-agent-a2a-lifespan-construction → v1.0.0-rc.67/0001-smithy-server-package-rename}/migration.d.ts +0 -0
- /package/src/migrations/{latest/smithy-server-package-rename → v1.0.0-rc.67/0001-smithy-server-package-rename}/migration.js +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/build-system-prompt.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/build-user-prompt.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/config-path.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/file-to-translate.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/get-files-to-translate.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/header.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/log.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/main-call.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/main.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/project-root.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/run-with-concurrency.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/scripts-dir.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/files/translate-file-for-language.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/already-migrated.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/build-system-prompt.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/build-user-prompt.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/config-path.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/file-to-translate.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/get-files-to-translate.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/log.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/main-call.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/main.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/project-root.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/run-with-concurrency.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/grit/translate-file-for-language.grit +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/metadata.json +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/migration.d.ts +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/migration.js +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/test-fixtures/released-script-first.ts.fixture +0 -0
- /package/src/migrations/{latest/translate-script-whole-file-writes → v1.0.0-rc.68/0001-translate-script-whole-file-writes}/test-fixtures/released-script.ts.fixture +0 -0
- /package/src/migrations/{latest/py-agent-a2a-lifespan-construction → v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction}/metadata.json +0 -0
- /package/src/migrations/{latest/smithy-server-package-rename → v1.0.0-rc.70/0001-py-agent-a2a-lifespan-construction}/migration.d.ts +0 -0
- /package/src/migrations/{latest/py-agent-a2a-httpx-client-per-call → v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call}/metadata.json +0 -0
- /package/src/migrations/{latest/py-agent-a2a-httpx-client-per-call → v1.0.0-rc.71/0001-py-agent-a2a-httpx-client-per-call}/migration.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { relative } from 'node:path';\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n readProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport {\n addPyDependencies,\n addTsDependencies,\n} from '../../utils/add-dependencies';\nimport { addPythonBundleTarget } from '../../utils/bundle/bundle';\nimport { resolveContainers } from '../../utils/containers';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies';\nimport { addDockerScanTarget, DOCKER_DEPENDENCIES } from '../../utils/docker';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs';\nimport { resolveIac } from '../../utils/iac';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase, snakeCase, toClassName } from '../../utils/names';\nimport { getNpmScope } from '../../utils/npm-scope';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { assignPort } from '../../utils/port';\nimport { addRdbInfra } from '../../utils/rdb-constructs/rdb-constructs';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs';\nimport {\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_SCRIPTS_DIR,\n} from '../../utils/shared-constructs-constants';\nimport {\n SHARED_RDB_SCRIPTS_DEPENDENCIES,\n sharedRdbScriptsGenerator,\n} from '../../utils/shared-rdb-scripts';\nimport { PY_VERSIONS } from '../../utils/versions';\nimport pyProjectGenerator, { getPyProjectDetails } from '../project/generator';\nimport type { PyRdbGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyRdbMetadata extends IacMetadata {\n readonly engine: PyRdbGeneratorSchema['engine'];\n}\n\n/** The Postgres engine, which MySQL takes none of. */\nconst isPostgres = (m: PyRdbMetadata) => m.engine !== 'mysql';\n\n// Each entry names the engine branch it belongs to, so the same declaration\n// drives both adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<PyRdbMetadata>()({\n ts: [\n // The engine client the local dev script wait-for-*-db.ts imports.\n { name: 'mariadb', when: (m) => m.engine === 'mysql', root: true },\n { name: 'pg', when: isPostgres, root: true },\n { name: '@types/pg', when: isPostgres, dev: true, root: true },\n // Added by the helpers that own the projects they belong to.\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(DOCKER_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_RDB_SCRIPTS_DEPENDENCIES),\n ],\n py: [\n { name: 'sqlmodel' },\n { name: 'alembic' },\n // SQLAlchemy's async engine (used by connection.py for both engines)\n // requires greenlet at runtime. Vend it explicitly at a pinned version so\n // the dependency graph is fully determined and doesn't float to an\n // unpublished-wheel release at install time.\n { name: 'greenlet' },\n { name: 'aiomysql', when: (m) => m.engine === 'mysql' },\n { name: 'asyncpg', when: (m) => m.engine !== 'mysql' },\n { name: 'boto3' },\n { name: 'aws-lambda-powertools' },\n ],\n});\n\nexport const PY_RDB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const pyRdbGenerator = async (\n tree: Tree,\n options: PyRdbGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const nameClassName = toClassName(options.name);\n const databaseUser = options.databaseUser ?? 'dbadmin';\n const databaseName = snakeCase(options.databaseName ?? options.name);\n const containerEngine = await resolveContainers(tree, 'inherit');\n\n const { fullyQualifiedName, dir, normalizedModuleName } = getPyProjectDetails(\n tree,\n {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n },\n );\n\n if (!projectExists(tree, fullyQualifiedName)) {\n await pyProjectGenerator(tree, {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n type: 'library',\n });\n }\n\n const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);\n\n const { engine } = options;\n // Recorded in the metadata below so the version sync can tell a CDK project\n // from a Terraform one; undefined when no infrastructure was generated.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyRdbMetadata = { engine, ...(iac ? { iac } : {}) };\n const localDbPort = assignPort(\n tree,\n projectConfig,\n engine === 'mysql' ? 3306 : 5432,\n );\n const localDbHost = 'localhost';\n const localDbUser = engine === 'mysql' ? 'root' : 'dbadmin';\n const localDbPassword = 'password';\n const containerName = `${getNpmScope(tree)}-${databaseName}`;\n const dockerImage =\n engine === 'mysql'\n ? 'public.ecr.aws/docker/library/mysql:8.0.44'\n : 'public.ecr.aws/docker/library/postgres:17.7';\n\n const templateOptions = {\n name: normalizedModuleName,\n runtimeConfigKey: nameClassName,\n engine,\n localDbPort,\n localDbHost,\n localDbName: databaseName,\n localDbUser,\n localDbPassword,\n containerEngine,\n containerName,\n dockerImage,\n sqlmodelVersion: PY_VERSIONS.sqlmodel,\n alembicVersion: PY_VERSIONS.alembic,\n aiomysqlVersion: PY_VERSIONS.aiomysql,\n asyncpgVersion: PY_VERSIONS.asyncpg,\n boto3Version: PY_VERSIONS.boto3,\n awsLambdaPowertoolsVersion: PY_VERSIONS['aws-lambda-powertools'],\n };\n\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n dir,\n templateOptions,\n );\n\n await sharedRdbScriptsGenerator(tree, engine, DEPENDENCIES);\n const scriptsDir = relative(\n dir,\n joinPathFragments(PACKAGES_DIR, SHARED_SCRIPTS_DIR, 'src', 'rdb'),\n );\n const fs = new FsCommands(tree, DEPENDENCIES);\n\n const migrationBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'migration',\n );\n const createDbUserBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'create-db-user',\n );\n const migrationDockerImageTag = `${getNpmScope(tree)}-${kebabCase(options.name)}-migration:latest`;\n const createDbUserDockerImageTag = `${getNpmScope(tree)}-${kebabCase(\n options.name,\n )}-create-db-user:latest`;\n\n if (options.infra !== 'none') {\n const { bundleTargetName, bundleOutputDir } = addPythonBundleTarget(\n projectConfig,\n { pythonPlatform: 'aarch64-manylinux_2_28' },\n );\n\n projectConfig.targets['bundle-migration'] = {\n cache: true,\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/migration'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(migrationBundleDir),\n fs.mkdir(migrationBundleDir),\n fs.cp(bundleOutputDir, migrationBundleDir),\n fs.cp(\n joinPathFragments(dir, 'migrations'),\n joinPathFragments(migrationBundleDir, 'migrations'),\n ),\n fs.cp(\n joinPathFragments(dir, 'alembic.ini'),\n joinPathFragments(migrationBundleDir, 'alembic.ini'),\n ),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.migration'),\n joinPathFragments(migrationBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n projectConfig.targets['bundle-create-db-user'] = {\n cache: true,\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/create-db-user'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(createDbUserBundleDir),\n fs.mkdir(createDbUserBundleDir),\n fs.cp(bundleOutputDir, createDbUserBundleDir),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.create-db-user'),\n joinPathFragments(createDbUserBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-create-db-user',\n );\n }\n\n projectConfig.targets['pull-image'] = {\n executor: 'nx:run-commands',\n options: {\n command: `tsx ${scriptsDir}/pull-image.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets['dev'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `tsx ${scriptsDir}/start-container.ts`,\n cwd: '{projectRoot}',\n },\n dependsOn: ['pull-image'],\n };\n projectConfig.targets['wait-for-db'] = {\n executor: 'nx:run-commands',\n dependsOn: ['dev'],\n options: {\n command: `tsx ${scriptsDir}/wait-for-${engine}-db.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets.migrate = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic upgrade head',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n projectConfig.targets.alembic = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n\n if (options.infra !== 'none') {\n if (iac === 'terraform') {\n projectConfig.targets.docker = {\n cache: true,\n executor: 'nx:run-commands',\n options: {\n commands: [\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${migrationDockerImageTag} ${migrationBundleDir}`,\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${createDbUserDockerImageTag} ${createDbUserBundleDir}`,\n ],\n parallel: false,\n },\n dependsOn: ['bundle-migration', 'bundle-create-db-user'],\n };\n addDependencyToTargetIfNotPresent(projectConfig, 'build', 'docker');\n\n addDockerScanTarget(\n tree,\n {\n project: projectConfig,\n containerEngine,\n trivyTargetName: 'trivy',\n dockerTargetName: 'docker',\n imageTags: [migrationDockerImageTag, createDbUserDockerImageTag],\n },\n DEPENDENCIES,\n );\n }\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-create-db-user',\n );\n }\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfig);\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n PY_RDB_GENERATOR_INFO,\n metadata,\n );\n\n if (options.infra !== 'none') {\n await sharedConstructsGenerator(tree, { iac }, DEPENDENCIES);\n await addRdbInfra(tree, {\n iac,\n projectName: fullyQualifiedName,\n projectRoot: dir,\n nameClassName,\n nameKebabCase: kebabCase(options.name),\n databasePackageAlias: normalizedModuleName,\n databaseName,\n adminUser: databaseUser,\n engine,\n migrationBundleDir,\n createDbUserBundleDir,\n framework: 'sqlmodel',\n createDbUserDockerImageTag,\n migrationDockerImageTag,\n containerEngine,\n });\n }\n\n addPyDependencies(tree, DEPENDENCIES, { metadata, projectRoot: dir });\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [PY_RDB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default pyRdbGenerator;\n"],"names":["relative","generateFiles","joinPathFragments","readProjectConfiguration","updateProjectConfiguration","addPyDependencies","addTsDependencies","addPythonBundleTarget","resolveContainers","declareDependencies","ownedElsewhere","addDockerScanTarget","DOCKER_DEPENDENCIES","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","snakeCase","toClassName","getNpmScope","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","assignPort","addRdbInfra","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_SCRIPTS_DIR","SHARED_RDB_SCRIPTS_DEPENDENCIES","sharedRdbScriptsGenerator","PY_VERSIONS","pyProjectGenerator","getPyProjectDetails","isPostgres","m","engine","DEPENDENCIES","ts","name","when","root","dev","py","PY_RDB_GENERATOR_INFO","filename","pyRdbGenerator","tree","options","nameClassName","databaseUser","databaseName","containerEngine","fullyQualifiedName","dir","normalizedModuleName","directory","subDirectory","type","projectConfig","iac","infra","undefined","metadata","localDbPort","localDbHost","localDbUser","localDbPassword","containerName","dockerImage","templateOptions","runtimeConfigKey","localDbName","sqlmodelVersion","sqlmodel","alembicVersion","alembic","aiomysqlVersion","aiomysql","asyncpgVersion","asyncpg","boto3Version","boto3","awsLambdaPowertoolsVersion","dirname","scriptsDir","fs","migrationBundleDir","createDbUserBundleDir","migrationDockerImageTag","createDbUserDockerImageTag","bundleTargetName","bundleOutputDir","pythonPlatform","targets","cache","outputs","executor","commands","rm","mkdir","cp","parallel","dependsOn","command","cwd","continuous","migrate","env","LOCAL_DEV","docker","project","trivyTargetName","dockerTargetName","imageTags","projectName","projectRoot","nameKebabCase","databasePackageAlias","adminUser","framework","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAEEC,aAAa,EACbC,iBAAiB,EACjBC,wBAAwB,EAExBC,0BAA0B,QACrB,aAAa;AACpB,SACEC,iBAAiB,EACjBC,iBAAiB,QACZ,kCAA+B;AACtC,SAASC,qBAAqB,QAAQ,+BAA4B;AAClE,SAASC,iBAAiB,QAAQ,4BAAyB;AAC3D,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAoC;AAC3C,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,wBAAqB;AAC9E,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,eAAe,EAAEC,UAAU,QAAQ,oBAAiB;AAC7D,SAASC,UAAU,QAAQ,qBAAkB;AAC7C,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,EAAEC,SAAS,EAAEC,WAAW,QAAQ,uBAAoB;AACtE,SAASC,WAAW,QAAQ,2BAAwB;AACpD,SACEC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAiB;AACxB,SAASC,UAAU,QAAQ,sBAAmB;AAC9C,SAASC,WAAW,QAAQ,+CAA4C;AACxE,SACEC,8BAA8B,EAC9BC,yBAAyB,QACpB,mCAAgC;AACvC,SAEEC,YAAY,EACZC,kBAAkB,QACb,6CAA0C;AACjD,SACEC,+BAA+B,EAC/BC,y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AAE;YAC3DC,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAe5E,eAAe"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { relative } from 'node:path';\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n readProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n writeJson,\n} from '@nx/devkit';\nimport {\n addPyDependencies,\n addTsDependencies,\n} from '../../utils/add-dependencies';\nimport { addPythonReExport } from '../../utils/agent-connection/agent-connection';\nimport { addPythonBundleTarget } from '../../utils/bundle/bundle';\nimport { resolveContainers } from '../../utils/containers';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../utils/declared-dependencies';\nimport { addDockerScanTarget, DOCKER_DEPENDENCIES } from '../../utils/docker';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { FS_DEPENDENCIES, FsCommands } from '../../utils/fs';\nimport { resolveIac } from '../../utils/iac';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { kebabCase, snakeCase, toClassName } from '../../utils/names';\nimport { getNpmScope } from '../../utils/npm-scope';\nimport {\n addDependencyToTargetIfNotPresent,\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { assignPort } from '../../utils/port';\nimport { addRdbInfra } from '../../utils/rdb-constructs/rdb-constructs';\nimport {\n SHARED_CONSTRUCTS_DEPENDENCIES,\n sharedConstructsGenerator,\n} from '../../utils/shared-constructs';\nimport {\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_SCRIPTS_DIR,\n} from '../../utils/shared-constructs-constants';\nimport {\n SHARED_RDB_SCRIPTS_DEPENDENCIES,\n sharedRdbScriptsGenerator,\n} from '../../utils/shared-rdb-scripts';\nimport { PY_VERSIONS } from '../../utils/versions';\nimport pyProjectGenerator, { getPyProjectDetails } from '../project/generator';\nimport type { PyRdbGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyRdbMetadata extends IacMetadata {\n readonly engine: PyRdbGeneratorSchema['engine'];\n}\n\n/** The Postgres engine, which MySQL takes none of. */\nconst isPostgres = (m: PyRdbMetadata) => m.engine !== 'mysql';\n\n// Each entry names the engine branch it belongs to, so the same declaration\n// drives both adding and the version sync.\nexport const DEPENDENCIES = declareDependencies<PyRdbMetadata>()({\n ts: [\n // The engine client the local dev script wait-for-*-db.ts imports.\n { name: 'mariadb', when: (m) => m.engine === 'mysql', root: true },\n { name: 'pg', when: isPostgres, root: true },\n { name: '@types/pg', when: isPostgres, dev: true, root: true },\n // Added by the helpers that own the projects they belong to.\n ...ownedElsewhere(FS_DEPENDENCIES),\n ...ownedElsewhere(DOCKER_DEPENDENCIES),\n ...ownedElsewhere(SHARED_CONSTRUCTS_DEPENDENCIES),\n ...ownedElsewhere(SHARED_RDB_SCRIPTS_DEPENDENCIES),\n ],\n py: [\n { name: 'sqlmodel' },\n { name: 'alembic' },\n // SQLAlchemy's async engine (used by connection.py for both engines)\n // requires greenlet at runtime. Vend it explicitly at a pinned version so\n // the dependency graph is fully determined and doesn't float to an\n // unpublished-wheel release at install time.\n { name: 'greenlet' },\n { name: 'aiomysql', when: (m) => m.engine === 'mysql' },\n { name: 'asyncpg', when: (m) => m.engine !== 'mysql' },\n { name: 'boto3' },\n { name: 'aws-lambda-powertools' },\n ],\n});\n\nexport const PY_RDB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport const pyRdbGenerator = async (\n tree: Tree,\n options: PyRdbGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const nameClassName = toClassName(options.name);\n const databaseUser = options.databaseUser ?? 'dbadmin';\n const databaseName = snakeCase(options.databaseName ?? options.name);\n const containerEngine = await resolveContainers(tree, 'inherit');\n\n const { fullyQualifiedName, dir, normalizedModuleName } = getPyProjectDetails(\n tree,\n {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n },\n );\n\n if (!projectExists(tree, fullyQualifiedName)) {\n await pyProjectGenerator(tree, {\n name: options.name,\n directory: options.directory,\n subDirectory: options.subDirectory,\n type: 'library',\n });\n }\n\n const projectConfig = readProjectConfiguration(tree, fullyQualifiedName);\n\n const { engine } = options;\n // Recorded in the metadata below so the version sync can tell a CDK project\n // from a Terraform one; undefined when no infrastructure was generated.\n const iac =\n options.infra !== 'none' ? await resolveIac(tree, options.iac) : undefined;\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyRdbMetadata = { engine, ...(iac ? { iac } : {}) };\n const localDbPort = assignPort(\n tree,\n projectConfig,\n engine === 'mysql' ? 3306 : 5432,\n );\n const localDbHost = 'localhost';\n const localDbUser = engine === 'mysql' ? 'root' : 'dbadmin';\n const localDbPassword = 'password';\n const containerName = `${getNpmScope(tree)}-${databaseName}`;\n const dockerImage =\n engine === 'mysql'\n ? 'public.ecr.aws/docker/library/mysql:8.0.44'\n : 'public.ecr.aws/docker/library/postgres:17.7';\n\n const templateOptions = {\n name: normalizedModuleName,\n runtimeConfigKey: nameClassName,\n engine,\n localDbPort,\n localDbHost,\n localDbName: databaseName,\n localDbUser,\n localDbPassword,\n containerEngine,\n containerName,\n dockerImage,\n sqlmodelVersion: PY_VERSIONS.sqlmodel,\n alembicVersion: PY_VERSIONS.alembic,\n aiomysqlVersion: PY_VERSIONS.aiomysql,\n asyncpgVersion: PY_VERSIONS.asyncpg,\n boto3Version: PY_VERSIONS.boto3,\n awsLambdaPowertoolsVersion: PY_VERSIONS['aws-lambda-powertools'],\n };\n\n // Models, the connection module, the Alembic config and the migration env are\n // user-editable, so a re-run (to add infrastructure, or after a failed run)\n // must not clobber the user's schema and edits.\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n dir,\n templateOptions,\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // The package barrel re-exports connection.py. `pyProjectGenerator` writes a\n // stub __init__.py when it creates the project, so the re-exports are added to\n // whatever is there rather than replacing it — which also leaves a user's own\n // additions to the barrel alone on a re-run.\n const initFilePath = joinPathFragments(\n dir,\n normalizedModuleName,\n '__init__.py',\n );\n for (const importName of ['get_engine', 'is_local_dev', 'session_context']) {\n await addPythonReExport(tree, initFilePath, '.connection', importName);\n }\n\n // config.json is framework-owned: it carries values derived from the\n // generator's options, so it converges on a re-run with changed options.\n writeJson(tree, joinPathFragments(dir, 'config.json'), {\n runtimeConfigKey: nameClassName,\n localDev: {\n containerEngine,\n containerName,\n image: dockerImage,\n port: localDbPort,\n host: localDbHost,\n dbName: databaseName,\n dbUser: localDbUser,\n dbPassword: localDbPassword,\n dbEngine: engine,\n },\n });\n\n await sharedRdbScriptsGenerator(tree, engine, DEPENDENCIES);\n const scriptsDir = relative(\n dir,\n joinPathFragments(PACKAGES_DIR, SHARED_SCRIPTS_DIR, 'src', 'rdb'),\n );\n const fs = new FsCommands(tree, DEPENDENCIES);\n\n const migrationBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'migration',\n );\n const createDbUserBundleDir = joinPathFragments(\n 'dist',\n projectConfig.root,\n 'docker',\n 'create-db-user',\n );\n const migrationDockerImageTag = `${getNpmScope(tree)}-${kebabCase(options.name)}-migration:latest`;\n const createDbUserDockerImageTag = `${getNpmScope(tree)}-${kebabCase(\n options.name,\n )}-create-db-user:latest`;\n\n if (options.infra !== 'none') {\n const { bundleTargetName, bundleOutputDir } = addPythonBundleTarget(\n projectConfig,\n { pythonPlatform: 'aarch64-manylinux_2_28' },\n );\n\n projectConfig.targets['bundle-migration'] = {\n cache: true,\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/migration'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(migrationBundleDir),\n fs.mkdir(migrationBundleDir),\n fs.cp(bundleOutputDir, migrationBundleDir),\n fs.cp(\n joinPathFragments(dir, 'migrations'),\n joinPathFragments(migrationBundleDir, 'migrations'),\n ),\n fs.cp(\n joinPathFragments(dir, 'alembic.ini'),\n joinPathFragments(migrationBundleDir, 'alembic.ini'),\n ),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.migration'),\n joinPathFragments(migrationBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n projectConfig.targets['bundle-create-db-user'] = {\n cache: true,\n outputs: ['{workspaceRoot}/dist/{projectRoot}/docker/create-db-user'],\n executor: 'nx:run-commands',\n options: {\n commands: [\n fs.rm(createDbUserBundleDir),\n fs.mkdir(createDbUserBundleDir),\n fs.cp(bundleOutputDir, createDbUserBundleDir),\n fs.cp(\n joinPathFragments(dir, 'Dockerfile.create-db-user'),\n joinPathFragments(createDbUserBundleDir, 'Dockerfile'),\n ),\n ],\n parallel: false,\n },\n dependsOn: [bundleTargetName],\n };\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'bundle',\n 'bundle-create-db-user',\n );\n }\n\n projectConfig.targets['pull-image'] = {\n executor: 'nx:run-commands',\n options: {\n command: `tsx ${scriptsDir}/pull-image.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets['dev'] = {\n executor: 'nx:run-commands',\n continuous: true,\n options: {\n command: `tsx ${scriptsDir}/start-container.ts`,\n cwd: '{projectRoot}',\n },\n dependsOn: ['pull-image'],\n };\n projectConfig.targets['wait-for-db'] = {\n executor: 'nx:run-commands',\n dependsOn: ['dev'],\n options: {\n command: `tsx ${scriptsDir}/wait-for-${engine}-db.ts`,\n cwd: '{projectRoot}',\n },\n };\n projectConfig.targets.migrate = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic upgrade head',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n projectConfig.targets.alembic = {\n executor: 'nx:run-commands',\n dependsOn: ['dev', 'wait-for-db'],\n options: {\n command: 'uv run alembic',\n cwd: '{projectRoot}',\n env: {\n LOCAL_DEV: 'true',\n },\n },\n };\n\n if (options.infra !== 'none') {\n if (iac === 'terraform') {\n projectConfig.targets.docker = {\n cache: true,\n executor: 'nx:run-commands',\n options: {\n commands: [\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${migrationDockerImageTag} ${migrationBundleDir}`,\n `${containerEngine} build --platform linux/arm64 --provenance=false -t ${createDbUserDockerImageTag} ${createDbUserBundleDir}`,\n ],\n parallel: false,\n },\n dependsOn: ['bundle-migration', 'bundle-create-db-user'],\n };\n addDependencyToTargetIfNotPresent(projectConfig, 'build', 'docker');\n\n addDockerScanTarget(\n tree,\n {\n project: projectConfig,\n containerEngine,\n trivyTargetName: 'trivy',\n dockerTargetName: 'docker',\n imageTags: [migrationDockerImageTag, createDbUserDockerImageTag],\n },\n DEPENDENCIES,\n );\n }\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-migration',\n );\n addDependencyToTargetIfNotPresent(\n projectConfig,\n 'build',\n 'bundle-create-db-user',\n );\n }\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfig);\n addGeneratorMetadata(\n tree,\n fullyQualifiedName,\n PY_RDB_GENERATOR_INFO,\n metadata,\n );\n\n if (options.infra !== 'none') {\n await sharedConstructsGenerator(tree, { iac }, DEPENDENCIES);\n await addRdbInfra(tree, {\n iac,\n projectName: fullyQualifiedName,\n projectRoot: dir,\n nameClassName,\n nameKebabCase: kebabCase(options.name),\n databasePackageAlias: normalizedModuleName,\n databaseName,\n adminUser: databaseUser,\n engine,\n migrationBundleDir,\n createDbUserBundleDir,\n framework: 'sqlmodel',\n createDbUserDockerImageTag,\n migrationDockerImageTag,\n containerEngine,\n });\n }\n\n addPyDependencies(tree, DEPENDENCIES, { metadata, projectRoot: dir });\n addTsDependencies(tree, DEPENDENCIES, { metadata });\n\n await addGeneratorMetricsIfApplicable(tree, [PY_RDB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default pyRdbGenerator;\n"],"names":["relative","generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateProjectConfiguration","writeJson","addPyDependencies","addTsDependencies","addPythonReExport","addPythonBundleTarget","resolveContainers","declareDependencies","ownedElsewhere","addDockerScanTarget","DOCKER_DEPENDENCIES","formatFilesInSubtree","FS_DEPENDENCIES","FsCommands","resolveIac","installDependencies","addGeneratorMetricsIfApplicable","kebabCase","snakeCase","toClassName","getNpmScope","addDependencyToTargetIfNotPresent","addGeneratorMetadata","getGeneratorInfo","projectExists","assignPort","addRdbInfra","SHARED_CONSTRUCTS_DEPENDENCIES","sharedConstructsGenerator","PACKAGES_DIR","SHARED_SCRIPTS_DIR","SHARED_RDB_SCRIPTS_DEPENDENCIES","sharedRdbScriptsGenerator","PY_VERSIONS","pyProjectGenerator","getPyProjectDetails","isPostgres","m","engine","DEPENDENCIES","ts","name","when","root","dev","py","PY_RDB_GENERATOR_INFO","filename","pyRdbGenerator","tree","options","nameClassName","databaseUser","databaseName","containerEngine","fullyQualifiedName","dir","normalizedModuleName","directory","subDirectory","type","projectConfig","iac","infra","undefined","metadata","localDbPort","localDbHost","localDbUser","localDbPassword","containerName","dockerImage","templateOptions","runtimeConfigKey","localDbName","sqlmodelVersion","sqlmodel","alembicVersion","alembic","aiomysqlVersion","aiomysql","asyncpgVersion","asyncpg","boto3Version","boto3","awsLambdaPowertoolsVersion","dirname","overwriteStrategy","KeepExisting","initFilePath","importName","localDev","image","port","host","dbName","dbUser","dbPassword","dbEngine","scriptsDir","fs","migrationBundleDir","createDbUserBundleDir","migrationDockerImageTag","createDbUserDockerImageTag","bundleTargetName","bundleOutputDir","pythonPlatform","targets","cache","outputs","executor","commands","rm","mkdir","cp","parallel","dependsOn","command","cwd","continuous","migrate","env","LOCAL_DEV","docker","project","trivyTargetName","dockerTargetName","imageTags","projectName","projectRoot","nameKebabCase","databasePackageAlias","adminUser","framework","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAEEC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,wBAAwB,EAExBC,0BAA0B,EAC1BC,SAAS,QACJ,aAAa;AACpB,SACEC,iBAAiB,EACjBC,iBAAiB,QACZ,kCAA+B;AACtC,SAASC,iBAAiB,QAAQ,mDAAgD;AAClF,SAASC,qBAAqB,QAAQ,+BAA4B;AAClE,SAASC,iBAAiB,QAAQ,4BAAyB;AAC3D,SACEC,mBAAmB,EACnBC,cAAc,QACT,uCAAoC;AAC3C,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,wBAAqB;AAC9E,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,eAAe,EAAEC,UAAU,QAAQ,oBAAiB;AAC7D,SAASC,UAAU,QAAQ,qBAAkB;AAC7C,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,SAAS,EAAEC,SAAS,EAAEC,WAAW,QAAQ,uBAAoB;AACtE,SAASC,WAAW,QAAQ,2BAAwB;AACpD,SACEC,iCAAiC,EACjCC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAiB;AACxB,SAASC,UAAU,QAAQ,sBAAmB;AAC9C,SAASC,WAAW,QAAQ,+CAA4C;AACxE,SACEC,8BAA8B,EAC9BC,yBAAyB,QACpB,mCAAgC;AACvC,SAEEC,YAAY,EACZC,kBAAkB,QACb,6CAA0C;AACjD,SACEC,+BAA+B,EAC/BC,yBAAyB,QACpB,oCAAiC;AACxC,SAASC,WAAW,QAAQ,0BAAuB;AACnD,OAAOC,sBAAsBC,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AA0BqB,MAAM;YAAEa;QAAI,GAAGvB;QAC/C,MAAMb,YAAYuB,MAAM;YACtBa;YACAmE,aAAa1E;YACb2E,aAAa1E;YACbL;YACAgF,eAAelH,UAAUiC,QAAQT,IAAI;YACrC2F,sBAAsB3E;YACtBJ;YACAgF,WAAWjF;YACXd;YACA+D;YACAC;YACAgC,WAAW;YACX9B;YACAD;YACAjD;QACF;IACF;IAEApD,kBAAkB+C,MAAMV,cAAc;QAAE0B;QAAUiE,aAAa1E;IAAI;IACnErD,kBAAkB8C,MAAMV,cAAc;QAAE0B;IAAS;IAEjD,MAAMjD,gCAAgCiC,MAAM;QAACH;KAAsB;IAEnE,MAAMnC,qBAAqBsC;IAC3B,OAAO,IACLlC,oBAAoBkC,MAAMC,QAAQqF,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAexF,eAAe"}
|
|
@@ -42,7 +42,7 @@ exports[`smithyProjectGenerator > shape libraries > should generate a shape libr
|
|
|
42
42
|
"rimraf dist/{projectRoot}/build",
|
|
43
43
|
"rimraf dist/{projectRoot}/smithy",
|
|
44
44
|
"make-dir dist/{projectRoot}/build",
|
|
45
|
-
"npx -y mise@2026.8.
|
|
45
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
46
46
|
"ncp dist/{projectRoot}/smithy/source/model/model.json dist/{projectRoot}/build/model.json"
|
|
47
47
|
],
|
|
48
48
|
"parallel": false,
|
|
@@ -59,7 +59,7 @@ exports[`smithyProjectGenerator > shape libraries > should generate a shape libr
|
|
|
59
59
|
"version": "1.0",
|
|
60
60
|
"sources": ["src/"],
|
|
61
61
|
"maven": {
|
|
62
|
-
"dependencies": ["software.amazon.smithy:smithy-model:1.
|
|
62
|
+
"dependencies": ["software.amazon.smithy:smithy-model:1.73.0"]
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
"
|
|
@@ -116,7 +116,7 @@ exports[`smithyProjectGenerator > should generate smithy project with all custom
|
|
|
116
116
|
"rimraf dist/{projectRoot}/build",
|
|
117
117
|
"rimraf dist/{projectRoot}/smithy",
|
|
118
118
|
"make-dir dist/{projectRoot}/build",
|
|
119
|
-
"npx -y mise@2026.8.
|
|
119
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
120
120
|
"cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
|
|
121
121
|
],
|
|
122
122
|
"parallel": false,
|
|
@@ -170,7 +170,7 @@ exports[`smithyProjectGenerator > should generate smithy project with custom dir
|
|
|
170
170
|
"rimraf dist/{projectRoot}/build",
|
|
171
171
|
"rimraf dist/{projectRoot}/smithy",
|
|
172
172
|
"make-dir dist/{projectRoot}/build",
|
|
173
|
-
"npx -y mise@2026.8.
|
|
173
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
174
174
|
"cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
|
|
175
175
|
],
|
|
176
176
|
"parallel": false,
|
|
@@ -316,7 +316,7 @@ exports[`smithyProjectGenerator > should generate smithy project with default op
|
|
|
316
316
|
"rimraf dist/{projectRoot}/build",
|
|
317
317
|
"rimraf dist/{projectRoot}/smithy",
|
|
318
318
|
"make-dir dist/{projectRoot}/build",
|
|
319
|
-
"npx -y mise@2026.8.
|
|
319
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
320
320
|
"cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
|
|
321
321
|
],
|
|
322
322
|
"parallel": false,
|
|
@@ -360,10 +360,10 @@ exports[`smithyProjectGenerator > should generate smithy project with default op
|
|
|
360
360
|
},
|
|
361
361
|
"maven": {
|
|
362
362
|
"dependencies": [
|
|
363
|
-
"software.amazon.smithy:smithy-model:1.
|
|
364
|
-
"software.amazon.smithy:smithy-aws-traits:1.
|
|
365
|
-
"software.amazon.smithy:smithy-validation-model:1.
|
|
366
|
-
"software.amazon.smithy:smithy-openapi:1.
|
|
363
|
+
"software.amazon.smithy:smithy-model:1.73.0",
|
|
364
|
+
"software.amazon.smithy:smithy-aws-traits:1.73.0",
|
|
365
|
+
"software.amazon.smithy:smithy-validation-model:1.73.0",
|
|
366
|
+
"software.amazon.smithy:smithy-openapi:1.73.0",
|
|
367
367
|
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.52.0"
|
|
368
368
|
]
|
|
369
369
|
}
|
|
@@ -456,7 +456,7 @@ exports[`smithyProjectGenerator > should generate smithy project with subdirecto
|
|
|
456
456
|
"rimraf dist/{projectRoot}/build",
|
|
457
457
|
"rimraf dist/{projectRoot}/smithy",
|
|
458
458
|
"make-dir dist/{projectRoot}/build",
|
|
459
|
-
"npx -y mise@2026.8.
|
|
459
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
460
460
|
"cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
|
|
461
461
|
],
|
|
462
462
|
"parallel": false,
|
|
@@ -546,10 +546,10 @@ exports[`smithyProjectGenerator > should handle kebab-case conversion for servic
|
|
|
546
546
|
},
|
|
547
547
|
"maven": {
|
|
548
548
|
"dependencies": [
|
|
549
|
-
"software.amazon.smithy:smithy-model:1.
|
|
550
|
-
"software.amazon.smithy:smithy-aws-traits:1.
|
|
551
|
-
"software.amazon.smithy:smithy-validation-model:1.
|
|
552
|
-
"software.amazon.smithy:smithy-openapi:1.
|
|
549
|
+
"software.amazon.smithy:smithy-model:1.73.0",
|
|
550
|
+
"software.amazon.smithy:smithy-aws-traits:1.73.0",
|
|
551
|
+
"software.amazon.smithy:smithy-validation-model:1.73.0",
|
|
552
|
+
"software.amazon.smithy:smithy-openapi:1.73.0",
|
|
553
553
|
"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.52.0"
|
|
554
554
|
]
|
|
555
555
|
}
|
|
@@ -50,7 +50,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
50
50
|
readonly dev: true;
|
|
51
51
|
readonly root: true;
|
|
52
52
|
readonly when: (metadata: SmithyProjectMetadata) => boolean;
|
|
53
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
|
|
53
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
|
|
54
54
|
export declare const SMITHY_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
55
55
|
/**
|
|
56
56
|
* The commands that build a Smithy project's model, run from the workspace root.
|
|
@@ -19,7 +19,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
19
19
|
readonly name: "@tanstack/react-query-devtools";
|
|
20
20
|
}, {
|
|
21
21
|
readonly name: "@smithy/types";
|
|
22
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
22
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
23
23
|
export declare const SMITHY_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
24
24
|
export declare const smithyReactConnectionGenerator: (tree: Tree, options: SmithyReactConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
25
25
|
export default smithyReactConnectionGenerator;
|
|
@@ -1765,7 +1765,7 @@ exports[`tsSmithyApiGenerator > should generate smithy ts api with default optio
|
|
|
1765
1765
|
"rimraf dist/{projectRoot}/build",
|
|
1766
1766
|
"rimraf dist/{projectRoot}/smithy",
|
|
1767
1767
|
"make-dir dist/{projectRoot}/build",
|
|
1768
|
-
"npx -y mise@2026.8.
|
|
1768
|
+
"npx -y mise@2026.8.6 exec smithy@1.73.0 -- smithy build -c {projectRoot}/smithy-build.json --output dist/{projectRoot}/smithy",
|
|
1769
1769
|
"cpy \\"dist/{projectRoot}/smithy/source/openapi/*.openapi.json\\" dist/{projectRoot}/build/openapi --flat --rename=openapi.json"
|
|
1770
1770
|
],
|
|
1771
1771
|
"parallel": false,
|
|
@@ -54,7 +54,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
54
54
|
readonly name: "@types/node";
|
|
55
55
|
} & {
|
|
56
56
|
versionOnly: true;
|
|
57
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
57
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
58
58
|
export declare const TERRAFORM_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
59
59
|
export declare function terraformProjectGenerator(tree: Tree, schema: TerraformProjectGeneratorSchema): Promise<GeneratorCallback>;
|
|
60
60
|
export default terraformProjectGenerator;
|
|
@@ -41,7 +41,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
41
41
|
readonly name: "@types/event-source-polyfill";
|
|
42
42
|
readonly when: (m: TrpcReactMetadata) => boolean;
|
|
43
43
|
readonly dev: true;
|
|
44
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TrpcReactMetadata>[]>;
|
|
44
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TrpcReactMetadata>[]>;
|
|
45
45
|
export declare const TRPC_REACT_GENERATOR_INFO: NxGeneratorInfo;
|
|
46
46
|
export declare function reactGenerator(tree: Tree, options: ReactGeneratorSchema): Promise<() => Promise<void>>;
|
|
47
47
|
export default reactGenerator;
|
|
@@ -642,6 +642,13 @@ export const getSessionManager = async (): Promise<SessionManager> => {
|
|
|
642
642
|
exports[`ts#agent generator > should match snapshot for BedrockAgentCoreRuntime generated constructs files > agent-Dockerfile 1`] = `
|
|
643
643
|
"FROM public.ecr.aws/docker/library/node:lts-slim
|
|
644
644
|
|
|
645
|
+
# Apply the distribution's security updates: base image tags lag behind the
|
|
646
|
+
# security suite, so its OS packages carry fixed HIGH/CRITICAL vulnerabilities
|
|
647
|
+
# flagged by the image scan.
|
|
648
|
+
RUN apt-get update && \\
|
|
649
|
+
apt-get upgrade -y --no-install-recommends && \\
|
|
650
|
+
rm -rf /var/lib/apt/lists/*
|
|
651
|
+
|
|
645
652
|
# Upgrade npm to a version free of known HIGH/CRITICAL vulnerabilities
|
|
646
653
|
RUN npm install -g npm@12.0.2
|
|
647
654
|
|
|
@@ -714,7 +721,16 @@ export type SnapshotBedrockAgentProps = Omit<
|
|
|
714
721
|
| 'protocolConfiguration'
|
|
715
722
|
| 'agentRuntimeArtifact'
|
|
716
723
|
| 'authorizerConfiguration'
|
|
717
|
-
|
|
724
|
+
> & {
|
|
725
|
+
/**
|
|
726
|
+
* Removal policy for the session bucket holding the agent's conversation
|
|
727
|
+
* history. Defaults to retaining it so a stack \`destroy\` doesn't silently
|
|
728
|
+
* delete session data — set to \`RemovalPolicy.DESTROY\` for sandbox/CI teardown.
|
|
729
|
+
*
|
|
730
|
+
* @default RemovalPolicy.RETAIN
|
|
731
|
+
*/
|
|
732
|
+
readonly sessionBucketRemovalPolicy?: RemovalPolicy;
|
|
733
|
+
};
|
|
718
734
|
|
|
719
735
|
export class SnapshotBedrockAgent
|
|
720
736
|
extends Construct
|
|
@@ -742,6 +758,9 @@ export class SnapshotBedrockAgent
|
|
|
742
758
|
platform: Platform.LINUX_ARM64,
|
|
743
759
|
});
|
|
744
760
|
|
|
761
|
+
const { sessionBucketRemovalPolicy = RemovalPolicy.RETAIN, ...restProps } =
|
|
762
|
+
props ?? {};
|
|
763
|
+
|
|
745
764
|
const sessionKey = new Key(this, 'SessionKey', {
|
|
746
765
|
enableKeyRotation: true,
|
|
747
766
|
});
|
|
@@ -778,7 +797,7 @@ export class SnapshotBedrockAgent
|
|
|
778
797
|
|
|
779
798
|
const sessionBucket = new Bucket(this, 'SessionBucket', {
|
|
780
799
|
enforceSSL: true,
|
|
781
|
-
removalPolicy:
|
|
800
|
+
removalPolicy: sessionBucketRemovalPolicy,
|
|
782
801
|
encryption: BucketEncryption.KMS,
|
|
783
802
|
encryptionKey: sessionKey,
|
|
784
803
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
@@ -854,10 +873,10 @@ export class SnapshotBedrockAgent
|
|
|
854
873
|
}),
|
|
855
874
|
protocolConfiguration: ProtocolType.HTTP,
|
|
856
875
|
agentRuntimeArtifact: this.dockerImage,
|
|
857
|
-
...
|
|
876
|
+
...restProps,
|
|
858
877
|
environmentVariables: {
|
|
859
878
|
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
860
|
-
...
|
|
879
|
+
...restProps?.environmentVariables,
|
|
861
880
|
},
|
|
862
881
|
});
|
|
863
882
|
|
|
@@ -883,7 +902,9 @@ export class SnapshotBedrockAgent
|
|
|
883
902
|
...rc.get('agentcore').agentRuntimes,
|
|
884
903
|
SnapshotBedrockAgent: {
|
|
885
904
|
arn: this.agentCoreRuntime.agentRuntimeArn,
|
|
886
|
-
session: {
|
|
905
|
+
session: {
|
|
906
|
+
bucketName: sessionBucket.bucketName,
|
|
907
|
+
},
|
|
887
908
|
},
|
|
888
909
|
});
|
|
889
910
|
}
|
|
@@ -1014,6 +1035,12 @@ variable "appconfig_application_id" {
|
|
|
1014
1035
|
type = string
|
|
1015
1036
|
}
|
|
1016
1037
|
|
|
1038
|
+
variable "session_force_destroy" {
|
|
1039
|
+
description = "Whether to allow the session bucket to be destroyed even if it still contains objects."
|
|
1040
|
+
type = bool
|
|
1041
|
+
default = false
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1017
1044
|
variable "appconfig_application_arn" {
|
|
1018
1045
|
description = "ARN of the shared runtime-config AppConfig application (from \`core/runtime-config/appconfig.application_arn\`). Used to scope the IAM read permission granted to the agent runtime."
|
|
1019
1046
|
type = string
|
|
@@ -1085,12 +1112,13 @@ resource "aws_cloudwatch_log_group" "session_access_logs" {
|
|
|
1085
1112
|
|
|
1086
1113
|
# Bucket storing the agent's session data
|
|
1087
1114
|
resource "aws_s3_bucket" "session" {
|
|
1115
|
+
bucket = "terraform-snapshot-agent-sessions-\${random_id.session_unique_suffix.hex}"
|
|
1088
1116
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for session data
|
|
1089
1117
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for session data
|
|
1090
1118
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for session data
|
|
1091
1119
|
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.session)
|
|
1092
1120
|
#checkov:skip=CKV_AWS_21:Session data does not need versioning enabled
|
|
1093
|
-
force_destroy =
|
|
1121
|
+
force_destroy = var.session_force_destroy
|
|
1094
1122
|
}
|
|
1095
1123
|
|
|
1096
1124
|
resource "aws_s3_bucket_server_side_encryption_configuration" "session" {
|
|
@@ -1267,7 +1295,7 @@ exports[`ts#agent generator > should match snapshot for Terraform generated file
|
|
|
1267
1295
|
}
|
|
1268
1296
|
null = {
|
|
1269
1297
|
source = "hashicorp/null"
|
|
1270
|
-
version = "3.3.
|
|
1298
|
+
version = "3.3.1"
|
|
1271
1299
|
}
|
|
1272
1300
|
random = {
|
|
1273
1301
|
source = "hashicorp/random"
|
|
@@ -1679,7 +1707,7 @@ resource "null_resource" "runtime_ready" {
|
|
|
1679
1707
|
|
|
1680
1708
|
provisioner "local-exec" {
|
|
1681
1709
|
command = <<-EOT
|
|
1682
|
-
uv run --with boto3==1.43.
|
|
1710
|
+
uv run --with boto3==1.43.72 python -c "
|
|
1683
1711
|
import boto3
|
|
1684
1712
|
import json
|
|
1685
1713
|
import os
|
|
@@ -50,7 +50,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies"
|
|
|
50
50
|
readonly name: "@strands-agents/sdk";
|
|
51
51
|
} & {
|
|
52
52
|
versionOnly: true;
|
|
53
|
-
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
53
|
+
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
54
54
|
export declare const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
55
55
|
export declare const tsAgentA2aConnectionGenerator: (tree: Tree, options: TsAgentA2aConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
56
56
|
export default tsAgentA2aConnectionGenerator;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/ import { generateFiles, joinPathFragments, OverwriteStrategy, updateProjectConfiguration } from "@nx/devkit";
|
|
5
5
|
import { addTsDependencies } from "../../../utils/add-dependencies.js";
|
|
6
6
|
import { AGENT_CONNECTION_DEPENDENCIES, AGENT_CONNECTION_PROJECT_DIR, addTypeScriptCoreClient, ensureTypeScriptAgentConnectionProject } from "../../../utils/agent-connection/agent-connection.js";
|
|
7
|
-
import { addDestructuredImport, addStarExport, applyGritQL } from "../../../utils/ast.js";
|
|
7
|
+
import { addDestructuredImport, addStarExport, appendToArrayViaGritQL, applyGritQL } from "../../../utils/ast.js";
|
|
8
8
|
import { declareDependencies, ownedElsewhere } from "../../../utils/declared-dependencies.js";
|
|
9
9
|
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
10
10
|
import { installDependencies } from "../../../utils/install.js";
|
|
@@ -123,7 +123,9 @@ export const tsAgentA2aConnectionGenerator = async (tree, options)=>{
|
|
|
123
123
|
$body
|
|
124
124
|
}\` where { $body <: contains \`new Agent($_)\`, $program <: not contains \`${clientClassName}.create\` } }`);
|
|
125
125
|
// Append the tool to the tools array (after existing items)
|
|
126
|
-
await
|
|
126
|
+
await appendToArrayViaGritQL(tree, agentFilePath, 'tools:', toolVarName, {
|
|
127
|
+
scope: 'new Agent($_)'
|
|
128
|
+
});
|
|
127
129
|
}
|
|
128
130
|
// 4. Set up dev target — depend on the target agent's dev
|
|
129
131
|
// so running the host's dev also spins up the remote A2A agent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/ts/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 { addTsDependencies } from '../../../utils/add-dependencies';\nimport {\n AGENT_CONNECTION_DEPENDENCIES,\n AGENT_CONNECTION_PROJECT_DIR,\n addTypeScriptCoreClient,\n ensureTypeScriptAgentConnectionProject,\n} from '../../../utils/agent-connection/agent-connection';\nimport {\n addDestructuredImport,\n addStarExport,\n applyGritQL,\n} from '../../../utils/ast';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies';\nimport { formatFilesInSubtree } from '../../../utils/format';\nimport { installDependencies } from '../../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics';\nimport { esmVars } from '../../../utils/module-format';\nimport { kebabCase } from '../../../utils/names';\nimport { getNpmScope } from '../../../utils/npm-scope';\nimport {\n addComponentGeneratorMetadata,\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx';\nimport { toProjectRelativePath } from '../../../utils/paths';\nimport type { TsAgentA2aConnectionGeneratorSchema } from './schema';\n\n// The A2A core client + vended client need these whatever the connection's\n// options, so no entry is conditional.\n// The A2A client the generated agent code imports, plus the AppConfig lookup and\n// sigv4 signing it resolves the remote agent with. Added to the workspace root,\n// where this connection has always put them.\nexport const DEPENDENCIES = declareDependencies()({\n ts: [\n { name: '@a2a-js/sdk', root: true },\n { name: '@strands-agents/sdk', root: true },\n { name: '@aws-lambda-powertools/parameters', root: true },\n { name: '@aws-sdk/client-appconfigdata', root: true },\n { name: 'aws4fetch', root: true },\n { name: '@aws-sdk/credential-providers', root: true },\n { name: 'zod', root: true },\n ...ownedElsewhere(AGENT_CONNECTION_DEPENDENCIES),\n ],\n});\n\nexport const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const tsAgentA2aConnectionGenerator = async (\n tree: Tree,\n options: TsAgentA2aConnectionGeneratorSchema,\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 ts#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 targetAgentKebabCase = kebabCase(targetAgentClassName);\n const targetAgentPort = targetAgentComponent.port ?? 9000;\n\n const npmScope = getNpmScope(tree);\n\n // 1. Ensure the shared agent-connection project exists + has the A2A core client\n await ensureTypeScriptAgentConnectionProject(tree, DEPENDENCIES);\n await addTypeScriptCoreClient(tree, 'a2a', DEPENDENCIES);\n\n // 2. Generate the per-connection <Name>Client into app/\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'agent-connection', 'app'),\n joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'src', 'app'),\n {\n targetAgentKebabCase,\n targetAgentClassName,\n targetAgentPort,\n ...esmVars(tree),\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // Add re-export to index.ts\n await addStarExport(\n tree,\n joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'),\n `./app/${targetAgentKebabCase}-client-strands.js`,\n );\n\n // 3. AST transform agent.ts to add the remote A2A agent as a tool\n const agentSourceDir = joinPathFragments(\n sourceProject.root,\n agentComponent.path ?? 'src',\n );\n const agentFilePath = joinPathFragments(agentSourceDir, 'agent.ts');\n\n if (tree.exists(agentFilePath)) {\n const clientClassName = `${targetAgentClassName}ClientStrands`;\n const clientVarName =\n targetAgentClassName.charAt(0).toLowerCase() +\n targetAgentClassName.slice(1);\n const toolName = `ask${targetAgentClassName}`;\n const toolVarName = `${clientVarName}Tool`;\n\n // Ensure tool + z imports are available\n await addDestructuredImport(\n tree,\n agentFilePath,\n ['tool'],\n '@strands-agents/sdk',\n );\n await addDestructuredImport(tree, agentFilePath, ['z'], 'zod');\n await addDestructuredImport(\n tree,\n agentFilePath,\n [clientClassName],\n `@${npmScope}/agent-connection`,\n );\n\n // Build the tool creation + Agent wiring.\n const toolCreationBlock = `const ${clientVarName} = await ${clientClassName}.create();\n const ${toolVarName} = tool({\n name: '${toolName}',\n description: 'Delegate a question to the remote ${targetAgentClassName} A2A agent and return its reply.',\n inputSchema: z.object({ prompt: z.string() }),\n callback: async ({ prompt }) => (await ${clientVarName}.invoke(prompt)).toString(),\n });`;\n\n // Transform the arrow function that contains `new Agent`:\n // - Expression body: wrap in block with tool creation and return\n // - Block body: prepend tool creation statement\n await applyGritQL(\n tree,\n agentFilePath,\n `or { \\`async ($p) => new Agent($args)\\` => raw\\`async ($p) => {\n ${toolCreationBlock}\n return new Agent($args);\n}\\` where { $program <: not contains \\`${clientClassName}.create\\` }, \\`async ($p) => { $body }\\` => raw\\`async ($p) => {\n ${toolCreationBlock}\n $body\n}\\` where { $body <: contains \\`new Agent($_)\\`, $program <: not contains \\`${clientClassName}.create\\` } }`,\n );\n\n // Append the tool to the tools array (after existing items)\n await applyGritQL(\n tree,\n agentFilePath,\n `\\`tools: [$items]\\` => \\`tools: [$items, ${toolVarName}]\\` where { $items <: within \\`new Agent($_)\\`, $items <: not contains \\`${toolVarName}\\` }`,\n );\n }\n\n // 4. Set up dev target — depend on the target agent's dev\n // so running the host's dev also spins up the remote A2A 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 // 5. Add dependencies to the workspace root manifest\n addTsDependencies(tree, DEPENDENCIES);\n\n // Recorded so the version sync knows this connection's dependencies are ours.\n addComponentGeneratorMetadata(\n tree,\n sourceProject.name,\n TS_AGENT_A2A_CONNECTION_GENERATOR_INFO,\n toProjectRelativePath(sourceProject, agentFilePath),\n targetAgentClassName,\n // The source component this connection is made from, so the pair is\n // identifiable rather than just the two projects.\n { sourcePath: options.sourceComponent?.path },\n );\n\n await addGeneratorMetricsIfApplicable(tree, [\n TS_AGENT_A2A_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default tsAgentA2aConnectionGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addTsDependencies","AGENT_CONNECTION_DEPENDENCIES","AGENT_CONNECTION_PROJECT_DIR","addTypeScriptCoreClient","ensureTypeScriptAgentConnectionProject","addDestructuredImport","addStarExport","applyGritQL","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","kebabCase","getNpmScope","addComponentGeneratorMetadata","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","toProjectRelativePath","DEPENDENCIES","ts","name","root","TS_AGENT_A2A_CONNECTION_GENERATOR_INFO","filename","tsAgentA2aConnectionGenerator","tree","options","sourceProject","targetProject","agentComponent","sourceComponent","targetAgentComponent","targetComponent","Error","protocol","toLowerCase","auth","targetAgentComponentName","targetAgentClassName","rc","targetAgentKebabCase","targetAgentPort","port","npmScope","dirname","overwriteStrategy","KeepExisting","agentSourceDir","path","agentFilePath","exists","clientClassName","clientVarName","charAt","slice","toolName","toolVarName","toolCreationBlock","agentName","devTargetName","targetDevTargetName","targets","projects","target","sourcePath","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,iBAAiB,QAAQ,qCAAkC;AACpE,SACEC,6BAA6B,EAC7BC,4BAA4B,EAC5BC,uBAAuB,EACvBC,sCAAsC,QACjC,sDAAmD;AAC1D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,WAAW,QACN,wBA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kBAAkB4B,MAAMP;IAExB,8EAA8E;IAC9EL,8BACEY,MACAE,cAAcP,IAAI,EAClBE,wCACAL,sBAAsBU,eAAesB,gBACrCX,sBACA,oEAAoE;IACpE,kDAAkD;IAClD;QAAE0B,YAAYtC,QAAQI,eAAe,EAAEkB;IAAK;IAG9C,MAAMvC,gCAAgCgB,MAAM;QAC1CH;KACD;IAED,MAAMf,qBAAqBkB;IAC3B,OAAO,IACLjB,oBAAoBiB,MAAMC,QAAQuC,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,eAAe1C,8BAA8B"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/ts/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 { addTsDependencies } from '../../../utils/add-dependencies';\nimport {\n AGENT_CONNECTION_DEPENDENCIES,\n AGENT_CONNECTION_PROJECT_DIR,\n addTypeScriptCoreClient,\n ensureTypeScriptAgentConnectionProject,\n} from '../../../utils/agent-connection/agent-connection';\nimport {\n addDestructuredImport,\n addStarExport,\n appendToArrayViaGritQL,\n applyGritQL,\n} from '../../../utils/ast';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies';\nimport { formatFilesInSubtree } from '../../../utils/format';\nimport { installDependencies } from '../../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics';\nimport { esmVars } from '../../../utils/module-format';\nimport { kebabCase } from '../../../utils/names';\nimport { getNpmScope } from '../../../utils/npm-scope';\nimport {\n addComponentGeneratorMetadata,\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx';\nimport { toProjectRelativePath } from '../../../utils/paths';\nimport type { TsAgentA2aConnectionGeneratorSchema } from './schema';\n\n// The A2A core client + vended client need these whatever the connection's\n// options, so no entry is conditional.\n// The A2A client the generated agent code imports, plus the AppConfig lookup and\n// sigv4 signing it resolves the remote agent with. Added to the workspace root,\n// where this connection has always put them.\nexport const DEPENDENCIES = declareDependencies()({\n ts: [\n { name: '@a2a-js/sdk', root: true },\n { name: '@strands-agents/sdk', root: true },\n { name: '@aws-lambda-powertools/parameters', root: true },\n { name: '@aws-sdk/client-appconfigdata', root: true },\n { name: 'aws4fetch', root: true },\n { name: '@aws-sdk/credential-providers', root: true },\n { name: 'zod', root: true },\n ...ownedElsewhere(AGENT_CONNECTION_DEPENDENCIES),\n ],\n});\n\nexport const TS_AGENT_A2A_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const tsAgentA2aConnectionGenerator = async (\n tree: Tree,\n options: TsAgentA2aConnectionGeneratorSchema,\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 ts#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 targetAgentKebabCase = kebabCase(targetAgentClassName);\n const targetAgentPort = targetAgentComponent.port ?? 9000;\n\n const npmScope = getNpmScope(tree);\n\n // 1. Ensure the shared agent-connection project exists + has the A2A core client\n await ensureTypeScriptAgentConnectionProject(tree, DEPENDENCIES);\n await addTypeScriptCoreClient(tree, 'a2a', DEPENDENCIES);\n\n // 2. Generate the per-connection <Name>Client into app/\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'agent-connection', 'app'),\n joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'src', 'app'),\n {\n targetAgentKebabCase,\n targetAgentClassName,\n targetAgentPort,\n ...esmVars(tree),\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n // Add re-export to index.ts\n await addStarExport(\n tree,\n joinPathFragments(AGENT_CONNECTION_PROJECT_DIR, 'src', 'index.ts'),\n `./app/${targetAgentKebabCase}-client-strands.js`,\n );\n\n // 3. AST transform agent.ts to add the remote A2A agent as a tool\n const agentSourceDir = joinPathFragments(\n sourceProject.root,\n agentComponent.path ?? 'src',\n );\n const agentFilePath = joinPathFragments(agentSourceDir, 'agent.ts');\n\n if (tree.exists(agentFilePath)) {\n const clientClassName = `${targetAgentClassName}ClientStrands`;\n const clientVarName =\n targetAgentClassName.charAt(0).toLowerCase() +\n targetAgentClassName.slice(1);\n const toolName = `ask${targetAgentClassName}`;\n const toolVarName = `${clientVarName}Tool`;\n\n // Ensure tool + z imports are available\n await addDestructuredImport(\n tree,\n agentFilePath,\n ['tool'],\n '@strands-agents/sdk',\n );\n await addDestructuredImport(tree, agentFilePath, ['z'], 'zod');\n await addDestructuredImport(\n tree,\n agentFilePath,\n [clientClassName],\n `@${npmScope}/agent-connection`,\n );\n\n // Build the tool creation + Agent wiring.\n const toolCreationBlock = `const ${clientVarName} = await ${clientClassName}.create();\n const ${toolVarName} = tool({\n name: '${toolName}',\n description: 'Delegate a question to the remote ${targetAgentClassName} A2A agent and return its reply.',\n inputSchema: z.object({ prompt: z.string() }),\n callback: async ({ prompt }) => (await ${clientVarName}.invoke(prompt)).toString(),\n });`;\n\n // Transform the arrow function that contains `new Agent`:\n // - Expression body: wrap in block with tool creation and return\n // - Block body: prepend tool creation statement\n await applyGritQL(\n tree,\n agentFilePath,\n `or { \\`async ($p) => new Agent($args)\\` => raw\\`async ($p) => {\n ${toolCreationBlock}\n return new Agent($args);\n}\\` where { $program <: not contains \\`${clientClassName}.create\\` }, \\`async ($p) => { $body }\\` => raw\\`async ($p) => {\n ${toolCreationBlock}\n $body\n}\\` where { $body <: contains \\`new Agent($_)\\`, $program <: not contains \\`${clientClassName}.create\\` } }`,\n );\n\n // Append the tool to the tools array (after existing items)\n await appendToArrayViaGritQL(tree, agentFilePath, 'tools:', toolVarName, {\n scope: 'new Agent($_)',\n });\n }\n\n // 4. Set up dev target — depend on the target agent's dev\n // so running the host's dev also spins up the remote A2A 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 // 5. Add dependencies to the workspace root manifest\n addTsDependencies(tree, DEPENDENCIES);\n\n // Recorded so the version sync knows this connection's dependencies are ours.\n addComponentGeneratorMetadata(\n tree,\n sourceProject.name,\n TS_AGENT_A2A_CONNECTION_GENERATOR_INFO,\n toProjectRelativePath(sourceProject, agentFilePath),\n targetAgentClassName,\n // The source component this connection is made from, so the pair is\n // identifiable rather than just the two projects.\n { sourcePath: options.sourceComponent?.path },\n );\n\n await addGeneratorMetricsIfApplicable(tree, [\n TS_AGENT_A2A_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default tsAgentA2aConnectionGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","addTsDependencies","AGENT_CONNECTION_DEPENDENCIES","AGENT_CONNECTION_PROJECT_DIR","addTypeScriptCoreClient","ensureTypeScriptAgentConnectionProject","addDestructuredImport","addStarExport","appendToArrayViaGritQL","applyGritQL","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","esmVars","kebabCase","getNpmScope","addComponentGeneratorMetadata","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","toProjectRelativePath","DEPENDENCIES","ts","name","root","TS_AGENT_A2A_CONNECTION_GENERATOR_INFO","filename","tsAgentA2aConnectionGenerator","tree","options","sourceProject","targetProject","agentComponent","sourceComponent","targetAgentComponent","targetComponent","Error","protocol","toLowerCase","auth","targetAgentComponentName","targetAgentClassName","rc","targetAgentKebabCase","targetAgentPort","port","npmScope","dirname","overwriteStrategy","KeepExisting","agentSourceDir","path","agentFilePath","exists","clientClassName","clientVarName","charAt","slice","toolName","toolVarName","toolCreationBlock","scope","agentName","devTargetName","targetDevTargetName","targets","projects","target","sourcePath","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAEjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,iBAAiB,QAAQ,qCAAkC;AACpE,SACEC,6BAA6B,EAC7BC,4BAA4B,EAC5BC,uBAAuB,EACvBC,sCAAsC,QACjC,sDAAmD;AAC1D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,sBAAsB,EACtBC,WAAW,QACN,wBAAqB;AAC5B,SACEC,mBAAmB,EACnBC,cAAc,QACT,0CAAuC;AAC9C,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAAyB;AAC7D,SAASC,+BAA+B,QAAQ,4BAAyB;AACzE,SAASC,OAAO,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CAAgCgB,MAAM;QAC1CH;KACD;IAED,MAAMf,qBAAqBkB;IAC3B,OAAO,IACLjB,oBAAoBiB,MAAMC,QAAQwC,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,eAAe3C,8BAA8B"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
FROM <%- nodeBaseImage %>
|
|
2
2
|
|
|
3
|
+
# Apply the distribution's security updates: base image tags lag behind the
|
|
4
|
+
# security suite, so its OS packages carry fixed HIGH/CRITICAL vulnerabilities
|
|
5
|
+
# flagged by the image scan.
|
|
6
|
+
RUN apt-get update && \
|
|
7
|
+
apt-get upgrade -y --no-install-recommends && \
|
|
8
|
+
rm -rf /var/lib/apt/lists/*
|
|
9
|
+
|
|
3
10
|
# Upgrade npm to a version free of known HIGH/CRITICAL vulnerabilities
|
|
4
11
|
RUN npm install -g npm@<%- npmVersion %>
|
|
5
12
|
|
|
@@ -41,7 +41,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies"
|
|
|
41
41
|
readonly name: "@strands-agents/sdk";
|
|
42
42
|
} & {
|
|
43
43
|
versionOnly: true;
|
|
44
|
-
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
44
|
+
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
45
45
|
export declare const TS_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
46
46
|
export declare const tsAgentGatewayConnectionGenerator: (tree: Tree, options: TsAgentGatewayConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
47
47
|
export default tsAgentGatewayConnectionGenerator;
|
|
@@ -41,7 +41,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies"
|
|
|
41
41
|
readonly name: "@strands-agents/sdk";
|
|
42
42
|
} & {
|
|
43
43
|
versionOnly: true;
|
|
44
|
-
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
44
|
+
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
45
45
|
export declare const TS_AGENT_MCP_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
46
46
|
export declare const tsAgentMcpConnectionGenerator: (tree: Tree, options: TsAgentMcpConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
47
47
|
export default tsAgentMcpConnectionGenerator;
|
|
@@ -190,7 +190,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies"
|
|
|
190
190
|
when: (m: TsAgentReactConnectionMetadata) => boolean;
|
|
191
191
|
} & {
|
|
192
192
|
versionOnly: true;
|
|
193
|
-
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TsAgentReactConnectionMetadata>[]>;
|
|
193
|
+
}], readonly import("../../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TsAgentReactConnectionMetadata>[]>;
|
|
194
194
|
export declare const TS_AGENT_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
195
195
|
/**
|
|
196
196
|
* Options for routing the website's requests to the agent through an
|
|
@@ -42,7 +42,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
42
42
|
readonly when: (m: TsAstroDocsMetadata) => boolean;
|
|
43
43
|
readonly dev: true;
|
|
44
44
|
readonly root: true;
|
|
45
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TsAstroDocsMetadata>[]>;
|
|
45
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TsAstroDocsMetadata>[]>;
|
|
46
46
|
export declare const TS_ASTRO_DOCS_GENERATOR_INFO: NxGeneratorInfo;
|
|
47
47
|
export declare const tsAstroDocsGenerator: (tree: Tree, schema: TsAstroDocsGeneratorSchema) => Promise<GeneratorCallback>;
|
|
48
48
|
export default tsAstroDocsGenerator;
|
|
@@ -28,7 +28,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
28
28
|
readonly name: "@types/node";
|
|
29
29
|
} & {
|
|
30
30
|
versionOnly: true;
|
|
31
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
31
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
32
32
|
export declare const TS_DCR_PROXY_GENERATOR_INFO: NxGeneratorInfo;
|
|
33
33
|
export declare const tsDcrProxyGenerator: (tree: Tree, options: TsDcrProxyGeneratorSchema) => Promise<GeneratorCallback>;
|
|
34
34
|
export default tsDcrProxyGenerator;
|
|
@@ -45,7 +45,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies").D
|
|
|
45
45
|
readonly name: "tsx";
|
|
46
46
|
} & {
|
|
47
47
|
versionOnly: true;
|
|
48
|
-
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
48
|
+
}], readonly import("../../utils/declared-dependencies").DeclaredPyDependency<"a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "ruff" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
49
49
|
export declare const TS_DYNAMODB_GENERATOR_INFO: NxGeneratorInfo;
|
|
50
50
|
export declare const tsDynamoDBGenerator: (tree: Tree, options: TsDynamoDBGeneratorSchema) => Promise<GeneratorCallback>;
|
|
51
51
|
export default tsDynamoDBGenerator;
|