@aws/nx-plugin 1.0.0-rc.71 → 1.0.0-rc.72
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/migrations.json +6 -1
- package/package.json +1 -1
- package/src/agentcore-harness/generator.d.ts +1 -1
- package/src/infra/app/generator.d.ts +1 -1
- package/src/init/generator.d.ts +1 -1
- package/src/license/dependency-check/evaluator.js +55 -10
- package/src/license/dependency-check/evaluator.js.map +1 -1
- package/src/migrations/latest/py-agent-session-management-support/metadata.json +3 -0
- package/src/migrations/latest/py-agent-session-management-support/migration.d.ts +2 -0
- package/src/migrations/latest/py-agent-session-management-support/migration.js +308 -0
- package/src/migrations/latest/py-agent-session-management-support/migration.js.map +1 -0
- package/src/preset/generator.d.ts +1 -1
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +615 -6
- package/src/py/agent/__snapshots__/generator.core.spec.ts.snap +186 -0
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +47 -3
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +667 -2
- package/src/py/agent/files/langchain/common/__init__.py.template +0 -0
- package/src/py/agent/files/langchain/common/agent.py.template +3 -3
- package/src/py/agent/files/langchain/common/session.py.template +61 -0
- package/src/py/agent/files/strands/ag-ui/main.py.template +5 -1
- package/src/py/agent/files/strands/common/agent.py.template +9 -2
- package/src/py/agent/files/strands/common/session.py.template +36 -0
- package/src/py/agent/generator.d.ts +11 -1
- package/src/py/agent/generator.js +78 -28
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +2 -0
- package/src/py/agent/react-connection/generator.d.ts +1 -1
- package/src/py/agent/schema.d.js.map +1 -1
- package/src/py/agent/schema.d.ts +1 -1
- package/src/py/agent/schema.json +3 -3
- package/src/py/fast-api/react/generator.d.ts +1 -1
- package/src/smithy/project/generator.d.ts +1 -1
- package/src/smithy/react-connection/generator.d.ts +1 -1
- package/src/terraform/project/generator.d.ts +1 -1
- package/src/trpc/react/generator.d.ts +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +27 -6
- package/src/ts/agent/a2a-connection/generator.d.ts +1 -1
- package/src/ts/agent/gateway-connection/generator.d.ts +1 -1
- package/src/ts/agent/mcp-connection/generator.d.ts +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +1 -1
- package/src/ts/astro-docs/generator.d.ts +1 -1
- package/src/ts/dcr-proxy/generator.d.ts +1 -1
- package/src/ts/dynamodb/generator.d.ts +1 -1
- package/src/ts/lambda-function/generator.d.ts +1 -1
- package/src/ts/lib/generator.d.ts +1 -1
- package/src/ts/nx-generator/generator.d.ts +1 -1
- package/src/ts/nx-migration/generator.d.ts +1 -1
- package/src/ts/nx-plugin/generator.d.ts +1 -1
- package/src/ts/rdb/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/utils/agent-connection/agent-connection.d.ts +10 -0
- package/src/utils/agent-connection/agent-connection.js +15 -0
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +5 -3
- package/src/utils/agent-connection/files/py-core-langchain/s3/s3_checkpoint_saver_langchain.py.template +360 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +2 -4
- package/src/utils/agent-connection/files/py-core-strands/base/tool_errors_strands.py.template +24 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +1 -1
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +113 -13
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +76 -7
- package/src/utils/versions.d.ts +3 -0
- package/src/utils/versions.js +3 -0
- package/src/utils/versions.js.map +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from strands.hooks import AfterToolCallEvent, HookRegistry
|
|
4
|
+
|
|
5
|
+
logger = logging.getLogger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class _LogToolErrors:
|
|
9
|
+
def register_hooks(self, registry: HookRegistry, **_kwargs) -> None:
|
|
10
|
+
registry.add_callback(AfterToolCallEvent, self._on_after_tool_call)
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def _on_after_tool_call(event: AfterToolCallEvent) -> None:
|
|
14
|
+
tool_name = event.tool_use.get("name", "<unknown>")
|
|
15
|
+
if event.exception is not None:
|
|
16
|
+
logger.error("Tool '%s' failed: %s", tool_name, event.exception)
|
|
17
|
+
return
|
|
18
|
+
if event.result.get("status") != "error":
|
|
19
|
+
return
|
|
20
|
+
message = " ".join(block["text"] for block in event.result.get("content", []) if "text" in block)
|
|
21
|
+
logger.error("Tool '%s' failed%s", tool_name, f": {message}" if message else "")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
log_tool_errors = _LogToolErrors()
|
|
@@ -45,7 +45,7 @@ export declare const AGENT_CORE_CONSTRUCTS_PY_DEPENDENCIES: readonly [{
|
|
|
45
45
|
readonly when: (m: IacMetadata) => boolean;
|
|
46
46
|
}];
|
|
47
47
|
export type AgentCoreAuth = 'iam' | 'cognito';
|
|
48
|
-
export type AgentCoreSession = 's3' | 'in-memory';
|
|
48
|
+
export type AgentCoreSession = 's3' | 'dynamodb-s3' | 'in-memory';
|
|
49
49
|
export interface AddAgentCoreInfraProps {
|
|
50
50
|
nameClassName: string;
|
|
51
51
|
nameKebabCase: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport { addStarExport } from '../ast';\nimport type { Containers } from '../containers';\nimport {\n type DeclaredPyDependency,\n type DeclaredTsDependency,\n type DependencyDeclaration,\n forDependencies,\n type MustDeclare,\n} from '../declared-dependencies';\nimport { addDependenciesToPackageJson } from '../dependencies';\nimport type { Iac } from '../iac';\nimport { esmVars } from '../module-format';\nimport { addDependencyToTargetIfNotPresent } from '../nx';\nimport {\n generatedInfrastructure,\n generatedTerraform,\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_TERRAFORM_DIR,\n} from '../shared-constructs-constants';\nimport {\n type IPyDepVersion,\n type ITsDepVersion,\n PY_VERSIONS,\n terraformProviderVersions,\n withVersions,\n} from '../versions';\n\ntype IACProvider = { iac: Iac };\n\n/**\n * Dependencies a caller must declare to add an AgentCore Gateway construct.\n *\n * Gated on infrastructure having been generated, since the construct helpers only\n * run on that branch.\n */\nexport const AGENT_CORE_CONSTRUCTS_DEPENDENCIES = [\n { name: 'ejs', when: generatedInfrastructure },\n { name: '@aws-sdk/client-bedrock-agentcore', when: generatedInfrastructure },\n { name: '@types/ejs', when: generatedInfrastructure },\n] as const satisfies readonly DeclaredTsDependency<\n ITsDepVersion,\n IacMetadata\n>[];\n\n/**\n * Python versions the generated Terraform pins in an inline `uv run --with`\n * script, rather than in any `pyproject.toml`.\n *\n * Spread through `ownedElsewhere` because nothing installs them into the\n * workspace — the pin is owned so the version sync keeps it current, and gated on\n * Terraform since the CDK branch writes no such script.\n */\nexport const AGENT_CORE_CONSTRUCTS_PY_DEPENDENCIES = [\n { name: 'boto3', when: generatedTerraform },\n { name: 'httpx', when: generatedTerraform },\n { name: 'mcp', when: generatedTerraform },\n] as const satisfies readonly DeclaredPyDependency<\n IPyDepVersion,\n IacMetadata\n>[];\n\nexport type AgentCoreAuth = 'iam' | 'cognito';\n\nexport type AgentCoreSession = 's3' | 'in-memory';\n\nexport interface AddAgentCoreInfraProps {\n nameClassName: string;\n nameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n appDirectory: string;\n serverProtocol: 'mcp' | 'http' | 'a2a';\n auth: AgentCoreAuth;\n /** How this runtime's session should be persisted. MCP servers have no session, so pass 'in-memory'. */\n session: AgentCoreSession;\n containers: Containers;\n}\n\nconst addAgentCoreInfra = async (\n tree: Tree,\n options: AddAgentCoreInfraProps & { iac: Iac },\n) => {\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreCDKInfra(tree, options);\n break;\n case 'terraform':\n addAgentCoreTerraformInfra(tree, options);\n break;\n }\n\n // Update shared constructs/terraform project configuration to depend on this project\n updateJson(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n options.iac === 'cdk' ? SHARED_CONSTRUCTS_DIR : SHARED_TERRAFORM_DIR,\n 'project.json',\n ),\n (config: ProjectConfiguration) => {\n addDependencyToTargetIfNotPresent(\n config,\n 'build',\n `${options.projectName}:build`,\n );\n return config;\n },\n );\n};\n\nconst addAgentCoreCDKInfra = async (\n tree: Tree,\n options: AddAgentCoreInfraProps,\n) => {\n // Generate app specific CDK construct\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'cdk', 'app', 'agent-core'),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n options.appDirectory,\n ),\n { ...options, ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Export app specific CDK construct\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n options.appDirectory,\n 'index.ts',\n ),\n `./${options.nameKebabCase}/${options.nameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n `./${options.appDirectory}/index.js`,\n );\n};\n\nconst addAgentCoreTerraformInfra = (\n tree: Tree,\n options: AddAgentCoreInfraProps,\n) => {\n // Add the AgentCore shared module\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'core',\n 'agent-core',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'core',\n 'agent-core',\n ),\n {\n containers: options.containers,\n boto3Version: PY_VERSIONS.boto3,\n ...terraformProviderVersions(),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Generate app specific agent core configuration\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agent-core',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n options.appDirectory,\n ),\n { ...options, ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n};\n\nexport interface AddMcpServerInfraProps {\n mcpServerNameClassName: string;\n mcpServerNameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n auth: AgentCoreAuth;\n containers: Containers;\n}\n\n/**\n * Add an MCP server CDK construct\n */\nexport const addMcpServerInfra = async (\n tree: Tree,\n options: AddMcpServerInfraProps & IACProvider,\n) => {\n await addAgentCoreInfra(tree, {\n nameClassName: options.mcpServerNameClassName,\n nameKebabCase: options.mcpServerNameKebabCase,\n dockerImageTag: options.dockerImageTag,\n dockerOutputDir: options.dockerOutputDir,\n projectName: options.projectName,\n appDirectory: 'mcp-servers',\n serverProtocol: 'mcp',\n iac: options.iac,\n auth: options.auth,\n // MCP servers are stateless (no conversation session to persist).\n session: 'in-memory',\n containers: options.containers,\n });\n};\n\nexport interface AddAgentInfraProps {\n agentNameClassName: string;\n agentNameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n auth: AgentCoreAuth;\n session: AgentCoreSession;\n serverProtocol?: 'http' | 'a2a';\n containers: Containers;\n}\n\n/**\n * Add an agent CDK construct\n */\nexport const addAgentInfra = async (\n tree: Tree,\n options: AddAgentInfraProps & IACProvider,\n) => {\n await addAgentCoreInfra(tree, {\n nameClassName: options.agentNameClassName,\n nameKebabCase: options.agentNameKebabCase,\n projectName: options.projectName,\n dockerImageTag: options.dockerImageTag,\n dockerOutputDir: options.dockerOutputDir,\n appDirectory: 'agents',\n session: options.session,\n serverProtocol: options.serverProtocol ?? 'http',\n iac: options.iac,\n auth: options.auth,\n containers: options.containers,\n });\n};\n\nexport interface AddAgentCoreGatewayInfraProps {\n gatewayNameClassName: string;\n gatewayNameKebabCase: string;\n projectName: string;\n projectDirectory: string;\n cedarPolicy: boolean;\n auth: AgentCoreAuth;\n /**\n * The gateway's protocol: mcp aggregates MCP server targets, http proxies\n * agent runtime targets via path-based routing.\n */\n protocol: 'mcp' | 'http';\n}\n\nexport const addAgentCoreGatewayInfra = async <\n const D extends DependencyDeclaration,\n>(\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps & IACProvider,\n declaration: D & MustDeclare<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES, D>,\n) => {\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreGatewayCDKInfra(tree, options, declaration);\n break;\n case 'terraform':\n addAgentCoreGatewayTerraformInfra(tree, options);\n break;\n }\n\n updateJson(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n options.iac === 'cdk' ? SHARED_CONSTRUCTS_DIR : SHARED_TERRAFORM_DIR,\n 'project.json',\n ),\n (config: ProjectConfiguration) => {\n addDependencyToTargetIfNotPresent(\n config,\n 'build',\n `${options.projectName}:build`,\n );\n return config;\n },\n );\n};\n\nconst addAgentCoreGatewayCDKInfra = async (\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps,\n declaration: DependencyDeclaration,\n) => {\n // Generic gateway construct (readiness probe, policy engine, Cedar policy\n // loading) shared by all gateways\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'core',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'core',\n 'agentcore-gateway',\n ),\n { ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'app',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'gateways',\n ),\n {\n nameClassName: options.gatewayNameClassName,\n nameKebabCase: options.gatewayNameKebabCase,\n projectDirectory: options.projectDirectory,\n cedarPolicy: options.cedarPolicy,\n auth: options.auth,\n protocol: options.protocol,\n ...esmVars(tree),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'core',\n 'index.ts',\n ),\n './agentcore-gateway/agentcore-gateway.js',\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'gateways',\n 'index.ts',\n ),\n `./${options.gatewayNameKebabCase}/${options.gatewayNameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n './gateways/index.js',\n );\n\n // The gateway construct renders Cedar policies with ejs and its readiness\n // probe uses the AgentCore SDK client; declare both so the lint passes.\n addDependenciesToPackageJson(\n tree,\n withVersions(\n forDependencies<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES>(declaration),\n ['ejs', '@aws-sdk/client-bedrock-agentcore'],\n ),\n withVersions(\n forDependencies<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES>(declaration),\n ['@types/ejs'],\n ),\n joinPathFragments(PACKAGES_DIR, SHARED_CONSTRUCTS_DIR, 'package.json'),\n );\n};\n\nconst addAgentCoreGatewayTerraformInfra = (\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps,\n) => {\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'core',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'core',\n 'agentcore-gateway',\n ),\n { ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'gateways',\n ),\n {\n nameClassName: options.gatewayNameClassName,\n nameKebabCase: options.gatewayNameKebabCase,\n projectDirectory: options.projectDirectory,\n cedarPolicy: options.cedarPolicy,\n auth: options.auth,\n protocol: options.protocol,\n boto3Version: PY_VERSIONS.boto3,\n httpxVersion: PY_VERSIONS.httpx,\n mcpVersion: PY_VERSIONS.mcp,\n ...terraformProviderVersions(),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // The Cedar render script is only needed when policies are enabled\n if (!options.cedarPolicy) {\n const renderScript = joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'gateways',\n options.gatewayNameKebabCase,\n 'render-cedar.cjs',\n );\n if (tree.exists(renderScript)) {\n tree.delete(renderScript);\n }\n }\n};\n\nexport interface AddAgentCoreHarnessInfraProps {\n harnessNameClassName: string;\n harnessNameKebabCase: string;\n /**\n * Workspace-root-relative harness project root, eg `packages/my-harness`.\n * The `src/PROMPT.md` path both templates read is derived from it.\n */\n projectRoot: string;\n /** Leading-letter-guaranteed, 31-char-truncated resource name prefix. */\n harnessNamePrefix: string;\n}\n\n/**\n * Template substitution context shared by the CDK and Terraform harness\n * branches. Both prompt path fields carry the same workspace-root-relative\n * path, named per provider so each template's usage reads on its own.\n */\ninterface HarnessTemplateContext {\n nameClassName: string;\n nameKebabCase: string;\n harnessNamePrefix: string;\n /** Joined onto `findWorkspaceRoot()` in the CDK construct. */\n promptPathFromCdk: string;\n /** Appended to the `path.module` walk to the workspace root in Terraform. */\n promptPathFromTerraform: string;\n}\n\n/**\n * Add AgentCore Harness infrastructure for the selected IaC provider.\n *\n * Renders the provider-specific Harness infrastructure (a CDK construct or\n * a Terraform module) into the Shared Infrastructure Project with\n * `KeepExisting`, so existing files become user-owned and are never\n * rewritten by reruns.\n *\n * Unlike agents, MCP servers and gateways, no build dependency is added\n * from the shared infrastructure project to the Harness Project: generated\n * Harness infrastructure does not import Harness Project source, so a\n * dependency would only create false rebuild coupling.\n */\nexport const addAgentCoreHarnessInfra = async (\n tree: Tree,\n options: AddAgentCoreHarnessInfraProps & IACProvider,\n): Promise<void> => {\n // One resolved template context, built once and passed to both provider\n // branches. The prompt path is derived from the same projectRoot the\n // Harness Project is written to, so explicit placement needs no extra logic.\n const promptPath = joinPathFragments(options.projectRoot, 'src', 'PROMPT.md');\n const templateContext: HarnessTemplateContext = {\n nameClassName: options.harnessNameClassName,\n nameKebabCase: options.harnessNameKebabCase,\n harnessNamePrefix: options.harnessNamePrefix,\n promptPathFromCdk: promptPath,\n promptPathFromTerraform: promptPath,\n };\n\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreHarnessCDKInfra(tree, templateContext);\n break;\n case 'terraform':\n addAgentCoreHarnessTerraformInfra(tree, templateContext);\n break;\n }\n};\n\nconst addAgentCoreHarnessCDKInfra = async (\n tree: Tree,\n templateContext: HarnessTemplateContext,\n) => {\n // Generate the app specific CDK construct under\n // src/app/harnesses/<kebab-case-name>/\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'app',\n 'agentcore-harness',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'harnesses',\n ),\n { ...templateContext, ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Export the construct through the harnesses app index and the shared\n // app index. addStarExport creates a missing index file and semantically\n // deduplicates equivalent exports on reruns.\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'harnesses',\n 'index.ts',\n ),\n `./${templateContext.nameKebabCase}/${templateContext.nameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n './harnesses/index.js',\n );\n};\n\nconst addAgentCoreHarnessTerraformInfra = (\n tree: Tree,\n templateContext: HarnessTemplateContext,\n) => {\n // Generate the app specific Terraform module under\n // src/app/harnesses/<kebab-case-name>/. No CDK files or exports are\n // created on this path.\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agentcore-harness',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'harnesses',\n ),\n { ...templateContext, ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n};\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateJson","addStarExport","forDependencies","addDependenciesToPackageJson","esmVars","addDependencyToTargetIfNotPresent","generatedInfrastructure","generatedTerraform","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_TERRAFORM_DIR","PY_VERSIONS","terraformProviderVersions","withVersions","AGENT_CORE_CONSTRUCTS_DEPENDENCIES","name","when","AGENT_CORE_CONSTRUCTS_PY_DEPENDENCIES","addAgentCoreInfra","tree","options","iac","addAgentCoreCDKInfra","addAgentCoreTerraformInfra","config","projectName","dirname","appDirectory","overwriteStrategy","KeepExisting","nameKebabCase","containers","boto3Version","boto3","addMcpServerInfra","nameClassName","mcpServerNameClassName","mcpServerNameKebabCase","dockerImageTag","dockerOutputDir","serverProtocol","auth","session","addAgentInfra","agentNameClassName","agentNameKebabCase","addAgentCoreGatewayInfra","declaration","addAgentCoreGatewayCDKInfra","addAgentCoreGatewayTerraformInfra","gatewayNameClassName","gatewayNameKebabCase","projectDirectory","cedarPolicy","protocol","httpxVersion","httpx","mcpVersion","mcp","renderScript","exists","delete","addAgentCoreHarnessInfra","promptPath","projectRoot","templateContext","harnessNameClassName","harnessNameKebabCase","harnessNamePrefix","promptPathFromCdk","promptPathFromTerraform","addAgentCoreHarnessCDKInfra","addAgentCoreHarnessTerraformInfra"],"mappings":"AAAA;;;CAGC,GACD,SACEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAGjBC,UAAU,QACL,aAAa;AACpB,SAASC,aAAa,QAAQ,YAAS;AAEvC,SAIEC,eAAe,QAEV,8BAA2B;AAClC,SAASC,4BAA4B,QAAQ,qBAAkB;AAE/D,SAASC,OAAO,QAAQ,sBAAmB;AAC3C,SAASC,iCAAiC,QAAQ,WAAQ;AAC1D,SACEC,uBAAuB,EACvBC,kBAAkB,EAElBC,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,QACf,oCAAiC;AACxC,SAGEC,WAAW,EACXC,yBAAyB,EACzBC,YAAY,QACP,iBAAc;AAIrB;;;;;CAKC,GACD,OAAO,MAAMC,qCAAqC;IAChD;QAAEC,MAAM;QAAOC,MAAMV;IAAwB;IAC7C;QAAES,MAAM;QAAqCC,MAAMV;IAAwB;IAC3E;QAAES,MAAM;QAAcC,MAAMV;IAAwB;CACrD,CAGG;AAEJ;;;;;;;CAOC,GACD,OAAO,MAAMW,wCAAwC;IACnD;QAAEF,MAAM;QAASC,MAAMT;IAAmB;IAC1C;QAAEQ,MAAM;QAASC,MAAMT;IAAmB;IAC1C;QAAE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AC9C9B,eAAef,QAAQ8C,oBAAoB;QAC3CpC,eAAeV,QAAQ+C,oBAAoB;QAC3CC,mBAAmBhD,QAAQgD,iBAAiB;QAC5CC,mBAAmBN;QACnBO,yBAAyBP;IAC3B;IAEA,OAAQ3C,QAAQC,GAAG;QACjB,KAAK;YACH,MAAMkD,4BAA4BpD,MAAM8C;YACxC;QACF,KAAK;YACHO,kCAAkCrD,MAAM8C;YACxC;IACJ;AACF,EAAE;AAEF,MAAMM,8BAA8B,OAClCpD,MACA8C;IAEA,gDAAgD;IAChD,uCAAuC;IACvCpE,cACEsB,MACArB,kBACE,YAAY4B,OAAO,EACnB,SACA,OACA,OACA,sBAEF5B,kBACEU,cACAC,uBACA,OACA,OACA,cAEF;QAAE,GAAGwD,eAAe;QAAE,GAAG7D,QAAQe,KAAK;IAAC,GACvC;QACES,mBAAmB7B,kBAAkB8B,YAAY;IACnD;IAGF,sEAAsE;IACtE,yEAAyE;IACzE,6CAA6C;IAC7C,MAAM5B,cACJkB,MACArB,kBACEU,cACAC,uBACA,OACA,OACA,aACA,aAEF,CAAC,EAAE,EAAEwD,gBAAgBnC,aAAa,CAAC,CAAC,EAAEmC,gBAAgBnC,aAAa,CAAC,GAAG,CAAC;IAE1E,MAAM7B,cACJkB,MACArB,kBACEU,cACAC,uBACA,OACA,OACA,aAEF;AAEJ;AAEA,MAAM+D,oCAAoC,CACxCrD,MACA8C;IAEA,mDAAmD;IACnD,oEAAoE;IACpE,wBAAwB;IACxBpE,cACEsB,MACArB,kBACE,YAAY4B,OAAO,EACnB,SACA,aACA,OACA,sBAEF5B,kBACEU,cACAE,sBACA,OACA,OACA,cAEF;QAAE,GAAGuD,eAAe;QAAE,GAAGrD,2BAA2B;IAAC,GACrD;QACEgB,mBAAmB7B,kBAAkB8B,YAAY;IACnD;AAEJ"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/agent-core-constructs/agent-core-constructs.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type ProjectConfiguration,\n type Tree,\n updateJson,\n} from '@nx/devkit';\nimport { addStarExport } from '../ast';\nimport type { Containers } from '../containers';\nimport {\n type DeclaredPyDependency,\n type DeclaredTsDependency,\n type DependencyDeclaration,\n forDependencies,\n type MustDeclare,\n} from '../declared-dependencies';\nimport { addDependenciesToPackageJson } from '../dependencies';\nimport type { Iac } from '../iac';\nimport { esmVars } from '../module-format';\nimport { addDependencyToTargetIfNotPresent } from '../nx';\nimport {\n generatedInfrastructure,\n generatedTerraform,\n type IacMetadata,\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n SHARED_TERRAFORM_DIR,\n} from '../shared-constructs-constants';\nimport {\n type IPyDepVersion,\n type ITsDepVersion,\n PY_VERSIONS,\n terraformProviderVersions,\n withVersions,\n} from '../versions';\n\ntype IACProvider = { iac: Iac };\n\n/**\n * Dependencies a caller must declare to add an AgentCore Gateway construct.\n *\n * Gated on infrastructure having been generated, since the construct helpers only\n * run on that branch.\n */\nexport const AGENT_CORE_CONSTRUCTS_DEPENDENCIES = [\n { name: 'ejs', when: generatedInfrastructure },\n { name: '@aws-sdk/client-bedrock-agentcore', when: generatedInfrastructure },\n { name: '@types/ejs', when: generatedInfrastructure },\n] as const satisfies readonly DeclaredTsDependency<\n ITsDepVersion,\n IacMetadata\n>[];\n\n/**\n * Python versions the generated Terraform pins in an inline `uv run --with`\n * script, rather than in any `pyproject.toml`.\n *\n * Spread through `ownedElsewhere` because nothing installs them into the\n * workspace — the pin is owned so the version sync keeps it current, and gated on\n * Terraform since the CDK branch writes no such script.\n */\nexport const AGENT_CORE_CONSTRUCTS_PY_DEPENDENCIES = [\n { name: 'boto3', when: generatedTerraform },\n { name: 'httpx', when: generatedTerraform },\n { name: 'mcp', when: generatedTerraform },\n] as const satisfies readonly DeclaredPyDependency<\n IPyDepVersion,\n IacMetadata\n>[];\n\nexport type AgentCoreAuth = 'iam' | 'cognito';\n\nexport type AgentCoreSession = 's3' | 'dynamodb-s3' | 'in-memory';\n\nexport interface AddAgentCoreInfraProps {\n nameClassName: string;\n nameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n appDirectory: string;\n serverProtocol: 'mcp' | 'http' | 'a2a';\n auth: AgentCoreAuth;\n /** How this runtime's session should be persisted. MCP servers have no session, so pass 'in-memory'. */\n session: AgentCoreSession;\n containers: Containers;\n}\n\nconst addAgentCoreInfra = async (\n tree: Tree,\n options: AddAgentCoreInfraProps & { iac: Iac },\n) => {\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreCDKInfra(tree, options);\n break;\n case 'terraform':\n addAgentCoreTerraformInfra(tree, options);\n break;\n }\n\n // Update shared constructs/terraform project configuration to depend on this project\n updateJson(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n options.iac === 'cdk' ? SHARED_CONSTRUCTS_DIR : SHARED_TERRAFORM_DIR,\n 'project.json',\n ),\n (config: ProjectConfiguration) => {\n addDependencyToTargetIfNotPresent(\n config,\n 'build',\n `${options.projectName}:build`,\n );\n return config;\n },\n );\n};\n\nconst addAgentCoreCDKInfra = async (\n tree: Tree,\n options: AddAgentCoreInfraProps,\n) => {\n // Generate app specific CDK construct\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files', 'cdk', 'app', 'agent-core'),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n options.appDirectory,\n ),\n { ...options, ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Export app specific CDK construct\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n options.appDirectory,\n 'index.ts',\n ),\n `./${options.nameKebabCase}/${options.nameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n `./${options.appDirectory}/index.js`,\n );\n};\n\nconst addAgentCoreTerraformInfra = (\n tree: Tree,\n options: AddAgentCoreInfraProps,\n) => {\n // Add the AgentCore shared module\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'core',\n 'agent-core',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'core',\n 'agent-core',\n ),\n {\n containers: options.containers,\n boto3Version: PY_VERSIONS.boto3,\n ...terraformProviderVersions(),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Generate app specific agent core configuration\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agent-core',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n options.appDirectory,\n ),\n { ...options, ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n};\n\nexport interface AddMcpServerInfraProps {\n mcpServerNameClassName: string;\n mcpServerNameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n auth: AgentCoreAuth;\n containers: Containers;\n}\n\n/**\n * Add an MCP server CDK construct\n */\nexport const addMcpServerInfra = async (\n tree: Tree,\n options: AddMcpServerInfraProps & IACProvider,\n) => {\n await addAgentCoreInfra(tree, {\n nameClassName: options.mcpServerNameClassName,\n nameKebabCase: options.mcpServerNameKebabCase,\n dockerImageTag: options.dockerImageTag,\n dockerOutputDir: options.dockerOutputDir,\n projectName: options.projectName,\n appDirectory: 'mcp-servers',\n serverProtocol: 'mcp',\n iac: options.iac,\n auth: options.auth,\n // MCP servers are stateless (no conversation session to persist).\n session: 'in-memory',\n containers: options.containers,\n });\n};\n\nexport interface AddAgentInfraProps {\n agentNameClassName: string;\n agentNameKebabCase: string;\n projectName: string;\n dockerImageTag: string;\n dockerOutputDir: string;\n auth: AgentCoreAuth;\n session: AgentCoreSession;\n serverProtocol?: 'http' | 'a2a';\n containers: Containers;\n}\n\n/**\n * Add an agent CDK construct\n */\nexport const addAgentInfra = async (\n tree: Tree,\n options: AddAgentInfraProps & IACProvider,\n) => {\n await addAgentCoreInfra(tree, {\n nameClassName: options.agentNameClassName,\n nameKebabCase: options.agentNameKebabCase,\n projectName: options.projectName,\n dockerImageTag: options.dockerImageTag,\n dockerOutputDir: options.dockerOutputDir,\n appDirectory: 'agents',\n session: options.session,\n serverProtocol: options.serverProtocol ?? 'http',\n iac: options.iac,\n auth: options.auth,\n containers: options.containers,\n });\n};\n\nexport interface AddAgentCoreGatewayInfraProps {\n gatewayNameClassName: string;\n gatewayNameKebabCase: string;\n projectName: string;\n projectDirectory: string;\n cedarPolicy: boolean;\n auth: AgentCoreAuth;\n /**\n * The gateway's protocol: mcp aggregates MCP server targets, http proxies\n * agent runtime targets via path-based routing.\n */\n protocol: 'mcp' | 'http';\n}\n\nexport const addAgentCoreGatewayInfra = async <\n const D extends DependencyDeclaration,\n>(\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps & IACProvider,\n declaration: D & MustDeclare<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES, D>,\n) => {\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreGatewayCDKInfra(tree, options, declaration);\n break;\n case 'terraform':\n addAgentCoreGatewayTerraformInfra(tree, options);\n break;\n }\n\n updateJson(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n options.iac === 'cdk' ? SHARED_CONSTRUCTS_DIR : SHARED_TERRAFORM_DIR,\n 'project.json',\n ),\n (config: ProjectConfiguration) => {\n addDependencyToTargetIfNotPresent(\n config,\n 'build',\n `${options.projectName}:build`,\n );\n return config;\n },\n );\n};\n\nconst addAgentCoreGatewayCDKInfra = async (\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps,\n declaration: DependencyDeclaration,\n) => {\n // Generic gateway construct (readiness probe, policy engine, Cedar policy\n // loading) shared by all gateways\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'core',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'core',\n 'agentcore-gateway',\n ),\n { ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'app',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'gateways',\n ),\n {\n nameClassName: options.gatewayNameClassName,\n nameKebabCase: options.gatewayNameKebabCase,\n projectDirectory: options.projectDirectory,\n cedarPolicy: options.cedarPolicy,\n auth: options.auth,\n protocol: options.protocol,\n ...esmVars(tree),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'core',\n 'index.ts',\n ),\n './agentcore-gateway/agentcore-gateway.js',\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'gateways',\n 'index.ts',\n ),\n `./${options.gatewayNameKebabCase}/${options.gatewayNameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n './gateways/index.js',\n );\n\n // The gateway construct renders Cedar policies with ejs and its readiness\n // probe uses the AgentCore SDK client; declare both so the lint passes.\n addDependenciesToPackageJson(\n tree,\n withVersions(\n forDependencies<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES>(declaration),\n ['ejs', '@aws-sdk/client-bedrock-agentcore'],\n ),\n withVersions(\n forDependencies<typeof AGENT_CORE_CONSTRUCTS_DEPENDENCIES>(declaration),\n ['@types/ejs'],\n ),\n joinPathFragments(PACKAGES_DIR, SHARED_CONSTRUCTS_DIR, 'package.json'),\n );\n};\n\nconst addAgentCoreGatewayTerraformInfra = (\n tree: Tree,\n options: AddAgentCoreGatewayInfraProps,\n) => {\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'core',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'core',\n 'agentcore-gateway',\n ),\n { ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agentcore-gateway',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'gateways',\n ),\n {\n nameClassName: options.gatewayNameClassName,\n nameKebabCase: options.gatewayNameKebabCase,\n projectDirectory: options.projectDirectory,\n cedarPolicy: options.cedarPolicy,\n auth: options.auth,\n protocol: options.protocol,\n boto3Version: PY_VERSIONS.boto3,\n httpxVersion: PY_VERSIONS.httpx,\n mcpVersion: PY_VERSIONS.mcp,\n ...terraformProviderVersions(),\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // The Cedar render script is only needed when policies are enabled\n if (!options.cedarPolicy) {\n const renderScript = joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'gateways',\n options.gatewayNameKebabCase,\n 'render-cedar.cjs',\n );\n if (tree.exists(renderScript)) {\n tree.delete(renderScript);\n }\n }\n};\n\nexport interface AddAgentCoreHarnessInfraProps {\n harnessNameClassName: string;\n harnessNameKebabCase: string;\n /**\n * Workspace-root-relative harness project root, eg `packages/my-harness`.\n * The `src/PROMPT.md` path both templates read is derived from it.\n */\n projectRoot: string;\n /** Leading-letter-guaranteed, 31-char-truncated resource name prefix. */\n harnessNamePrefix: string;\n}\n\n/**\n * Template substitution context shared by the CDK and Terraform harness\n * branches. Both prompt path fields carry the same workspace-root-relative\n * path, named per provider so each template's usage reads on its own.\n */\ninterface HarnessTemplateContext {\n nameClassName: string;\n nameKebabCase: string;\n harnessNamePrefix: string;\n /** Joined onto `findWorkspaceRoot()` in the CDK construct. */\n promptPathFromCdk: string;\n /** Appended to the `path.module` walk to the workspace root in Terraform. */\n promptPathFromTerraform: string;\n}\n\n/**\n * Add AgentCore Harness infrastructure for the selected IaC provider.\n *\n * Renders the provider-specific Harness infrastructure (a CDK construct or\n * a Terraform module) into the Shared Infrastructure Project with\n * `KeepExisting`, so existing files become user-owned and are never\n * rewritten by reruns.\n *\n * Unlike agents, MCP servers and gateways, no build dependency is added\n * from the shared infrastructure project to the Harness Project: generated\n * Harness infrastructure does not import Harness Project source, so a\n * dependency would only create false rebuild coupling.\n */\nexport const addAgentCoreHarnessInfra = async (\n tree: Tree,\n options: AddAgentCoreHarnessInfraProps & IACProvider,\n): Promise<void> => {\n // One resolved template context, built once and passed to both provider\n // branches. The prompt path is derived from the same projectRoot the\n // Harness Project is written to, so explicit placement needs no extra logic.\n const promptPath = joinPathFragments(options.projectRoot, 'src', 'PROMPT.md');\n const templateContext: HarnessTemplateContext = {\n nameClassName: options.harnessNameClassName,\n nameKebabCase: options.harnessNameKebabCase,\n harnessNamePrefix: options.harnessNamePrefix,\n promptPathFromCdk: promptPath,\n promptPathFromTerraform: promptPath,\n };\n\n switch (options.iac) {\n case 'cdk':\n await addAgentCoreHarnessCDKInfra(tree, templateContext);\n break;\n case 'terraform':\n addAgentCoreHarnessTerraformInfra(tree, templateContext);\n break;\n }\n};\n\nconst addAgentCoreHarnessCDKInfra = async (\n tree: Tree,\n templateContext: HarnessTemplateContext,\n) => {\n // Generate the app specific CDK construct under\n // src/app/harnesses/<kebab-case-name>/\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'cdk',\n 'app',\n 'agentcore-harness',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'harnesses',\n ),\n { ...templateContext, ...esmVars(tree) },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n\n // Export the construct through the harnesses app index and the shared\n // app index. addStarExport creates a missing index file and semantically\n // deduplicates equivalent exports on reruns.\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'harnesses',\n 'index.ts',\n ),\n `./${templateContext.nameKebabCase}/${templateContext.nameKebabCase}.js`,\n );\n await addStarExport(\n tree,\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_CONSTRUCTS_DIR,\n 'src',\n 'app',\n 'index.ts',\n ),\n './harnesses/index.js',\n );\n};\n\nconst addAgentCoreHarnessTerraformInfra = (\n tree: Tree,\n templateContext: HarnessTemplateContext,\n) => {\n // Generate the app specific Terraform module under\n // src/app/harnesses/<kebab-case-name>/. No CDK files or exports are\n // created on this path.\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n 'terraform',\n 'app',\n 'agentcore-harness',\n ),\n joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n 'app',\n 'harnesses',\n ),\n { ...templateContext, ...terraformProviderVersions() },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n};\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateJson","addStarExport","forDependencies","addDependenciesToPackageJson","esmVars","addDependencyToTargetIfNotPresent","generatedInfrastructure","generatedTerraform","PACKAGES_DIR","SHARED_CONSTRUCTS_DIR","SHARED_TERRAFORM_DIR","PY_VERSIONS","terraformProviderVersions","withVersions","AGENT_CORE_CONSTRUCTS_DEPENDENCIES","name","when","AGENT_CORE_CONSTRUCTS_PY_DEPENDENCIES","addAgentCoreInfra","tree","options","iac","addAgentCoreCDKInfra","addAgentCoreTerraformInfra","config","projectName","dirname","appDirectory","overwriteStrategy","KeepExisting","nameKebabCase","containers","boto3Version","boto3","addMcpServerInfra","nameClassName","mcpServerNameClassName","mcpServerNameKebabCase","dockerImageTag","dockerOutputDir","serverProtocol","auth","session","addAgentInfra","agentNameClassName","agentNameKebabCase","addAgentCoreGatewayInfra","declaration","addAgentCoreGatewayCDKInfra","addAgentCoreGatewayTerraformInfra","gatewayNameClassName","gatewayNameKebabCase","projectDirectory","cedarPolicy","protocol","httpxVersion","httpx","mcpVersion","mcp","renderScript","exists","delete","addAgentCoreHarnessInfra","promptPath","projectRoot","templateContext","harnessNameClassName","harnessNameKebabCase","harnessNamePrefix","promptPathFromCdk","promptPathFromTerraform","addAgentCoreHarnessCDKInfra","addAgentCoreHarnessTerraformInfra"],"mappings":"AAAA;;;CAGC,GACD,SACEA,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EAGjBC,UAAU,QACL,aAAa;AACpB,SAASC,aAAa,QAAQ,YAAS;AAEvC,SAIEC,eAAe,QAEV,8BAA2B;AAClC,SAASC,4BAA4B,QAAQ,qBAAkB;AAE/D,SAASC,OAAO,QAAQ,sBAAmB;AAC3C,SAASC,iCAAiC,QAAQ,WAAQ;AAC1D,SACEC,uBAAuB,EACvBC,kBAAkB,EAElBC,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,QACf,oCAAiC;AACxC,SAGEC,WAAW,EACXC,yBAAyB,EACzBC,YAAY,QACP,iBAAc;AAIrB;;;;;CAKC,GACD,OAAO,MAAMC,qCAAqC;IAChD;QAAEC,MAAM;QAAOC,MAAMV;IAAwB;IAC7C;QAAES,MAAM;QAAqCC,MAAMV;IAAwB;IAC3E;QAAES,MAAM;QAAcC,MAAMV;IAAwB;CACrD,CAGG;AAEJ;;;;;;;CAOC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IACnD;AAEJ"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
<%_ const hasSessionBucket = session === 's3' || session === 'dynamodb-s3'; _%>
|
|
2
|
+
import { Fn, Lazy, Names<%_ if (hasSessionBucket) { _%>, RemovalPolicy<%_ } _%>, Stack } from 'aws-cdk-lib';
|
|
2
3
|
import { Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
|
3
4
|
import { Connections, IConnectable } from 'aws-cdk-lib/aws-ec2';
|
|
4
|
-
<%_ if (
|
|
5
|
+
<%_ if (hasSessionBucket) { _%>
|
|
5
6
|
import { BlockPublicAccess, Bucket, BucketEncryption } from 'aws-cdk-lib/aws-s3';
|
|
6
7
|
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
7
8
|
import {
|
|
@@ -12,6 +13,14 @@ import {
|
|
|
12
13
|
RetentionDays,
|
|
13
14
|
} from 'aws-cdk-lib/aws-logs';
|
|
14
15
|
<%_ } _%>
|
|
16
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
17
|
+
import {
|
|
18
|
+
AttributeType,
|
|
19
|
+
BillingMode,
|
|
20
|
+
Table,
|
|
21
|
+
TableEncryption,
|
|
22
|
+
} from 'aws-cdk-lib/aws-dynamodb';
|
|
23
|
+
<%_ } _%>
|
|
15
24
|
import { Construct } from 'constructs';
|
|
16
25
|
import * as path from 'path';
|
|
17
26
|
import * as url from 'url';
|
|
@@ -24,11 +33,11 @@ import {
|
|
|
24
33
|
RuntimeAuthorizerConfiguration,
|
|
25
34
|
<%_ } _%>
|
|
26
35
|
} from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
27
|
-
import { <%_ if (serverProtocol !== 'mcp') { _%>PolicyStatement, <%_ } _%><%_ if (
|
|
36
|
+
import { <%_ if (serverProtocol !== 'mcp') { _%>PolicyStatement, <%_ } _%><%_ if (hasSessionBucket) { _%>Effect, ServicePrincipal, <%_ } _%>IGrantable, IPrincipal<%_ if (auth === 'iam') { _%>, Grant<%_ } _%> } from 'aws-cdk-lib/aws-iam';
|
|
28
37
|
<%_ if (auth === 'cognito') { _%>
|
|
29
38
|
import { IUserPool, IUserPoolClient } from 'aws-cdk-lib/aws-cognito';
|
|
30
39
|
<%_ } _%>
|
|
31
|
-
<%_ if (
|
|
40
|
+
<%_ if (hasSessionBucket) { _%>
|
|
32
41
|
import { suppressRules } from '../../../core/checkov<% if (esm) { %>.js<% } %>';
|
|
33
42
|
<%_ } _%>
|
|
34
43
|
import { RuntimeConfig } from '../../../core/runtime-config<% if (esm) { %>.js<% } %>';
|
|
@@ -41,7 +50,34 @@ export type <%- nameClassName %>Props = Omit<
|
|
|
41
50
|
| 'protocolConfiguration'
|
|
42
51
|
| 'agentRuntimeArtifact'
|
|
43
52
|
| 'authorizerConfiguration'
|
|
44
|
-
|
|
53
|
+
><%_ if (hasSessionBucket) { _%> & {
|
|
54
|
+
<%_ if (hasSessionBucket) { _%>
|
|
55
|
+
/**
|
|
56
|
+
* Removal policy for the session bucket holding the agent's conversation
|
|
57
|
+
* history. Defaults to retaining it so a stack `destroy` doesn't silently
|
|
58
|
+
* delete session data — set to `RemovalPolicy.DESTROY` for sandbox/CI teardown.
|
|
59
|
+
*
|
|
60
|
+
* @default RemovalPolicy.RETAIN
|
|
61
|
+
*/
|
|
62
|
+
readonly sessionBucketRemovalPolicy?: RemovalPolicy;
|
|
63
|
+
<%_ } _%>
|
|
64
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
65
|
+
/**
|
|
66
|
+
* Whether to enable deletion protection on the session checkpoint table.
|
|
67
|
+
* Set to `false` to allow a stack `destroy` to remove it (e.g. for
|
|
68
|
+
* sandbox/CI teardown).
|
|
69
|
+
*
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
readonly sessionTableDeletionProtection?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Removal policy for the session checkpoint table.
|
|
75
|
+
*
|
|
76
|
+
* @default RemovalPolicy.RETAIN
|
|
77
|
+
*/
|
|
78
|
+
readonly sessionTableRemovalPolicy?: RemovalPolicy;
|
|
79
|
+
<%_ } _%>
|
|
80
|
+
}<%_ } _%>;
|
|
45
81
|
<%_ } else if (auth === 'cognito') { _%>
|
|
46
82
|
export type <%- nameClassName %>Props = Omit<
|
|
47
83
|
RuntimeProps,
|
|
@@ -57,6 +93,32 @@ export type <%- nameClassName %>Props = Omit<
|
|
|
57
93
|
userPool: IUserPool;
|
|
58
94
|
userPoolClient: IUserPoolClient;
|
|
59
95
|
};
|
|
96
|
+
<%_ if (hasSessionBucket) { _%>
|
|
97
|
+
/**
|
|
98
|
+
* Removal policy for the session bucket holding the agent's conversation
|
|
99
|
+
* history. Defaults to retaining it so a stack `destroy` doesn't silently
|
|
100
|
+
* delete session data — set to `RemovalPolicy.DESTROY` for sandbox/CI teardown.
|
|
101
|
+
*
|
|
102
|
+
* @default RemovalPolicy.RETAIN
|
|
103
|
+
*/
|
|
104
|
+
readonly sessionBucketRemovalPolicy?: RemovalPolicy;
|
|
105
|
+
<%_ } _%>
|
|
106
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
107
|
+
/**
|
|
108
|
+
* Whether to enable deletion protection on the session checkpoint table.
|
|
109
|
+
* Set to `false` to allow a stack `destroy` to remove it (e.g. for
|
|
110
|
+
* sandbox/CI teardown).
|
|
111
|
+
*
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
readonly sessionTableDeletionProtection?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Removal policy for the session checkpoint table.
|
|
117
|
+
*
|
|
118
|
+
* @default RemovalPolicy.RETAIN
|
|
119
|
+
*/
|
|
120
|
+
readonly sessionTableRemovalPolicy?: RemovalPolicy;
|
|
121
|
+
<%_ } _%>
|
|
60
122
|
};
|
|
61
123
|
<%_ } _%>
|
|
62
124
|
|
|
@@ -88,11 +150,23 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
88
150
|
platform: Platform.LINUX_ARM64,
|
|
89
151
|
});
|
|
90
152
|
|
|
153
|
+
<%_ if (auth === 'cognito' || hasSessionBucket) { _%>
|
|
154
|
+
const {
|
|
91
155
|
<%_ if (auth === 'cognito') { _%>
|
|
92
|
-
|
|
156
|
+
identity,
|
|
157
|
+
<%_ } _%>
|
|
158
|
+
<%_ if (hasSessionBucket) { _%>
|
|
159
|
+
sessionBucketRemovalPolicy = RemovalPolicy.RETAIN,
|
|
160
|
+
<%_ } _%>
|
|
161
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
162
|
+
sessionTableDeletionProtection = true,
|
|
163
|
+
sessionTableRemovalPolicy = RemovalPolicy.RETAIN,
|
|
164
|
+
<%_ } _%>
|
|
165
|
+
...restProps
|
|
166
|
+
} = props ?? {};
|
|
93
167
|
|
|
94
168
|
<%_ } _%>
|
|
95
|
-
<%_ if (
|
|
169
|
+
<%_ if (hasSessionBucket) { _%>
|
|
96
170
|
const sessionKey = new Key(this, 'SessionKey', {
|
|
97
171
|
enableKeyRotation: true,
|
|
98
172
|
});
|
|
@@ -127,7 +201,7 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
127
201
|
|
|
128
202
|
const sessionBucket = new Bucket(this, 'SessionBucket', {
|
|
129
203
|
enforceSSL: true,
|
|
130
|
-
removalPolicy:
|
|
204
|
+
removalPolicy: sessionBucketRemovalPolicy,
|
|
131
205
|
encryption: BucketEncryption.KMS,
|
|
132
206
|
encryptionKey: sessionKey,
|
|
133
207
|
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
|
|
@@ -196,6 +270,22 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
196
270
|
);
|
|
197
271
|
sessionAccessLogsDelivery.addDependency(sessionAccessLogsSource);
|
|
198
272
|
|
|
273
|
+
<%_ } _%>
|
|
274
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
275
|
+
// Unified checkpoints/writes table, matching the schema
|
|
276
|
+
// langgraph_checkpoint_aws.DynamoDBSaver expects (PK/SK, TTL on `ttl`).
|
|
277
|
+
const sessionTable = new Table(this, 'SessionTable', {
|
|
278
|
+
partitionKey: { name: 'PK', type: AttributeType.STRING },
|
|
279
|
+
sortKey: { name: 'SK', type: AttributeType.STRING },
|
|
280
|
+
billingMode: BillingMode.PAY_PER_REQUEST,
|
|
281
|
+
pointInTimeRecoverySpecification: { pointInTimeRecoveryEnabled: true },
|
|
282
|
+
timeToLiveAttribute: 'ttl',
|
|
283
|
+
encryption: TableEncryption.CUSTOMER_MANAGED,
|
|
284
|
+
encryptionKey: sessionKey,
|
|
285
|
+
deletionProtection: sessionTableDeletionProtection,
|
|
286
|
+
removalPolicy: sessionTableRemovalPolicy,
|
|
287
|
+
});
|
|
288
|
+
|
|
199
289
|
<%_ } _%>
|
|
200
290
|
this.agentCoreRuntime = new Runtime(this, '<%- nameClassName %>', {
|
|
201
291
|
runtimeName: Lazy.string({
|
|
@@ -213,13 +303,15 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
213
303
|
requestHeaderConfiguration: {
|
|
214
304
|
allowlistedHeaders: ['Authorization'],
|
|
215
305
|
},
|
|
306
|
+
<%_ } _%>
|
|
307
|
+
<%_ if (auth === 'cognito' || hasSessionBucket) { _%>
|
|
216
308
|
...restProps,
|
|
217
309
|
<%_ } else { _%>
|
|
218
310
|
...props,
|
|
219
311
|
<%_ } _%>
|
|
220
312
|
environmentVariables: {
|
|
221
313
|
RUNTIME_CONFIG_APP_ID: rc.appConfigApplicationId,
|
|
222
|
-
<%_ if (auth === 'cognito') { _%>
|
|
314
|
+
<%_ if (auth === 'cognito' || hasSessionBucket) { _%>
|
|
223
315
|
...restProps?.environmentVariables,
|
|
224
316
|
<%_ } else { _%>
|
|
225
317
|
...props?.environmentVariables,
|
|
@@ -243,18 +335,26 @@ export class <%- nameClassName %> extends Construct implements IGrantable, IConn
|
|
|
243
335
|
);
|
|
244
336
|
|
|
245
337
|
<%_ } _%>
|
|
246
|
-
<%_ if (session === 's3') { _%>
|
|
338
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
339
|
+
sessionTable.grantReadWriteData(this.agentCoreRuntime);
|
|
340
|
+
<%_ } _%>
|
|
341
|
+
<%_ if (hasSessionBucket) { _%>
|
|
247
342
|
sessionBucket.grantReadWrite(this.agentCoreRuntime);
|
|
248
|
-
|
|
249
343
|
<%_ } _%>
|
|
344
|
+
|
|
250
345
|
rc.grantReadAppConfig(this.agentCoreRuntime);
|
|
251
346
|
|
|
252
347
|
rc.set('agentcore', 'agentRuntimes', {
|
|
253
348
|
...rc.get('agentcore').agentRuntimes,
|
|
254
349
|
<%- nameClassName %>: {
|
|
255
350
|
arn: this.agentCoreRuntime.agentRuntimeArn,
|
|
256
|
-
<%_ if (
|
|
257
|
-
session: {
|
|
351
|
+
<%_ if (hasSessionBucket) { _%>
|
|
352
|
+
session: {
|
|
353
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
354
|
+
tableName: sessionTable.tableName,
|
|
355
|
+
<%_ } _%>
|
|
356
|
+
bucketName: sessionBucket.bucketName,
|
|
357
|
+
},
|
|
258
358
|
<%_ } _%>
|
|
259
359
|
},
|
|
260
360
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<%_
|
|
1
|
+
<%_ const hasSessionBucket = session === 's3' || session === 'dynamodb-s3'; _%>
|
|
2
|
+
<%_ if (hasSessionBucket) { _%>
|
|
2
3
|
terraform {
|
|
3
4
|
required_providers {
|
|
4
5
|
random = {
|
|
@@ -55,6 +56,22 @@ variable "appconfig_application_id" {
|
|
|
55
56
|
type = string
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
<%_ if (hasSessionBucket) { _%>
|
|
60
|
+
variable "session_force_destroy" {
|
|
61
|
+
description = "Whether to allow the session bucket to be destroyed even if it still contains objects."
|
|
62
|
+
type = bool
|
|
63
|
+
default = false
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
<%_ } _%>
|
|
67
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
68
|
+
variable "session_deletion_protection_enabled" {
|
|
69
|
+
description = "Whether to enable deletion protection on the session checkpoint table."
|
|
70
|
+
type = bool
|
|
71
|
+
default = true
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
<%_ } _%>
|
|
58
75
|
variable "appconfig_application_arn" {
|
|
59
76
|
description = "ARN of the shared runtime-config AppConfig application (from `core/runtime-config/appconfig.application_arn`). Used to scope the IAM read permission granted to the agent runtime."
|
|
60
77
|
type = string
|
|
@@ -72,10 +89,10 @@ variable "user_pool_client_ids" {
|
|
|
72
89
|
}
|
|
73
90
|
|
|
74
91
|
<%_ } _%>
|
|
75
|
-
<%_ if (auth === 'cognito' ||
|
|
92
|
+
<%_ if (auth === 'cognito' || hasSessionBucket) { _%>
|
|
76
93
|
data "aws_region" "current" {}
|
|
77
94
|
<%_ } _%>
|
|
78
|
-
<%_ if (
|
|
95
|
+
<%_ if (hasSessionBucket) { _%>
|
|
79
96
|
data "aws_caller_identity" "current" {}
|
|
80
97
|
<%_ } _%>
|
|
81
98
|
<%_ if (auth === 'cognito') { _%>
|
|
@@ -84,7 +101,7 @@ locals {
|
|
|
84
101
|
aws_region = data.aws_region.current.id
|
|
85
102
|
}
|
|
86
103
|
<%_ } _%>
|
|
87
|
-
<%_ if (
|
|
104
|
+
<%_ if (hasSessionBucket) { _%>
|
|
88
105
|
|
|
89
106
|
locals {
|
|
90
107
|
# Delivery source/destination names have a 60 character maximum. Truncate
|
|
@@ -149,12 +166,13 @@ resource "aws_cloudwatch_log_group" "session_access_logs" {
|
|
|
149
166
|
|
|
150
167
|
# Bucket storing the agent's session data
|
|
151
168
|
resource "aws_s3_bucket" "session" {
|
|
169
|
+
bucket = "<%= nameKebabCase %>-sessions-${random_id.session_unique_suffix.hex}"
|
|
152
170
|
#checkov:skip=CKV2_AWS_61:Lifecycle configuration not required for session data
|
|
153
171
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for session data
|
|
154
172
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for session data
|
|
155
173
|
#checkov:skip=CKV_AWS_18:Server access logs are delivered to CloudWatch Logs (see aws_cloudwatch_log_delivery.session)
|
|
156
174
|
#checkov:skip=CKV_AWS_21:Session data does not need versioning enabled
|
|
157
|
-
force_destroy =
|
|
175
|
+
force_destroy = var.session_force_destroy
|
|
158
176
|
}
|
|
159
177
|
|
|
160
178
|
resource "aws_s3_bucket_server_side_encryption_configuration" "session" {
|
|
@@ -222,6 +240,45 @@ resource "aws_cloudwatch_log_delivery" "session" {
|
|
|
222
240
|
delivery_destination_arn = aws_cloudwatch_log_delivery_destination.session.arn
|
|
223
241
|
}
|
|
224
242
|
|
|
243
|
+
<%_ } _%>
|
|
244
|
+
<%_ if (session === 'dynamodb-s3') { _%>
|
|
245
|
+
# Unified checkpoints/writes table, matching the schema
|
|
246
|
+
# langgraph_checkpoint_aws.DynamoDBSaver expects (PK/SK, TTL on `ttl`).
|
|
247
|
+
resource "aws_dynamodb_table" "session" {
|
|
248
|
+
name = "<%= nameKebabCase %>-checkpoints-${random_id.session_unique_suffix.hex}"
|
|
249
|
+
billing_mode = "PAY_PER_REQUEST"
|
|
250
|
+
hash_key = "PK"
|
|
251
|
+
range_key = "SK"
|
|
252
|
+
|
|
253
|
+
attribute {
|
|
254
|
+
name = "PK"
|
|
255
|
+
type = "S"
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
attribute {
|
|
259
|
+
name = "SK"
|
|
260
|
+
type = "S"
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
ttl {
|
|
264
|
+
attribute_name = "ttl"
|
|
265
|
+
enabled = true
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
point_in_time_recovery {
|
|
269
|
+
enabled = true
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
server_side_encryption {
|
|
273
|
+
enabled = true
|
|
274
|
+
kms_key_arn = aws_kms_key.session.arn
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
deletion_protection_enabled = var.session_deletion_protection_enabled
|
|
278
|
+
|
|
279
|
+
tags = var.tags
|
|
280
|
+
}
|
|
281
|
+
|
|
225
282
|
<%_ } _%>
|
|
226
283
|
module "agent_core_runtime" {
|
|
227
284
|
source = "../../../core/agent-core"
|
|
@@ -263,7 +320,7 @@ module "agent_core_runtime" {
|
|
|
263
320
|
"arn:aws:bedrock:*:*:foundation-model/*",
|
|
264
321
|
"arn:aws:bedrock:*:*:inference-profile/*"
|
|
265
322
|
]
|
|
266
|
-
}<% } %><% if (
|
|
323
|
+
}<% } %><% if (hasSessionBucket) { %>,
|
|
267
324
|
# Grant access for the agent to read/write its session data
|
|
268
325
|
{
|
|
269
326
|
Effect = "Allow"
|
|
@@ -286,6 +343,18 @@ module "agent_core_runtime" {
|
|
|
286
343
|
"kms:GenerateDataKey*"
|
|
287
344
|
]
|
|
288
345
|
Resource = [aws_kms_key.session.arn]
|
|
346
|
+
}<% } %><% if (session === 'dynamodb-s3') { %>,
|
|
347
|
+
# Grant access for the agent to read/write its checkpoint table
|
|
348
|
+
{
|
|
349
|
+
Effect = "Allow"
|
|
350
|
+
Action = [
|
|
351
|
+
"dynamodb:GetItem",
|
|
352
|
+
"dynamodb:PutItem",
|
|
353
|
+
"dynamodb:Query",
|
|
354
|
+
"dynamodb:BatchGetItem",
|
|
355
|
+
"dynamodb:BatchWriteItem"
|
|
356
|
+
]
|
|
357
|
+
Resource = [aws_dynamodb_table.session.arn]
|
|
289
358
|
}<% } %>
|
|
290
359
|
], var.additional_iam_policy_statements)
|
|
291
360
|
tags = var.tags
|
|
@@ -297,7 +366,7 @@ module "add_agent_runtime_to_runtime_config" {
|
|
|
297
366
|
|
|
298
367
|
namespace = "agentcore"
|
|
299
368
|
key = "agentRuntimes"
|
|
300
|
-
value = { "<%= nameClassName %>" = { arn = module.agent_core_runtime.agent_core_runtime_arn<% if (session === 's3') {
|
|
369
|
+
value = { "<%= nameClassName %>" = { arn = module.agent_core_runtime.agent_core_runtime_arn<% if (hasSessionBucket) { %>, session = { <% if (session === 'dynamodb-s3') { %>tableName = aws_dynamodb_table.session.name, <% } %>bucketName = aws_s3_bucket.session.bucket }<% } %> } }
|
|
301
370
|
|
|
302
371
|
depends_on = [module.agent_core_runtime]
|
|
303
372
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -170,6 +170,7 @@ export declare const PY_VERSIONS: {
|
|
|
170
170
|
readonly 'ag-ui-langgraph': "==0.0.42";
|
|
171
171
|
readonly 'ag-ui-protocol': "==0.1.19";
|
|
172
172
|
readonly 'ag-ui-strands': "==0.2.4";
|
|
173
|
+
readonly aiosqlite: "==0.22.1";
|
|
173
174
|
readonly 'aws-lambda-powertools': "==3.31.1";
|
|
174
175
|
readonly 'aws-lambda-powertools[tracer]': "==3.31.1";
|
|
175
176
|
readonly 'aws-lambda-powertools[parser]': "==3.31.1";
|
|
@@ -184,6 +185,8 @@ export declare const PY_VERSIONS: {
|
|
|
184
185
|
readonly 'langchain-aws': "==1.7.0";
|
|
185
186
|
readonly 'langchain-mcp-adapters': "==0.3.2";
|
|
186
187
|
readonly langgraph: "==1.2.10";
|
|
188
|
+
readonly 'langgraph-checkpoint-aws': "==1.2.0";
|
|
189
|
+
readonly 'langgraph-checkpoint-sqlite': "==3.1.1";
|
|
187
190
|
readonly mcp: "==1.28.1";
|
|
188
191
|
readonly 'pip-check-updates': "==0.29.0";
|
|
189
192
|
readonly 'pip-licenses': "==5.5.5";
|
package/src/utils/versions.js
CHANGED
|
@@ -185,6 +185,7 @@
|
|
|
185
185
|
'ag-ui-langgraph': '==0.0.42',
|
|
186
186
|
'ag-ui-protocol': '==0.1.19',
|
|
187
187
|
'ag-ui-strands': '==0.2.4',
|
|
188
|
+
aiosqlite: '==0.22.1',
|
|
188
189
|
'aws-lambda-powertools': '==3.31.1',
|
|
189
190
|
'aws-lambda-powertools[tracer]': '==3.31.1',
|
|
190
191
|
'aws-lambda-powertools[parser]': '==3.31.1',
|
|
@@ -199,6 +200,8 @@
|
|
|
199
200
|
'langchain-aws': '==1.7.0',
|
|
200
201
|
'langchain-mcp-adapters': '==0.3.2',
|
|
201
202
|
langgraph: '==1.2.10',
|
|
203
|
+
'langgraph-checkpoint-aws': '==1.2.0',
|
|
204
|
+
'langgraph-checkpoint-sqlite': '==3.1.1',
|
|
202
205
|
mcp: '==1.28.1',
|
|
203
206
|
'pip-check-updates': '==0.29.0',
|
|
204
207
|
'pip-licenses': '==5.5.5',
|