agentcrew-ai 0.8.3__py3-none-any.whl → 0.8.4__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.
- AgentCrew/__init__.py +1 -1
- AgentCrew/main.py +3 -1
- AgentCrew/modules/a2a/agent_cards.py +8 -2
- AgentCrew/modules/a2a/errors.py +72 -0
- AgentCrew/modules/a2a/server.py +21 -2
- AgentCrew/modules/a2a/task_manager.py +180 -39
- AgentCrew/modules/browser_automation/js/extract_clickable_elements.js +2 -4
- AgentCrew/modules/chat/message/command_processor.py +7 -1
- AgentCrew/modules/code_analysis/service.py +39 -0
- AgentCrew/modules/code_analysis/tool.py +10 -1
- AgentCrew/modules/console/command_handlers.py +186 -1
- AgentCrew/modules/console/completers.py +67 -0
- AgentCrew/modules/console/console_ui.py +59 -5
- AgentCrew/modules/console/display_handlers.py +12 -0
- AgentCrew/modules/gui/widgets/message_bubble.py +1 -6
- AgentCrew/modules/llm/model_registry.py +1 -1
- AgentCrew/modules/memory/chroma_service.py +0 -1
- AgentCrew/modules/memory/context_persistent.py +10 -4
- AgentCrew/modules/memory/tool.py +2 -3
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/METADATA +2 -2
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/RECORD +25 -24
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/WHEEL +0 -0
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/entry_points.txt +0 -0
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/licenses/LICENSE +0 -0
- {agentcrew_ai-0.8.3.dist-info → agentcrew_ai-0.8.4.dist-info}/top_level.txt +0 -0
|
@@ -12,6 +12,7 @@ import subprocess
|
|
|
12
12
|
import sys
|
|
13
13
|
|
|
14
14
|
from rich.text import Text
|
|
15
|
+
from rich.table import Table
|
|
15
16
|
|
|
16
17
|
from .constants import (
|
|
17
18
|
RICH_STYLE_YELLOW,
|
|
@@ -19,7 +20,7 @@ from .constants import (
|
|
|
19
20
|
from AgentCrew.modules.config.config_management import ConfigManagement
|
|
20
21
|
from loguru import logger
|
|
21
22
|
|
|
22
|
-
from typing import TYPE_CHECKING
|
|
23
|
+
from typing import TYPE_CHECKING, Dict
|
|
23
24
|
|
|
24
25
|
if TYPE_CHECKING:
|
|
25
26
|
from .console_ui import ConsoleUI
|
|
@@ -38,6 +39,7 @@ class CommandHandlers:
|
|
|
38
39
|
"""
|
|
39
40
|
self.console = console_ui.console
|
|
40
41
|
self.message_handler = console_ui.message_handler
|
|
42
|
+
self.context_service = console_ui.message_handler.persistent_service
|
|
41
43
|
|
|
42
44
|
def open_file_in_editor(self, file_path: str) -> bool:
|
|
43
45
|
"""
|
|
@@ -278,3 +280,186 @@ class CommandHandlers:
|
|
|
278
280
|
)
|
|
279
281
|
)
|
|
280
282
|
logger.error(f"Import agent error: {str(e)}", exc_info=True)
|
|
283
|
+
|
|
284
|
+
def handle_list_behaviors_command(self) -> None:
|
|
285
|
+
try:
|
|
286
|
+
if not self.context_service:
|
|
287
|
+
self.console.print(
|
|
288
|
+
Text(
|
|
289
|
+
"❌ Context persistence service not available", style="bold red"
|
|
290
|
+
)
|
|
291
|
+
)
|
|
292
|
+
return
|
|
293
|
+
|
|
294
|
+
global_behaviors = self.context_service.get_adaptive_behaviors(
|
|
295
|
+
self.message_handler.agent.name
|
|
296
|
+
)
|
|
297
|
+
project_behaviors = self.context_service.get_adaptive_behaviors(
|
|
298
|
+
self.message_handler.agent.name, is_local=True
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
if not global_behaviors and not project_behaviors:
|
|
302
|
+
self.console.print(
|
|
303
|
+
Text("ℹ️ No adaptive behaviors found.", style=RICH_STYLE_YELLOW)
|
|
304
|
+
)
|
|
305
|
+
return
|
|
306
|
+
|
|
307
|
+
self._display_behaviors_table(global_behaviors, project_behaviors)
|
|
308
|
+
|
|
309
|
+
except Exception as e:
|
|
310
|
+
self.console.print(
|
|
311
|
+
Text(f"❌ Error listing behaviors: {str(e)}", style="bold red")
|
|
312
|
+
)
|
|
313
|
+
logger.error(f"List behaviors error: {str(e)}", exc_info=True)
|
|
314
|
+
|
|
315
|
+
def _display_behaviors_table(
|
|
316
|
+
self,
|
|
317
|
+
global_behaviors: Dict[str, str],
|
|
318
|
+
project_behaviors: Dict[str, str],
|
|
319
|
+
) -> None:
|
|
320
|
+
if global_behaviors:
|
|
321
|
+
global_table = Table(
|
|
322
|
+
title="🌍 Global Behaviors",
|
|
323
|
+
show_header=True,
|
|
324
|
+
header_style="bold cyan",
|
|
325
|
+
title_style="bold blue",
|
|
326
|
+
)
|
|
327
|
+
global_table.add_column("ID", style="yellow", no_wrap=True)
|
|
328
|
+
global_table.add_column("Behavior", style="white")
|
|
329
|
+
|
|
330
|
+
for behavior_id, behavior_text in global_behaviors.items():
|
|
331
|
+
global_table.add_row(behavior_id, behavior_text)
|
|
332
|
+
|
|
333
|
+
self.console.print(global_table)
|
|
334
|
+
self.console.print()
|
|
335
|
+
|
|
336
|
+
if project_behaviors:
|
|
337
|
+
project_table = Table(
|
|
338
|
+
title="📁 Project Behaviors",
|
|
339
|
+
show_header=True,
|
|
340
|
+
header_style="bold green",
|
|
341
|
+
title_style="bold magenta",
|
|
342
|
+
)
|
|
343
|
+
project_table.add_column("ID", style="yellow", no_wrap=True)
|
|
344
|
+
project_table.add_column("Behavior", style="white")
|
|
345
|
+
|
|
346
|
+
for behavior_id, behavior_text in project_behaviors.items():
|
|
347
|
+
project_table.add_row(behavior_id, behavior_text)
|
|
348
|
+
|
|
349
|
+
self.console.print(project_table)
|
|
350
|
+
self.console.print()
|
|
351
|
+
|
|
352
|
+
def handle_update_behavior_command(
|
|
353
|
+
self, behavior_id: str, behavior_text: str, scope: str = "global"
|
|
354
|
+
) -> None:
|
|
355
|
+
try:
|
|
356
|
+
if not self.context_service:
|
|
357
|
+
self.console.print(
|
|
358
|
+
Text(
|
|
359
|
+
"❌ Context persistence service not available", style="bold red"
|
|
360
|
+
)
|
|
361
|
+
)
|
|
362
|
+
return
|
|
363
|
+
|
|
364
|
+
behavior_text = behavior_text.strip()
|
|
365
|
+
|
|
366
|
+
if not behavior_text:
|
|
367
|
+
self.console.print(
|
|
368
|
+
Text("❌ Behavior text cannot be empty", style="bold red")
|
|
369
|
+
)
|
|
370
|
+
return
|
|
371
|
+
|
|
372
|
+
behavior_lower = behavior_text.lower().strip()
|
|
373
|
+
if not behavior_lower.startswith("when"):
|
|
374
|
+
self.console.print(
|
|
375
|
+
Text(
|
|
376
|
+
"❌ Behavior must follow 'when..., [action]...' format",
|
|
377
|
+
style="bold red",
|
|
378
|
+
)
|
|
379
|
+
)
|
|
380
|
+
return
|
|
381
|
+
|
|
382
|
+
is_local = scope == "project"
|
|
383
|
+
success = self.context_service.store_adaptive_behavior(
|
|
384
|
+
self.message_handler.agent.name,
|
|
385
|
+
behavior_id,
|
|
386
|
+
behavior_text,
|
|
387
|
+
is_local=is_local,
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
if success:
|
|
391
|
+
self.console.print(
|
|
392
|
+
Text(
|
|
393
|
+
f"✅ Behavior '{behavior_id}' updated successfully ({scope} scope)",
|
|
394
|
+
style="bold green",
|
|
395
|
+
)
|
|
396
|
+
)
|
|
397
|
+
else:
|
|
398
|
+
self.console.print(Text("❌ Failed to save behavior", style="bold red"))
|
|
399
|
+
|
|
400
|
+
except ValueError as e:
|
|
401
|
+
self.console.print(
|
|
402
|
+
Text(f"❌ Invalid behavior format: {str(e)}", style="bold red")
|
|
403
|
+
)
|
|
404
|
+
except Exception as e:
|
|
405
|
+
self.console.print(
|
|
406
|
+
Text(f"❌ Error updating behavior: {str(e)}", style="bold red")
|
|
407
|
+
)
|
|
408
|
+
logger.error(f"Update behavior error: {str(e)}", exc_info=True)
|
|
409
|
+
|
|
410
|
+
def handle_delete_behavior_command(
|
|
411
|
+
self, behavior_id: str, scope: str = "global"
|
|
412
|
+
) -> None:
|
|
413
|
+
try:
|
|
414
|
+
if not self.context_service:
|
|
415
|
+
self.console.print(
|
|
416
|
+
Text(
|
|
417
|
+
"❌ Context persistence service not available", style="bold red"
|
|
418
|
+
)
|
|
419
|
+
)
|
|
420
|
+
return
|
|
421
|
+
|
|
422
|
+
is_local = scope == "project"
|
|
423
|
+
|
|
424
|
+
success = self.context_service.remove_adaptive_behavior(
|
|
425
|
+
self.message_handler.agent.name, behavior_id, is_local=is_local
|
|
426
|
+
)
|
|
427
|
+
if success:
|
|
428
|
+
self.console.print(
|
|
429
|
+
Text(
|
|
430
|
+
f"✅ Behavior '{behavior_id}' deleted successfully",
|
|
431
|
+
style="bold green",
|
|
432
|
+
)
|
|
433
|
+
)
|
|
434
|
+
else:
|
|
435
|
+
self.console.print(
|
|
436
|
+
Text(
|
|
437
|
+
f"❌ Failed to delete behavior '{behavior_id}'",
|
|
438
|
+
style="bold red",
|
|
439
|
+
)
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
except Exception as e:
|
|
443
|
+
self.console.print(
|
|
444
|
+
Text(f"❌ Error deleting behavior: {str(e)}", style="bold red")
|
|
445
|
+
)
|
|
446
|
+
logger.error(f"Delete behavior error: {str(e)}", exc_info=True)
|
|
447
|
+
|
|
448
|
+
def get_all_behavior_ids(self) -> list[str]:
|
|
449
|
+
try:
|
|
450
|
+
if not self.context_service:
|
|
451
|
+
return []
|
|
452
|
+
|
|
453
|
+
all_behaviors = self.context_service.get_adaptive_behaviors(
|
|
454
|
+
self.message_handler.agent.name
|
|
455
|
+
) | self.context_service.get_adaptive_behaviors(
|
|
456
|
+
self.message_handler.agent.name, is_local=True
|
|
457
|
+
)
|
|
458
|
+
behavior_ids = []
|
|
459
|
+
|
|
460
|
+
for id, _ in all_behaviors.items():
|
|
461
|
+
behavior_ids.extend(id)
|
|
462
|
+
|
|
463
|
+
return behavior_ids
|
|
464
|
+
except Exception:
|
|
465
|
+
return []
|
|
@@ -121,6 +121,7 @@ class ChatCompleter(Completer):
|
|
|
121
121
|
self.jump_completer = JumpCompleter(message_handler)
|
|
122
122
|
self.mcp_completer = MCPCompleter(message_handler)
|
|
123
123
|
self.drop_completer = DropCompleter(message_handler)
|
|
124
|
+
self.behavior_completer = BehaviorIDCompleter(message_handler)
|
|
124
125
|
|
|
125
126
|
def get_completions(self, document, complete_event):
|
|
126
127
|
text = document.text
|
|
@@ -140,6 +141,8 @@ class ChatCompleter(Completer):
|
|
|
140
141
|
yield from self.file_completer.get_completions(document, complete_event)
|
|
141
142
|
elif text.startswith("/drop "):
|
|
142
143
|
yield from self.drop_completer.get_completions(document, complete_event)
|
|
144
|
+
elif text.startswith(("/delete_behavior ", "/update_behavior ")):
|
|
145
|
+
yield from self.behavior_completer.get_completions(document, complete_event)
|
|
143
146
|
elif text.startswith("/export_agent "):
|
|
144
147
|
remaining_text = text[14:] # Remove "/export_agent "
|
|
145
148
|
|
|
@@ -221,6 +224,15 @@ class ChatCompleter(Completer):
|
|
|
221
224
|
"/toggle_session_yolo",
|
|
222
225
|
"Toggle Auto-Approve Mode for Tool Calls (this session only)",
|
|
223
226
|
),
|
|
227
|
+
("/list_behaviors", "List all agent adaptive behaviors"),
|
|
228
|
+
(
|
|
229
|
+
"/update_behavior",
|
|
230
|
+
"Update or create an adaptive behavior (usage: /update_behavior <scope> <id> <behavior_text>)",
|
|
231
|
+
),
|
|
232
|
+
(
|
|
233
|
+
"/delete_behavior",
|
|
234
|
+
"Delete an adaptive behavior (usage: /delete_behavior <id>)",
|
|
235
|
+
),
|
|
224
236
|
("/exit", "Exit the application"),
|
|
225
237
|
("/quit", "Exit the application"),
|
|
226
238
|
]
|
|
@@ -305,6 +317,61 @@ class DropCompleter(Completer):
|
|
|
305
317
|
)
|
|
306
318
|
|
|
307
319
|
|
|
320
|
+
class BehaviorIDCompleter(Completer):
|
|
321
|
+
"""Completer that shows available behavior IDs when typing /delete_behavior or /update_behavior commands."""
|
|
322
|
+
|
|
323
|
+
def __init__(self, message_handler=None):
|
|
324
|
+
self.message_handler = message_handler
|
|
325
|
+
|
|
326
|
+
def get_completions(self, document, complete_event):
|
|
327
|
+
text = document.text
|
|
328
|
+
|
|
329
|
+
if text.startswith(
|
|
330
|
+
(
|
|
331
|
+
"/delete_behavior global ",
|
|
332
|
+
"/delete_behavior project ",
|
|
333
|
+
"/update_behavior global ",
|
|
334
|
+
"/update_behavior project ",
|
|
335
|
+
)
|
|
336
|
+
):
|
|
337
|
+
word_before_cursor = document.get_word_before_cursor(
|
|
338
|
+
pattern=COMPLETER_PATTERN
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
if self.message_handler and self.message_handler.persistent_service:
|
|
342
|
+
try:
|
|
343
|
+
scope = text.split(" ")[1].strip()
|
|
344
|
+
all_behaviors = (
|
|
345
|
+
self.message_handler.persistent_service.get_adaptive_behaviors(
|
|
346
|
+
self.message_handler.agent.name, is_local=scope == "project"
|
|
347
|
+
)
|
|
348
|
+
)
|
|
349
|
+
behavior_ids = []
|
|
350
|
+
for id, _ in all_behaviors.items():
|
|
351
|
+
behavior_ids.append(id)
|
|
352
|
+
|
|
353
|
+
for behavior_id in behavior_ids:
|
|
354
|
+
if behavior_id.startswith(word_before_cursor):
|
|
355
|
+
yield Completion(
|
|
356
|
+
behavior_id,
|
|
357
|
+
start_position=-len(word_before_cursor),
|
|
358
|
+
display=behavior_id,
|
|
359
|
+
)
|
|
360
|
+
except Exception:
|
|
361
|
+
pass
|
|
362
|
+
elif text.startswith(("/delete_behavior ", "/update_behavior ")):
|
|
363
|
+
word_before_cursor = document.get_word_before_cursor(
|
|
364
|
+
pattern=COMPLETER_PATTERN
|
|
365
|
+
)
|
|
366
|
+
for scope in ["global", "project"]:
|
|
367
|
+
if scope.startswith(word_before_cursor):
|
|
368
|
+
yield Completion(
|
|
369
|
+
scope,
|
|
370
|
+
start_position=-len(word_before_cursor),
|
|
371
|
+
display=scope,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
|
|
308
375
|
class DirectoryListingCompleter(Completer):
|
|
309
376
|
def __init__(self):
|
|
310
377
|
# Use PathCompleter for the heavy lifting
|
|
@@ -6,6 +6,7 @@ Refactored to use separate modules for different responsibilities.
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
import asyncio
|
|
8
8
|
import time
|
|
9
|
+
import sys
|
|
9
10
|
import signal
|
|
10
11
|
from typing import Any
|
|
11
12
|
from rich.console import Console
|
|
@@ -421,11 +422,12 @@ class ConsoleUI(Observer):
|
|
|
421
422
|
|
|
422
423
|
try:
|
|
423
424
|
while True:
|
|
424
|
-
if
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
425
|
+
if sys.platform != "win32":
|
|
426
|
+
if (
|
|
427
|
+
not signal.getsignal(signal.SIGWINCH)
|
|
428
|
+
or signal.getsignal(signal.SIGWINCH) == signal.SIG_DFL
|
|
429
|
+
):
|
|
430
|
+
signal.signal(signal.SIGWINCH, self._handle_terminal_resize)
|
|
429
431
|
try:
|
|
430
432
|
# Get user input (now in separate thread)
|
|
431
433
|
self.input_handler.is_message_processing = False
|
|
@@ -544,6 +546,58 @@ class ConsoleUI(Observer):
|
|
|
544
546
|
self.command_handlers.handle_edit_config_command()
|
|
545
547
|
continue
|
|
546
548
|
|
|
549
|
+
# Handle list_behaviors command
|
|
550
|
+
elif user_input.strip() == "/list_behaviors":
|
|
551
|
+
self.command_handlers.handle_list_behaviors_command()
|
|
552
|
+
continue
|
|
553
|
+
|
|
554
|
+
# Handle update_behavior command
|
|
555
|
+
elif user_input.strip().startswith("/update_behavior "):
|
|
556
|
+
args = user_input.strip()[17:].strip()
|
|
557
|
+
if args:
|
|
558
|
+
parts = args.split(maxsplit=2)
|
|
559
|
+
if len(parts) == 3:
|
|
560
|
+
scope, behavior_id, behavior_text = parts
|
|
561
|
+
self.command_handlers.handle_update_behavior_command(
|
|
562
|
+
behavior_id, behavior_text, scope
|
|
563
|
+
)
|
|
564
|
+
else:
|
|
565
|
+
self.console.print(
|
|
566
|
+
Text(
|
|
567
|
+
"Usage: /update_behavior <scope> <id> <behavior_text>\n"
|
|
568
|
+
"Example: /update_behavior project my_behavior_id when user asks about X, do provide detailed examples",
|
|
569
|
+
style=RICH_STYLE_YELLOW,
|
|
570
|
+
)
|
|
571
|
+
)
|
|
572
|
+
else:
|
|
573
|
+
self.console.print(
|
|
574
|
+
Text(
|
|
575
|
+
"Usage: /update_behavior <scope> <id> <behavior_text>\n"
|
|
576
|
+
"Example: /update_behavior project my_behavior_id when user asks about X, do provide detailed examples",
|
|
577
|
+
style=RICH_STYLE_YELLOW,
|
|
578
|
+
)
|
|
579
|
+
)
|
|
580
|
+
continue
|
|
581
|
+
|
|
582
|
+
# Handle delete_behavior command
|
|
583
|
+
elif user_input.strip().startswith("/delete_behavior "):
|
|
584
|
+
args = user_input.strip()[17:].strip()
|
|
585
|
+
parts = args.split(maxsplit=1)
|
|
586
|
+
if len(parts) == 2:
|
|
587
|
+
scope, behavior_id = parts
|
|
588
|
+
self.command_handlers.handle_delete_behavior_command(
|
|
589
|
+
behavior_id, scope
|
|
590
|
+
)
|
|
591
|
+
else:
|
|
592
|
+
self.console.print(
|
|
593
|
+
Text(
|
|
594
|
+
"Usage: /delete_behavior <scope> <id>\n"
|
|
595
|
+
"Example: /delete_behavior <scope> my_behavior_id",
|
|
596
|
+
style=RICH_STYLE_YELLOW,
|
|
597
|
+
)
|
|
598
|
+
)
|
|
599
|
+
continue
|
|
600
|
+
|
|
547
601
|
elif user_input.startswith("/voice"):
|
|
548
602
|
self.input_handler._stop_input_thread()
|
|
549
603
|
self.voice_recording = True
|
|
@@ -350,6 +350,18 @@ class DisplayHandlers:
|
|
|
350
350
|
"Use '/toggle_session_yolo' to toggle YOLO mode (auto-approval of tool calls) in this session only.",
|
|
351
351
|
style=RICH_STYLE_YELLOW,
|
|
352
352
|
),
|
|
353
|
+
Text(
|
|
354
|
+
"Use '/list_behaviors' to list all adaptive behaviors (global and project-specific).",
|
|
355
|
+
style=RICH_STYLE_YELLOW,
|
|
356
|
+
),
|
|
357
|
+
Text(
|
|
358
|
+
"Use '/update_behavior <scope> <id> <behavior>' to create or update an adaptive behavior (format: 'when..., do...').",
|
|
359
|
+
style=RICH_STYLE_YELLOW,
|
|
360
|
+
),
|
|
361
|
+
Text(
|
|
362
|
+
"Use '/delete_behavior <scope> <id>' to delete an adaptive behavior.",
|
|
363
|
+
style=RICH_STYLE_YELLOW,
|
|
364
|
+
),
|
|
353
365
|
Text("Use '/list' to list saved conversations.", style=RICH_STYLE_YELLOW),
|
|
354
366
|
Text(
|
|
355
367
|
"Use '/load <id>' or '/load <number>' to load a conversation.",
|
|
@@ -564,12 +564,7 @@ class MessageBubble(QFrame):
|
|
|
564
564
|
return
|
|
565
565
|
|
|
566
566
|
if self.streaming_text and self.streaming_text != self.message_label.text():
|
|
567
|
-
|
|
568
|
-
self.message_label.setText(
|
|
569
|
-
"[...]" + "".join(chunked_streaming_text[-60:])
|
|
570
|
-
if len(chunked_streaming_text) > 60
|
|
571
|
-
else self.streaming_text
|
|
572
|
-
)
|
|
567
|
+
self.message_label.setText(self.streaming_text)
|
|
573
568
|
|
|
574
569
|
def _finalize_streaming(self):
|
|
575
570
|
"""Convert to formatted text once streaming is complete."""
|
|
@@ -50,7 +50,7 @@ class ModelRegistry:
|
|
|
50
50
|
def get_model_sample_params(cls, mode_id):
|
|
51
51
|
registry = ModelRegistry.get_instance()
|
|
52
52
|
model = registry.get_model(mode_id)
|
|
53
|
-
if not model
|
|
53
|
+
if not model:
|
|
54
54
|
logger.warning(f"Model not found in registry: {mode_id}")
|
|
55
55
|
return None
|
|
56
56
|
return model.force_sample_params
|
|
@@ -369,7 +369,6 @@ class ChromaMemoryService(BaseMemoryService):
|
|
|
369
369
|
self.current_conversation_context[session_id] = latest_memory["documents"][
|
|
370
370
|
-1
|
|
371
371
|
]
|
|
372
|
-
print(self.current_conversation_context[session_id])
|
|
373
372
|
|
|
374
373
|
def generate_user_context(self, user_input: str, agent_name: str = "None") -> str:
|
|
375
374
|
"""
|
|
@@ -513,7 +513,9 @@ class ContextPersistenceService:
|
|
|
513
513
|
logger.error(f"ERROR: Failed to store adaptive behavior: {e}")
|
|
514
514
|
return False
|
|
515
515
|
|
|
516
|
-
def remove_adaptive_behavior(
|
|
516
|
+
def remove_adaptive_behavior(
|
|
517
|
+
self, agent_name: str, behavior_id: str, is_local: bool = False
|
|
518
|
+
) -> bool:
|
|
517
519
|
"""
|
|
518
520
|
Removes a specific adaptive behavior for an agent.
|
|
519
521
|
|
|
@@ -524,9 +526,13 @@ class ContextPersistenceService:
|
|
|
524
526
|
Returns:
|
|
525
527
|
True if successful or behavior didn't exist, False on error.
|
|
526
528
|
"""
|
|
527
|
-
|
|
528
|
-
|
|
529
|
+
|
|
530
|
+
adaptive_file_path = (
|
|
531
|
+
self.adaptive_behaviors_local_path
|
|
532
|
+
if is_local
|
|
533
|
+
else self.adaptive_behaviors_file_path
|
|
529
534
|
)
|
|
535
|
+
adaptive_data = self._read_json_file(adaptive_file_path, default_value={})
|
|
530
536
|
|
|
531
537
|
if not isinstance(adaptive_data, dict):
|
|
532
538
|
logger.warning("WARNING: Adaptive behaviors file was not a dictionary.")
|
|
@@ -540,7 +546,7 @@ class ContextPersistenceService:
|
|
|
540
546
|
del adaptive_data[agent_name]
|
|
541
547
|
|
|
542
548
|
try:
|
|
543
|
-
self._write_json_file(
|
|
549
|
+
self._write_json_file(adaptive_file_path, adaptive_data)
|
|
544
550
|
logger.info(
|
|
545
551
|
f"INFO: Removed adaptive behavior '{behavior_id}' for agent '{agent_name}'"
|
|
546
552
|
)
|
AgentCrew/modules/memory/tool.py
CHANGED
|
@@ -220,8 +220,7 @@ All behaviors must follow 'when..., [action]...' format for automatic activation
|
|
|
220
220
|
"scope": {
|
|
221
221
|
"type": "string",
|
|
222
222
|
"enum": ["global", "project"],
|
|
223
|
-
"
|
|
224
|
-
"description": "Scope of the behavior. 'global' for all interactions, 'project' for current project only. Default is 'global'. Optional.",
|
|
223
|
+
"description": "Scope of the behavior. 'global' apply for all conversations, 'project' applys for current project only. Use project scope when behavior is project-specific, use global if behavior is general.",
|
|
225
224
|
},
|
|
226
225
|
}
|
|
227
226
|
|
|
@@ -276,7 +275,7 @@ def get_adapt_tool_handler(persistence_service: Any) -> Callable:
|
|
|
276
275
|
|
|
277
276
|
try:
|
|
278
277
|
success = persistence_service.store_adaptive_behavior(
|
|
279
|
-
agent_name, behavior_id, behavior, scope == "
|
|
278
|
+
agent_name, behavior_id, behavior, scope == "project"
|
|
280
279
|
)
|
|
281
280
|
return (
|
|
282
281
|
f"Stored behavior '{behavior_id}': {behavior}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentcrew-ai
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.4
|
|
4
4
|
Summary: Multi-Agents Interactive Chat Tool
|
|
5
5
|
Author-email: Quy Truong <quy.truong@saigontechnology.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -39,7 +39,7 @@ Requires-Dist: voyageai>=0.3.2
|
|
|
39
39
|
Requires-Dist: numpy<2,>=1.24.4; python_version < "3.13" and sys_platform == "darwin"
|
|
40
40
|
Requires-Dist: pywin32; sys_platform == "win32"
|
|
41
41
|
Requires-Dist: pyobjc; sys_platform == "darwin"
|
|
42
|
-
Requires-Dist: a2a-sdk>=0.
|
|
42
|
+
Requires-Dist: a2a-sdk>=0.3.10
|
|
43
43
|
Requires-Dist: qtawesome>=1.4.0
|
|
44
44
|
Requires-Dist: xmltodict>=0.14.2
|
|
45
45
|
Requires-Dist: elevenlabs>=2.12.1
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
AgentCrew/__init__.py,sha256=
|
|
1
|
+
AgentCrew/__init__.py,sha256=jhHEJFZWhkQDemoZMomBYq-RNrKXknYzUaeIU9A6XsI,22
|
|
2
2
|
AgentCrew/app.py,sha256=dXjwoHLKf1tSOq1Vc-9wsF1dpjS5CaGqdiFSksKKwKA,36584
|
|
3
|
-
AgentCrew/main.py,sha256=
|
|
3
|
+
AgentCrew/main.py,sha256=tjyw4Z29YKKyzVKqDgF5icI1IM59DUiJrXZw6Sv_xN8,11187
|
|
4
4
|
AgentCrew/main_docker.py,sha256=1jpB-XOm-t3GWTKYidGHHkCSzJ-p39ua0E6-_Nj8_9Y,5472
|
|
5
5
|
AgentCrew/assets/agentcrew_logo.png,sha256=bA4WQ9QrZXxBd_GfbR2s5GWBRrRodzeDynQj7XHIPNw,944381
|
|
6
6
|
AgentCrew/modules/__init__.py,sha256=XFPEOINvFcwT5wToPt3lm4wst-XiBNjeAIK3s5QfV3Q,1191
|
|
7
7
|
AgentCrew/modules/a2a/__init__.py,sha256=gFX0PAA6sxCRyAo_Gbs81cK2FckW11GnTxMhQpchkmg,208
|
|
8
8
|
AgentCrew/modules/a2a/adapters.py,sha256=GOTZVstQOhMus1QWcqVQZXEmPovfhxRrJ9loUtypGSY,7989
|
|
9
|
-
AgentCrew/modules/a2a/agent_cards.py,sha256=
|
|
9
|
+
AgentCrew/modules/a2a/agent_cards.py,sha256=SWmo3jVNSrPUqpL8Tv6T3h1a-0oXrOgqJrbPy7tz5XQ,4098
|
|
10
|
+
AgentCrew/modules/a2a/errors.py,sha256=Yaw7Ew5LYDvrYgKZ34heBnEqlIXFF3_5GqqpNhNlveI,2353
|
|
10
11
|
AgentCrew/modules/a2a/registry.py,sha256=1PkasOOpRqulE7mMl1UNSt5GrqGT8AhP9UCWWSAF34I,2671
|
|
11
|
-
AgentCrew/modules/a2a/server.py,sha256=
|
|
12
|
-
AgentCrew/modules/a2a/task_manager.py,sha256=
|
|
12
|
+
AgentCrew/modules/a2a/server.py,sha256=CT_0Te4BBWJEwgbX0wLvHcu6gJAMFsGswwS4IOC5L_k,12345
|
|
13
|
+
AgentCrew/modules/a2a/task_manager.py,sha256=CnvB9m_mqA4S1GThPRUZqyz6jeZOv9GDCznMIzjOLHQ,25629
|
|
13
14
|
AgentCrew/modules/a2a/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
15
|
AgentCrew/modules/a2a/common/client/__init__.py,sha256=PoBTKucH8G2onta-vHT4qUJcBYa3TIabGqCO5GVVyT0,118
|
|
15
16
|
AgentCrew/modules/a2a/common/client/card_resolver.py,sha256=imtwwMNb1yLxTPcrct1ToH9fA18mzgAFYKR5vYTHHRw,637
|
|
@@ -38,7 +39,7 @@ AgentCrew/modules/browser_automation/service.py,sha256=xle7R7JZkEvdcjrzurCG468Yz
|
|
|
38
39
|
AgentCrew/modules/browser_automation/tool.py,sha256=q62Cmo8bgGFs-8PrXKqOYJRNniNAUkCc54wUirOKG2s,23997
|
|
39
40
|
AgentCrew/modules/browser_automation/js/click_element.js,sha256=eNkbPX9wXyj9mPnfNILJjtbiPF0iKCT52bfTFQRhT1Y,1652
|
|
40
41
|
AgentCrew/modules/browser_automation/js/draw_element_boxes.js,sha256=4ToM8UYy2HUyXCC2l219Zghjj2lG3JZD1X2mjsLgdtU,5781
|
|
41
|
-
AgentCrew/modules/browser_automation/js/extract_clickable_elements.js,sha256=
|
|
42
|
+
AgentCrew/modules/browser_automation/js/extract_clickable_elements.js,sha256=UlOZ68-SyJtSc9GBYTHF-caDDKoxaJ-4UXvedPO8U7Q,5818
|
|
42
43
|
AgentCrew/modules/browser_automation/js/extract_elements_by_text.js,sha256=0Ao1nXvhXjm98ff2r_EE4DYaUSN78Qz6HS6l0cqnaHg,3264
|
|
43
44
|
AgentCrew/modules/browser_automation/js/extract_input_elements.js,sha256=UIZRK5PbVAKvOn7YdBZNNA1exGwo1XiiRGWkmCH71ME,6994
|
|
44
45
|
AgentCrew/modules/browser_automation/js/extract_scrollable_elements.js,sha256=7V4dK9B0q0JfUv6NJYsRgx7YhujGByuy8ETSNVL1o6Q,5915
|
|
@@ -54,7 +55,7 @@ AgentCrew/modules/chat/history.py,sha256=I7q1_s16h975uAtq6fxC4UcS9iuk1aUpKkMMYCc
|
|
|
54
55
|
AgentCrew/modules/chat/message_handler.py,sha256=A8DfuIPjW0R7s3a0P8VzNa2PF6HgXcRt8CEm2nL8fEE,306
|
|
55
56
|
AgentCrew/modules/chat/message/__init__.py,sha256=SllV6nacLgBSTwkUhI7VbEW-7gwQxQh6cCjRtbU02O8,146
|
|
56
57
|
AgentCrew/modules/chat/message/base.py,sha256=Xnes4tQCfMfWShSHG8f3ZZ5y5Q0wTWy5g0EwnNmflK0,1016
|
|
57
|
-
AgentCrew/modules/chat/message/command_processor.py,sha256=
|
|
58
|
+
AgentCrew/modules/chat/message/command_processor.py,sha256=HNtCvpj8waMgyzBa7jSQ9_kUVvSQotq36kv6lPXVXWg,33485
|
|
58
59
|
AgentCrew/modules/chat/message/conversation.py,sha256=-I2q_DJFTA6EhBQmpT7VKnrCiU6NXoApIzEy65NARFs,10759
|
|
59
60
|
AgentCrew/modules/chat/message/handler.py,sha256=NOvOcS93WMf7ioeO1-8epqd2YMmaDNVOSPlnCO-CzGk,23606
|
|
60
61
|
AgentCrew/modules/chat/message/tool_manager.py,sha256=JZTmAQ08MMO42t9FeSKYzuSunkaBVJaragDfZBnIEkM,12852
|
|
@@ -62,8 +63,8 @@ AgentCrew/modules/clipboard/__init__.py,sha256=Xb0wwQ-9dwwLT3R3TYB87pwtDTNX5HAzh
|
|
|
62
63
|
AgentCrew/modules/clipboard/service.py,sha256=FCo3zSJH0zDdvW73u4D_ty9fTMsXmOeVsAIOfyJ54Ws,6246
|
|
63
64
|
AgentCrew/modules/clipboard/tool.py,sha256=RMu6Cr5wP79SvfOqojAbu6g1WxBw6EUS4Mdfdr9VEuY,5474
|
|
64
65
|
AgentCrew/modules/code_analysis/__init__.py,sha256=veGcJQiv2eR2YNRWM1xNhA0WkmEkkL3OLst1uSM-OyM,83
|
|
65
|
-
AgentCrew/modules/code_analysis/service.py,sha256=
|
|
66
|
-
AgentCrew/modules/code_analysis/tool.py,sha256=
|
|
66
|
+
AgentCrew/modules/code_analysis/service.py,sha256=6MW8DrRRX0rUHZfRBe92mDin8xZnf9FWx0HNYP28tVQ,63997
|
|
67
|
+
AgentCrew/modules/code_analysis/tool.py,sha256=BRkouK2radiW0_IAz8ptPdTLodDMsGzjEORnlDmgKGI,6552
|
|
67
68
|
AgentCrew/modules/command_execution/__init__.py,sha256=BIy7TSuz6yFaUQ0GEvXZO-ZSlkSwcRxforfIIhHCMTM,380
|
|
68
69
|
AgentCrew/modules/command_execution/constants.py,sha256=m0YL0a1bl41g9DuDI1YDPD9rx_61fCYnbB89nrPZh8I,4677
|
|
69
70
|
AgentCrew/modules/command_execution/metric.py,sha256=34hNwRtEBoMdTd7g55LO3yqEOfGBRwQjMmqLpX-e6Zg,1968
|
|
@@ -73,13 +74,13 @@ AgentCrew/modules/command_execution/types.py,sha256=KVxSmqTF_DdUoGBMMVt2reRLItw_
|
|
|
73
74
|
AgentCrew/modules/config/__init__.py,sha256=ehO0aAkK98f9BmMjG9uR15Hc9Lwj9CnJZl24XUtUT_M,80
|
|
74
75
|
AgentCrew/modules/config/config_management.py,sha256=yxmfx1nQAZxTzJ4g3F3ybYlmTTFpMmKxfNETyzsQ9uA,33648
|
|
75
76
|
AgentCrew/modules/console/__init__.py,sha256=nO53lUaMEAshdIqDEmgNZ_r35jyg6CuMa7Tsj55Y09g,66
|
|
76
|
-
AgentCrew/modules/console/command_handlers.py,sha256=
|
|
77
|
-
AgentCrew/modules/console/completers.py,sha256=
|
|
77
|
+
AgentCrew/modules/console/command_handlers.py,sha256=oDEmxm6reNXtejCfPF6_qqrZ31upKIuGLwjKBduocug,16240
|
|
78
|
+
AgentCrew/modules/console/completers.py,sha256=WeP5rJvCWq4Ept2_ajK9wjpDiTT4C5blcX5TeV3GSzU,17682
|
|
78
79
|
AgentCrew/modules/console/confirmation_handler.py,sha256=8xY_hdCqQ7DDrnPSU9rIPJ7AeM6Th2qlrOIZjSWVZPI,8406
|
|
79
|
-
AgentCrew/modules/console/console_ui.py,sha256=
|
|
80
|
+
AgentCrew/modules/console/console_ui.py,sha256=Slk0SFRg-_6ovplkjfGNqKjROzvAPaWqz-ZM8du0v9Y,29709
|
|
80
81
|
AgentCrew/modules/console/constants.py,sha256=fwLj52O96_t6m1qb0SOiaotM2dMLwXH83KAERm9ltLA,704
|
|
81
82
|
AgentCrew/modules/console/conversation_handler.py,sha256=vVtGxQJ4sEZJ77svBFJMIGiWiEfE47yDxvt7gZ9bRCA,3632
|
|
82
|
-
AgentCrew/modules/console/display_handlers.py,sha256=
|
|
83
|
+
AgentCrew/modules/console/display_handlers.py,sha256=fuh_rY0LbzvY-BHbYlMNPEsIsH4FRpKH5jEQ4brtomM,17565
|
|
83
84
|
AgentCrew/modules/console/input_handler.py,sha256=U6gyTuCdPRkjnqa_g1KRPp00r1mOc9kXL5N5mkh_mmw,18139
|
|
84
85
|
AgentCrew/modules/console/tool_display.py,sha256=qMdtc7zIOTPEDwuia8um8fxtVyGxjwBTQMVsKSGRUB8,6107
|
|
85
86
|
AgentCrew/modules/console/ui_effects.py,sha256=mr74XyweXkyXZIYUYczpTfYzGAQjSflIojr4q3Ayelg,7436
|
|
@@ -133,7 +134,7 @@ AgentCrew/modules/gui/widgets/history_sidebar.py,sha256=n-WMPf5cm5jNB_cT3IoK_nzA
|
|
|
133
134
|
AgentCrew/modules/gui/widgets/json_editor.py,sha256=lV-Me8TUJzIkF-tbiRiFSdRGDbxv9bBKDdSSLwof7oU,6211
|
|
134
135
|
AgentCrew/modules/gui/widgets/loading_overlay.py,sha256=jCfHDDJ5YudfwU15s61l3zQVeWoRhI38WvaTylysR9g,3630
|
|
135
136
|
AgentCrew/modules/gui/widgets/markdown_editor.py,sha256=53nUFXU5jH4HEv5StHoI5onfQDvyCCAlH6OIvYZFVyk,10121
|
|
136
|
-
AgentCrew/modules/gui/widgets/message_bubble.py,sha256=
|
|
137
|
+
AgentCrew/modules/gui/widgets/message_bubble.py,sha256=am3qhfilT-5vMSHatuAj44wvPiyg5xNS9mJyLPejrzA,29967
|
|
137
138
|
AgentCrew/modules/gui/widgets/paste_aware_textedit.py,sha256=_bbM3S0dWD-Kt5s_xxnwuS0OA7lLpvCmGAfsGrRvfNs,1891
|
|
138
139
|
AgentCrew/modules/gui/widgets/system_message.py,sha256=3uUwFMIL3vsm3Oa4EiNf9fw2zQzuqWWnb8XmrRCMxaY,5796
|
|
139
140
|
AgentCrew/modules/gui/widgets/token_usage.py,sha256=xfiY_IiCzMwDIYZi8bjRxgOWhqyAAWMNs22weJUABo0,1917
|
|
@@ -150,7 +151,7 @@ AgentCrew/modules/image_generation/tool.py,sha256=TCe6tOvvCXj5LvjMtmxH1AQ5s2FWHD
|
|
|
150
151
|
AgentCrew/modules/llm/__init__.py,sha256=dMlHRa09bbPEVZnGXm62TcHmbvQzdBqmRIxstlrls8k,63
|
|
151
152
|
AgentCrew/modules/llm/base.py,sha256=S2Tzg4LXQv69MVjNScWbpid3cM20QCgW0KHQqvghjeI,11511
|
|
152
153
|
AgentCrew/modules/llm/constants.py,sha256=0goLKY7kxCOEIlqHisdN2d7mH0AsAp-vO_GHQ34HgVk,19195
|
|
153
|
-
AgentCrew/modules/llm/model_registry.py,sha256=
|
|
154
|
+
AgentCrew/modules/llm/model_registry.py,sha256=7gJqn-YoentH2Xx0AlF5goyxQDlEBMFWak2poafjhyI,5510
|
|
154
155
|
AgentCrew/modules/llm/service_manager.py,sha256=oXSjcAbrfcGLdBcm_ylnSWIp87Ecl96yZ8efkWFb4Gw,10669
|
|
155
156
|
AgentCrew/modules/llm/types.py,sha256=Bkr1OIRJJ5neUiSCMUJco8SwerrycPh5Xg1kVDpO0os,949
|
|
156
157
|
AgentCrew/modules/mcpclient/__init__.py,sha256=Gd1y0YVgET37kQVo2HFfNzYRt_GnqCnQHFeaQJ3M6eU,157
|
|
@@ -161,11 +162,11 @@ AgentCrew/modules/mcpclient/service.py,sha256=qNM2dBADzhffMvkzqamukQjl4xSGwP-IMN
|
|
|
161
162
|
AgentCrew/modules/mcpclient/tool.py,sha256=6VrwvZOvyVzvfsMYGvrHl8DmLzbjhLQ3q2KmtpbQE-I,805
|
|
162
163
|
AgentCrew/modules/memory/__init__.py,sha256=1tdK0sybmY2c6y_rWFs2eF0Zy7vcEbGlwtIoF8BF0K4,251
|
|
163
164
|
AgentCrew/modules/memory/base_service.py,sha256=OW9ZfDDoYXpvzWBj5nLcssidc1HJU_0mn6VhgCBZfLA,4145
|
|
164
|
-
AgentCrew/modules/memory/chroma_service.py,sha256=
|
|
165
|
-
AgentCrew/modules/memory/context_persistent.py,sha256=
|
|
165
|
+
AgentCrew/modules/memory/chroma_service.py,sha256=qo9zqGXW1Lx4D9ZXjLUIzsEIKdD6UAFDtEUUY-amLKc,24958
|
|
166
|
+
AgentCrew/modules/memory/context_persistent.py,sha256=KoZtXdJVnMyrbBlBJZrHHJ0AnQvLV5mcjEzALu0bEzE,22849
|
|
166
167
|
AgentCrew/modules/memory/github_copilot_ef.py,sha256=NGIKG8G602cF1nR9QRHgGUwCToyKcx6Aw5I_YVRX7VI,9522
|
|
167
168
|
AgentCrew/modules/memory/google_genai_ef.py,sha256=8_c9MOR3HNJ-m-KT35eOUGHsN_wswPvjcpRhxFRgE1s,5124
|
|
168
|
-
AgentCrew/modules/memory/tool.py,sha256=
|
|
169
|
+
AgentCrew/modules/memory/tool.py,sha256=C8igk7GGoOgkKlwmVsn3m92Is-N5obxNVmxZONrtE8k,13180
|
|
169
170
|
AgentCrew/modules/memory/voyageai_ef.py,sha256=X9znUSfT9Ozd-l1Ak9ulBAZzfGu9G9W18V8XKdIytWk,4508
|
|
170
171
|
AgentCrew/modules/openai/__init__.py,sha256=w5Ytp3ckIsrcrkyaQl0OWWTHlulqBT7sYEYhxkYaOmE,141
|
|
171
172
|
AgentCrew/modules/openai/response_service.py,sha256=5HTfeCui15rYnJfXA-41BqE5iDBVObWpFB9bQxU1jjo,25050
|
|
@@ -184,9 +185,9 @@ AgentCrew/modules/voice/text_cleaner.py,sha256=NgAVBPkP2hFI330nJOyMK_oqP3R2AGZ22
|
|
|
184
185
|
AgentCrew/modules/web_search/__init__.py,sha256=sVf_z6nH2JghK46pG92PUtDghPIkceiX1F0Ul30euXU,111
|
|
185
186
|
AgentCrew/modules/web_search/service.py,sha256=DKcOdRSHB5AEvbK8pvTXdffSnk6rFRTzaM1FXf2B70E,4006
|
|
186
187
|
AgentCrew/modules/web_search/tool.py,sha256=GV4xleVFs0UwiPS9toSzPzZei3ehsDZWxTQCJCRaEs8,6655
|
|
187
|
-
agentcrew_ai-0.8.
|
|
188
|
-
agentcrew_ai-0.8.
|
|
189
|
-
agentcrew_ai-0.8.
|
|
190
|
-
agentcrew_ai-0.8.
|
|
191
|
-
agentcrew_ai-0.8.
|
|
192
|
-
agentcrew_ai-0.8.
|
|
188
|
+
agentcrew_ai-0.8.4.dist-info/licenses/LICENSE,sha256=O51CIaOUcxVLNf0_PE_a8ap5bf3iXe4SrWN_5NO1PSU,11348
|
|
189
|
+
agentcrew_ai-0.8.4.dist-info/METADATA,sha256=ItgD9ALLC_B5Vqq47NyAedgvjdX7eWhfx-z_4hUV52k,18060
|
|
190
|
+
agentcrew_ai-0.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
191
|
+
agentcrew_ai-0.8.4.dist-info/entry_points.txt,sha256=N9R5jslrBYA8dTaNMRJ_JdSosJ6jkpGEtnJFzlcZD6k,54
|
|
192
|
+
agentcrew_ai-0.8.4.dist-info/top_level.txt,sha256=bSsmhCOn6g-JytoVMpxB_QAnCgb7lV56fcnxUhbfrvg,10
|
|
193
|
+
agentcrew_ai-0.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|