@aws/nx-plugin 1.0.0-rc.2 → 1.0.0-rc.21
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 +3552 -4179
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +100 -1
- package/package.json +16 -12
- package/sdk/agentcore-gateway.d.ts +6 -0
- package/sdk/agentcore-gateway.js +11 -0
- package/sdk/agentcore-gateway.js.map +1 -0
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +14 -0
- package/sdk/license.js.map +1 -0
- package/sdk/py.d.ts +6 -6
- package/sdk/py.js +7 -7
- package/sdk/py.js.map +1 -1
- package/sdk/ts.d.ts +18 -14
- package/sdk/ts.js +38 -32
- package/sdk/ts.js.map +1 -1
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +41 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/cedar/policies/README.md +52 -0
- package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +11 -0
- package/src/agentcore-gateway/files/project/serve-local.ts.template +134 -0
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +102 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +26 -0
- package/src/agentcore-gateway/generator.d.ts +25 -0
- package/src/agentcore-gateway/generator.js +129 -0
- package/src/agentcore-gateway/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/mcp-connection/generator.js +63 -0
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +26 -0
- package/src/agentcore-gateway/schema.d.ts +16 -0
- package/src/agentcore-gateway/schema.json +65 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +93 -37
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +47 -58
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +19 -17
- package/src/infra/app/generator.js.map +1 -1
- package/src/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +111 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +76 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +75 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +121 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +122 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +43 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1280 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +102 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +6 -0
- package/src/license/known-exceptions.js +26 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +2 -2
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/schema-registry.d.ts +9 -3
- package/src/mcp-server/schema-registry.js +22 -6
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +4 -4
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- package/src/open-api/ts-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +5 -5
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +131 -13
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +21 -14
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +3 -1
- package/src/preset/schema.json +5 -0
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +659 -21
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +201 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +11 -10
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/http/init.py.template +7 -25
- package/src/py/agent/files/http/main.py.template +2 -3
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +197 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +35 -0
- package/src/py/agent/gateway-connection/generator.d.ts +10 -0
- package/src/py/agent/gateway-connection/generator.js +106 -0
- package/src/py/agent/gateway-connection/generator.js.map +1 -0
- package/src/py/agent/gateway-connection/schema.d.ts +12 -0
- package/src/py/agent/gateway-connection/schema.json +26 -0
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +47 -38
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +167 -81
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +11 -81
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +8 -17
- package/src/py/agent/react-connection/generator.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +4 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.js.map +1 -1
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js.map +1 -1
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1486 -0
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/agent-connection/generator.js +39 -0
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/py/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/py/dynamodb/agent-connection/schema.json +22 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/py/dynamodb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +37 -0
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.ts +12 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +18 -0
- package/src/py/dynamodb/files/__name__/__init__.py.template +6 -0
- package/src/py/dynamodb/files/__name__/client.py.template +39 -0
- package/src/py/dynamodb/files/__name__/entities/__init__.py.template +4 -0
- package/src/py/dynamodb/files/__name__/entities/base.py.template +63 -0
- package/src/py/dynamodb/files/__name__/entities/example.py.template +64 -0
- package/src/py/dynamodb/files/config.json.template +24 -0
- package/src/py/dynamodb/generator.d.ts +10 -0
- package/src/py/dynamodb/generator.js +106 -0
- package/src/py/dynamodb/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js +39 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/py/dynamodb/schema.d.ts +15 -0
- package/src/py/dynamodb/schema.json +70 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +167 -39
- package/src/py/fast-api/files/app/__name__/init.py.template +5 -22
- package/src/py/fast-api/files/app/__name__/main.py.template +4 -1
- package/src/py/fast-api/generator.d.ts +3 -3
- package/src/py/fast-api/generator.js +23 -17
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +2 -2
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +5 -2
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +11 -11
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +83 -13
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +33 -26
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/project/generator.d.ts +3 -3
- package/src/py/project/generator.js +96 -70
- package/src/py/project/generator.js.map +1 -1
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +19 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/project/files/src/operations/echo.smithy.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +30 -28
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +3 -3
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +14 -34
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +18 -12
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +13 -8
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +163 -18
- package/src/trpc/backend/files/src/procedures/echo.ts.template +1 -1
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +3 -3
- package/src/trpc/backend/generator.js +11 -10
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +2 -2
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +3 -3
- package/src/trpc/react/generator.d.ts +3 -3
- package/src/trpc/react/generator.js +5 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +652 -14
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +256 -0
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +23 -0
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +8 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/http/router.ts.template +1 -1
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +220 -0
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +30 -0
- package/src/ts/agent/gateway-connection/generator.d.ts +10 -0
- package/src/ts/agent/gateway-connection/generator.js +106 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -0
- package/src/ts/agent/gateway-connection/schema.d.ts +12 -0
- package/src/ts/agent/gateway-connection/schema.json +26 -0
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +44 -32
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +191 -110
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +22 -0
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +9 -21
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +9 -9
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +4 -4
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +2 -1
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1352 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -0
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +61 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/index.ts.template +2 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +111 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +15 -0
- package/src/ts/dynamodb/schema.json +70 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +8 -8
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +27 -29
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -4
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +82 -12
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +34 -12
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +19 -14
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +52 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +10 -9
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +252 -388
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/config.json.template +14 -0
- package/src/ts/rdb/files/prisma.config.ts.template +5 -4
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- package/src/ts/rdb/files/src/prisma.ts.template +26 -21
- package/src/ts/rdb/generator.d.ts +3 -7
- package/src/ts/rdb/generator.js +52 -41
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +1 -16
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.js +4 -5
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +530 -367
- package/src/ts/react-website/app/generator.d.ts +3 -3
- package/src/ts/react-website/app/generator.js +21 -17
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +9 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +0 -20
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +10 -13
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +1 -1
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +30 -0
- package/src/utils/agent-chat/agent-chat.js.map +1 -0
- package/src/utils/agent-chat/files/a2a/chat.ts.template +33 -0
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +17 -0
- package/src/utils/agent-chat/files/common/agentcore.ts.template +81 -0
- package/src/utils/agent-chat/files/http-py/chat.ts.template +43 -0
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +54 -0
- package/src/utils/agent-connection/agent-connection.d.ts +67 -24
- package/src/utils/agent-connection/agent-connection.js +236 -44
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +93 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-endpoints.ts.template +37 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +54 -0
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +41 -0
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +70 -0
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +22 -32
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +39 -0
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +61 -0
- package/src/utils/agent-connection/files/core-strands/base/model-errors-strands.ts.template +36 -0
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +26 -0
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +27 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client_config.py.template +43 -0
- package/src/utils/agent-connection/files/py-core-auth/agentcore_endpoints.py.template +47 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/session.py.template +51 -0
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +28 -0
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +5 -18
- package/src/utils/agent-connection/files/py-core-shared/agentcore_transport.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/a2a/agentcore_a2a_client_strands.py.template +66 -0
- package/src/utils/agent-connection/files/py-core-strands/base/model_errors_strands.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +22 -0
- package/src/utils/agent-connection/files/py-core-strands/mcp/agentcore_mcp_client_strands.py.template +30 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +11 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js +57 -12
- 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 +4 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +40 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +375 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/readiness-probe/index.js.template +55 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +335 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/render-cedar.cjs.template +13 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +77 -9
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +14 -0
- package/src/utils/api-constructs/api-constructs.d.ts +2 -2
- package/src/utils/api-constructs/api-constructs.js +1 -1
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +3 -0
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +9 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +23 -1
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +61 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +3 -0
- package/src/utils/api-constructs/open-api-metadata.d.ts +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.d.ts +5 -1
- package/src/utils/ast/website.js +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +1 -1
- package/src/utils/connection/open-api/react.d.ts +1 -1
- package/src/utils/connection/open-api/react.js +4 -4
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +43 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +62 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +195 -0
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +13 -0
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +91 -0
- package/src/utils/files/common/scripts/src/rdb/pull-image.ts.template +16 -0
- package/src/utils/files/common/scripts/src/rdb/start-container.ts.template +102 -0
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +59 -0
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +9 -3
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +7 -2
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/function-constructs.d.ts +2 -2
- package/src/utils/function-constructs/function-constructs.js +1 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac.d.ts +1 -1
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +9 -3
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +1 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +31 -3
- package/src/utils/port.js +74 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +12 -2
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +38 -16
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +28 -13
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +3 -11
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.d.ts +1 -0
- package/src/utils/shared-constructs-constants.js +2 -1
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +7 -7
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.d.ts +11 -0
- package/src/utils/shared-dynamodb-scripts.js +23 -0
- package/src/utils/shared-dynamodb-scripts.js.map +1 -0
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +1 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.d.ts +11 -0
- package/src/utils/shared-infra-scripts.js +35 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +11 -0
- package/src/utils/shared-rdb-scripts.js +20 -0
- package/src/utils/shared-rdb-scripts.js.map +1 -0
- package/src/utils/shared-scripts.d.ts +2 -5
- package/src/utils/shared-scripts.js +2 -23
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +82 -83
- package/src/utils/versions.js +81 -82
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +72 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +63 -15
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +1 -1
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -22
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -22
- package/src/py/agent/scripts/http/chat.ts.template +0 -38
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/scripts/http/chat.ts.template +0 -35
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +0 -15
- package/src/ts/rdb/files/scripts/docker-start.ts.template +0 -84
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +0 -55
- package/src/ts/rdb/files/src/constants.ts.template +0 -8
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +0 -123
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-client.ts.template +0 -128
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +0 -120
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_client.py.template +0 -89
- /package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → core-strands/base/with-session-id-strands.ts.template} +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/with_session_id.py.template → py-core-strands/base/with_session_id_strands.py.template} +0 -0
- /package/src/utils/files/common/scripts/src/{index.ts.template → infra/index.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-deploy.ts.template → infra/infra-deploy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-destroy.ts.template → infra/infra-destroy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/cdk-command.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/credentials.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/run.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/stage-parser.ts.template +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.addAgentChatScripts = void 0;
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
/**
|
|
10
|
+
* Emit the chat CLI scripts for an agent. Every protocol gets a small
|
|
11
|
+
* `chat.ts` that connects to the local `serve-local` server by default, and
|
|
12
|
+
* to the deployed agent on Bedrock AgentCore (resolved from runtime config)
|
|
13
|
+
* when `RUNTIME_CONFIG_APP_ID` is set. The shared `agentcore.ts` helper
|
|
14
|
+
* handles ARN resolution and request authentication.
|
|
15
|
+
*/
|
|
16
|
+
const addAgentChatScripts = (tree, options) => {
|
|
17
|
+
const templateContext = {
|
|
18
|
+
agentNameClassName: options.agentNameClassName,
|
|
19
|
+
auth: options.auth,
|
|
20
|
+
relativeAgentImport: options.relativeAgentImport ?? '',
|
|
21
|
+
};
|
|
22
|
+
// Shared remote-resolution + auth helper, used by every protocol.
|
|
23
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', 'common'), options.scriptsDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
24
|
+
// Protocol-specific chat adapter. HTTP differs by server language; A2A and
|
|
25
|
+
// AG-UI speak standard protocols so the same script serves both languages.
|
|
26
|
+
const protocolDir = options.protocol === 'http' ? `http-${options.language}` : options.protocol;
|
|
27
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files', protocolDir), options.scriptsDir, templateContext, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
28
|
+
};
|
|
29
|
+
exports.addAgentChatScripts = addAgentChatScripts;
|
|
30
|
+
//# sourceMappingURL=agent-chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/utils/agent-chat/agent-chat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uCAIoB;AAsBpB;;;;;;GAMG;AACI,MAAM,mBAAmB,GAAG,CACjC,IAAU,EACV,OAAmC,EAC7B,EAAE;IACR,MAAM,eAAe,GAAG;QACtB,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,EAAE;KACvD,CAAC;IAEF,kEAAkE;IAClE,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAC/C,OAAO,CAAC,UAAU,EAClB,eAAe,EACf,EAAE,iBAAiB,EAAE,0BAAiB,CAAC,YAAY,EAAE,CACtD,CAAC;IAEF,2EAA2E;IAC3E,2EAA2E;IAC3E,MAAM,WAAW,GACf,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC9E,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC,EAClD,OAAO,CAAC,UAAU,EAClB,eAAe,EACf,EAAE,iBAAiB,EAAE,0BAAiB,CAAC,YAAY,EAAE,CACtD,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,mBAAmB,uBA8B9B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Chat CLI for <%- agentNameClassName %> (A2A protocol). Connects to the local
|
|
2
|
+
// `serve-local` server, or the deployed agent when `RUNTIME_CONFIG_APP_ID` is set.
|
|
3
|
+
import {
|
|
4
|
+
ClientFactory,
|
|
5
|
+
ClientFactoryOptions,
|
|
6
|
+
DefaultAgentCardResolver,
|
|
7
|
+
JsonRpcTransportFactory,
|
|
8
|
+
} from '@a2a-js/sdk/client';
|
|
9
|
+
import { A2AChatAdapter, chatLoop } from 'agent-chat-cli';
|
|
10
|
+
import { createAgentCoreFetch, resolveRemoteAgent } from './agentcore.js';
|
|
11
|
+
|
|
12
|
+
const remote = await resolveRemoteAgent();
|
|
13
|
+
|
|
14
|
+
const url = remote
|
|
15
|
+
? `https://bedrock-agentcore.${remote.region}.amazonaws.com/runtimes/${encodeURIComponent(remote.arn)}/invocations/`
|
|
16
|
+
: process.env.URL!;
|
|
17
|
+
|
|
18
|
+
// Remote requests are authenticated via a custom fetch; locally the default client talks plain HTTP.
|
|
19
|
+
const clientFactory = remote
|
|
20
|
+
? new ClientFactory({
|
|
21
|
+
...ClientFactoryOptions.default,
|
|
22
|
+
transports: [
|
|
23
|
+
new JsonRpcTransportFactory({
|
|
24
|
+
fetchImpl: createAgentCoreFetch(<%- auth === 'iam' ? 'remote.region' : '' %>),
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
cardResolver: new DefaultAgentCardResolver({
|
|
28
|
+
fetchImpl: createAgentCoreFetch(<%- auth === 'iam' ? 'remote.region' : '' %>),
|
|
29
|
+
}),
|
|
30
|
+
})
|
|
31
|
+
: undefined;
|
|
32
|
+
|
|
33
|
+
await chatLoop(new A2AChatAdapter({ clientFactory }), url);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Chat CLI for <%- agentNameClassName %> (AG-UI protocol). Connects to the local
|
|
2
|
+
// `serve-local` server, or the deployed agent when `RUNTIME_CONFIG_APP_ID` is set.
|
|
3
|
+
import { AGUIChatAdapter, chatLoop } from 'agent-chat-cli';
|
|
4
|
+
import { createAgentCoreFetch, resolveRemoteAgent } from './agentcore.js';
|
|
5
|
+
|
|
6
|
+
const remote = await resolveRemoteAgent();
|
|
7
|
+
|
|
8
|
+
const url = remote
|
|
9
|
+
? `https://bedrock-agentcore.${remote.region}.amazonaws.com/runtimes/${encodeURIComponent(remote.arn)}/invocations?qualifier=DEFAULT`
|
|
10
|
+
: process.env.URL!;
|
|
11
|
+
|
|
12
|
+
// Remote requests are authenticated via a custom fetch; locally the default agent talks plain HTTP.
|
|
13
|
+
const fetchImpl = remote
|
|
14
|
+
? createAgentCoreFetch(<%- auth === 'iam' ? 'remote.region' : '' %>)
|
|
15
|
+
: undefined;
|
|
16
|
+
|
|
17
|
+
await chatLoop(new AGUIChatAdapter({ fetch: fetchImpl }), url);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Resolves the deployed <%- agentNameClassName %> agent from runtime config and authenticates requests to it.
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { getAppConfig } from '@aws-lambda-powertools/parameters/appconfig';
|
|
4
|
+
<%_ if (auth === 'iam') { _%>
|
|
5
|
+
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
|
|
6
|
+
import { AwsClient } from 'aws4fetch';
|
|
7
|
+
<%_ } _%>
|
|
8
|
+
|
|
9
|
+
const SESSION_HEADER = 'X-Amzn-Bedrock-AgentCore-Runtime-Session-Id';
|
|
10
|
+
|
|
11
|
+
// AgentCore session ids must be at least 33 characters.
|
|
12
|
+
export const SESSION_ID = randomUUID().replaceAll('-', '').padEnd(33, '0');
|
|
13
|
+
|
|
14
|
+
export interface RemoteAgent {
|
|
15
|
+
/** ARN of the deployed Bedrock AgentCore runtime. */
|
|
16
|
+
arn: string;
|
|
17
|
+
/** AWS region parsed from the runtime ARN. */
|
|
18
|
+
region: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Returns the deployed agent when `RUNTIME_CONFIG_APP_ID` is set, otherwise `undefined` to chat locally.
|
|
22
|
+
export const resolveRemoteAgent = async (): Promise<
|
|
23
|
+
RemoteAgent | undefined
|
|
24
|
+
> => {
|
|
25
|
+
const application = process.env.RUNTIME_CONFIG_APP_ID;
|
|
26
|
+
if (!application) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const config = (await getAppConfig('agentcore', {
|
|
30
|
+
application,
|
|
31
|
+
environment: 'default',
|
|
32
|
+
transform: 'json',
|
|
33
|
+
})) as { agentRuntimes?: Record<string, string> };
|
|
34
|
+
const arn = config?.agentRuntimes?.['<%- agentNameClassName %>'];
|
|
35
|
+
if (!arn) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
`No deployed agent named '<%- agentNameClassName %>' found in runtime configuration (application ${application}).`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return { arn, region: arn.split(':')[3] };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
<%_ if (auth === 'cognito') { _%>
|
|
44
|
+
/** The Cognito access token used to authenticate with the deployed agent. */
|
|
45
|
+
export const getAccessToken = (): string => {
|
|
46
|
+
const accessToken = process.env.AGENT_ACCESS_TOKEN;
|
|
47
|
+
if (!accessToken) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
'AGENT_ACCESS_TOKEN is not set. Provide a Cognito access token to chat with the deployed agent.',
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return accessToken;
|
|
53
|
+
};
|
|
54
|
+
<%_ } _%>
|
|
55
|
+
|
|
56
|
+
// A `fetch` that authenticates requests to the deployed agent and forwards the session id.
|
|
57
|
+
<%_ if (auth === 'iam') { _%>
|
|
58
|
+
export const createAgentCoreFetch = (region: string): typeof fetch => {
|
|
59
|
+
const credentialProvider = fromNodeProviderChain();
|
|
60
|
+
return async (input, init) => {
|
|
61
|
+
const headers = new Headers(init?.headers);
|
|
62
|
+
headers.set(SESSION_HEADER, SESSION_ID);
|
|
63
|
+
const client = new AwsClient({
|
|
64
|
+
...(await credentialProvider()),
|
|
65
|
+
service: 'bedrock-agentcore',
|
|
66
|
+
region,
|
|
67
|
+
});
|
|
68
|
+
return client.fetch(input, { ...init, headers });
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
<%_ } else { _%>
|
|
72
|
+
export const createAgentCoreFetch = (): typeof fetch => {
|
|
73
|
+
const accessToken = getAccessToken();
|
|
74
|
+
return (input, init) => {
|
|
75
|
+
const headers = new Headers(init?.headers);
|
|
76
|
+
headers.set(SESSION_HEADER, SESSION_ID);
|
|
77
|
+
headers.set('Authorization', `Bearer ${accessToken}`);
|
|
78
|
+
return fetch(input, { ...init, headers });
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
<%_ } _%>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Chat CLI for <%- agentNameClassName %> (Python FastAPI / JSONL streaming), using the
|
|
2
|
+
// generated client. Connects to the local `serve-local` server, or the deployed
|
|
3
|
+
// agent when `RUNTIME_CONFIG_APP_ID` is set.
|
|
4
|
+
import { chatLoop, type ChatAdapter } from 'agent-chat-cli';
|
|
5
|
+
import { <%- agentNameClassName %> } from './generated/client.gen.js';
|
|
6
|
+
import {
|
|
7
|
+
createAgentCoreFetch,
|
|
8
|
+
resolveRemoteAgent,
|
|
9
|
+
SESSION_ID,
|
|
10
|
+
} from './agentcore.js';
|
|
11
|
+
|
|
12
|
+
const SESSION_ID_HEADER = 'X-Amzn-Bedrock-AgentCore-Runtime-Session-Id';
|
|
13
|
+
|
|
14
|
+
const remote = await resolveRemoteAgent();
|
|
15
|
+
|
|
16
|
+
class <%- agentNameClassName %>Adapter implements ChatAdapter {
|
|
17
|
+
private client!: <%- agentNameClassName %>;
|
|
18
|
+
|
|
19
|
+
async connect(url: string) {
|
|
20
|
+
this.client = remote
|
|
21
|
+
? new <%- agentNameClassName %>({
|
|
22
|
+
url: `https://bedrock-agentcore.${remote.region}.amazonaws.com/runtimes/${encodeURIComponent(remote.arn)}`,
|
|
23
|
+
fetch: createAgentCoreFetch(<%- auth === 'iam' ? 'remote.region' : '' %>),
|
|
24
|
+
})
|
|
25
|
+
: new <%- agentNameClassName %>({
|
|
26
|
+
url,
|
|
27
|
+
fetch: (input, init) => {
|
|
28
|
+
const headers = new Headers(init?.headers);
|
|
29
|
+
headers.set(SESSION_ID_HEADER, SESSION_ID);
|
|
30
|
+
return fetch(input, { ...init, headers });
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return { agentName: '<%- agentNameClassName %>' };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async *sendMessage(text: string): AsyncIterable<string> {
|
|
37
|
+
for await (const chunk of this.client.invoke({ message: text })) {
|
|
38
|
+
if (typeof chunk.content === 'string') yield chunk.content;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
await chatLoop(new <%- agentNameClassName %>Adapter(), process.env.URL ?? '');
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Chat CLI for <%- agentNameClassName %> (HTTP / tRPC WebSocket). Connects to the local
|
|
2
|
+
// `serve-local` server, or the deployed agent when `RUNTIME_CONFIG_APP_ID` is set.
|
|
3
|
+
import { chatLoop, type ChatAdapter } from 'agent-chat-cli';
|
|
4
|
+
import { <%- agentNameClassName %>Client } from '<%- relativeAgentImport %>/client.js';
|
|
5
|
+
import {
|
|
6
|
+
resolveRemoteAgent,
|
|
7
|
+
SESSION_ID,
|
|
8
|
+
<%_ if (auth === 'cognito') { _%>
|
|
9
|
+
getAccessToken,
|
|
10
|
+
<%_ } _%>
|
|
11
|
+
} from './agentcore.js';
|
|
12
|
+
|
|
13
|
+
const remote = await resolveRemoteAgent();
|
|
14
|
+
|
|
15
|
+
class TrpcWebSocketAdapter implements ChatAdapter {
|
|
16
|
+
private client!: ReturnType<typeof <%- agentNameClassName %>Client.local>;
|
|
17
|
+
|
|
18
|
+
async connect(url: string) {
|
|
19
|
+
this.client = remote
|
|
20
|
+
<%_ if (auth === 'iam') { _%>
|
|
21
|
+
? <%- agentNameClassName %>Client.withIamAuth({
|
|
22
|
+
agentRuntimeArn: remote.arn,
|
|
23
|
+
sessionId: SESSION_ID,
|
|
24
|
+
})
|
|
25
|
+
<%_ } else { _%>
|
|
26
|
+
? <%- agentNameClassName %>Client.withJwtAuth({
|
|
27
|
+
agentRuntimeArn: remote.arn,
|
|
28
|
+
sessionId: SESSION_ID,
|
|
29
|
+
accessTokenProvider: async () => getAccessToken(),
|
|
30
|
+
})
|
|
31
|
+
<%_ } _%>
|
|
32
|
+
: <%- agentNameClassName %>Client.local({ url, sessionId: SESSION_ID });
|
|
33
|
+
return { agentName: '<%- agentNameClassName %>' };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async *sendMessage(text: string): AsyncIterable<string> {
|
|
37
|
+
const stream = new ReadableStream<string>({
|
|
38
|
+
start: (controller) => {
|
|
39
|
+
this.client.invoke.subscribe(
|
|
40
|
+
{ message: text },
|
|
41
|
+
{
|
|
42
|
+
onData: (chunk: string) => controller.enqueue(chunk),
|
|
43
|
+
onComplete: () => controller.close(),
|
|
44
|
+
onError: (err: unknown) => controller.error(err),
|
|
45
|
+
},
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
yield* stream as unknown as AsyncIterable<string>;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await chatLoop(new TrpcWebSocketAdapter(), process.env.URL ?? '');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
6
|
export declare const AGENT_CONNECTION_PROJECT_DIR: string;
|
|
7
7
|
/**
|
|
8
8
|
* Get the directory of the shared Python agent-connection project.
|
|
@@ -17,32 +17,46 @@ export declare function getPythonAgentConnectionModuleName(tree: Tree): string;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function getPythonAgentConnectionPackageName(tree: Tree): string;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
20
|
+
* The connection protocols an agent framework can connect over. Each maps to a
|
|
21
|
+
* framework-agnostic Layer-0/1 template directory plus a per-framework Layer-2
|
|
22
|
+
* client directory (see `FRAMEWORKS`).
|
|
23
|
+
*/
|
|
24
|
+
export type ConnectionProtocol = 'mcp' | 'gateway' | 'a2a';
|
|
25
|
+
/**
|
|
26
|
+
* The agent frameworks we can generate connection clients for. Adding a new
|
|
27
|
+
* framework is an additive change: append an entry to `FRAMEWORKS` with its
|
|
28
|
+
* Layer-2 template directories and dependencies — the framework-agnostic
|
|
29
|
+
* Layer-0/1 (`core-auth`, `core-shared`, the per-protocol transports/configs)
|
|
30
|
+
* is reused unchanged.
|
|
31
|
+
*/
|
|
32
|
+
export type AgentFramework = 'strands';
|
|
34
33
|
/**
|
|
35
34
|
* Ensure the shared TypeScript agent-connection project exists and has the
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* framework-agnostic core helpers (runtime-config loader, session context).
|
|
36
|
+
* Per-connection generators emit their own protocol + framework client
|
|
37
|
+
* templates via `addTypeScriptCoreClient`.
|
|
38
38
|
*/
|
|
39
39
|
export declare function ensureTypeScriptAgentConnectionProject(tree: Tree): Promise<void>;
|
|
40
40
|
/**
|
|
41
|
-
* Emit
|
|
42
|
-
* agent-connection project
|
|
43
|
-
*
|
|
41
|
+
* Emit a framework's base Layer-2 helpers (model-error logging + per-session
|
|
42
|
+
* agent cache) into the agent-connection project and re-export them. The agent
|
|
43
|
+
* server entry point imports these regardless of whether any connection client
|
|
44
|
+
* is wired in, so the agent generator calls this directly; connection
|
|
45
|
+
* generators call it transitively via `addTypeScriptCoreClient`.
|
|
44
46
|
*/
|
|
45
|
-
export declare function
|
|
47
|
+
export declare function addTypeScriptFrameworkBase(tree: Tree, framework?: AgentFramework): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Emit the TypeScript client templates for a connection protocol and agent
|
|
50
|
+
* framework into the agent-connection project's `src/core/` directory. Safe to
|
|
51
|
+
* call multiple times — `KeepExisting` preserves customised files.
|
|
52
|
+
*
|
|
53
|
+
* Layers emitted:
|
|
54
|
+
* - Layer 0 `core-auth` (signed fetch + endpoint resolution) — always
|
|
55
|
+
* - Layer 1 `core-shared` MCP transport — for mcp/gateway protocols
|
|
56
|
+
* - Layer 1 the protocol's transport/client-config — always
|
|
57
|
+
* - Layer 2 the framework's base helpers + protocol client — per framework
|
|
58
|
+
*/
|
|
59
|
+
export declare function addTypeScriptCoreClient(tree: Tree, protocol: ConnectionProtocol, framework?: AgentFramework): Promise<void>;
|
|
46
60
|
/**
|
|
47
61
|
* Ensure the shared Python agent-connection project exists.
|
|
48
62
|
* Only creates the project shell — per-connection generators are responsible
|
|
@@ -50,10 +64,39 @@ export declare function addTypeScriptCoreClient(tree: Tree, kind: keyof typeof T
|
|
|
50
64
|
*/
|
|
51
65
|
export declare function ensurePythonAgentConnectionProject(tree: Tree): Promise<void>;
|
|
52
66
|
/**
|
|
53
|
-
* Emit a
|
|
54
|
-
* agent-connection project
|
|
67
|
+
* Emit a framework's base Layer-2 helpers (model-error logging + per-session
|
|
68
|
+
* agent cache) into the Python agent-connection project and re-export them.
|
|
69
|
+
* The agent server entry point imports these regardless of whether a connection
|
|
70
|
+
* client is wired in, so the agent generator calls this directly; connection
|
|
71
|
+
* generators call it transitively via `addPythonCoreClient`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function addPythonFrameworkBase(tree: Tree, framework?: AgentFramework): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Emit the Python client templates for a connection protocol and agent
|
|
76
|
+
* framework into the agent-connection project's core directory.
|
|
77
|
+
*
|
|
78
|
+
* Layers emitted:
|
|
79
|
+
* - Layer 0 `py-core-auth` (SigV4 httpx.Auth, session auth, endpoints) — always
|
|
80
|
+
* - Layer 1 `py-core-shared` MCP transport — for mcp/gateway protocols
|
|
81
|
+
* - Layer 1 the protocol's transport/client-config — always
|
|
82
|
+
* - Layer 2 the framework's base helpers + protocol client — per framework
|
|
83
|
+
*/
|
|
84
|
+
export declare function addPythonCoreClient(tree: Tree, protocol: ConnectionProtocol, framework?: AgentFramework): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Patch a TypeScript agent.ts to create a connection client and register it
|
|
87
|
+
* in the Agent's tools. Used by the MCP and gateway connection generators —
|
|
88
|
+
* the client class must expose a static async `create()` returning a value
|
|
89
|
+
* accepted by `Agent.tools` (e.g. an `McpClient`).
|
|
90
|
+
*/
|
|
91
|
+
export declare function addTypeScriptClientToAgent(tree: Tree, agentFilePath: string, clientClassName: string, clientVarName: string): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Patch a Python agent.py to create a context-managed connection client,
|
|
94
|
+
* enter it in the `with` block around `yield Agent(...)`, and spread its
|
|
95
|
+
* `list_tools_sync()` into the Agent's tools. Used by the MCP and gateway
|
|
96
|
+
* connection generators — the client class must expose a static `create()`
|
|
97
|
+
* returning a context manager with `list_tools_sync()` (e.g. an `MCPClient`).
|
|
55
98
|
*/
|
|
56
|
-
export declare function
|
|
99
|
+
export declare function addPythonClientToAgent(tree: Tree, agentFilePath: string, clientClassName: string, clientVarName: string): Promise<void>;
|
|
57
100
|
/**
|
|
58
101
|
* Add a re-export to the Python agent-connection module's __init__.py.
|
|
59
102
|
* Equivalent to addStarExport for TS.
|