Commit f0e1af7
authored
feat: add import from Bedrock Agents to add agent and create flows (#563)
* feat: add Import from Bedrock Agents to add agent and create flows
Adds a third option in the "add agent" flow that fetches a Bedrock Agent's
configuration via AWS SDK and translates it into runnable Strands or
LangChain/LangGraph Python code, wired into the standard AgentCore project
structure.
Supports action groups, knowledge bases, multi-agent collaboration, code
interpreter, guardrails, prompt overrides, and memory configuration. Both
interactive TUI and non-interactive CLI paths are implemented.
* style: fix prettier formatting in docs
* fix: escape backslashes in action group description for generated Python code
* style: fix prettier formatting across all changed files
* fix: align memory retrieval strategies with agentcore.json config
- Add actor_id=user_id to all retrieve_memories calls (was missing in
Strands translator)
- Pass memoryOption through to translators so generated Python code
matches the strategies written to agentcore.json
- shortTerm: no namespace-specific retrieval (no strategies in schema)
- longAndShortTerm: retrieve from all three strategy namespaces
(/users/{user_id}/facts, /users/{user_id}/preferences,
/summaries/{user_id}/) matching SEMANTIC, USER_PREFERENCE, and
SUMMARIZATION strategies
* style: fix prettier formatting in translators
* fix: address review feedback from aidandaly24
- Prevent infinite recursion in collaborator fetching by threading a
visited-agents set through getBedrockAgentConfig
- Fix LangGraph checkpointer_STM NameError when memory is disabled by
making the checkpointer parameter conditional
- Fix memory_manager NameError in both translators when memoryEnabled
but agentcoreMemoryEnabled is false
- Add shared Python string escaping utilities (escapePyDoubleQuote,
escapePySingleQuote, escapePyTripleQuote) and apply consistently
to all user-provided string interpolations
- Sanitize KB and collaborator names into valid Python identifiers
(replace non-alphanumeric chars, handle leading digits)
- Add pagination loops for all list API calls (agents, aliases,
action groups, knowledge bases, collaborators)
- Replace non-null assertions with explicit null guards
- Validate alias ARNs with regex before extracting agent/alias IDs
- Add console.warn messages to all catch blocks instead of silently
discarding errors
- Fix stale closure for importConfig.region using a ref
- Add guardrail warning comment in Strands generated code
* fix: resolve lint errors in bedrock-import and AddAgentScreen
- Use Set<string> constructor generic instead of variable annotation
- Replace unknown err in template literals with String(err)
- Use RegExp#exec() instead of String#match()
- Move ref update into useEffect to avoid updating during render1 parent 4da709b commit f0e1af7
File tree
29 files changed
+4915
-604
lines changed- docs
- src/cli
- aws
- __tests__
- commands
- add
- __tests__
- create
- operations/agent/import
- __tests__
- primitives
- tui/screens
- add
- agent
- create
29 files changed
+4915
-604
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
70 | 81 | | |
71 | 82 | | |
72 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
167 | 181 | | |
168 | 182 | | |
169 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
170 | 194 | | |
171 | 195 | | |
172 | 196 | | |
173 | 197 | | |
174 | 198 | | |
175 | | - | |
| 199 | + | |
176 | 200 | | |
177 | 201 | | |
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
181 | | - | |
| 205 | + | |
182 | 206 | | |
183 | 207 | | |
184 | 208 | | |
185 | 209 | | |
186 | 210 | | |
187 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
188 | 215 | | |
189 | 216 | | |
190 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
79 | 124 | | |
80 | 125 | | |
81 | 126 | | |
| |||
0 commit comments