@aws/agentcore 0.3.0-preview.7.0 → 0.3.0-preview.9.0

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.
Files changed (68) hide show
  1. package/README.md +4 -6
  2. package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +24 -12
  3. package/dist/assets/agents/AGENTS.md +2 -2
  4. package/dist/assets/cdk/bin/cdk.ts +13 -7
  5. package/dist/assets/cdk/lib/cdk-stack.ts +1 -0
  6. package/dist/assets/cdk/test/cdk.test.ts +3 -0
  7. package/dist/assets/python/http/langchain_langgraph/base/main.py +4 -1
  8. package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +1 -2
  9. package/dist/cli/index.mjs +430 -382
  10. package/dist/lib/constants.d.ts +0 -1
  11. package/dist/lib/constants.d.ts.map +1 -1
  12. package/dist/lib/constants.js +0 -1
  13. package/dist/lib/constants.js.map +1 -1
  14. package/dist/lib/schemas/io/config-io.d.ts +2 -10
  15. package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
  16. package/dist/lib/schemas/io/config-io.js +0 -15
  17. package/dist/lib/schemas/io/config-io.js.map +1 -1
  18. package/dist/lib/schemas/io/path-resolver.d.ts +0 -5
  19. package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -1
  20. package/dist/lib/schemas/io/path-resolver.js +0 -6
  21. package/dist/lib/schemas/io/path-resolver.js.map +1 -1
  22. package/dist/schema/schemas/agent-env.d.ts +57 -0
  23. package/dist/schema/schemas/agent-env.d.ts.map +1 -1
  24. package/dist/schema/schemas/agent-env.js +64 -1
  25. package/dist/schema/schemas/agent-env.js.map +1 -1
  26. package/dist/schema/schemas/agentcore-project.d.ts +424 -6
  27. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
  28. package/dist/schema/schemas/agentcore-project.js +36 -3
  29. package/dist/schema/schemas/agentcore-project.js.map +1 -1
  30. package/dist/schema/schemas/auth.d.ts +140 -0
  31. package/dist/schema/schemas/auth.d.ts.map +1 -0
  32. package/dist/schema/schemas/auth.js +114 -0
  33. package/dist/schema/schemas/auth.js.map +1 -0
  34. package/dist/schema/schemas/deployed-state.d.ts +108 -0
  35. package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
  36. package/dist/schema/schemas/deployed-state.js +2 -0
  37. package/dist/schema/schemas/deployed-state.js.map +1 -1
  38. package/dist/schema/schemas/index.d.ts +1 -0
  39. package/dist/schema/schemas/index.d.ts.map +1 -1
  40. package/dist/schema/schemas/index.js +1 -0
  41. package/dist/schema/schemas/index.js.map +1 -1
  42. package/dist/schema/schemas/mcp.d.ts +26 -383
  43. package/dist/schema/schemas/mcp.d.ts.map +1 -1
  44. package/dist/schema/schemas/mcp.js +8 -69
  45. package/dist/schema/schemas/mcp.js.map +1 -1
  46. package/dist/schema/schemas/primitives/index.d.ts +1 -1
  47. package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
  48. package/dist/schema/schemas/primitives/index.js +2 -1
  49. package/dist/schema/schemas/primitives/index.js.map +1 -1
  50. package/dist/schema/schemas/primitives/memory.d.ts +9 -0
  51. package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
  52. package/dist/schema/schemas/primitives/memory.js +26 -3
  53. package/dist/schema/schemas/primitives/memory.js.map +1 -1
  54. package/dist/schema/schemas/primitives/online-eval-config.d.ts +1 -0
  55. package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
  56. package/dist/schema/schemas/primitives/online-eval-config.js +2 -0
  57. package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
  58. package/dist/schema/schemas/primitives/policy.d.ts +1 -0
  59. package/dist/schema/schemas/primitives/policy.d.ts.map +1 -1
  60. package/dist/schema/schemas/primitives/policy.js +2 -0
  61. package/dist/schema/schemas/primitives/policy.js.map +1 -1
  62. package/dist/schema/schemas/primitives/tags.d.ts +6 -0
  63. package/dist/schema/schemas/primitives/tags.d.ts.map +1 -0
  64. package/dist/schema/schemas/primitives/tags.js +27 -0
  65. package/dist/schema/schemas/primitives/tags.js.map +1 -0
  66. package/package.json +4 -2
  67. package/scripts/check-old-cli.lib.mjs +13 -15
  68. package/scripts/check-old-cli.mjs +2 -3
package/README.md CHANGED
@@ -17,17 +17,15 @@ AgentCore with minimal configuration.
17
17
 
18
18
  ## Installation
19
19
 
20
- > **Upgrading from the Bedrock AgentCore Starter Toolkit?** The old Python CLI conflicts with this package. If it is
21
- > still installed, `npm install` will fail with an error telling you which package manager has it. Uninstall it first
22
- > using whichever tool you originally used:
20
+ > **Upgrading from the Bedrock AgentCore Starter Toolkit?** If the old Python CLI is still installed, you'll see a
21
+ > warning after install asking you to uninstall it. Both CLIs use the `agentcore` command name, so having both can cause
22
+ > confusion. Uninstall the old one using whichever tool you originally used:
23
23
  >
24
24
  > ```bash
25
25
  > pip uninstall bedrock-agentcore-starter-toolkit # if installed via pip
26
26
  > pipx uninstall bedrock-agentcore-starter-toolkit # if installed via pipx
27
27
  > uv tool uninstall bedrock-agentcore-starter-toolkit # if installed via uv
28
28
  > ```
29
- >
30
- > If you need to bypass the check (for example, in CI), set `AGENTCORE_SKIP_CONFLICT_CHECK=1` before installing.
31
29
 
32
30
  ```bash
33
31
  npm install -g @aws/agentcore
@@ -100,7 +98,7 @@ agentcore invoke
100
98
  | -------------------- | --------------------------------------------- |
101
99
  | `add evaluator` | Add a custom LLM-as-a-Judge evaluator |
102
100
  | `add online-eval` | Add continuous evaluation for live traffic |
103
- | `run evals` | Run on-demand evaluation against agent traces |
101
+ | `run eval` | Run on-demand evaluation against agent traces |
104
102
  | `evals history` | View past eval run results |
105
103
  | `pause online-eval` | Pause a deployed online eval config |
106
104
  | `resume online-eval` | Resume a paused online eval config |
@@ -73,13 +73,19 @@ async function main() {
73
73
  const spec = await configIO.readProjectSpec();
74
74
  const targets = await configIO.readAWSDeploymentTargets();
75
75
 
76
- // Read MCP configuration if it exists
77
- let mcpSpec;
78
- try {
79
- mcpSpec = await configIO.readMcpSpec();
80
- } catch {
81
- // MCP config is optional
82
- }
76
+ // Extract MCP configuration from project spec.
77
+ // Gateway fields are stored in agentcore.json but may not yet be on the
78
+ // AgentCoreProjectSpec type from @aws/agentcore-cdk, so we read them
79
+ // dynamically and cast the resulting object.
80
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
+ const specAny = spec as any;
82
+ const mcpSpec = specAny.agentCoreGateways?.length
83
+ ? {
84
+ agentCoreGateways: specAny.agentCoreGateways,
85
+ mcpRuntimeTools: specAny.mcpRuntimeTools,
86
+ unassignedTargets: specAny.unassignedTargets,
87
+ }
88
+ : undefined;
83
89
 
84
90
  // Read deployed state for credential ARNs (populated by pre-deploy identity setup)
85
91
  let deployedState: Record<string, unknown> | undefined;
@@ -301,6 +307,7 @@ export class AgentCoreStack extends Stack {
301
307
  mcpSpec,
302
308
  agentCoreApplication: this.application,
303
309
  credentials,
310
+ projectTags: spec.tags,
304
311
  });
305
312
  }
306
313
 
@@ -375,6 +382,9 @@ test('AgentCoreStack synthesizes with empty spec', () => {
375
382
  evaluators: [],
376
383
  onlineEvalConfigs: [],
377
384
  policyEngines: [],
385
+ agentCoreGateways: [],
386
+ mcpRuntimeTools: [],
387
+ unassignedTargets: [],
378
388
  },
379
389
  });
380
390
  const template = Template.fromStack(stack);
@@ -2894,12 +2904,15 @@ async def invoke(payload, context):
2894
2904
 
2895
2905
  # Process the user prompt
2896
2906
  prompt = payload.get("prompt", "What can you help me with?")
2907
+ log.info(f"Agent input: {prompt}")
2897
2908
 
2898
2909
  # Run the agent
2899
2910
  result = await graph.ainvoke({"messages": [HumanMessage(content=prompt)]})
2900
2911
 
2901
2912
  # Return result
2902
- return {"result": result["messages"][-1].content}
2913
+ output = result["messages"][-1].content
2914
+ log.info(f"Agent output: {output}")
2915
+ return {"result": output}
2903
2916
 
2904
2917
 
2905
2918
  if __name__ == "__main__":
@@ -3137,8 +3150,7 @@ description = "AgentCore Runtime Application using LangChain/LangGraph"
3137
3150
  readme = "README.md"
3138
3151
  requires-python = ">=3.10"
3139
3152
  dependencies = [
3140
- "opentelemetry-distro",
3141
- "opentelemetry-exporter-otlp",
3153
+ "aws-opentelemetry-distro",
3142
3154
  "langgraph >= 1.0.2",
3143
3155
  "mcp >= 1.19.0",
3144
3156
  "langchain-mcp-adapters >= 0.1.11",
@@ -4266,7 +4278,7 @@ model** where agents, memories, and credentials are top-level arrays.
4266
4278
  The project uses a **flat resource model**. Agents, memories, and credentials are independent top-level arrays in
4267
4279
  \`agentcore.json\`. There is no binding or attachment between resources in the schema — each resource is provisioned
4268
4280
  independently. To use a memory or credential from an agent, the application code discovers the resource at runtime
4269
- (e.g., via environment variables or SDK calls).
4281
+ (e.g., via environment variables or SDK calls). Tags defined in \`agentcore.json\` flow through to deployed CloudFormation resources.
4270
4282
 
4271
4283
  ## Critical Invariants
4272
4284
 
@@ -4318,7 +4330,7 @@ file maps to a JSON config file and includes validation constraints as comments.
4318
4330
  - **BuildType**: \`'CodeZip'\` | \`'Container'\`
4319
4331
  - **NetworkMode**: \`'PUBLIC'\`
4320
4332
  - **RuntimeVersion**: \`'PYTHON_3_10'\` | \`'PYTHON_3_11'\` | \`'PYTHON_3_12'\` | \`'PYTHON_3_13'\`
4321
- - **MemoryStrategyType**: \`'SEMANTIC'\` | \`'SUMMARIZATION'\` | \`'USER_PREFERENCE'\`
4333
+ - **MemoryStrategyType**: \`'SEMANTIC'\` | \`'SUMMARIZATION'\` | \`'USER_PREFERENCE'\` | \`'EPISODIC'\`
4322
4334
 
4323
4335
  ### Build Types
4324
4336
 
@@ -11,7 +11,7 @@ model** where agents, memories, and credentials are top-level arrays.
11
11
  The project uses a **flat resource model**. Agents, memories, and credentials are independent top-level arrays in
12
12
  `agentcore.json`. There is no binding or attachment between resources in the schema — each resource is provisioned
13
13
  independently. To use a memory or credential from an agent, the application code discovers the resource at runtime
14
- (e.g., via environment variables or SDK calls).
14
+ (e.g., via environment variables or SDK calls). Tags defined in `agentcore.json` flow through to deployed CloudFormation resources.
15
15
 
16
16
  ## Critical Invariants
17
17
 
@@ -63,7 +63,7 @@ file maps to a JSON config file and includes validation constraints as comments.
63
63
  - **BuildType**: `'CodeZip'` | `'Container'`
64
64
  - **NetworkMode**: `'PUBLIC'`
65
65
  - **RuntimeVersion**: `'PYTHON_3_10'` | `'PYTHON_3_11'` | `'PYTHON_3_12'` | `'PYTHON_3_13'`
66
- - **MemoryStrategyType**: `'SEMANTIC'` | `'SUMMARIZATION'` | `'USER_PREFERENCE'`
66
+ - **MemoryStrategyType**: `'SEMANTIC'` | `'SUMMARIZATION'` | `'USER_PREFERENCE'` | `'EPISODIC'`
67
67
 
68
68
  ### Build Types
69
69
 
@@ -28,13 +28,19 @@ async function main() {
28
28
  const spec = await configIO.readProjectSpec();
29
29
  const targets = await configIO.readAWSDeploymentTargets();
30
30
 
31
- // Read MCP configuration if it exists
32
- let mcpSpec;
33
- try {
34
- mcpSpec = await configIO.readMcpSpec();
35
- } catch {
36
- // MCP config is optional
37
- }
31
+ // Extract MCP configuration from project spec.
32
+ // Gateway fields are stored in agentcore.json but may not yet be on the
33
+ // AgentCoreProjectSpec type from @aws/agentcore-cdk, so we read them
34
+ // dynamically and cast the resulting object.
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ const specAny = spec as any;
37
+ const mcpSpec = specAny.agentCoreGateways?.length
38
+ ? {
39
+ agentCoreGateways: specAny.agentCoreGateways,
40
+ mcpRuntimeTools: specAny.mcpRuntimeTools,
41
+ unassignedTargets: specAny.unassignedTargets,
42
+ }
43
+ : undefined;
38
44
 
39
45
  // Read deployed state for credential ARNs (populated by pre-deploy identity setup)
40
46
  let deployedState: Record<string, unknown> | undefined;
@@ -49,6 +49,7 @@ export class AgentCoreStack extends Stack {
49
49
  mcpSpec,
50
50
  agentCoreApplication: this.application,
51
51
  credentials,
52
+ projectTags: spec.tags,
52
53
  });
53
54
  }
54
55
 
@@ -14,6 +14,9 @@ test('AgentCoreStack synthesizes with empty spec', () => {
14
14
  evaluators: [],
15
15
  onlineEvalConfigs: [],
16
16
  policyEngines: [],
17
+ agentCoreGateways: [],
18
+ mcpRuntimeTools: [],
19
+ unassignedTargets: [],
17
20
  },
18
21
  });
19
22
  const template = Template.fromStack(stack);
@@ -54,12 +54,15 @@ async def invoke(payload, context):
54
54
 
55
55
  # Process the user prompt
56
56
  prompt = payload.get("prompt", "What can you help me with?")
57
+ log.info(f"Agent input: {prompt}")
57
58
 
58
59
  # Run the agent
59
60
  result = await graph.ainvoke({"messages": [HumanMessage(content=prompt)]})
60
61
 
61
62
  # Return result
62
- return {"result": result["messages"][-1].content}
63
+ output = result["messages"][-1].content
64
+ log.info(f"Agent output: {output}")
65
+ return {"result": output}
63
66
 
64
67
 
65
68
  if __name__ == "__main__":
@@ -9,8 +9,7 @@ description = "AgentCore Runtime Application using LangChain/LangGraph"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  dependencies = [
12
- "opentelemetry-distro",
13
- "opentelemetry-exporter-otlp",
12
+ "aws-opentelemetry-distro",
14
13
  "langgraph >= 1.0.2",
15
14
  "mcp >= 1.19.0",
16
15
  "langchain-mcp-adapters >= 0.1.11",