agentcrew-ai 0.8.13__py3-none-any.whl → 0.9.1__py3-none-any.whl

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 (55) hide show
  1. AgentCrew/__init__.py +1 -1
  2. AgentCrew/app.py +46 -634
  3. AgentCrew/main_docker.py +1 -30
  4. AgentCrew/modules/a2a/common/client/card_resolver.py +27 -8
  5. AgentCrew/modules/a2a/server.py +5 -0
  6. AgentCrew/modules/a2a/task_manager.py +1 -0
  7. AgentCrew/modules/agents/local_agent.py +2 -2
  8. AgentCrew/modules/chat/message/command_processor.py +33 -8
  9. AgentCrew/modules/chat/message/conversation.py +18 -1
  10. AgentCrew/modules/chat/message/handler.py +5 -1
  11. AgentCrew/modules/code_analysis/service.py +50 -7
  12. AgentCrew/modules/code_analysis/tool.py +9 -8
  13. AgentCrew/modules/console/completers.py +5 -1
  14. AgentCrew/modules/console/console_ui.py +23 -11
  15. AgentCrew/modules/console/conversation_browser/__init__.py +9 -0
  16. AgentCrew/modules/console/conversation_browser/browser.py +84 -0
  17. AgentCrew/modules/console/conversation_browser/browser_input_handler.py +279 -0
  18. AgentCrew/modules/console/{conversation_browser.py → conversation_browser/browser_ui.py} +249 -163
  19. AgentCrew/modules/console/conversation_handler.py +34 -1
  20. AgentCrew/modules/console/display_handlers.py +127 -7
  21. AgentCrew/modules/console/visual_mode/__init__.py +5 -0
  22. AgentCrew/modules/console/visual_mode/viewer.py +41 -0
  23. AgentCrew/modules/console/visual_mode/viewer_input_handler.py +315 -0
  24. AgentCrew/modules/console/visual_mode/viewer_ui.py +608 -0
  25. AgentCrew/modules/gui/components/command_handler.py +137 -29
  26. AgentCrew/modules/gui/components/menu_components.py +8 -7
  27. AgentCrew/modules/gui/themes/README.md +30 -14
  28. AgentCrew/modules/gui/themes/__init__.py +2 -1
  29. AgentCrew/modules/gui/themes/atom_light.yaml +1287 -0
  30. AgentCrew/modules/gui/themes/catppuccin.yaml +1276 -0
  31. AgentCrew/modules/gui/themes/dracula.yaml +1262 -0
  32. AgentCrew/modules/gui/themes/nord.yaml +1267 -0
  33. AgentCrew/modules/gui/themes/saigontech.yaml +1268 -0
  34. AgentCrew/modules/gui/themes/style_provider.py +78 -264
  35. AgentCrew/modules/gui/themes/theme_loader.py +379 -0
  36. AgentCrew/modules/gui/themes/unicorn.yaml +1276 -0
  37. AgentCrew/modules/gui/widgets/configs/global_settings.py +4 -4
  38. AgentCrew/modules/gui/widgets/history_sidebar.py +6 -1
  39. AgentCrew/modules/llm/constants.py +28 -9
  40. AgentCrew/modules/mcpclient/service.py +0 -1
  41. AgentCrew/modules/memory/base_service.py +13 -0
  42. AgentCrew/modules/memory/chroma_service.py +50 -0
  43. AgentCrew/setup.py +470 -0
  44. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/METADATA +1 -1
  45. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/RECORD +49 -40
  46. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/WHEEL +1 -1
  47. AgentCrew/modules/gui/themes/atom_light.py +0 -1365
  48. AgentCrew/modules/gui/themes/catppuccin.py +0 -1404
  49. AgentCrew/modules/gui/themes/dracula.py +0 -1372
  50. AgentCrew/modules/gui/themes/nord.py +0 -1365
  51. AgentCrew/modules/gui/themes/saigontech.py +0 -1359
  52. AgentCrew/modules/gui/themes/unicorn.py +0 -1372
  53. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/entry_points.txt +0 -0
  54. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/licenses/LICENSE +0 -0
  55. {agentcrew_ai-0.8.13.dist-info → agentcrew_ai-0.9.1.dist-info}/top_level.txt +0 -0
@@ -136,33 +136,132 @@ class CommandHandler:
136
136
 
137
137
  def display_debug_info(self):
138
138
  """Display debug information about the current messages."""
139
- try:
140
- # Format the messages for display
141
- debug_info = json.dumps(
142
- self.chat_window.message_handler.agent.history, indent=2
143
- )
144
- except Exception as _:
145
- debug_info = str(self.chat_window.message_handler.agent.history)
146
- # Add as a system message
147
- self.chat_window.chat_components.add_system_message(
148
- f"DEBUG INFO:\n\n```json\n{debug_info}\n```"
139
+ # Display agent messages
140
+ self._display_debug_messages(
141
+ "Agent Messages", self.chat_window.message_handler.agent.history
149
142
  )
150
143
 
151
- try:
152
- # Format the messages for display
153
- debug_info = json.dumps(
154
- self.chat_window.message_handler.streamline_messages, indent=2
155
- )
156
- except Exception as _:
157
- debug_info = str(self.chat_window.message_handler.streamline_messages)
158
- # Add as a system message
159
- self.chat_window.chat_components.add_system_message(
160
- f"DEBUG INFO:\n\n```json\n{debug_info}\n```"
144
+ # Display chat/streamline messages
145
+ self._display_debug_messages(
146
+ "Chat Messages", self.chat_window.message_handler.streamline_messages
161
147
  )
162
148
 
163
149
  # Update status bar
164
150
  self.chat_window.display_status_message("Debug information displayed")
165
151
 
152
+ def _display_debug_messages(
153
+ self, title: str, messages: list, max_content_length: int = 200
154
+ ):
155
+ """Display formatted debug messages with content truncation.
156
+
157
+ Args:
158
+ title: Section title for the debug output
159
+ messages: List of message dictionaries
160
+ max_content_length: Maximum length for message content (default: 200)
161
+ """
162
+ formatted_messages = self._format_messages_for_debug(
163
+ messages, max_content_length
164
+ )
165
+
166
+ try:
167
+ debug_info = json.dumps(formatted_messages, indent=2)
168
+ except Exception:
169
+ debug_info = str(formatted_messages)
170
+
171
+ self.chat_window.chat_components.add_system_message(
172
+ f"DEBUG - {title} ({len(messages)} messages):\n\n```json\n{debug_info}\n```"
173
+ )
174
+
175
+ def _format_messages_for_debug(
176
+ self, messages: list, max_content_length: int = 200
177
+ ) -> list:
178
+ """Format messages for debug display with truncated content.
179
+
180
+ Args:
181
+ messages: List of message dictionaries
182
+ max_content_length: Maximum length for message content
183
+
184
+ Returns:
185
+ List of formatted message dictionaries
186
+ """
187
+ formatted = []
188
+
189
+ for i, msg in enumerate(messages):
190
+ formatted_msg = {"#": i}
191
+
192
+ # Copy basic fields
193
+ if "role" in msg:
194
+ formatted_msg["role"] = msg["role"]
195
+ if "agent" in msg:
196
+ formatted_msg["agent"] = msg["agent"]
197
+
198
+ # Truncate content
199
+ content = msg.get("content", "")
200
+ formatted_msg["content"] = self._truncate_content(
201
+ content, max_content_length
202
+ )
203
+
204
+ # Include tool_use/tool_result indicators if present
205
+ if isinstance(content, list):
206
+ content_types = []
207
+ for item in content:
208
+ if isinstance(item, dict):
209
+ item_type = item.get("type", "unknown")
210
+ if item_type == "tool_use":
211
+ tool_name = item.get("name", "unknown")
212
+ content_types.append(f"tool_use:{tool_name}")
213
+ elif item_type == "tool_result":
214
+ content_types.append("tool_result")
215
+ elif item_type not in ("text",):
216
+ content_types.append(item_type)
217
+ if content_types:
218
+ formatted_msg["content_types"] = content_types
219
+
220
+ formatted.append(formatted_msg)
221
+
222
+ return formatted
223
+
224
+ def _truncate_content(self, content: Any, max_length: int) -> str:
225
+ """Truncate content to max_length with ellipsis.
226
+
227
+ Args:
228
+ content: Message content (can be string, list, or dict)
229
+ max_length: Maximum length for the output
230
+
231
+ Returns:
232
+ Truncated string representation
233
+ """
234
+ if isinstance(content, str):
235
+ text = content
236
+ elif isinstance(content, list):
237
+ # Extract text from content blocks
238
+ text_parts = []
239
+ for item in content:
240
+ if isinstance(item, dict):
241
+ if item.get("type") == "text":
242
+ text_parts.append(item.get("text", ""))
243
+ elif item.get("type") == "tool_use":
244
+ text_parts.append(f"[tool:{item.get('name', 'unknown')}]")
245
+ elif item.get("type") == "tool_result":
246
+ result = item.get("content", "")
247
+ if isinstance(result, str):
248
+ text_parts.append(f"[result:{result[:50]}...]")
249
+ else:
250
+ text_parts.append("[result:...]")
251
+ elif isinstance(item, str):
252
+ text_parts.append(item)
253
+ text = " | ".join(text_parts)
254
+ else:
255
+ text = str(content)
256
+
257
+ # Clean up whitespace
258
+ text = " ".join(text.split())
259
+
260
+ if len(text) <= max_length:
261
+ return text
262
+
263
+ return text[: max_length - 3] + "..."
264
+
166
265
  def handle_event(self, event: str, data: Any) -> bool:
167
266
  """
168
267
  Handle command-related events. Returns True if event was processed, False otherwise.
@@ -193,15 +292,24 @@ class CommandHandler:
193
292
  return True
194
293
 
195
294
  elif event == "debug_requested":
196
- try:
197
- debug_info = json.dumps(data, indent=2)
198
- self.chat_window.chat_components.add_system_message(
199
- f"DEBUG INFO:\n\n```json\n{debug_info}\n```"
200
- )
201
- except Exception:
202
- self.chat_window.chat_components.add_system_message(
203
- f"DEBUG INFO:\n\n{str(data)}"
204
- )
295
+ if isinstance(data, dict) and "type" in data and "messages" in data:
296
+ # New format with type and messages
297
+ msg_type = data["type"]
298
+ messages = data["messages"]
299
+ title = "Agent Messages" if msg_type == "agent" else "Chat Messages"
300
+ self._display_debug_messages(title, messages)
301
+ else:
302
+ # Legacy format - just raw messages
303
+ try:
304
+ formatted = self._format_messages_for_debug(data)
305
+ debug_info = json.dumps(formatted, indent=2)
306
+ self.chat_window.chat_components.add_system_message(
307
+ f"DEBUG INFO ({len(data)} messages):\n\n```json\n{debug_info}\n```"
308
+ )
309
+ except Exception:
310
+ self.chat_window.chat_components.add_system_message(
311
+ f"DEBUG INFO:\n\n{str(data)}"
312
+ )
205
313
  return True
206
314
 
207
315
  elif event == "agent_changed":
@@ -62,8 +62,9 @@ class MenuBuilder:
62
62
  for agent_name in available_agents:
63
63
  agent_action = QAction(agent_name, self.chat_window)
64
64
  agent_action.triggered.connect(
65
- lambda checked,
66
- name=agent_name: self.chat_window.command_handler.change_agent(name)
65
+ lambda checked, name=agent_name: (
66
+ self.chat_window.command_handler.change_agent(name)
67
+ )
67
68
  )
68
69
  agents_menu.addAction(agent_action)
69
70
  current_agent = agent_manager.get_current_agent()
@@ -84,8 +85,9 @@ class MenuBuilder:
84
85
  for agent_name in available_agents:
85
86
  agent_action = QAction(agent_name, self.chat_window)
86
87
  agent_action.triggered.connect(
87
- lambda checked,
88
- name=agent_name: self.chat_window.command_handler.change_agent(name)
88
+ lambda checked, name=agent_name: (
89
+ self.chat_window.command_handler.change_agent(name)
90
+ )
89
91
  )
90
92
  agents_menu.addAction(agent_action)
91
93
 
@@ -107,9 +109,8 @@ class MenuBuilder:
107
109
  for model in models:
108
110
  model_action = QAction(f"{model.name} ({model.id})", self.chat_window)
109
111
  model_action.triggered.connect(
110
- lambda checked,
111
- model_id=f"{model.provider}/{model.id}": self.chat_window.command_handler.change_model(
112
- model_id
112
+ lambda checked, model_id=f"{model.provider}/{model.id}": (
113
+ self.chat_window.command_handler.change_model(model_id)
113
114
  )
114
115
  )
115
116
  provider_menu.addAction(model_action)
@@ -5,26 +5,32 @@ This directory contains the theming system for the AgentCrew GUI application.
5
5
  ## Available Themes
6
6
 
7
7
  ### 1. Catppuccin Theme (`catppuccin.py`)
8
+
8
9
  - **Type**: Dark theme
9
10
  - **Style**: Modern, vibrant dark theme with purple and blue accents
10
11
  - **Usage**: Default dark theme, activated when `theme = "dark"` in config
11
12
 
12
13
  ### 2. Atom Light Theme (`atom_light.py`)
13
- - **Type**: Light theme
14
+
15
+ - **Type**: Light theme
14
16
  - **Style**: Clean, minimalist light theme with blue accents
15
17
  - **Usage**: Activated when `theme = "light"` in config
16
18
 
17
19
  ### 3. Nord Theme (`nord.py`)
20
+
18
21
  - **Type**: Dark theme
19
22
  - **Style**: Arctic-inspired color palette with cool blue/teal accents
20
23
  - **Usage**: Activated when `theme = "nord"` in config
21
- - **Color Palette**: Based on the official [Nord Color Palette](https://www.nordtheme.com/)
24
+ - **Color Palette**: Based on the official
25
+ [Nord Color Palette](https://www.nordtheme.com/)
22
26
 
23
27
  ### 4. Dracula Theme (`dracula.py`) ⭐ **NEW**
28
+
24
29
  - **Type**: Dark theme
25
30
  - **Style**: Bold, vibrant dark theme with purple and pink accents
26
31
  - **Usage**: Activated when `theme = "dracula"` in config
27
- - **Color Palette**: Based on the official [Dracula Theme](https://draculatheme.com/contribute)
32
+ - **Color Palette**: Based on the official
33
+ [Dracula Theme](https://draculatheme.com/contribute)
28
34
 
29
35
  ## Dracula Theme Details
30
36
 
@@ -33,12 +39,14 @@ The Dracula theme implements the complete official color palette:
33
39
  ### Color Groups
34
40
 
35
41
  #### Base Colors
42
+
36
43
  - `#282A36` - Background (Main application background)
37
44
  - `#44475A` - Current Line (Secondary elements, input fields)
38
45
  - `#F8F8F2` - Foreground (Text color)
39
46
  - `#6272A4` - Comment (Secondary text, borders)
40
47
 
41
48
  #### Accent Colors
49
+
42
50
  - `#8BE9FD` - Cyan (Focus states, operators)
43
51
  - `#50FA7B` - Green (Success states, strings)
44
52
  - `#FFB86C` - Orange (Warnings, special text)
@@ -61,23 +69,27 @@ The Nord theme implements the complete 16-color Nord palette:
61
69
  ### Color Groups
62
70
 
63
71
  #### Polar Night (Dark Backgrounds)
72
+
64
73
  - `#2e3440` - Polar Night 0 (Main backgrounds)
65
74
  - `#3b4252` - Polar Night 1 (Secondary backgrounds)
66
- - `#434c5e` - Polar Night 2 (Input backgrounds)
75
+ - `#434c5e` - Polar Night 2 (Input backgrounds)
67
76
  - `#4c566a` - Polar Night 3 (Borders, disabled states)
68
77
 
69
78
  #### Snow Storm (Light Text)
79
+
70
80
  - `#d8dee9` - Snow Storm 0 (Secondary text)
71
81
  - `#e5e9f0` - Snow Storm 1 (Primary text)
72
82
  - `#eceff4` - Snow Storm 2 (Highlighted text)
73
83
 
74
84
  #### Frost (Blue Accents)
85
+
75
86
  - `#8fbcbb` - Frost 0 (Hover states)
76
87
  - `#88c0d0` - Frost 1 (Focus states, links)
77
88
  - `#81a1c1` - Frost 2 (Active states)
78
89
  - `#5e81ac` - Frost 3 (Primary actions)
79
90
 
80
91
  #### Aurora (Semantic Colors)
92
+
81
93
  - `#bf616a` - Aurora Red (Errors, stop actions)
82
94
  - `#d08770` - Aurora Orange (Warnings, hover effects)
83
95
  - `#ebcb8b` - Aurora Yellow (Classes, namespaces)
@@ -96,14 +108,16 @@ The Nord theme implements the complete 16-color Nord palette:
96
108
  To use a specific theme in AgentCrew:
97
109
 
98
110
  1. Set the theme in your global configuration:
99
-
111
+
100
112
  For Nord theme:
113
+
101
114
  ```toml
102
115
  [global_settings]
103
116
  theme = "nord"
104
117
  ```
105
-
118
+
106
119
  For Dracula theme:
120
+
107
121
  ```toml
108
122
  [global_settings]
109
123
  theme = "dracula"
@@ -111,7 +125,8 @@ To use a specific theme in AgentCrew:
111
125
 
112
126
  2. Restart the application or reload the configuration
113
127
 
114
- 3. The application will automatically apply the Nord color scheme to all UI components
128
+ 3. The application will automatically apply the Nord color scheme to all UI
129
+ components
115
130
 
116
131
  ## Architecture
117
132
 
@@ -119,9 +134,11 @@ The theming system uses:
119
134
 
120
135
  - **StyleProvider**: Central theme management class
121
136
  - **Theme Classes**: Static classes containing CSS style definitions
122
- - **Configuration Integration**: Automatic theme switching based on user preferences
137
+ - **Configuration Integration**: Automatic theme switching based on user
138
+ preferences
123
139
 
124
140
  Each theme class provides comprehensive styling for:
141
+
125
142
  - Main application windows and containers
126
143
  - Buttons (primary, secondary, stop, success, error)
127
144
  - Input fields and text areas
@@ -135,11 +152,9 @@ Each theme class provides comprehensive styling for:
135
152
 
136
153
  To add a new theme:
137
154
 
138
- 1. Create a new theme file (e.g., `mytheme.py`)
139
- 2. Implement a theme class with all required style constants
140
- 3. Update `style_provider.py` to import and support the new theme
141
- 4. Update `__init__.py` to export the new theme class
142
- 5. Document the theme configuration value
155
+ 1. Create a new theme file (e.g., `mytheme.yaml`)
156
+ 2. Implement a theme file with all required style constants
157
+ 3. Document the theme configuration value
143
158
 
144
159
  ## Development Notes
145
160
 
@@ -147,4 +162,5 @@ To add a new theme:
147
162
  - Color values should be hex codes with comments for clarity
148
163
  - Maintain consistency with existing theme patterns
149
164
  - Test all UI components with the new theme
150
- - Ensure accessibility standards are met
165
+ - Ensure accessibility standards are met
166
+
@@ -1,3 +1,4 @@
1
1
  from .style_provider import StyleProvider
2
+ from .theme_loader import ThemeLoader, ThemeData
2
3
 
3
- __all__ = ["StyleProvider"]
4
+ __all__ = ["StyleProvider", "ThemeLoader", "ThemeData"]