@@ -25,8 +25,8 @@ defmodule FrontmanServer.Agents do
2525 alias FrontmanServer.Providers
2626 alias FrontmanServer.Providers.ResolvedKey
2727 alias FrontmanServer.Tasks
28- alias Swarm .LLM.Chunk
29- alias Swarm .Message
28+ alias SwarmAi .LLM.Chunk
29+ alias SwarmAi .Message
3030
3131 @ doc """
3232 Checks if an agent is currently running for the given task.
@@ -74,7 +74,7 @@ defmodule FrontmanServer.Agents do
7474 - `:tools` - List of tool definitions for LLM (default: [])
7575 - `:model` - LLM model spec (defaults to provider default)
7676 - `:env_api_key` - Map of provider => api_key from client's environment
77- - `:agent` - Custom agent struct implementing Swarm .Agent (for testing)
77+ - `:agent` - Custom agent struct implementing SwarmAi .Agent (for testing)
7878
7979 ## Returns
8080 - `{:ok, pid}` - Agent started successfully
@@ -116,7 +116,7 @@ defmodule FrontmanServer.Agents do
116116 # Dialyzer warning suppressed: the anonymous function calls execute_agent which
117117 # has the same protocol dispatch issue. See execute_agent comment for details.
118118 @ dialyzer { :nowarn_function , run_agent: 5 }
119- @ spec run_agent ( Scope . t ( ) , Swarm .Agent. t ( ) , String . t ( ) , [ Message . t ( ) ] , keyword ( ) ) ::
119+ @ spec run_agent ( Scope . t ( ) , SwarmAi .Agent. t ( ) , String . t ( ) , [ Message . t ( ) ] , keyword ( ) ) ::
120120 { :ok , pid ( ) } | { :error , term ( ) }
121121 defp run_agent ( scope , agent , task_id , messages , opts ) do
122122 on_event = Keyword . fetch! ( opts , :on_event )
@@ -204,7 +204,7 @@ defmodule FrontmanServer.Agents do
204204 case Registry . lookup ( FrontmanServer.AgentRegistry , { :tool_call , tool_call_id } ) do
205205 [ { _pid , % { caller_pid: caller } } ] ->
206206 # MCP tool - send result to waiting executor
207- # Encode non-string results since Swarm .Message.ContentPart.text/1 requires strings
207+ # Encode non-string results since SwarmAi .Message.ContentPart.text/1 requires strings
208208 encoded = encode_result_for_swarm ( result )
209209 send ( caller , { :tool_result , tool_call_id , encoded , is_error } )
210210 :ok
@@ -223,7 +223,7 @@ defmodule FrontmanServer.Agents do
223223
224224 ## Options
225225 - `:tools` - List of tool definitions for LLM (default: [])
226- - `:agent` - Custom agent struct implementing Swarm .Agent (for testing)
226+ - `:agent` - Custom agent struct implementing SwarmAi .Agent (for testing)
227227 """
228228 @ spec notify_user_message ( Scope . t ( ) , String . t ( ) , list ( FrontmanServer.Tools.MCP . t ( ) ) , keyword ( ) ) ::
229229 :ok
@@ -423,7 +423,7 @@ defmodule FrontmanServer.Agents do
423423
424424 defp to_swarm_tool_calls ( tool_calls ) do
425425 Enum . map ( tool_calls , fn tc ->
426- % Swarm .ToolCall{
426+ % SwarmAi .ToolCall{
427427 id: tc . id ,
428428 name: ReqLLM.ToolCall . name ( tc ) ,
429429 arguments: ReqLLM.ToolCall . args_json ( tc )
@@ -442,7 +442,7 @@ defmodule FrontmanServer.Agents do
442442 Phoenix.PubSub . broadcast ( FrontmanServer.PubSub , Tasks . topic ( task_id ) , message )
443443 end
444444
445- # Encode non-string results to JSON for Swarm .Message.ContentPart.text/1
445+ # Encode non-string results to JSON for SwarmAi .Message.ContentPart.text/1
446446 defp encode_result_for_swarm ( value ) when is_binary ( value ) , do: value
447447 defp encode_result_for_swarm ( value ) , do: Jason . encode! ( value )
448448
@@ -476,7 +476,7 @@ defmodule FrontmanServer.Agents do
476476 tool_executor =
477477 ToolExecutor . make_executor ( scope , task_id , mcp_tools: mcp_tools , llm_opts: llm_opts )
478478
479- Logger . info ( "Starting agent execution for task #{ task_id } via Swarm .run_streaming" )
479+ Logger . info ( "Starting agent execution for task #{ task_id } via SwarmAi .run_streaming" )
480480
481481 # Emit task start telemetry - creates the root OTEL span for this task
482482 TelemetryEvents . task_start ( task_id )
@@ -485,7 +485,7 @@ defmodule FrontmanServer.Agents do
485485 # Pass task_id in metadata for telemetry correlation.
486486 # Swarm returns loop_id for execution identification and crash reporting.
487487 result =
488- Swarm . run_streaming ( agent , messages ,
488+ SwarmAi . run_streaming ( agent , messages ,
489489 metadata: % { task_id: task_id } ,
490490 tool_executor: tool_executor ,
491491 on_chunk: & handle_stream_chunk ( & 1 , on_event ) ,
@@ -538,7 +538,7 @@ defmodule FrontmanServer.Agents do
538538 end
539539 end
540540
541- defp build_response_metadata ( % Swarm .LLM.Response{ } = response ) do
541+ defp build_response_metadata ( % SwarmAi .LLM.Response{ } = response ) do
542542 metadata = % { }
543543
544544 metadata =
@@ -558,7 +558,7 @@ defmodule FrontmanServer.Agents do
558558 metadata
559559 end
560560
561- defp to_reqllm_tool_call ( % Swarm .ToolCall{ } = tc ) do
561+ defp to_reqllm_tool_call ( % SwarmAi .ToolCall{ } = tc ) do
562562 ReqLLM.ToolCall . new ( tc . id , tc . name , tc . arguments )
563563 end
564564end
0 commit comments