@aws/agentcore 0.3.0-preview.9.0 → 0.4.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 (45) hide show
  1. package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +2 -333
  2. package/dist/assets/agents/AGENTS.md +0 -1
  3. package/dist/assets/cdk/test/cdk.test.ts +2 -1
  4. package/dist/cli/index.mjs +308 -310
  5. package/dist/lib/packaging/index.js +3 -3
  6. package/dist/lib/packaging/index.js.map +1 -1
  7. package/dist/lib/packaging/python.js +1 -1
  8. package/dist/lib/schemas/io/config-io.d.ts +11 -3
  9. package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
  10. package/dist/lib/schemas/io/config-io.js +14 -3
  11. package/dist/lib/schemas/io/config-io.js.map +1 -1
  12. package/dist/lib/schemas/io/index.d.ts +1 -1
  13. package/dist/lib/schemas/io/index.d.ts.map +1 -1
  14. package/dist/lib/schemas/io/index.js +2 -1
  15. package/dist/lib/schemas/io/index.js.map +1 -1
  16. package/dist/schema/constants.d.ts +0 -1
  17. package/dist/schema/constants.d.ts.map +1 -1
  18. package/dist/schema/constants.js +2 -5
  19. package/dist/schema/constants.js.map +1 -1
  20. package/dist/schema/schemas/agent-env.d.ts +0 -7
  21. package/dist/schema/schemas/agent-env.d.ts.map +1 -1
  22. package/dist/schema/schemas/agent-env.js +2 -3
  23. package/dist/schema/schemas/agent-env.js.map +1 -1
  24. package/dist/schema/schemas/agentcore-project.d.ts +18 -22
  25. package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
  26. package/dist/schema/schemas/agentcore-project.js +21 -12
  27. package/dist/schema/schemas/agentcore-project.js.map +1 -1
  28. package/dist/schema/schemas/deployed-state.d.ts +4 -4
  29. package/dist/schema/schemas/deployed-state.js +1 -1
  30. package/dist/schema/schemas/deployed-state.js.map +1 -1
  31. package/dist/schema/schemas/mcp.d.ts +4 -4
  32. package/dist/schema/schemas/mcp.js +3 -3
  33. package/dist/schema/schemas/mcp.js.map +1 -1
  34. package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -1
  35. package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
  36. package/dist/schema/schemas/primitives/online-eval-config.js +0 -1
  37. package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
  38. package/package.json +2 -1
  39. package/scripts/generate-schema.mjs +40 -0
  40. package/dist/assets/python/http/crewai/base/README.md +0 -39
  41. package/dist/assets/python/http/crewai/base/gitignore.template +0 -41
  42. package/dist/assets/python/http/crewai/base/main.py +0 -55
  43. package/dist/assets/python/http/crewai/base/model/__init__.py +0 -1
  44. package/dist/assets/python/http/crewai/base/model/load.py +0 -133
  45. package/dist/assets/python/http/crewai/base/pyproject.toml +0 -31
@@ -1,133 +0,0 @@
1
- {{#if (eq modelProvider "Bedrock")}}
2
- from crewai import LLM
3
-
4
- # Uses global inference profile for Claude Sonnet 4.5
5
- # https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html
6
- MODEL_ID = "bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0"
7
-
8
-
9
- def load_model() -> LLM:
10
- """Get Bedrock model client using IAM credentials."""
11
- return LLM(model=MODEL_ID)
12
- {{/if}}
13
- {{#if (eq modelProvider "Anthropic")}}
14
- import os
15
- from crewai import LLM
16
- from bedrock_agentcore.identity.auth import requires_api_key
17
-
18
- IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
19
- IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
20
-
21
-
22
- @requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
23
- def _agentcore_identity_api_key_provider(api_key: str) -> str:
24
- """Fetch API key from AgentCore Identity."""
25
- return api_key
26
-
27
-
28
- def _get_api_key() -> str:
29
- """
30
- Uses AgentCore Identity for API key management in deployed environments.
31
- For local development, run via 'agentcore dev' which loads agentcore/.env.
32
- """
33
- if os.getenv("LOCAL_DEV") == "1":
34
- api_key = os.getenv(IDENTITY_ENV_VAR)
35
- if not api_key:
36
- raise RuntimeError(
37
- f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
38
- )
39
- return api_key
40
- return _agentcore_identity_api_key_provider()
41
-
42
-
43
- def load_model() -> LLM:
44
- """Get authenticated Anthropic model client."""
45
- api_key = _get_api_key()
46
- # CrewAI requires ANTHROPIC_API_KEY env var (ignores api_key parameter)
47
- os.environ["ANTHROPIC_API_KEY"] = api_key
48
- return LLM(
49
- model="anthropic/claude-sonnet-4-5-20250929",
50
- api_key=api_key,
51
- max_tokens=4096
52
- )
53
- {{/if}}
54
- {{#if (eq modelProvider "OpenAI")}}
55
- import os
56
- from crewai import LLM
57
- from bedrock_agentcore.identity.auth import requires_api_key
58
-
59
- IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
60
- IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
61
-
62
-
63
- @requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
64
- def _agentcore_identity_api_key_provider(api_key: str) -> str:
65
- """Fetch API key from AgentCore Identity."""
66
- return api_key
67
-
68
-
69
- def _get_api_key() -> str:
70
- """
71
- Uses AgentCore Identity for API key management in deployed environments.
72
- For local development, run via 'agentcore dev' which loads agentcore/.env.
73
- """
74
- if os.getenv("LOCAL_DEV") == "1":
75
- api_key = os.getenv(IDENTITY_ENV_VAR)
76
- if not api_key:
77
- raise RuntimeError(
78
- f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
79
- )
80
- return api_key
81
- return _agentcore_identity_api_key_provider()
82
-
83
-
84
- def load_model() -> LLM:
85
- """Get authenticated OpenAI model client."""
86
- api_key = _get_api_key()
87
- # CrewAI requires OPENAI_API_KEY env var (ignores api_key parameter)
88
- os.environ["OPENAI_API_KEY"] = api_key
89
- return LLM(
90
- model="openai/gpt-4.1",
91
- api_key=api_key
92
- )
93
- {{/if}}
94
- {{#if (eq modelProvider "Gemini")}}
95
- import os
96
- from crewai import LLM
97
- from bedrock_agentcore.identity.auth import requires_api_key
98
-
99
- IDENTITY_PROVIDER_NAME = "{{identityProviders.[0].name}}"
100
- IDENTITY_ENV_VAR = "{{identityProviders.[0].envVarName}}"
101
-
102
-
103
- @requires_api_key(provider_name=IDENTITY_PROVIDER_NAME)
104
- def _agentcore_identity_api_key_provider(api_key: str) -> str:
105
- """Fetch API key from AgentCore Identity."""
106
- return api_key
107
-
108
-
109
- def _get_api_key() -> str:
110
- """
111
- Uses AgentCore Identity for API key management in deployed environments.
112
- For local development, run via 'agentcore dev' which loads agentcore/.env.
113
- """
114
- if os.getenv("LOCAL_DEV") == "1":
115
- api_key = os.getenv(IDENTITY_ENV_VAR)
116
- if not api_key:
117
- raise RuntimeError(
118
- f"{IDENTITY_ENV_VAR} not found. Add {IDENTITY_ENV_VAR}=your-key to .env.local"
119
- )
120
- return api_key
121
- return _agentcore_identity_api_key_provider()
122
-
123
-
124
- def load_model() -> LLM:
125
- """Get authenticated Gemini model client."""
126
- api_key = _get_api_key()
127
- # CrewAI requires GEMINI_API_KEY env var (ignores api_key parameter)
128
- os.environ["GEMINI_API_KEY"] = api_key
129
- return LLM(
130
- model="gemini/gemini-2.5-flash",
131
- api_key=api_key
132
- )
133
- {{/if}}
@@ -1,31 +0,0 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "{{ name }}"
7
- version = "0.1.0"
8
- description = "AgentCore Runtime Application using CrewAI SDK"
9
- readme = "README.md"
10
- requires-python = ">=3.11"
11
- dependencies = [
12
- "opentelemetry-distro",
13
- "opentelemetry-exporter-otlp",
14
- "bedrock-agentcore >= 1.0.3",
15
- "botocore[crt] >= 1.35.0",
16
- {{#if (eq modelProvider "Bedrock")}}
17
- "crewai[tools,bedrock] >= 1.3.0",
18
- {{/if}}
19
- {{#if (eq modelProvider "Anthropic")}}
20
- "crewai[tools,anthropic] >= 1.3.0",
21
- {{/if}}
22
- {{#if (eq modelProvider "OpenAI")}}
23
- "crewai[tools,openai] >= 1.3.0",
24
- {{/if}}
25
- {{#if (eq modelProvider "Gemini")}}
26
- "crewai[tools,google-genai] >= 1.3.0",
27
- {{/if}}
28
- ]
29
-
30
- [tool.hatch.build.targets.wheel]
31
- packages = ["."]