@aws/agentcore-cdk 0.1.0-alpha.4 → 0.1.0-alpha.40
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/README.md +20 -12
- package/dist/cdk/constants.d.ts +8 -0
- package/dist/cdk/constants.d.ts.map +1 -1
- package/dist/cdk/constants.js +27 -1
- package/dist/cdk/constants.js.map +1 -1
- package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts +17 -0
- package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.d.ts.map +1 -0
- package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js +20 -0
- package/dist/cdk/constructs/bundling/container/ContainerSourceAssetFromPath.js.map +1 -0
- package/dist/cdk/constructs/bundling/container/index.d.ts +1 -0
- package/dist/cdk/constructs/bundling/container/index.d.ts.map +1 -1
- package/dist/cdk/constructs/bundling/container/index.js +3 -1
- package/dist/cdk/constructs/bundling/container/index.js.map +1 -1
- package/dist/cdk/constructs/bundling/index.d.ts +2 -0
- package/dist/cdk/constructs/bundling/index.d.ts.map +1 -1
- package/dist/cdk/constructs/bundling/index.js +6 -2
- package/dist/cdk/constructs/bundling/index.js.map +1 -1
- package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts +7 -0
- package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.d.ts.map +1 -0
- package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js +30 -0
- package/dist/cdk/constructs/bundling/zip/NodeBundledCodeZipAsset.js.map +1 -0
- package/dist/cdk/constructs/bundling/zip/index.d.ts +1 -0
- package/dist/cdk/constructs/bundling/zip/index.d.ts.map +1 -1
- package/dist/cdk/constructs/bundling/zip/index.js +3 -1
- package/dist/cdk/constructs/bundling/zip/index.js.map +1 -1
- package/dist/cdk/constructs/components/base-props.d.ts +2 -0
- package/dist/cdk/constructs/components/base-props.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.js +5 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.js.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts +4 -2
- package/dist/cdk/constructs/components/container/ContainerImageBuilder.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerImageBuilder.js +2 -2
- package/dist/cdk/constructs/components/container/ContainerImageBuilder.js.map +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.d.ts +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.js +2 -3
- package/dist/cdk/constructs/components/container/container-build-handler.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts +71 -0
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +1 -0
- package/dist/cdk/constructs/components/mcp/Gateway.js +897 -0
- package/dist/cdk/constructs/components/mcp/Gateway.js.map +1 -0
- package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js +2 -2
- package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js +1 -1
- package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts +20 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts.map +1 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js +16 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js.map +1 -0
- package/dist/cdk/constructs/components/mcp/index.d.ts +1 -1
- package/dist/cdk/constructs/components/mcp/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/mcp/index.js +3 -3
- package/dist/cdk/constructs/components/mcp/index.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts +1 -1
- package/dist/cdk/constructs/components/mcp/mcp-utils.d.ts.map +1 -1
- package/dist/cdk/constructs/components/mcp/mcp-utils.js +2 -2
- package/dist/cdk/constructs/components/mcp/mcp-utils.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts +51 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js +54 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts +36 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js +65 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts +36 -0
- package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js +91 -0
- package/dist/cdk/constructs/components/primitives/dataset/AgentCoreDataset.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/dataset/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/dataset/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/dataset/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/dataset/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts +47 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js +207 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +222 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts +58 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js +79 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +65 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +445 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js +182 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts +47 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js +391 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/index.d.ts +9 -0
- package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.js +21 -1
- package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts +69 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js +292 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts +15 -4
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js +93 -35
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js +146 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js +44 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts +38 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js +111 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +72 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/policy/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/policy/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts +14 -1
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js +237 -80
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js +113 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js.map +1 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts +2 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js +99 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js.map +1 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts +28 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts.map +1 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.js +39 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.js.map +1 -0
- package/dist/cdk/constructs/index.d.ts +7 -3
- package/dist/cdk/constructs/index.d.ts.map +1 -1
- package/dist/cdk/constructs/index.js +20 -1
- package/dist/cdk/constructs/index.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +126 -2
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.js +526 -10
- package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts +38 -0
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts.map +1 -0
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js +86 -0
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js.map +1 -0
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts +9 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js +95 -17
- package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +9 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.js +40 -2
- package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -1
- package/dist/cdk/constructs/l3/index.d.ts +2 -1
- package/dist/cdk/constructs/l3/index.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/index.js +3 -1
- package/dist/cdk/constructs/l3/index.js.map +1 -1
- package/dist/cdk/index.d.ts +1 -1
- package/dist/cdk/index.d.ts.map +1 -1
- package/dist/cdk/index.js +15 -1
- package/dist/cdk/index.js.map +1 -1
- package/dist/cdk/utils/__tests__/tags.test.d.ts +2 -0
- package/dist/cdk/utils/__tests__/tags.test.d.ts.map +1 -0
- package/dist/cdk/utils/__tests__/tags.test.js +57 -0
- package/dist/cdk/utils/__tests__/tags.test.js.map +1 -0
- package/dist/cdk/utils/tags.d.ts +11 -0
- package/dist/cdk/utils/tags.d.ts.map +1 -0
- package/dist/cdk/utils/tags.js +22 -0
- package/dist/cdk/utils/tags.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/constants.d.ts +1 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +2 -1
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/errors/config.js +1 -1
- package/dist/lib/errors/config.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/packaging/helpers.d.ts +4 -0
- package/dist/lib/packaging/helpers.d.ts.map +1 -1
- package/dist/lib/packaging/helpers.js +53 -16
- package/dist/lib/packaging/helpers.js.map +1 -1
- package/dist/lib/packaging/index.d.ts +2 -6
- package/dist/lib/packaging/index.d.ts.map +1 -1
- package/dist/lib/packaging/index.js +11 -10
- package/dist/lib/packaging/index.js.map +1 -1
- package/dist/lib/packaging/node.d.ts +6 -0
- package/dist/lib/packaging/node.d.ts.map +1 -0
- package/dist/lib/packaging/node.js +97 -0
- package/dist/lib/packaging/node.js.map +1 -0
- package/dist/lib/packaging/types/packaging.d.ts +2 -0
- package/dist/lib/packaging/types/packaging.d.ts.map +1 -1
- package/dist/lib/packaging/uv.d.ts.map +1 -1
- package/dist/lib/packaging/uv.js +1 -1
- package/dist/lib/packaging/uv.js.map +1 -1
- package/dist/lib/schemas/io/config-io.d.ts +6 -3
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
- package/dist/lib/schemas/io/config-io.js +19 -11
- package/dist/lib/schemas/io/config-io.js.map +1 -1
- package/dist/schema/constants.d.ts +23 -0
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/constants.js +40 -2
- package/dist/schema/constants.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +186 -6
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agent-env.js +249 -12
- package/dist/schema/schemas/agent-env.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +928 -22
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +297 -11
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/auth.d.ts +311 -0
- package/dist/schema/schemas/auth.d.ts.map +1 -0
- package/dist/schema/schemas/auth.js +236 -0
- package/dist/schema/schemas/auth.js.map +1 -0
- package/dist/schema/schemas/aws-targets.d.ts +21 -0
- package/dist/schema/schemas/aws-targets.d.ts.map +1 -1
- package/dist/schema/schemas/aws-targets.js +8 -0
- package/dist/schema/schemas/aws-targets.js.map +1 -1
- package/dist/schema/schemas/deployed-state.d.ts +224 -16
- package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
- package/dist/schema/schemas/deployed-state.js +52 -4
- package/dist/schema/schemas/deployed-state.js.map +1 -1
- package/dist/schema/schemas/index.d.ts +1 -0
- package/dist/schema/schemas/index.d.ts.map +1 -1
- package/dist/schema/schemas/index.js +1 -0
- package/dist/schema/schemas/index.js.map +1 -1
- package/dist/schema/schemas/mcp.d.ts +628 -32
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +736 -44
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/config-bundle.d.ts +30 -0
- package/dist/schema/schemas/primitives/config-bundle.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/config-bundle.js +36 -0
- package/dist/schema/schemas/primitives/config-bundle.js.map +1 -0
- package/dist/schema/schemas/primitives/dataset.d.ts +53 -0
- package/dist/schema/schemas/primitives/dataset.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/dataset.js +65 -0
- package/dist/schema/schemas/primitives/dataset.js.map +1 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts +100 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/evaluator.js +73 -0
- package/dist/schema/schemas/primitives/evaluator.js.map +1 -0
- package/dist/schema/schemas/primitives/harness.d.ts +606 -0
- package/dist/schema/schemas/primitives/harness.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/harness.js +575 -0
- package/dist/schema/schemas/primitives/harness.js.map +1 -0
- package/dist/schema/schemas/primitives/index.d.ts +16 -2
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +63 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/knowledge-base.d.ts +103 -0
- package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/knowledge-base.js +98 -0
- package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
- package/dist/schema/schemas/primitives/memory.d.ts +33 -2
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/memory.js +33 -3
- package/dist/schema/schemas/primitives/memory.js.map +1 -1
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +32 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.js +66 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -0
- package/dist/schema/schemas/primitives/policy.d.ts +49 -0
- package/dist/schema/schemas/primitives/policy.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/policy.js +62 -0
- package/dist/schema/schemas/primitives/policy.js.map +1 -0
- package/dist/schema/schemas/primitives/tags.d.ts +6 -0
- package/dist/schema/schemas/primitives/tags.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/tags.js +20 -0
- package/dist/schema/schemas/primitives/tags.js.map +1 -0
- package/package.json +22 -5
- package/dist/cdk/constructs/components/mcp/McpGateway.d.ts +0 -49
- package/dist/cdk/constructs/components/mcp/McpGateway.d.ts.map +0 -1
- package/dist/cdk/constructs/components/mcp/McpGateway.js +0 -288
- package/dist/cdk/constructs/components/mcp/McpGateway.js.map +0 -1
|
@@ -1,56 +1,147 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentCoreMcpSpecSchema = exports.AgentCoreMcpRuntimeToolSchema = exports.McpRuntimeBindingSchema = exports.AgentCoreGatewaySchema = exports.AgentCoreGatewayTargetSchema = exports.ToolComputeConfigSchema = exports.CodeZipRuntimeSchema = exports.RuntimeConfigSchema = exports.IamPolicyDocumentSchema = exports.ToolImplementationBindingSchema = exports.ComputeHostSchema = exports.McpImplLanguageSchema = exports.OutboundAuthSchema = exports.OutboundAuthTypeSchema = exports.
|
|
3
|
+
exports.AgentCoreMcpSpecSchema = exports.AgentCoreMcpRuntimeToolSchema = exports.McpRuntimeBindingSchema = exports.AgentCoreGatewaySchema = exports.GatewayProtocolTypeSchema = exports.GatewayPolicyEngineConfigurationSchema = exports.PolicyEngineModeSchema = exports.GatewayExceptionLevelSchema = exports.AgentCoreGatewayTargetSchema = exports.PassthroughConfigSchema = exports.PassthroughProtocolTypeSchema = exports.StickinessConfigSchema = exports.HttpRuntimeConfigSchema = exports.SchemaSourceSchema = exports.ToolComputeConfigSchema = exports.CodeZipRuntimeSchema = exports.RuntimeConfigSchema = exports.IamPolicyDocumentSchema = exports.ToolImplementationBindingSchema = exports.ComputeHostSchema = exports.McpImplLanguageSchema = exports.LambdaFunctionArnConfigSchema = exports.ApiGatewayConfigSchema = exports.ApiGatewayToolConfigurationSchema = exports.ApiGatewayToolOverrideSchema = exports.ApiGatewayToolFilterSchema = exports.ApiGatewayHttpMethodSchema = exports.TARGET_TYPE_AUTH_CONFIG = exports.OutboundAuthSchema = exports.OutboundAuthTypeSchema = exports.REAL_KB_ID_PATTERN = exports.ConnectorIdSchema = exports.CONNECTOR_ID_VALUES = exports.CONNECTOR_ID = exports.MCP_TARGET_TYPES = exports.NON_MCP_TARGET_TYPES = exports.GatewayTargetTypeSchema = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const agent_env_1 = require("./agent-env");
|
|
6
|
+
const auth_1 = require("./auth");
|
|
6
7
|
const mcp_defs_1 = require("./mcp-defs");
|
|
8
|
+
const tags_1 = require("./primitives/tags");
|
|
7
9
|
const zod_1 = require("zod");
|
|
8
10
|
// ============================================================================
|
|
9
11
|
// MCP-Specific Schemas
|
|
10
12
|
// ============================================================================
|
|
11
|
-
exports.GatewayTargetTypeSchema = zod_1.z.enum([
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
exports.GatewayTargetTypeSchema = zod_1.z.enum([
|
|
14
|
+
'lambda',
|
|
15
|
+
'mcpServer',
|
|
16
|
+
'openApiSchema',
|
|
17
|
+
'smithyModel',
|
|
18
|
+
'apiGateway',
|
|
19
|
+
'lambdaFunctionArn',
|
|
20
|
+
'httpRuntime',
|
|
21
|
+
'connector',
|
|
22
|
+
'passthrough',
|
|
23
|
+
'webSearch',
|
|
24
|
+
]);
|
|
18
25
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @see https://openid.net/specs/openid-connect-discovery-1_0.html
|
|
26
|
+
* Target types that use the non-MCP (HTTP) protocol.
|
|
27
|
+
* These targets require a gateway with protocolType: "None".
|
|
22
28
|
*/
|
|
23
|
-
|
|
24
|
-
.string()
|
|
25
|
-
.url('Must be a valid URL')
|
|
26
|
-
.refine(url => url.endsWith(OIDC_WELL_KNOWN_SUFFIX), {
|
|
27
|
-
message: `OIDC discovery URL must end with '${OIDC_WELL_KNOWN_SUFFIX}'`,
|
|
28
|
-
});
|
|
29
|
+
exports.NON_MCP_TARGET_TYPES = ['httpRuntime', 'passthrough'];
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
* Used when authorizerType is 'CUSTOM_JWT'.
|
|
31
|
+
* Target types that use the MCP protocol.
|
|
32
32
|
*/
|
|
33
|
-
exports.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
exports.MCP_TARGET_TYPES = [
|
|
34
|
+
'lambda',
|
|
35
|
+
'mcpServer',
|
|
36
|
+
'openApiSchema',
|
|
37
|
+
'smithyModel',
|
|
38
|
+
'apiGateway',
|
|
39
|
+
'lambdaFunctionArn',
|
|
40
|
+
'connector',
|
|
41
|
+
'webSearch',
|
|
42
|
+
];
|
|
43
|
+
// ============================================================================
|
|
44
|
+
// Connector (managed-service gateway target)
|
|
45
|
+
// ============================================================================
|
|
42
46
|
/**
|
|
43
|
-
*
|
|
47
|
+
* Managed-service connector identifiers. The L3 maps each one to an operation
|
|
48
|
+
* name + Enabled list via CONNECTOR_DEFAULTS.
|
|
44
49
|
*/
|
|
45
|
-
exports.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
exports.CONNECTOR_ID = {
|
|
51
|
+
BEDROCK_KNOWLEDGE_BASES: 'bedrock-knowledge-bases',
|
|
52
|
+
BEDROCK_AGENTIC_RETRIEVE: 'bedrock-agentic-retrieve',
|
|
53
|
+
};
|
|
54
|
+
exports.CONNECTOR_ID_VALUES = [
|
|
55
|
+
exports.CONNECTOR_ID.BEDROCK_KNOWLEDGE_BASES,
|
|
56
|
+
exports.CONNECTOR_ID.BEDROCK_AGENTIC_RETRIEVE,
|
|
57
|
+
];
|
|
58
|
+
exports.ConnectorIdSchema = zod_1.z.enum(exports.CONNECTOR_ID_VALUES);
|
|
59
|
+
/**
|
|
60
|
+
* Real Bedrock Knowledge Base IDs are 10 uppercase alphanumeric chars.
|
|
61
|
+
* KB names follow the standard primitive-name shape (1-48 chars, starts with a letter).
|
|
62
|
+
* The two formats can never collide, so a connector target's `knowledgeBaseId`
|
|
63
|
+
* field is unambiguously a project KB name or a literal external KB ID.
|
|
64
|
+
*/
|
|
65
|
+
exports.REAL_KB_ID_PATTERN = /^[A-Z0-9]{10}$/;
|
|
66
|
+
// ============================================================================
|
|
67
|
+
// Gateway Authorization Schemas
|
|
68
|
+
// ============================================================================
|
|
69
|
+
// Auth schemas (GatewayAuthorizerTypeSchema, CustomJwtAuthorizerConfigSchema, etc.)
|
|
70
|
+
// are defined in ./auth.ts and exported via the barrel (index.ts).
|
|
71
|
+
exports.OutboundAuthTypeSchema = zod_1.z.enum(['OAUTH', 'API_KEY', 'NONE', 'GATEWAY_IAM_ROLE', 'JWT_PASSTHROUGH']);
|
|
49
72
|
exports.OutboundAuthSchema = zod_1.z
|
|
50
73
|
.object({
|
|
51
74
|
type: exports.OutboundAuthTypeSchema.default('NONE'),
|
|
52
75
|
credentialName: zod_1.z.string().min(1).optional(),
|
|
53
76
|
scopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
77
|
+
service: zod_1.z.string().min(1).max(64).optional(),
|
|
78
|
+
region: zod_1.z.string().min(1).max(32).optional(),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
// ============================================================================
|
|
82
|
+
// Target Type → Auth Rules (single source of truth)
|
|
83
|
+
// ============================================================================
|
|
84
|
+
/**
|
|
85
|
+
* Outbound authentication rules per gateway target type.
|
|
86
|
+
*
|
|
87
|
+
* - `authRequired` — target cannot be created without outbound auth
|
|
88
|
+
* - `validAuthTypes` — allowed OutboundAuthType values (empty = no outbound auth applicable)
|
|
89
|
+
* - `iamRoleFallback` — CDK passes GATEWAY_IAM_ROLE when no auth configured
|
|
90
|
+
*/
|
|
91
|
+
exports.TARGET_TYPE_AUTH_CONFIG = {
|
|
92
|
+
openApiSchema: { authRequired: true, validAuthTypes: ['OAUTH', 'API_KEY'], iamRoleFallback: false },
|
|
93
|
+
smithyModel: { authRequired: false, validAuthTypes: [], iamRoleFallback: true },
|
|
94
|
+
apiGateway: { authRequired: false, validAuthTypes: ['API_KEY', 'NONE'], iamRoleFallback: true },
|
|
95
|
+
mcpServer: { authRequired: false, validAuthTypes: ['OAUTH', 'NONE'], iamRoleFallback: false },
|
|
96
|
+
lambda: { authRequired: false, validAuthTypes: ['OAUTH', 'NONE'], iamRoleFallback: true },
|
|
97
|
+
lambdaFunctionArn: { authRequired: false, validAuthTypes: ['OAUTH', 'NONE'], iamRoleFallback: true },
|
|
98
|
+
httpRuntime: { authRequired: false, validAuthTypes: ['OAUTH', 'API_KEY', 'NONE'], iamRoleFallback: true },
|
|
99
|
+
// Connector targets call the underlying managed service (Bedrock KB, etc.)
|
|
100
|
+
// via the gateway's IAM role. No outbound auth applies.
|
|
101
|
+
connector: { authRequired: false, validAuthTypes: [], iamRoleFallback: true },
|
|
102
|
+
passthrough: {
|
|
103
|
+
authRequired: true,
|
|
104
|
+
validAuthTypes: ['GATEWAY_IAM_ROLE', 'OAUTH', 'JWT_PASSTHROUGH'],
|
|
105
|
+
iamRoleFallback: false,
|
|
106
|
+
},
|
|
107
|
+
// Amazon Web Search is invoked via the gateway's IAM role. No outbound auth.
|
|
108
|
+
webSearch: { authRequired: false, validAuthTypes: [], iamRoleFallback: true },
|
|
109
|
+
};
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// API Gateway Target Schemas
|
|
112
|
+
// ============================================================================
|
|
113
|
+
exports.ApiGatewayHttpMethodSchema = zod_1.z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS']);
|
|
114
|
+
exports.ApiGatewayToolFilterSchema = zod_1.z
|
|
115
|
+
.object({
|
|
116
|
+
filterPath: zod_1.z.string().min(1),
|
|
117
|
+
methods: zod_1.z.array(exports.ApiGatewayHttpMethodSchema).min(1),
|
|
118
|
+
})
|
|
119
|
+
.strict();
|
|
120
|
+
exports.ApiGatewayToolOverrideSchema = zod_1.z
|
|
121
|
+
.object({
|
|
122
|
+
name: zod_1.z.string().min(1),
|
|
123
|
+
path: zod_1.z.string().min(1),
|
|
124
|
+
method: exports.ApiGatewayHttpMethodSchema,
|
|
125
|
+
description: zod_1.z.string().optional(),
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
exports.ApiGatewayToolConfigurationSchema = zod_1.z
|
|
129
|
+
.object({
|
|
130
|
+
toolFilters: zod_1.z.array(exports.ApiGatewayToolFilterSchema).min(1),
|
|
131
|
+
toolOverrides: zod_1.z.array(exports.ApiGatewayToolOverrideSchema).optional(),
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
exports.ApiGatewayConfigSchema = zod_1.z
|
|
135
|
+
.object({
|
|
136
|
+
restApiId: zod_1.z.string().min(1),
|
|
137
|
+
stage: zod_1.z.string().min(1),
|
|
138
|
+
apiGatewayToolConfiguration: exports.ApiGatewayToolConfigurationSchema,
|
|
139
|
+
})
|
|
140
|
+
.strict();
|
|
141
|
+
exports.LambdaFunctionArnConfigSchema = zod_1.z
|
|
142
|
+
.object({
|
|
143
|
+
lambdaArn: zod_1.z.string().min(1).max(170),
|
|
144
|
+
toolSchemaFile: zod_1.z.string().min(1),
|
|
54
145
|
})
|
|
55
146
|
.strict();
|
|
56
147
|
exports.McpImplLanguageSchema = zod_1.z.enum(['TypeScript', 'Python']);
|
|
@@ -114,7 +205,7 @@ const AgentRuntimeNameSchema = zod_1.z
|
|
|
114
205
|
const PythonEntrypointSchema = zod_1.z
|
|
115
206
|
.string()
|
|
116
207
|
.min(1)
|
|
117
|
-
.regex(/^[a-zA-Z0-9_][a-zA-Z0-9_/.-]*\.py(
|
|
208
|
+
.regex(/^[a-zA-Z0-9_][a-zA-Z0-9_/.-]*\.py(?:$|:[a-zA-Z_][a-zA-Z0-9_]*$)/, 'Must be a Python file path with optional handler (e.g., "main.py:agent" or "src/handler.py:app")');
|
|
118
209
|
/**
|
|
119
210
|
* Instrumentation configuration for runtime observability.
|
|
120
211
|
*/
|
|
@@ -200,6 +291,60 @@ exports.ToolComputeConfigSchema = zod_1.z.discriminatedUnion('host', [
|
|
|
200
291
|
AgentCoreRuntimeComputeConfigSchema,
|
|
201
292
|
]);
|
|
202
293
|
// ============================================================================
|
|
294
|
+
// Schema Source (for OpenAPI / Smithy targets)
|
|
295
|
+
// ============================================================================
|
|
296
|
+
/** S3 reference for an API schema file. */
|
|
297
|
+
const SchemaS3SourceSchema = zod_1.z
|
|
298
|
+
.object({
|
|
299
|
+
uri: zod_1.z.string().min(1).startsWith('s3://'),
|
|
300
|
+
bucketOwnerAccountId: zod_1.z.string().optional(),
|
|
301
|
+
})
|
|
302
|
+
.strict();
|
|
303
|
+
/** Inline (local file) reference for an API schema file. Path is relative to project root. */
|
|
304
|
+
const SchemaInlineSourceSchema = zod_1.z
|
|
305
|
+
.object({
|
|
306
|
+
path: zod_1.z.string().min(1),
|
|
307
|
+
})
|
|
308
|
+
.strict();
|
|
309
|
+
/** Schema source: either a local file path (read at synth time) or an S3 URI. */
|
|
310
|
+
exports.SchemaSourceSchema = zod_1.z.union([
|
|
311
|
+
zod_1.z.object({ inline: SchemaInlineSourceSchema }).strict(),
|
|
312
|
+
zod_1.z.object({ s3: SchemaS3SourceSchema }).strict(),
|
|
313
|
+
]);
|
|
314
|
+
// ============================================================================
|
|
315
|
+
// HTTP Runtime Configuration
|
|
316
|
+
// ============================================================================
|
|
317
|
+
exports.HttpRuntimeConfigSchema = zod_1.z
|
|
318
|
+
.object({
|
|
319
|
+
runtime: zod_1.z.string().min(1),
|
|
320
|
+
runtimeEndpoint: zod_1.z.string().min(1).optional(),
|
|
321
|
+
})
|
|
322
|
+
.strict();
|
|
323
|
+
// ============================================================================
|
|
324
|
+
// Passthrough Target Configuration
|
|
325
|
+
// ============================================================================
|
|
326
|
+
exports.StickinessConfigSchema = zod_1.z
|
|
327
|
+
.object({
|
|
328
|
+
identifier: zod_1.z.string().min(1).max(256),
|
|
329
|
+
timeout: zod_1.z.number().int().min(1).max(86400).optional(),
|
|
330
|
+
})
|
|
331
|
+
.strict();
|
|
332
|
+
/**
|
|
333
|
+
* Passthrough protocol type. HTTP is NOT valid — use CUSTOM for plain HTTP/REST backends.
|
|
334
|
+
*/
|
|
335
|
+
exports.PassthroughProtocolTypeSchema = zod_1.z.enum(['MCP', 'A2A', 'INFERENCE', 'CUSTOM']);
|
|
336
|
+
exports.PassthroughConfigSchema = zod_1.z
|
|
337
|
+
.object({
|
|
338
|
+
endpoint: zod_1.z
|
|
339
|
+
.string()
|
|
340
|
+
.min(1)
|
|
341
|
+
.regex(/^https:\/\/[a-zA-Z0-9\-.]+(:[0-9]{1,5})?(\/.*)?$/, 'Must be a valid HTTPS URL'),
|
|
342
|
+
/** Protocol type for the passthrough backend. Defaults to CUSTOM (generic HTTP/REST). */
|
|
343
|
+
protocolType: exports.PassthroughProtocolTypeSchema.default('CUSTOM'),
|
|
344
|
+
stickinessConfiguration: exports.StickinessConfigSchema.optional(),
|
|
345
|
+
})
|
|
346
|
+
.strict();
|
|
347
|
+
// ============================================================================
|
|
203
348
|
// Gateway Target
|
|
204
349
|
// ============================================================================
|
|
205
350
|
/**
|
|
@@ -218,18 +363,268 @@ exports.AgentCoreGatewayTargetSchema = zod_1.z
|
|
|
218
363
|
toolDefinitions: zod_1.z.array(mcp_defs_1.ToolDefinitionSchema).optional(),
|
|
219
364
|
/** Compute configuration. Required for Lambda/Runtime scaffold targets. */
|
|
220
365
|
compute: exports.ToolComputeConfigSchema.optional(),
|
|
221
|
-
/**
|
|
366
|
+
/** Endpoint URL for mcpServer targets. */
|
|
222
367
|
endpoint: zod_1.z.string().url().optional(),
|
|
223
368
|
/** Outbound auth configuration for the target. */
|
|
224
369
|
outboundAuth: exports.OutboundAuthSchema.optional(),
|
|
370
|
+
/** API Gateway configuration. Required for apiGateway target type. */
|
|
371
|
+
apiGateway: exports.ApiGatewayConfigSchema.optional(),
|
|
372
|
+
/** Schema source for openApiSchema / smithyModel targets. */
|
|
373
|
+
schemaSource: exports.SchemaSourceSchema.optional(),
|
|
374
|
+
/** Lambda Function ARN configuration. Required for lambdaFunctionArn target type. */
|
|
375
|
+
lambdaFunctionArn: exports.LambdaFunctionArnConfigSchema.optional(),
|
|
376
|
+
/** HTTP Runtime configuration. Required for httpRuntime target type. */
|
|
377
|
+
httpRuntime: exports.HttpRuntimeConfigSchema.optional(),
|
|
378
|
+
/**
|
|
379
|
+
* Managed-service connector identifier. Required for `connector` target type.
|
|
380
|
+
*/
|
|
381
|
+
connectorId: exports.ConnectorIdSchema.optional(),
|
|
382
|
+
/**
|
|
383
|
+
* For `bedrock-knowledge-bases` connector targets: either a project KB
|
|
384
|
+
* name (an entry in `knowledgeBases[]` on the project spec) or a literal
|
|
385
|
+
* 10-character KB ID (refers to an external KB this project does not
|
|
386
|
+
* own). The L3 disambiguates by regex match: a 10-char uppercase-
|
|
387
|
+
* alphanumeric value is used verbatim, anything else is looked up in
|
|
388
|
+
* `application.knowledgeBases`. Mutually exclusive with
|
|
389
|
+
* `knowledgeBaseIds`.
|
|
390
|
+
*/
|
|
391
|
+
knowledgeBaseId: zod_1.z
|
|
392
|
+
.string()
|
|
393
|
+
.min(1)
|
|
394
|
+
.max(48)
|
|
395
|
+
.regex(/^[a-zA-Z0-9_-]+$/, 'Must be a KB name (1-48 chars, letters/digits/dash/underscore) or a 10-char KB ID')
|
|
396
|
+
.optional(),
|
|
397
|
+
/**
|
|
398
|
+
* For `bedrock-agentic-retrieve` connector targets only. List of project
|
|
399
|
+
* KB names or literal 10-char external KB IDs that this orchestrated
|
|
400
|
+
* retriever should fan out across. Each entry is disambiguated the same
|
|
401
|
+
* way `knowledgeBaseId` is. Mutually exclusive with `knowledgeBaseId`.
|
|
402
|
+
*/
|
|
403
|
+
knowledgeBaseIds: zod_1.z
|
|
404
|
+
.array(zod_1.z
|
|
405
|
+
.string()
|
|
406
|
+
.min(1)
|
|
407
|
+
.max(48)
|
|
408
|
+
.regex(/^[a-zA-Z0-9_-]+$/, 'Each entry must be a KB name (1-48 chars) or a 10-char KB ID'))
|
|
409
|
+
.min(1)
|
|
410
|
+
.optional(),
|
|
411
|
+
/** Passthrough configuration. Required for passthrough target type. */
|
|
412
|
+
passthrough: exports.PassthroughConfigSchema.optional(),
|
|
413
|
+
/**
|
|
414
|
+
* For `webSearch` target type only. Domains to exclude from web search
|
|
415
|
+
* results. Maps to the connector's `domainFilter.exclude` parameterValue
|
|
416
|
+
* at synth time.
|
|
417
|
+
*/
|
|
418
|
+
excludeDomains: zod_1.z.array(zod_1.z.string().min(1)).min(1).optional(),
|
|
225
419
|
})
|
|
226
420
|
.strict()
|
|
227
421
|
.superRefine((data, ctx) => {
|
|
228
|
-
if (data.targetType === '
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
422
|
+
if (data.targetType === 'apiGateway') {
|
|
423
|
+
if (!data.apiGateway) {
|
|
424
|
+
ctx.addIssue({
|
|
425
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
426
|
+
message: 'apiGateway config is required for apiGateway target type',
|
|
427
|
+
path: ['apiGateway'],
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
if (data.compute) {
|
|
431
|
+
ctx.addIssue({
|
|
432
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
433
|
+
message: 'compute is not applicable for apiGateway target type',
|
|
434
|
+
path: ['compute'],
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
if (data.endpoint) {
|
|
438
|
+
ctx.addIssue({
|
|
439
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
440
|
+
message: 'endpoint is not applicable for apiGateway target type',
|
|
441
|
+
path: ['endpoint'],
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
445
|
+
ctx.addIssue({
|
|
446
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
447
|
+
message: 'toolDefinitions is not applicable for apiGateway target type',
|
|
448
|
+
path: ['toolDefinitions'],
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
if (data.lambdaFunctionArn) {
|
|
452
|
+
ctx.addIssue({
|
|
453
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
454
|
+
message: 'lambdaFunctionArn is not applicable for apiGateway target type',
|
|
455
|
+
path: ['lambdaFunctionArn'],
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (data.targetType === 'lambdaFunctionArn') {
|
|
460
|
+
if (!data.lambdaFunctionArn) {
|
|
461
|
+
ctx.addIssue({
|
|
462
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
463
|
+
message: 'lambdaFunctionArn config is required for lambdaFunctionArn target type',
|
|
464
|
+
path: ['lambdaFunctionArn'],
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
if (data.compute) {
|
|
468
|
+
ctx.addIssue({
|
|
469
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
470
|
+
message: 'compute is not applicable for lambdaFunctionArn target type',
|
|
471
|
+
path: ['compute'],
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
if (data.endpoint) {
|
|
475
|
+
ctx.addIssue({
|
|
476
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
477
|
+
message: 'endpoint is not applicable for lambdaFunctionArn target type',
|
|
478
|
+
path: ['endpoint'],
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
if (data.apiGateway) {
|
|
482
|
+
ctx.addIssue({
|
|
483
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
484
|
+
message: 'apiGateway is not applicable for lambdaFunctionArn target type',
|
|
485
|
+
path: ['apiGateway'],
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
489
|
+
ctx.addIssue({
|
|
490
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
491
|
+
message: 'toolDefinitions is not applicable for lambdaFunctionArn target type (tools are defined via toolSchemaFile)',
|
|
492
|
+
path: ['toolDefinitions'],
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
if (data.outboundAuth) {
|
|
496
|
+
ctx.addIssue({
|
|
497
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
498
|
+
message: 'outboundAuth is not applicable for lambdaFunctionArn target type',
|
|
499
|
+
path: ['outboundAuth'],
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (data.targetType === 'httpRuntime') {
|
|
504
|
+
if (!data.httpRuntime) {
|
|
505
|
+
ctx.addIssue({
|
|
506
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
507
|
+
message: 'httpRuntime targets require an httpRuntime configuration (with a runtime reference).',
|
|
508
|
+
path: ['httpRuntime'],
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (data.endpoint) {
|
|
512
|
+
ctx.addIssue({
|
|
513
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
514
|
+
message: 'httpRuntime targets should use httpRuntime.runtimeEndpoint instead of endpoint.',
|
|
515
|
+
path: ['endpoint'],
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
// toolDefinitions requires a length check since it's an array
|
|
519
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
520
|
+
ctx.addIssue({
|
|
521
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
522
|
+
message: 'toolDefinitions is not applicable for httpRuntime target type',
|
|
523
|
+
path: ['toolDefinitions'],
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
const HTTP_RUNTIME_DISALLOWED_FIELDS = ['compute', 'apiGateway', 'lambdaFunctionArn'];
|
|
527
|
+
for (const field of HTTP_RUNTIME_DISALLOWED_FIELDS) {
|
|
528
|
+
if (data[field]) {
|
|
529
|
+
ctx.addIssue({
|
|
530
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
531
|
+
message: `${field} is not applicable for httpRuntime target type`,
|
|
532
|
+
path: [field],
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (data.targetType === 'passthrough') {
|
|
538
|
+
if (!data.passthrough) {
|
|
539
|
+
ctx.addIssue({
|
|
540
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
541
|
+
message: 'passthrough targets require a passthrough configuration (with an endpoint).',
|
|
542
|
+
path: ['passthrough'],
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
if (data.endpoint) {
|
|
546
|
+
ctx.addIssue({
|
|
547
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
548
|
+
message: 'passthrough targets should use passthrough.endpoint instead of endpoint.',
|
|
549
|
+
path: ['endpoint'],
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
553
|
+
ctx.addIssue({
|
|
554
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
555
|
+
message: 'toolDefinitions is not applicable for passthrough target type',
|
|
556
|
+
path: ['toolDefinitions'],
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
const PASSTHROUGH_DISALLOWED_FIELDS = ['compute', 'apiGateway', 'lambdaFunctionArn', 'httpRuntime'];
|
|
560
|
+
for (const field of PASSTHROUGH_DISALLOWED_FIELDS) {
|
|
561
|
+
if (data[field]) {
|
|
562
|
+
ctx.addIssue({
|
|
563
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
564
|
+
message: `${field} is not applicable for passthrough target type`,
|
|
565
|
+
path: [field],
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if (data.targetType === 'openApiSchema' || data.targetType === 'smithyModel') {
|
|
571
|
+
if (!data.schemaSource) {
|
|
572
|
+
ctx.addIssue({
|
|
573
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
574
|
+
message: `${data.targetType} targets require a schemaSource.`,
|
|
575
|
+
path: ['schemaSource'],
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
if (data.compute) {
|
|
579
|
+
ctx.addIssue({
|
|
580
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
581
|
+
message: `compute is not applicable for ${data.targetType} target type`,
|
|
582
|
+
path: ['compute'],
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
if (data.endpoint) {
|
|
586
|
+
ctx.addIssue({
|
|
587
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
588
|
+
message: `endpoint is not applicable for ${data.targetType} target type`,
|
|
589
|
+
path: ['endpoint'],
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
593
|
+
ctx.addIssue({
|
|
594
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
595
|
+
message: `toolDefinitions is not applicable for ${data.targetType} target type`,
|
|
596
|
+
path: ['toolDefinitions'],
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
if (data.apiGateway) {
|
|
600
|
+
ctx.addIssue({
|
|
601
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
602
|
+
message: `apiGateway config is not applicable for ${data.targetType} target type`,
|
|
603
|
+
path: ['apiGateway'],
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (data.targetType === 'mcpServer') {
|
|
608
|
+
if (!data.compute && !data.endpoint) {
|
|
609
|
+
ctx.addIssue({
|
|
610
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
611
|
+
message: 'MCP Server targets require either an endpoint URL or compute configuration.',
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
if (data.apiGateway) {
|
|
615
|
+
ctx.addIssue({
|
|
616
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
617
|
+
message: 'apiGateway is not applicable for mcpServer target type',
|
|
618
|
+
path: ['apiGateway'],
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
if (data.lambdaFunctionArn) {
|
|
622
|
+
ctx.addIssue({
|
|
623
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
624
|
+
message: 'lambdaFunctionArn is not applicable for mcpServer target type',
|
|
625
|
+
path: ['lambdaFunctionArn'],
|
|
626
|
+
});
|
|
627
|
+
}
|
|
233
628
|
}
|
|
234
629
|
if (data.targetType === 'lambda' && !data.compute) {
|
|
235
630
|
ctx.addIssue({
|
|
@@ -245,30 +640,314 @@ exports.AgentCoreGatewayTargetSchema = zod_1.z
|
|
|
245
640
|
path: ['toolDefinitions'],
|
|
246
641
|
});
|
|
247
642
|
}
|
|
248
|
-
if (data.
|
|
643
|
+
if (data.targetType === 'connector') {
|
|
644
|
+
if (!data.connectorId) {
|
|
645
|
+
ctx.addIssue({
|
|
646
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
647
|
+
message: 'connectorId is required for connector target type',
|
|
648
|
+
path: ['connectorId'],
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
if (data.connectorId === exports.CONNECTOR_ID.BEDROCK_KNOWLEDGE_BASES) {
|
|
652
|
+
if (!data.knowledgeBaseId) {
|
|
653
|
+
ctx.addIssue({
|
|
654
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
655
|
+
message: `knowledgeBaseId is required for connectorId '${data.connectorId}'`,
|
|
656
|
+
path: ['knowledgeBaseId'],
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
if (data.knowledgeBaseIds) {
|
|
660
|
+
ctx.addIssue({
|
|
661
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
662
|
+
message: `knowledgeBaseIds is not applicable for connectorId '${data.connectorId}' (use knowledgeBaseId)`,
|
|
663
|
+
path: ['knowledgeBaseIds'],
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
if (data.connectorId === exports.CONNECTOR_ID.BEDROCK_AGENTIC_RETRIEVE) {
|
|
668
|
+
if (!data.knowledgeBaseIds || data.knowledgeBaseIds.length === 0) {
|
|
669
|
+
ctx.addIssue({
|
|
670
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
671
|
+
message: `knowledgeBaseIds (non-empty) is required for connectorId '${data.connectorId}'`,
|
|
672
|
+
path: ['knowledgeBaseIds'],
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
if (data.knowledgeBaseId) {
|
|
676
|
+
ctx.addIssue({
|
|
677
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
678
|
+
message: `knowledgeBaseId is not applicable for connectorId '${data.connectorId}' (use knowledgeBaseIds)`,
|
|
679
|
+
path: ['knowledgeBaseId'],
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (data.excludeDomains) {
|
|
684
|
+
ctx.addIssue({
|
|
685
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
686
|
+
message: `excludeDomains only applies to webSearch target type`,
|
|
687
|
+
path: ['excludeDomains'],
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
if (data.compute) {
|
|
691
|
+
ctx.addIssue({
|
|
692
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
693
|
+
message: 'compute is not applicable for connector target type',
|
|
694
|
+
path: ['compute'],
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
if (data.endpoint) {
|
|
698
|
+
ctx.addIssue({
|
|
699
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
700
|
+
message: 'endpoint is not applicable for connector target type',
|
|
701
|
+
path: ['endpoint'],
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
705
|
+
ctx.addIssue({
|
|
706
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
707
|
+
message: 'toolDefinitions is not applicable for connector target type',
|
|
708
|
+
path: ['toolDefinitions'],
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
if (data.apiGateway) {
|
|
712
|
+
ctx.addIssue({
|
|
713
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
714
|
+
message: 'apiGateway is not applicable for connector target type',
|
|
715
|
+
path: ['apiGateway'],
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
if (data.lambdaFunctionArn) {
|
|
719
|
+
ctx.addIssue({
|
|
720
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
721
|
+
message: 'lambdaFunctionArn is not applicable for connector target type',
|
|
722
|
+
path: ['lambdaFunctionArn'],
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
if (data.schemaSource) {
|
|
726
|
+
ctx.addIssue({
|
|
727
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
728
|
+
message: 'schemaSource is not applicable for connector target type',
|
|
729
|
+
path: ['schemaSource'],
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (data.targetType === 'webSearch') {
|
|
734
|
+
// Web search is invoked via the gateway's IAM role and takes only an
|
|
735
|
+
// optional excludeDomains list. Reject anything else.
|
|
736
|
+
if (data.compute) {
|
|
737
|
+
ctx.addIssue({
|
|
738
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
739
|
+
message: 'compute is not applicable for webSearch target type',
|
|
740
|
+
path: ['compute'],
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
if (data.endpoint) {
|
|
744
|
+
ctx.addIssue({
|
|
745
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
746
|
+
message: 'endpoint is not applicable for webSearch target type',
|
|
747
|
+
path: ['endpoint'],
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
if (data.toolDefinitions && data.toolDefinitions.length > 0) {
|
|
751
|
+
ctx.addIssue({
|
|
752
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
753
|
+
message: 'toolDefinitions is not applicable for webSearch target type',
|
|
754
|
+
path: ['toolDefinitions'],
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
if (data.apiGateway) {
|
|
758
|
+
ctx.addIssue({
|
|
759
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
760
|
+
message: 'apiGateway is not applicable for webSearch target type',
|
|
761
|
+
path: ['apiGateway'],
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
if (data.lambdaFunctionArn) {
|
|
765
|
+
ctx.addIssue({
|
|
766
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
767
|
+
message: 'lambdaFunctionArn is not applicable for webSearch target type',
|
|
768
|
+
path: ['lambdaFunctionArn'],
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
if (data.schemaSource) {
|
|
772
|
+
ctx.addIssue({
|
|
773
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
774
|
+
message: 'schemaSource is not applicable for webSearch target type',
|
|
775
|
+
path: ['schemaSource'],
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
if (data.httpRuntime) {
|
|
779
|
+
ctx.addIssue({
|
|
780
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
781
|
+
message: 'httpRuntime is not applicable for webSearch target type',
|
|
782
|
+
path: ['httpRuntime'],
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
if (data.passthrough) {
|
|
786
|
+
ctx.addIssue({
|
|
787
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
788
|
+
message: 'passthrough is not applicable for webSearch target type',
|
|
789
|
+
path: ['passthrough'],
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
if (data.outboundAuth && data.outboundAuth.type !== 'NONE') {
|
|
793
|
+
ctx.addIssue({
|
|
794
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
795
|
+
message: 'outboundAuth is not applicable for webSearch target type (uses gateway IAM role)',
|
|
796
|
+
path: ['outboundAuth'],
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
if (data.connectorId) {
|
|
800
|
+
ctx.addIssue({
|
|
801
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
802
|
+
message: 'connectorId is not applicable for webSearch target type',
|
|
803
|
+
path: ['connectorId'],
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
if (data.knowledgeBaseId) {
|
|
807
|
+
ctx.addIssue({
|
|
808
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
809
|
+
message: 'knowledgeBaseId is not applicable for webSearch target type',
|
|
810
|
+
path: ['knowledgeBaseId'],
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
if (data.knowledgeBaseIds) {
|
|
814
|
+
ctx.addIssue({
|
|
815
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
816
|
+
message: 'knowledgeBaseIds is not applicable for webSearch target type',
|
|
817
|
+
path: ['knowledgeBaseIds'],
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
if (data.targetType !== 'connector' && data.targetType !== 'webSearch') {
|
|
822
|
+
if (data.connectorId) {
|
|
823
|
+
ctx.addIssue({
|
|
824
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
825
|
+
message: `connectorId only applies to connector target type`,
|
|
826
|
+
path: ['connectorId'],
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
if (data.knowledgeBaseId) {
|
|
830
|
+
ctx.addIssue({
|
|
831
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
832
|
+
message: `knowledgeBaseId only applies to connector target type`,
|
|
833
|
+
path: ['knowledgeBaseId'],
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
if (data.knowledgeBaseIds) {
|
|
837
|
+
ctx.addIssue({
|
|
838
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
839
|
+
message: `knowledgeBaseIds only applies to connector target type`,
|
|
840
|
+
path: ['knowledgeBaseIds'],
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
if (data.excludeDomains) {
|
|
844
|
+
ctx.addIssue({
|
|
845
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
846
|
+
message: `excludeDomains only applies to webSearch target type`,
|
|
847
|
+
path: ['excludeDomains'],
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
// Centralized outbound auth validation (driven by TARGET_TYPE_AUTH_CONFIG)
|
|
852
|
+
const authConfig = exports.TARGET_TYPE_AUTH_CONFIG[data.targetType];
|
|
853
|
+
const authType = data.outboundAuth?.type ?? 'NONE';
|
|
854
|
+
if (authConfig.authRequired && authType === 'NONE') {
|
|
855
|
+
ctx.addIssue({
|
|
856
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
857
|
+
message: `${data.targetType} targets require outbound auth (${authConfig.validAuthTypes.join(' or ')})`,
|
|
858
|
+
path: ['outboundAuth'],
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
if (authConfig.validAuthTypes.length === 0 && authType !== 'NONE') {
|
|
862
|
+
ctx.addIssue({
|
|
863
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
864
|
+
message: `${data.targetType} targets use IAM role auth; outboundAuth is not applicable`,
|
|
865
|
+
path: ['outboundAuth'],
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
if (authConfig.validAuthTypes.length > 0 && authType !== 'NONE' && !authConfig.validAuthTypes.includes(authType)) {
|
|
869
|
+
ctx.addIssue({
|
|
870
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
871
|
+
message: `${data.targetType} targets do not support ${authType} outbound auth`,
|
|
872
|
+
path: ['outboundAuth'],
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
if (data.outboundAuth &&
|
|
876
|
+
data.outboundAuth.type !== 'NONE' &&
|
|
877
|
+
data.outboundAuth.type !== 'GATEWAY_IAM_ROLE' &&
|
|
878
|
+
data.outboundAuth.type !== 'JWT_PASSTHROUGH' &&
|
|
879
|
+
!data.outboundAuth.credentialName) {
|
|
249
880
|
ctx.addIssue({
|
|
250
881
|
code: zod_1.z.ZodIssueCode.custom,
|
|
251
882
|
message: `${data.outboundAuth.type} outbound auth requires a credentialName.`,
|
|
252
883
|
path: ['outboundAuth', 'credentialName'],
|
|
253
884
|
});
|
|
254
885
|
}
|
|
886
|
+
// GATEWAY_IAM_ROLE on passthrough requires service
|
|
887
|
+
if (data.targetType === 'passthrough' &&
|
|
888
|
+
data.outboundAuth?.type === 'GATEWAY_IAM_ROLE' &&
|
|
889
|
+
!data.outboundAuth.service) {
|
|
890
|
+
ctx.addIssue({
|
|
891
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
892
|
+
message: 'GATEWAY_IAM_ROLE outbound auth on passthrough targets requires a service name.',
|
|
893
|
+
path: ['outboundAuth', 'service'],
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
// JWT_PASSTHROUGH is only valid for passthrough targets
|
|
897
|
+
if (data.outboundAuth?.type === 'JWT_PASSTHROUGH' && data.targetType !== 'passthrough') {
|
|
898
|
+
ctx.addIssue({
|
|
899
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
900
|
+
message: 'JWT_PASSTHROUGH outbound auth is only valid for passthrough targets.',
|
|
901
|
+
path: ['outboundAuth', 'type'],
|
|
902
|
+
});
|
|
903
|
+
}
|
|
255
904
|
});
|
|
256
905
|
// ============================================================================
|
|
257
906
|
// Gateway
|
|
258
907
|
// ============================================================================
|
|
908
|
+
// ── Gateway Exception Level ──
|
|
909
|
+
/** Controls the verbosity of error responses returned by the gateway. */
|
|
910
|
+
exports.GatewayExceptionLevelSchema = zod_1.z.enum(['NONE', 'DEBUG']);
|
|
911
|
+
// ── Gateway Policy Engine Configuration ──
|
|
912
|
+
exports.PolicyEngineModeSchema = zod_1.z.enum(['LOG_ONLY', 'ENFORCE']);
|
|
913
|
+
exports.GatewayPolicyEngineConfigurationSchema = zod_1.z
|
|
914
|
+
.object({
|
|
915
|
+
policyEngineName: zod_1.z.string().min(1),
|
|
916
|
+
mode: exports.PolicyEngineModeSchema,
|
|
917
|
+
})
|
|
918
|
+
.strict();
|
|
259
919
|
/**
|
|
260
920
|
* Gateway abstraction with opinionated defaults.
|
|
261
921
|
* Supports NONE (default) or CUSTOM_JWT authorizer types.
|
|
262
922
|
*/
|
|
923
|
+
/** Protocol type for the gateway. */
|
|
924
|
+
exports.GatewayProtocolTypeSchema = zod_1.z.enum(['MCP', 'None']);
|
|
263
925
|
exports.AgentCoreGatewaySchema = zod_1.z
|
|
264
926
|
.object({
|
|
265
927
|
name: agent_env_1.GatewayNameSchema,
|
|
928
|
+
/** Actual AWS resource name for imported gateways. When set, CDK uses this instead of generating projectName-name. */
|
|
929
|
+
resourceName: agent_env_1.GatewayNameSchema.optional(),
|
|
266
930
|
description: zod_1.z.string().optional(),
|
|
267
931
|
targets: zod_1.z.array(exports.AgentCoreGatewayTargetSchema),
|
|
268
932
|
/** Authorization type for the gateway. Defaults to 'NONE'. */
|
|
269
|
-
authorizerType:
|
|
933
|
+
authorizerType: auth_1.GatewayAuthorizerTypeSchema.default('NONE'),
|
|
270
934
|
/** Authorizer configuration. Required when authorizerType is 'CUSTOM_JWT'. */
|
|
271
|
-
authorizerConfiguration:
|
|
935
|
+
authorizerConfiguration: auth_1.GatewayAuthorizerConfigSchema.optional(),
|
|
936
|
+
/** Whether to enable semantic search for tool discovery. Defaults to true. */
|
|
937
|
+
enableSemanticSearch: zod_1.z.boolean().default(true),
|
|
938
|
+
/** Exception verbosity level. 'NONE' = generic errors (default), 'DEBUG' = verbose errors. */
|
|
939
|
+
exceptionLevel: exports.GatewayExceptionLevelSchema.default('NONE'),
|
|
940
|
+
/** Protocol type for the gateway. 'None' gateways skip protocol configuration. */
|
|
941
|
+
protocolType: exports.GatewayProtocolTypeSchema.optional(),
|
|
942
|
+
/** Policy engine configuration for Cedar-based authorization of tool calls. */
|
|
943
|
+
policyEngineConfiguration: exports.GatewayPolicyEngineConfigurationSchema.optional(),
|
|
944
|
+
/** ARN of an existing IAM execution role. When set, CDK uses this role instead of creating a new one. */
|
|
945
|
+
executionRoleArn: zod_1.z
|
|
946
|
+
.string()
|
|
947
|
+
.regex(/^arn:[^:]+:iam::\d{12}:role\/.+/, 'Must be a valid IAM role ARN')
|
|
948
|
+
.max(2048)
|
|
949
|
+
.optional(),
|
|
950
|
+
tags: tags_1.TagsSchema.optional(),
|
|
272
951
|
})
|
|
273
952
|
.strict()
|
|
274
953
|
.refine(data => {
|
|
@@ -280,6 +959,19 @@ exports.AgentCoreGatewaySchema = zod_1.z
|
|
|
280
959
|
}, {
|
|
281
960
|
message: 'customJwtAuthorizer configuration is required when authorizerType is CUSTOM_JWT',
|
|
282
961
|
path: ['authorizerConfiguration'],
|
|
962
|
+
})
|
|
963
|
+
.superRefine((gw, ctx) => {
|
|
964
|
+
// A protocolType: "None" (HTTP) gateway is a superset: it can host any target
|
|
965
|
+
// type, including MCP targets (mcpServer, connector, KB, etc.). Only an MCP
|
|
966
|
+
// gateway is restrictive — it cannot host the HTTP-only target types.
|
|
967
|
+
for (const target of gw.targets) {
|
|
968
|
+
if (gw.protocolType !== 'None' && exports.NON_MCP_TARGET_TYPES.includes(target.targetType)) {
|
|
969
|
+
ctx.addIssue({
|
|
970
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
971
|
+
message: `Target "${target.name}" is ${target.targetType} but gateway does not have protocolType: "None". Add --protocol-type None when creating the gateway.`,
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
}
|
|
283
975
|
});
|
|
284
976
|
// ============================================================================
|
|
285
977
|
// MCP Runtime Tool
|
|
@@ -291,7 +983,7 @@ exports.AgentCoreGatewaySchema = zod_1.z
|
|
|
291
983
|
*/
|
|
292
984
|
exports.McpRuntimeBindingSchema = zod_1.z
|
|
293
985
|
.object({
|
|
294
|
-
|
|
986
|
+
runtimeName: zod_1.z.string().min(1),
|
|
295
987
|
envVarName: agent_env_1.EnvVarNameSchema,
|
|
296
988
|
})
|
|
297
989
|
.strict();
|