fast-agent-mcp 0.3.11__py3-none-any.whl → 0.3.12__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.
Potentially problematic release.
This version of fast-agent-mcp might be problematic. Click here for more details.
- fast_agent/agents/llm_decorator.py +7 -0
- fast_agent/agents/tool_agent.py +2 -2
- fast_agent/cli/commands/quickstart.py +142 -129
- fast_agent/core/direct_decorators.py +18 -26
- fast_agent/core/fastagent.py +2 -1
- fast_agent/interfaces.py +4 -0
- fast_agent/llm/fastagent_llm.py +17 -0
- fast_agent/llm/model_database.py +2 -0
- fast_agent/llm/model_factory.py +4 -1
- fast_agent/mcp/prompts/prompt_load.py +2 -3
- fast_agent/ui/enhanced_prompt.py +47 -16
- fast_agent/ui/history_display.py +555 -0
- fast_agent/ui/interactive_prompt.py +44 -12
- fast_agent/ui/mcp_display.py +3 -0
- fast_agent/ui/notification_tracker.py +62 -23
- fast_agent/ui/rich_progress.py +1 -1
- {fast_agent_mcp-0.3.11.dist-info → fast_agent_mcp-0.3.12.dist-info}/METADATA +4 -4
- {fast_agent_mcp-0.3.11.dist-info → fast_agent_mcp-0.3.12.dist-info}/RECORD +21 -20
- {fast_agent_mcp-0.3.11.dist-info → fast_agent_mcp-0.3.12.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.3.11.dist-info → fast_agent_mcp-0.3.12.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.3.11.dist-info → fast_agent_mcp-0.3.12.dist-info}/licenses/LICENSE +0 -0
fast_agent/llm/model_database.py
CHANGED
|
@@ -232,6 +232,8 @@ class ModelDatabase:
|
|
|
232
232
|
"claude-3-7-sonnet-latest": ANTHROPIC_37_SERIES,
|
|
233
233
|
"claude-sonnet-4-0": ANTHROPIC_SONNET_4_VERSIONED,
|
|
234
234
|
"claude-sonnet-4-20250514": ANTHROPIC_SONNET_4_VERSIONED,
|
|
235
|
+
"claude-sonnet-4-5": ANTHROPIC_SONNET_4_VERSIONED,
|
|
236
|
+
"claude-sonnet-4-5-20250929": ANTHROPIC_SONNET_4_VERSIONED,
|
|
235
237
|
"claude-opus-4-0": ANTHROPIC_OPUS_4_VERSIONED,
|
|
236
238
|
"claude-opus-4-1": ANTHROPIC_OPUS_4_VERSIONED,
|
|
237
239
|
"claude-opus-4-20250514": ANTHROPIC_OPUS_4_VERSIONED,
|
fast_agent/llm/model_factory.py
CHANGED
|
@@ -84,6 +84,8 @@ class ModelFactory:
|
|
|
84
84
|
"claude-opus-4-20250514": Provider.ANTHROPIC,
|
|
85
85
|
"claude-sonnet-4-20250514": Provider.ANTHROPIC,
|
|
86
86
|
"claude-sonnet-4-0": Provider.ANTHROPIC,
|
|
87
|
+
"claude-sonnet-4-5-20250929": Provider.ANTHROPIC,
|
|
88
|
+
"claude-sonnet-4-5": Provider.ANTHROPIC,
|
|
87
89
|
"deepseek-chat": Provider.DEEPSEEK,
|
|
88
90
|
"gemini-2.0-flash": Provider.GOOGLE,
|
|
89
91
|
"gemini-2.5-flash-preview-05-20": Provider.GOOGLE,
|
|
@@ -101,8 +103,9 @@ class ModelFactory:
|
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
MODEL_ALIASES = {
|
|
104
|
-
"sonnet": "claude-sonnet-4-
|
|
106
|
+
"sonnet": "claude-sonnet-4-5",
|
|
105
107
|
"sonnet4": "claude-sonnet-4-0",
|
|
108
|
+
"sonnet45": "claude-sonnet-4-5",
|
|
106
109
|
"sonnet35": "claude-3-5-sonnet-latest",
|
|
107
110
|
"sonnet37": "claude-3-7-sonnet-latest",
|
|
108
111
|
"claude": "claude-sonnet-4-0",
|
|
@@ -117,6 +117,7 @@ def load_prompt(file: Path) -> List[PromptMessageExtended]:
|
|
|
117
117
|
if path_str.endswith(".json"):
|
|
118
118
|
# JSON files use the serialization module directly
|
|
119
119
|
from fast_agent.mcp.prompt_serialization import load_messages
|
|
120
|
+
|
|
120
121
|
return load_messages(str(file))
|
|
121
122
|
else:
|
|
122
123
|
# Non-JSON files need template processing for resource loading
|
|
@@ -128,15 +129,13 @@ def load_prompt(file: Path) -> List[PromptMessageExtended]:
|
|
|
128
129
|
# Render the template without arguments to get the messages
|
|
129
130
|
messages = create_messages_with_resources(
|
|
130
131
|
template.content_sections,
|
|
131
|
-
[file] # Pass the file path for resource resolution
|
|
132
|
+
[file], # Pass the file path for resource resolution
|
|
132
133
|
)
|
|
133
134
|
|
|
134
135
|
# Convert to PromptMessageExtended
|
|
135
136
|
return PromptMessageExtended.to_extended(messages)
|
|
136
137
|
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
139
|
def load_prompt_as_get_prompt_result(file: Path):
|
|
141
140
|
"""
|
|
142
141
|
Load a prompt from a file and convert to GetPromptResult format for MCP compatibility.
|
fast_agent/ui/enhanced_prompt.py
CHANGED
|
@@ -339,15 +339,16 @@ class AgentCompleter(Completer):
|
|
|
339
339
|
# Map commands to their descriptions for better completion hints
|
|
340
340
|
self.commands = {
|
|
341
341
|
"mcp": "Show MCP server status",
|
|
342
|
+
"history": "Show conversation history overview (optionally another agent)",
|
|
342
343
|
"tools": "List available MCP tools",
|
|
343
344
|
"prompt": "List and choose MCP prompts, or apply specific prompt (/prompt <name>)",
|
|
345
|
+
"clear": "Clear history",
|
|
344
346
|
"agents": "List available agents",
|
|
345
347
|
"system": "Show the current system prompt",
|
|
346
348
|
"usage": "Show current usage statistics",
|
|
347
349
|
"markdown": "Show last assistant message without markdown formatting",
|
|
348
350
|
"save_history": "Save history; .json = MCP JSON, others = Markdown",
|
|
349
351
|
"help": "Show commands and shortcuts",
|
|
350
|
-
"clear": "Clear the screen",
|
|
351
352
|
"EXIT": "Exit fast-agent, terminating any running workflows",
|
|
352
353
|
"STOP": "Stop this prompting session and move to next workflow step",
|
|
353
354
|
**(commands or {}), # Allow custom commands to be passed in
|
|
@@ -518,7 +519,15 @@ def create_keybindings(
|
|
|
518
519
|
|
|
519
520
|
@kb.add("c-l")
|
|
520
521
|
def _(event) -> None:
|
|
521
|
-
"""Ctrl+L: Clear the
|
|
522
|
+
"""Ctrl+L: Clear and redraw the terminal screen."""
|
|
523
|
+
app_ref = event.app or app
|
|
524
|
+
if app_ref and getattr(app_ref, "renderer", None):
|
|
525
|
+
app_ref.renderer.clear()
|
|
526
|
+
app_ref.invalidate()
|
|
527
|
+
|
|
528
|
+
@kb.add("c-u")
|
|
529
|
+
def _(event) -> None:
|
|
530
|
+
"""Ctrl+U: Clear the input buffer."""
|
|
522
531
|
event.current_buffer.text = ""
|
|
523
532
|
|
|
524
533
|
@kb.add("c-e")
|
|
@@ -725,13 +734,24 @@ async def get_enhanced_input(
|
|
|
725
734
|
# Check for active events first (highest priority)
|
|
726
735
|
active_status = notification_tracker.get_active_status()
|
|
727
736
|
if active_status:
|
|
728
|
-
event_type = active_status[
|
|
729
|
-
server = active_status[
|
|
730
|
-
notification_segment =
|
|
737
|
+
event_type = active_status["type"].upper()
|
|
738
|
+
server = active_status["server"]
|
|
739
|
+
notification_segment = (
|
|
740
|
+
f" | <style fg='ansired' bg='ansiblack'>◀ {event_type} ({server})</style>"
|
|
741
|
+
)
|
|
731
742
|
elif notification_tracker.get_count() > 0:
|
|
732
743
|
# Show completed events summary when no active events
|
|
733
|
-
|
|
734
|
-
|
|
744
|
+
counts_by_type = notification_tracker.get_counts_by_type()
|
|
745
|
+
total_events = sum(counts_by_type.values()) if counts_by_type else 0
|
|
746
|
+
|
|
747
|
+
if len(counts_by_type) == 1:
|
|
748
|
+
event_type, count = next(iter(counts_by_type.items()))
|
|
749
|
+
label_text = notification_tracker.format_event_label(event_type, count)
|
|
750
|
+
notification_segment = f" | ◀ {label_text}"
|
|
751
|
+
else:
|
|
752
|
+
summary = notification_tracker.get_summary(compact=True)
|
|
753
|
+
heading = "event" if total_events == 1 else "events"
|
|
754
|
+
notification_segment = f" | ◀ {total_events} {heading} ({summary})"
|
|
735
755
|
|
|
736
756
|
if middle:
|
|
737
757
|
return HTML(
|
|
@@ -824,14 +844,26 @@ async def get_enhanced_input(
|
|
|
824
844
|
|
|
825
845
|
if cmd == "help":
|
|
826
846
|
return "HELP"
|
|
827
|
-
elif cmd == "clear":
|
|
828
|
-
return "CLEAR"
|
|
829
847
|
elif cmd == "agents":
|
|
830
848
|
return "LIST_AGENTS"
|
|
831
849
|
elif cmd == "system":
|
|
832
850
|
return "SHOW_SYSTEM"
|
|
833
851
|
elif cmd == "usage":
|
|
834
852
|
return "SHOW_USAGE"
|
|
853
|
+
elif cmd == "history":
|
|
854
|
+
target_agent = None
|
|
855
|
+
if len(cmd_parts) > 1:
|
|
856
|
+
candidate = cmd_parts[1].strip()
|
|
857
|
+
if candidate:
|
|
858
|
+
target_agent = candidate
|
|
859
|
+
return {"show_history": {"agent": target_agent}}
|
|
860
|
+
elif cmd == "clear":
|
|
861
|
+
target_agent = None
|
|
862
|
+
if len(cmd_parts) > 1:
|
|
863
|
+
candidate = cmd_parts[1].strip()
|
|
864
|
+
if candidate:
|
|
865
|
+
target_agent = candidate
|
|
866
|
+
return {"clear_history": {"agent": target_agent}}
|
|
835
867
|
elif cmd == "markdown":
|
|
836
868
|
return "MARKDOWN"
|
|
837
869
|
elif cmd in ("save_history", "save"):
|
|
@@ -1010,15 +1042,18 @@ async def handle_special_commands(command, agent_app=None):
|
|
|
1010
1042
|
if isinstance(command, dict):
|
|
1011
1043
|
return command
|
|
1012
1044
|
|
|
1045
|
+
global agent_histories
|
|
1046
|
+
|
|
1013
1047
|
# Check for special string commands
|
|
1014
1048
|
if command == "HELP":
|
|
1015
1049
|
rich_print("\n[bold]Available Commands:[/bold]")
|
|
1016
1050
|
rich_print(" /help - Show this help")
|
|
1017
|
-
rich_print(" /clear - Clear screen")
|
|
1018
1051
|
rich_print(" /agents - List available agents")
|
|
1019
1052
|
rich_print(" /system - Show the current system prompt")
|
|
1020
1053
|
rich_print(" /prompt <name> - Apply a specific prompt by name")
|
|
1021
1054
|
rich_print(" /usage - Show current usage statistics")
|
|
1055
|
+
rich_print(" /history [agent_name] - Show chat history overview")
|
|
1056
|
+
rich_print(" /clear [agent_name] - Clear conversation history (keeps templates)")
|
|
1022
1057
|
rich_print(" /markdown - Show last assistant message without markdown formatting")
|
|
1023
1058
|
rich_print(" /mcpstatus - Show MCP server status summary for the active agent")
|
|
1024
1059
|
rich_print(" /save_history <filename> - Save current chat history to a file")
|
|
@@ -1034,15 +1069,11 @@ async def handle_special_commands(command, agent_app=None):
|
|
|
1034
1069
|
rich_print(" Ctrl+T - Toggle multiline mode")
|
|
1035
1070
|
rich_print(" Ctrl+E - Edit in external editor")
|
|
1036
1071
|
rich_print(" Ctrl+Y - Copy last assistant response to clipboard")
|
|
1037
|
-
rich_print(" Ctrl+L -
|
|
1072
|
+
rich_print(" Ctrl+L - Redraw the screen")
|
|
1073
|
+
rich_print(" Ctrl+U - Clear input")
|
|
1038
1074
|
rich_print(" Up/Down - Navigate history")
|
|
1039
1075
|
return True
|
|
1040
1076
|
|
|
1041
|
-
elif command == "CLEAR":
|
|
1042
|
-
# Clear screen (ANSI escape sequence)
|
|
1043
|
-
print("\033c", end="")
|
|
1044
|
-
return True
|
|
1045
|
-
|
|
1046
1077
|
elif isinstance(command, str) and command.upper() == "EXIT":
|
|
1047
1078
|
raise PromptExitError("User requested to exit fast-agent session")
|
|
1048
1079
|
|