Skip to content

Self-improving AI Employees for everyone

feat(plugin): Wave 11.C batch 2 — 26 nodes (agents + chat models + social)

trohitgb1e794941fd8
diff --git a/server/nodes/agent/_handles.py b/server/nodes/agent/_handles.py
index 614760cb..a90575f8 100644
--- a/server/nodes/agent/_handles.py
+++ b/server/nodes/agent/_handles.py
@@ -24,3 +24,32 @@ def std_agent_handles() -> tuple:
{"name": "output-main", "kind": "output", "position": "right", "offset": "50%", "label": "Output", "role": "main"},
{"name": "output-top", "kind": "output", "position": "top", "label": "Output", "role": "main"},
)
+
+
+def team_lead_agent_handles() -> tuple:
+ """Skill / Tool / Teammates bottom + Memory/Task/Input left + Outputs.
+ Used by orchestrator_agent and ai_employee."""
+ return (
+ {"name": "input-skill", "kind": "input", "position": "bottom", "offset": "20%", "label": "Skill", "role": "skill"},
+ {"name": "input-tools", "kind": "input", "position": "bottom", "offset": "50%", "label": "Tool", "role": "tools"},
+ {"name": "input-teammates", "kind": "input", "position": "bottom", "offset": "80%", "label": "Team", "role": "teammates"},
+ {"name": "input-main", "kind": "input", "position": "left", "offset": "25%", "label": "Input", "role": "main"},
+ {"name": "input-memory", "kind": "input", "position": "left", "offset": "50%", "label": "Memory","role": "memory"},
+ {"name": "input-task", "kind": "input", "position": "left", "offset": "75%", "label": "Task", "role": "task"},
+ {"name": "output-main", "kind": "output", "position": "right", "offset": "50%", "label": "Output","role": "main"},
+ {"name": "output-top", "kind": "output", "position": "top", "label": "Output","role": "main"},
+ )
+
+
+def deep_agent_handles() -> tuple:
+ """Skill / Teammates / Tool bottom — used by deep_agent only."""
+ return (
+ {"name": "input-skill", "kind": "input", "position": "bottom", "offset": "30%", "label": "Skill", "role": "skill"},
+ {"name": "input-teammates", "kind": "input", "position": "bottom", "offset": "55%", "label": "Team", "role": "teammates"},
+ {"name": "input-tools", "kind": "input", "position": "bottom", "offset": "80%", "label": "Tool", "role": "tools"},
+ {"name": "input-main", "kind": "input", "position": "left", "offset": "25%", "label": "Input", "role": "main"},
+ {"name": "input-memory", "kind": "input", "position": "left", "offset": "50%", "label": "Memory","role": "memory"},
+ {"name": "input-task", "kind": "input", "position": "left", "offset": "75%", "label": "Task", "role": "task"},
+ {"name": "output-main", "kind": "output", "position": "right", "offset": "50%", "label": "Output","role": "main"},
+ {"name": "output-top", "kind": "output", "position": "top", "label": "Output","role": "main"},
+ )
diff --git a/server/nodes/agent/_specialized.py b/server/nodes/agent/_specialized.py
new file mode 100644
index 00000000..d8bfac24
--- /dev/null
+++ b/server/nodes/agent/_specialized.py
@@ -0,0 +1,95 @@
+"""Specialized agent base — subclass + set 5 attrs to mint a new agent.
+
+13 specialized agents (android / coding / web / task / social / travel
+/ tool / productivity / payments / consumer / autonomous / rlm /
+claude_code) all share the LangGraph-via-handle_chat_agent execution
+path. The only differences are display name, icon, colour, subtitle,
+description. Each agent gets its own file under ``nodes/agent/`` so
+the user can find ``android_agent.py`` directly — but the body lives
+here so changing the dispatch path is a one-file edit.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Literal, Optional
+
+from pydantic import BaseModel, ConfigDict, Field
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+from ._handles import STD_AGENT_HINTS, std_agent_handles
+
+
+class SpecializedAgentParams(BaseModel):
+ """Identical to AIAgentParams — full LLM tuning surface."""
+
+ prompt: str = Field(
+ default="",
+ json_schema_extra={
+ "placeholder": "Enter your prompt or use template variables...",
+ "rows": 4,
+ },
+ )
+ provider: Literal[
+ "openai", "anthropic", "gemini", "openrouter",
+ "groq", "cerebras", "deepseek", "kimi", "mistral",
+ ] = "openai"
+ model: str = Field(
+ default="", json_schema_extra={"placeholder": "Select a model..."},
+ )
+ temperature: float = Field(default=0.7, ge=0.0, le=2.0)
+ max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=200000)
+ system_message: Optional[str] = Field(
+ default="You are a helpful assistant",
+ alias="systemMessage", json_schema_extra={"rows": 3},
+ )
+ api_key: Optional[str] = Field(
+ default=None, alias="apiKey",
+ json_schema_extra={"password": True},
+ )
+
+ model_config = ConfigDict(populate_by_name=True, extra="ignore")
+
+
+class SpecializedAgentOutput(BaseModel):
+ response: Optional[str] = None
+ thinking: Optional[str] = None
+ model: Optional[str] = None
+ provider: Optional[str] = None
+ finish_reason: Optional[str] = None
+ timestamp: Optional[str] = None
+
+ model_config = ConfigDict(extra="allow")
+
+
+class SpecializedAgentBase(ActionNode, abstract=True):
+ """Subclass and set type/display_name/icon/color/subtitle/description."""
+
+ component_kind = "agent"
+ handles = std_agent_handles()
+ ui_hints = STD_AGENT_HINTS
+ annotations = {"destructive": False, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.AI_HEAVY
+
+ Params = SpecializedAgentParams
+ Output = SpecializedAgentOutput
+
+ @Operation("execute", cost={"service": "specialized_agent", "action": "run", "count": 1})
+ async def execute_op(self, ctx: NodeContext, params: SpecializedAgentParams) -> Any:
+ from core.container import container
+ from services.handlers.ai import handle_chat_agent
+
+ ai_service = container.ai_service()
+ database = container.database()
+ payload = params.model_dump(by_alias=True)
+ response = await handle_chat_agent(
+ ai_service=ai_service,
+ database=database,
+ node_id=ctx.node_id,
+ node_type=self.type,
+ parameters=payload,
+ context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or f"{self.type} execution failed")
diff --git a/server/nodes/agent/ai_employee.py b/server/nodes/agent/ai_employee.py
new file mode 100644
index 00000000..9b76d7f5
--- /dev/null
+++ b/server/nodes/agent/ai_employee.py
@@ -0,0 +1,13 @@
+from ._handles import team_lead_agent_handles
+from ._specialized import SpecializedAgentBase
+
+
+class AIEmployeeNode(SpecializedAgentBase):
+ type = "ai_employee"
+ display_name = "AI Employee"
+ subtitle = "Team Orchestration"
+ icon = "👥"
+ color = "#bd93f9"
+ group = ("agent",)
+ description = "Team lead for multi-agent coordination"
+ handles = team_lead_agent_handles()
diff --git a/server/nodes/agent/android_agent.py b/server/nodes/agent/android_agent.py
new file mode 100644
index 00000000..12bd9679
--- /dev/null
+++ b/server/nodes/agent/android_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class AndroidAgentNode(SpecializedAgentBase):
+ type = "android_agent"
+ display_name = "Android Agent"
+ subtitle = "Device Control"
+ icon = "📱"
+ color = "#50fa7b"
+ group = ("agent",)
+ description = "AI agent for Android device control"
diff --git a/server/nodes/agent/autonomous_agent.py b/server/nodes/agent/autonomous_agent.py
new file mode 100644
index 00000000..1b0cc6c0
--- /dev/null
+++ b/server/nodes/agent/autonomous_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class AutonomousAgentNode(SpecializedAgentBase):
+ type = "autonomous_agent"
+ display_name = "Autonomous Agent"
+ subtitle = "Autonomous Ops"
+ icon = "🎯"
+ color = "#bd93f9"
+ group = ("agent",)
+ description = "Autonomous agent using Code Mode patterns"
diff --git a/server/nodes/agent/claude_code_agent.py b/server/nodes/agent/claude_code_agent.py
new file mode 100644
index 00000000..8bd9837a
--- /dev/null
+++ b/server/nodes/agent/claude_code_agent.py
@@ -0,0 +1,52 @@
+"""Claude Code Agent — Claude Code CLI as a specialized agent.
+
+Distinct execute path: routes through ``handle_claude_code_agent``
+which shells out to the local ``claude`` CLI binary with isolated auth.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+from ._handles import STD_AGENT_HINTS, std_agent_handles
+from ._specialized import SpecializedAgentOutput, SpecializedAgentParams
+
+
+class ClaudeCodeAgentNode(ActionNode):
+ type = "claude_code_agent"
+ display_name = "Claude Code"
+ subtitle = "Agentic Coding"
+ icon = "lobehub:Claude"
+ color = "#8be9fd"
+ group = ("agent",)
+ description = "Claude Code CLI as a specialized agent"
+ component_kind = "agent"
+ handles = std_agent_handles()
+ ui_hints = STD_AGENT_HINTS
+ annotations = {"destructive": True, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.AI_HEAVY
+
+ Params = SpecializedAgentParams
+ Output = SpecializedAgentOutput
+
+ @Operation("execute", cost={"service": "claude_code_agent", "action": "run", "count": 1})
+ async def execute_op(self, ctx: NodeContext, params: SpecializedAgentParams) -> Any:
+ from core.container import container
+ from services.handlers.ai import handle_claude_code_agent
+
+ ai_service = container.ai_service()
+ database = container.database()
+ payload = params.model_dump(by_alias=True)
+ response = await handle_claude_code_agent(
+ ai_service=ai_service,
+ database=database,
+ node_id=ctx.node_id,
+ node_type=self.type,
+ parameters=payload,
+ context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or "claude_code_agent execution failed")
diff --git a/server/nodes/agent/coding_agent.py b/server/nodes/agent/coding_agent.py
new file mode 100644
index 00000000..1d55357a
--- /dev/null
+++ b/server/nodes/agent/coding_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class CodingAgentNode(SpecializedAgentBase):
+ type = "coding_agent"
+ display_name = "Coding Agent"
+ subtitle = "Code Execution"
+ icon = "💻"
+ color = "#8be9fd"
+ group = ("agent",)
+ description = "AI agent for code execution"
diff --git a/server/nodes/agent/consumer_agent.py b/server/nodes/agent/consumer_agent.py
new file mode 100644
index 00000000..d4bb0d91
--- /dev/null
+++ b/server/nodes/agent/consumer_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class ConsumerAgentNode(SpecializedAgentBase):
+ type = "consumer_agent"
+ display_name = "Consumer Agent"
+ subtitle = "Consumer Support"
+ icon = "🛒"
+ color = "#bd93f9"
+ group = ("agent",)
+ description = "AI agent for consumer interactions"
diff --git a/server/nodes/agent/deep_agent.py b/server/nodes/agent/deep_agent.py
new file mode 100644
index 00000000..58ac3b77
--- /dev/null
+++ b/server/nodes/agent/deep_agent.py
@@ -0,0 +1,53 @@
+"""Deep Agent — LangChain DeepAgents with FS tools + sub-agent delegation.
+
+Distinct execute path: routes through ``handlers/deep_agent.handle_deep_agent``
+rather than the generic ``handle_chat_agent``. Different bottom-handle
+ordering (Skill / Team / Tool) for the team-delegation UX.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+from ._handles import STD_AGENT_HINTS, deep_agent_handles
+from ._specialized import SpecializedAgentOutput, SpecializedAgentParams
+
+
+class DeepAgentNode(ActionNode):
+ type = "deep_agent"
+ display_name = "Deep Agent"
+ subtitle = "LangChain DeepAgents"
+ icon = "\U0001F9E0"
+ color = "#50fa7b"
+ group = ("agent",)
+ description = "LangChain DeepAgents with filesystem tools and sub-agent delegation"
+ component_kind = "agent"
+ handles = deep_agent_handles()
+ ui_hints = STD_AGENT_HINTS
+ annotations = {"destructive": True, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.AI_HEAVY
+
+ Params = SpecializedAgentParams
+ Output = SpecializedAgentOutput
+
+ @Operation("execute", cost={"service": "deep_agent", "action": "run", "count": 1})
+ async def execute_op(self, ctx: NodeContext, params: SpecializedAgentParams) -> Any:
+ from core.container import container
+ from services.handlers.deep_agent import handle_deep_agent
+
+ ai_service = container.ai_service()
+ database = container.database()
+ payload = params.model_dump(by_alias=True)
+ response = await handle_deep_agent(
+ ai_service=ai_service,
+ database=database,
+ node_id=ctx.node_id,
+ node_type=self.type,
+ parameters=payload,
+ context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or "deep_agent execution failed")
diff --git a/server/nodes/agent/orchestrator_agent.py b/server/nodes/agent/orchestrator_agent.py
new file mode 100644
index 00000000..bb146679
--- /dev/null
+++ b/server/nodes/agent/orchestrator_agent.py
@@ -0,0 +1,13 @@
+from ._handles import team_lead_agent_handles
+from ._specialized import SpecializedAgentBase
+
+
+class OrchestratorAgentNode(SpecializedAgentBase):
+ type = "orchestrator_agent"
+ display_name = "Orchestrator Agent"
+ subtitle = "Agent Coordination"
+ icon = "🎼"
+ color = "#8be9fd"
+ group = ("agent",)
+ description = "Team lead that delegates to connected specialized agents"
+ handles = team_lead_agent_handles()
diff --git a/server/nodes/agent/payments_agent.py b/server/nodes/agent/payments_agent.py
new file mode 100644
index 00000000..27a866e4
--- /dev/null
+++ b/server/nodes/agent/payments_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class PaymentsAgentNode(SpecializedAgentBase):
+ type = "payments_agent"
+ display_name = "Payments Agent"
+ subtitle = "Payment Processing"
+ icon = "💳"
+ color = "#50fa7b"
+ group = ("agent",)
+ description = "AI agent for payment processing"
diff --git a/server/nodes/agent/productivity_agent.py b/server/nodes/agent/productivity_agent.py
new file mode 100644
index 00000000..1579f905
--- /dev/null
+++ b/server/nodes/agent/productivity_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class ProductivityAgentNode(SpecializedAgentBase):
+ type = "productivity_agent"
+ display_name = "Productivity Agent"
+ subtitle = "Workflows"
+ icon = "⏰"
+ color = "#8be9fd"
+ group = ("agent",)
+ description = "AI agent for productivity workflows"
diff --git a/server/nodes/agent/rlm_agent.py b/server/nodes/agent/rlm_agent.py
new file mode 100644
index 00000000..87d3054a
--- /dev/null
+++ b/server/nodes/agent/rlm_agent.py
@@ -0,0 +1,53 @@
+"""RLM Agent — Recursive Language Model agent (REPL-based).
+
+Distinct from the standard LangGraph chat agent — uses
+``handle_rlm_agent`` which spins a recursive language-model loop
+inside a REPL sandbox.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+from ._handles import STD_AGENT_HINTS, std_agent_handles
+from ._specialized import SpecializedAgentOutput, SpecializedAgentParams
+
+
+class RLMAgentNode(ActionNode):
+ type = "rlm_agent"
+ display_name = "RLM Agent"
+ subtitle = "Recursive Reasoning"
+ icon = "🧠"
+ color = "#ffb86c"
+ group = ("agent",)
+ description = "Recursive Language Model agent (REPL-based)"
+ component_kind = "agent"
+ handles = std_agent_handles()
+ ui_hints = STD_AGENT_HINTS
+ annotations = {"destructive": True, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.AI_HEAVY
+
+ Params = SpecializedAgentParams
+ Output = SpecializedAgentOutput
+
+ @Operation("execute", cost={"service": "rlm_agent", "action": "run", "count": 1})
+ async def execute_op(self, ctx: NodeContext, params: SpecializedAgentParams) -> Any:
+ from core.container import container
+ from services.handlers.ai import handle_rlm_agent
+
+ ai_service = container.ai_service()
+ database = container.database()
+ payload = params.model_dump(by_alias=True)
+ response = await handle_rlm_agent(
+ ai_service=ai_service,
+ database=database,
+ node_id=ctx.node_id,
+ node_type=self.type,
+ parameters=payload,
+ context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or "rlm_agent execution failed")
diff --git a/server/nodes/agent/social_agent.py b/server/nodes/agent/social_agent.py
new file mode 100644
index 00000000..105b0843
--- /dev/null
+++ b/server/nodes/agent/social_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class SocialAgentNode(SpecializedAgentBase):
+ type = "social_agent"
+ display_name = "Social Agent"
+ subtitle = "Social Messaging"
+ icon = "📱"
+ color = "#50fa7b"
+ group = ("agent",)
+ description = "AI agent for social messaging"
diff --git a/server/nodes/agent/task_agent.py b/server/nodes/agent/task_agent.py
new file mode 100644
index 00000000..6a9f6bdc
--- /dev/null
+++ b/server/nodes/agent/task_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class TaskAgentNode(SpecializedAgentBase):
+ type = "task_agent"
+ display_name = "Task Agent"
+ subtitle = "Task Automation"
+ icon = "📋"
+ color = "#bd93f9"
+ group = ("agent",)
+ description = "AI agent for task automation"
diff --git a/server/nodes/agent/tool_agent.py b/server/nodes/agent/tool_agent.py
new file mode 100644
index 00000000..645589c7
--- /dev/null
+++ b/server/nodes/agent/tool_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class ToolAgentNode(SpecializedAgentBase):
+ type = "tool_agent"
+ display_name = "Tool Agent"
+ subtitle = "Tool Orchestration"
+ icon = "🔧"
+ color = "#f1fa8c"
+ group = ("agent",)
+ description = "AI agent for tool orchestration"
diff --git a/server/nodes/agent/travel_agent.py b/server/nodes/agent/travel_agent.py
new file mode 100644
index 00000000..5eadd362
--- /dev/null
+++ b/server/nodes/agent/travel_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class TravelAgentNode(SpecializedAgentBase):
+ type = "travel_agent"
+ display_name = "Travel Agent"
+ subtitle = "Travel Planning"
+ icon = "✈️"
+ color = "#ffb86c"
+ group = ("agent",)
+ description = "AI agent for travel planning"
diff --git a/server/nodes/agent/web_agent.py b/server/nodes/agent/web_agent.py
new file mode 100644
index 00000000..afed9ea4
--- /dev/null
+++ b/server/nodes/agent/web_agent.py
@@ -0,0 +1,11 @@
+from ._specialized import SpecializedAgentBase
+
+
+class WebAgentNode(SpecializedAgentBase):
+ type = "web_agent"
+ display_name = "Web Agent"
+ subtitle = "Browser Automation"
+ icon = "🌐"
+ color = "#ff79c6"
+ group = ("agent",)
+ description = "AI agent for web automation"
diff --git a/server/nodes/agents.py b/server/nodes/agents.py
index fecdc5c9..4c3ef9a0 100644
--- a/server/nodes/agents.py
+++ b/server/nodes/agents.py
@@ -1,182 +1,6 @@
-"""Agent node plugins (Wave 10.C migration batch 1).
+"""Agent legacy bulk file — fully migrated to nodes/agent/*.py.
-Migrates the 20 entries currently hardcoded in
-``client/src/components/AIAgentNode.tsx`` ``AGENT_CONFIGS`` so each
-agent carries its own visual metadata (icon, color, handles,
-componentKind) server-side. Frontend component dispatch (10.D) will
-then read handles from NodeSpec instead of from AGENT_CONFIGS.
-
-Each ``register_node`` call is explicit — no group-based derivation,
-no color lookup tables. The node declares what it is.
-
-Handlers stay in ``node_executor._build_handler_registry`` for now
-(they'd need service-injection via ``functools.partial`` which the
-plugin pattern defers to the executor). Pydantic input models stay in
-``models/nodes.py`` as part of the discriminated union. This module
-only extends the metadata each node already had.
+Kept as a marker so anyone grepping for the old location lands on the
+breadcrumb. Delete in Wave 11.D once 100% of legacy bulk files are
+empty across the package.
"""
-
-from __future__ import annotations
-
-from services.node_registry import register_node
-
-
-_STD_SIZE = {"width": 300, "height": 200}
-_SOCIAL_SIZE = {"width": 260, "height": 160}
-
-# Wave 10.G.3: every LangGraph-style agent accepts a Skill input handle
-# and exposes the "Connected Skills" accordion in the parameter panel.
-# The frontend MiddleSection reads `uiHints.hasSkills` directly — no
-# tribal AGENT_WITH_SKILLS_TYPES array anymore.
-_STD_AGENT_HINTS = {**_STD_SIZE, "hasSkills": True}
-
-
-def _std_handles(extra_bottom: list[dict] | None = None) -> list[dict]:
- """Input + Skill + Tool + Memory + Task + Output — the handle set
- shared by 18 of the 20 agent variants. Factored out as a local helper
- in this module only; not a global lookup. Each register_node call
- below still opts in by name.
- """
- bottom = list(extra_bottom) if extra_bottom else [
- {"name": "input-skill", "kind": "input", "position": "bottom", "offset": "25%", "label": "Skill", "role": "skill"},
- {"name": "input-tools", "kind": "input", "position": "bottom", "offset": "75%", "label": "Tool", "role": "tools"},
- ]
- return [
- *bottom,
- {"name": "input-main", "kind": "input", "position": "left", "offset": "25%", "label": "Input", "role": "main"},
- {"name": "input-memory", "kind": "input", "position": "left", "offset": "50%", "label": "Memory", "role": "memory"},
- {"name": "input-task", "kind": "input", "position": "left", "offset": "75%", "label": "Task", "role": "task"},
- {"name": "output-main", "kind": "output", "position": "right", "offset": "50%", "label": "Output", "role": "main"},
- {"name": "output-top", "kind": "output", "position": "top", "label": "Output", "role": "main"},
- ]
-
-
-_TEAM_BOTTOM_HANDLES = [
- {"name": "input-skill", "kind": "input", "position": "bottom", "offset": "20%", "label": "Skill", "role": "skill"},
- {"name": "input-tools", "kind": "input", "position": "bottom", "offset": "50%", "label": "Tool", "role": "tools"},
- {"name": "input-teammates", "kind": "input", "position": "bottom", "offset": "80%", "label": "Team", "role": "teammates"},
-]
-
-_DEEP_BOTTOM_HANDLES = [
- {"name": "input-skill", "kind": "input", "position": "bottom", "offset": "30%", "label": "Skill", "role": "skill"},
- {"name": "input-teammates", "kind": "input", "position": "bottom", "offset": "55%", "label": "Team", "role": "teammates"},
- {"name": "input-tools", "kind": "input", "position": "bottom", "offset": "80%", "label": "Tool", "role": "tools"},
-]
-
-
-# -- Core agents --------------------------------------------------------------
-
-# aiAgent + chatAgent — migrated to nodes/agent/{ai_agent,chat_agent}.py (Wave 11.C).
-
-
-# -- Specialized agents (share the LangGraph Skill/Tool/Memory/Task topology) -
-
-register_node(type="android_agent", metadata={"displayName": "Android Agent", "subtitle": "Device Control", "icon": "📱", "color": "#50fa7b", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for Android device control", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="coding_agent", metadata={"displayName": "Coding Agent", "subtitle": "Code Execution", "icon": "💻", "color": "#8be9fd", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for code execution", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="web_agent", metadata={"displayName": "Web Agent", "subtitle": "Browser Automation", "icon": "🌐", "color": "#ff79c6", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for web automation", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="task_agent", metadata={"displayName": "Task Agent", "subtitle": "Task Automation", "icon": "📋", "color": "#bd93f9", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for task automation", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="social_agent", metadata={"displayName": "Social Agent", "subtitle": "Social Messaging", "icon": "📱", "color": "#50fa7b", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for social messaging", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="travel_agent", metadata={"displayName": "Travel Agent", "subtitle": "Travel Planning", "icon": "✈️", "color": "#ffb86c", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for travel planning", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="tool_agent", metadata={"displayName": "Tool Agent", "subtitle": "Tool Orchestration", "icon": "🔧", "color": "#f1fa8c", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for tool orchestration", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="productivity_agent", metadata={"displayName": "Productivity Agent", "subtitle": "Workflows", "icon": "⏰", "color": "#8be9fd", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for productivity workflows","version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="payments_agent", metadata={"displayName": "Payments Agent", "subtitle": "Payment Processing", "icon": "💳", "color": "#50fa7b", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for payment processing", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="consumer_agent", metadata={"displayName": "Consumer Agent", "subtitle": "Consumer Support", "icon": "🛒", "color": "#bd93f9", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "AI agent for consumer interactions", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="autonomous_agent", metadata={"displayName": "Autonomous Agent", "subtitle": "Autonomous Ops", "icon": "🎯", "color": "#bd93f9", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "Autonomous agent using Code Mode patterns", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="rlm_agent", metadata={"displayName": "RLM Agent", "subtitle": "Recursive Reasoning", "icon": "🧠", "color": "#ffb86c", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "Recursive Language Model agent (REPL-based)", "version": 1, "uiHints": _STD_AGENT_HINTS})
-register_node(type="claude_code_agent", metadata={"displayName": "Claude Code", "subtitle": "Agentic Coding", "icon": "lobehub:Claude", "color": "#8be9fd", "group": ["agent"], "componentKind": "agent", "handles": _std_handles(), "description": "Claude Code CLI as a specialized agent", "version": 1, "uiHints": _STD_AGENT_HINTS})
-
-
-# -- Team leads (Skill / Tool / Teammates bottom handles) --------------------
-
-register_node(
- type="orchestrator_agent",
- metadata={
- "displayName": "Orchestrator Agent",
- "subtitle": "Agent Coordination",
- "icon": "🎼",
- "color": "#8be9fd",
- "group": ["agent"],
- "componentKind": "agent",
- "handles": _std_handles(extra_bottom=_TEAM_BOTTOM_HANDLES),
- "description": "Team lead that delegates to connected specialized agents",
- "version": 1,
- "uiHints": _STD_AGENT_HINTS,
- },
-)
-
-register_node(
- type="ai_employee",
- metadata={
- "displayName": "AI Employee",
- "subtitle": "Team Orchestration",
- "icon": "👥",
- "color": "#bd93f9",
- "group": ["agent"],
- "componentKind": "agent",
- "handles": _std_handles(extra_bottom=_TEAM_BOTTOM_HANDLES),
- "description": "Team lead for multi-agent coordination",
- "version": 1,
- "uiHints": _STD_AGENT_HINTS,
- },
-)
-
-register_node(
- type="deep_agent",
- metadata={
- "displayName": "Deep Agent",
- "subtitle": "LangChain DeepAgents",
- "icon": "\U0001F9E0",
- "color": "#50fa7b",
- "group": ["agent"],
- "componentKind": "agent",
- "handles": _std_handles(extra_bottom=_DEEP_BOTTOM_HANDLES),
- "description": "LangChain DeepAgents with filesystem tools and sub-agent delegation",
- "version": 1,
- "uiHints": _STD_AGENT_HINTS,
- },
-)
-
-
-# -- Social messaging nodes (different handle topology, share component) ----
-
-register_node(
- type="socialReceive",
- metadata={
- "displayName": "Social Receive",
- "subtitle": "Normalize Message",
- "icon": "asset:social",
- "color": "#bd93f9",
- "group": ["social"],
- "componentKind": "agent", # Uses AIAgentNode component for multi-handle rendering
- "handles": [
- {"name": "output-message", "kind": "output", "position": "right", "offset": "20%", "label": "Message", "role": "main"},
- {"name": "output-media", "kind": "output", "position": "right", "offset": "40%", "label": "Media", "role": "main"},
- {"name": "output-contact", "kind": "output", "position": "right", "offset": "60%", "label": "Contact", "role": "main"},
- {"name": "output-metadata", "kind": "output", "position": "right", "offset": "80%", "label": "Metadata", "role": "main"},
- ],
- "description": "Normalizes messages from platform triggers into unified format",
- "version": 1,
- "uiHints": _SOCIAL_SIZE,
- },
-)
-
-register_node(
- type="socialSend",
- metadata={
- "displayName": "Social Send",
- "subtitle": "Send Message",
- "icon": "asset:social",
- "color": "#bd93f9",
- "group": ["social", "tool"],
- "componentKind": "agent",
- "handles": [
- {"name": "input-message", "kind": "input", "position": "left", "offset": "15%", "label": "Message", "role": "main"},
- {"name": "input-media", "kind": "input", "position": "left", "offset": "35%", "label": "Media", "role": "main"},
- {"name": "input-contact", "kind": "input", "position": "left", "offset": "55%", "label": "Contact", "role": "main"},
- {"name": "input-metadata", "kind": "input", "position": "left", "offset": "75%", "label": "Metadata", "role": "main"},
- ],
- "description": "Unified send action for any social platform",
- "version": 1,
- "uiHints": _SOCIAL_SIZE,
- },
-)
diff --git a/server/nodes/model/_base.py b/server/nodes/model/_base.py
new file mode 100644
index 00000000..323ad271
--- /dev/null
+++ b/server/nodes/model/_base.py
@@ -0,0 +1,100 @@
+"""Shared base for chat-model plugins.
+
+8 providers (openai / anthropic / openrouter / groq / cerebras /
+deepseek / kimi / mistral) all delegate to ``handle_ai_chat_model`` —
+only the type / display_name / icon / colour / description vary.
+Per-provider tuning fields (top_k, safety_settings, thinking_budget,
+reasoning_effort, reasoning_format) are set on the per-provider Params
+when relevant; the union from ``models/nodes.py`` is pre-existing and
+can be re-used.
+
+Each provider gets its own file under ``nodes/model/`` so the path
+matches the palette grouping; this base lives in ``_base.py`` (private).
+"""
+
+from __future__ import annotations
+
+from typing import Any, Literal, Optional
+
+from pydantic import BaseModel, ConfigDict, Field
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+
+class ChatModelParams(BaseModel):
+ """Shared params surface — providers override fields where their
+ capabilities differ (e.g. fixed temperature for o-series, no
+ thinking for openrouter passthrough)."""
+
+ prompt: str = Field(
+ default="",
+ json_schema_extra={"rows": 4, "placeholder": "{{ $json.message }}"},
+ )
+ model: str = Field(
+ default="",
+ json_schema_extra={"placeholder": "Select a model..."},
+ )
+ temperature: float = Field(
+ default=0.7, ge=0.0, le=2.0,
+ json_schema_extra={"numberStepSize": 0.1},
+ )
+ max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=200000)
+ system_prompt: Optional[str] = Field(
+ default="", alias="systemMessage",
+ json_schema_extra={"rows": 3, "placeholder": "You are a helpful assistant."},
+ )
+ api_key: Optional[str] = Field(
+ default=None, alias="apiKey",
+ json_schema_extra={"password": True},
+ )
+ top_p: Optional[float] = Field(
+ default=1.0, alias="topP", ge=0.0, le=1.0,
+ json_schema_extra={"numberStepSize": 0.1},
+ )
+
+ model_config = ConfigDict(populate_by_name=True, extra="ignore")
+
+
+class ChatModelOutput(BaseModel):
+ response: Optional[str] = None
+ thinking: Optional[str] = None
+ model: Optional[str] = None
+ provider: Optional[str] = None
+ finish_reason: Optional[str] = None
+ timestamp: Optional[str] = None
+
+ model_config = ConfigDict(extra="allow")
+
+
+class ChatModelBase(ActionNode, abstract=True):
+ """Subclass and set type/display_name/icon/color/description.
+ Override Params to add provider-specific tuning fields."""
+
+ component_kind = "model"
+ handles = (
+ {"name": "output-model", "kind": "output", "position": "right",
+ "label": "Model", "role": "model"},
+ )
+ annotations = {"destructive": False, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.AI_HEAVY
+
+ Params = ChatModelParams
+ Output = ChatModelOutput
+
+ @Operation("chat", cost={"service": "chat_model", "action": "chat", "count": 1})
+ async def chat(self, ctx: NodeContext, params: ChatModelParams) -> Any:
+ from core.container import container
+ from services.handlers.ai import handle_ai_chat_model
+
+ ai_service = container.ai_service()
+ payload = params.model_dump(by_alias=True)
+ response = await handle_ai_chat_model(
+ ai_service=ai_service,
+ node_id=ctx.node_id,
+ node_type=self.type,
+ parameters=payload,
+ context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or f"{self.type} chat failed")
diff --git a/server/nodes/model/anthropic_chat_model.py b/server/nodes/model/anthropic_chat_model.py
new file mode 100644
index 00000000..96953b75
--- /dev/null
+++ b/server/nodes/model/anthropic_chat_model.py
@@ -0,0 +1,26 @@
+from typing import Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class AnthropicChatModelParams(ChatModelParams):
+ top_k: Optional[int] = Field(default=40, alias="topK", ge=1, le=100)
+ thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
+ thinking_budget: Optional[int] = Field(
+ default=2048, alias="thinkingBudget", ge=1024, le=16000,
+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},
+ )
+
+
+class AnthropicChatModelNode(ChatModelBase):
+ type = "anthropicChatModel"
+ display_name = "Claude"
+ subtitle = "Chat Model"
+ icon = "lobehub:claude"
+ color = "#FF6B35"
+ group = ("model",)
+ description = "Anthropic Claude models for conversation and analysis"
+
+ Params = AnthropicChatModelParams
diff --git a/server/nodes/model/cerebras_chat_model.py b/server/nodes/model/cerebras_chat_model.py
new file mode 100644
index 00000000..4617d2d0
--- /dev/null
+++ b/server/nodes/model/cerebras_chat_model.py
@@ -0,0 +1,25 @@
+from typing import Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class CerebrasChatModelParams(ChatModelParams):
+ thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
+ thinking_budget: Optional[int] = Field(
+ default=2048, alias="thinkingBudget", ge=1024, le=16000,
+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},
+ )
+
+
+class CerebrasChatModelNode(ChatModelBase):
+ type = "cerebrasChatModel"
+ display_name = "Cerebras"
+ subtitle = "Chat Model"
+ icon = "lobehub:cerebras"
+ color = "#ffb86c"
+ group = ("model",)
+ description = "Cerebras ultra-fast inference on custom AI hardware"
+
+ Params = CerebrasChatModelParams
diff --git a/server/nodes/model/deepseek_chat_model.py b/server/nodes/model/deepseek_chat_model.py
new file mode 100644
index 00000000..2aeb309f
--- /dev/null
+++ b/server/nodes/model/deepseek_chat_model.py
@@ -0,0 +1,26 @@
+from typing import Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class DeepseekChatModelParams(ChatModelParams):
+ frequency_penalty: Optional[float] = Field(
+ default=0.0, alias="frequencyPenalty", ge=-2.0, le=2.0,
+ )
+ presence_penalty: Optional[float] = Field(
+ default=0.0, alias="presencePenalty", ge=-2.0, le=2.0,
+ )
+
+
+class DeepseekChatModelNode(ChatModelBase):
+ type = "deepseekChatModel"
+ display_name = "DeepSeek"
+ subtitle = "Chat Model"
+ icon = "lobehub:deepseek"
+ color = "#8be9fd"
+ group = ("model",)
+ description = "DeepSeek V3 models (deepseek-chat, deepseek-reasoner with always-on CoT)"
+
+ Params = DeepseekChatModelParams
diff --git a/server/nodes/model/gemini_chat_model.py b/server/nodes/model/gemini_chat_model.py
index 0b707c5b..8219723e 100644
--- a/server/nodes/model/gemini_chat_model.py
+++ b/server/nodes/model/gemini_chat_model.py
@@ -1,51 +1,11 @@
-"""Gemini Chat Model — Wave 11.C migration.
+from typing import Literal, Optional
-Per-provider chat-model plugin. Replaces the cross-provider
-``AIChatModelParams`` discriminated union for *this provider only* —
-gemini-specific knobs (top_k, safety_settings, thinking_budget) live
-in this Params model. Other providers get their own plugins as 11.C
-continues.
+from pydantic import Field
-Delegates execution to the existing ``AIService.execute_chat`` via
-``handlers.ai.handle_ai_chat_model`` — that body owns the native
-SDK + LangChain dual-path for thinking/streaming/usage-tracking.
-"""
+from ._base import ChatModelBase, ChatModelParams
-from __future__ import annotations
-from typing import Any, Literal, Optional
-
-from pydantic import BaseModel, ConfigDict, Field
-
-from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
-
-
-class GeminiChatModelParams(BaseModel):
- prompt: str = Field(
- default="",
- json_schema_extra={"rows": 4, "placeholder": "{{ $json.message }}"},
- )
- model: str = Field(
- default="",
- json_schema_extra={"placeholder": "Select a model..."},
- )
- temperature: float = Field(
- default=0.7, ge=0.0, le=2.0,
- json_schema_extra={"numberStepSize": 0.1},
- )
- max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=128000)
- system_prompt: Optional[str] = Field(
- default="", alias="systemMessage",
- json_schema_extra={"rows": 3, "placeholder": "You are a helpful assistant."},
- )
- api_key: Optional[str] = Field(
- default=None, alias="apiKey",
- json_schema_extra={"password": True},
- )
- top_p: Optional[float] = Field(
- default=1.0, alias="topP", ge=0.0, le=1.0,
- json_schema_extra={"numberStepSize": 0.1},
- )
+class GeminiChatModelParams(ChatModelParams):
top_k: Optional[int] = Field(default=40, alias="topK", ge=1, le=100)
safety_settings: Literal["default", "strict", "permissive"] = Field(
default="default", alias="safetySettings",
@@ -56,21 +16,8 @@ class GeminiChatModelParams(BaseModel):
json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},
)
- model_config = ConfigDict(populate_by_name=True, extra="ignore")
-
-
-class GeminiChatModelOutput(BaseModel):
- response: Optional[str] = None
- thinking: Optional[str] = None
- model: Optional[str] = None
- provider: Optional[str] = None
- finish_reason: Optional[str] = None
- timestamp: Optional[str] = None
-
- model_config = ConfigDict(extra="allow")
-
-class GeminiChatModelNode(ActionNode):
+class GeminiChatModelNode(ChatModelBase):
type = "geminiChatModel"
display_name = "Gemini"
subtitle = "Chat Model"
@@ -78,33 +25,5 @@ class GeminiChatModelNode(ActionNode):
color = "#4285F4"
group = ("model",)
description = "Google Gemini models for multimodal AI capabilities"
- component_kind = "model"
- handles = (
- {"name": "output-model", "kind": "output", "position": "right",
- "label": "Model", "role": "model"},
- )
- annotations = {"destructive": False, "readonly": False, "open_world": True}
- task_queue = TaskQueue.AI_HEAVY
Params = GeminiChatModelParams
- Output = GeminiChatModelOutput
-
- @Operation("chat", cost={"service": "gemini", "action": "chat", "count": 1})
- async def chat(self, ctx: NodeContext, params: GeminiChatModelParams) -> Any:
- # Delegate to the legacy chat-model handler; AIService is a
- # singleton retrievable from the DI container.
- from core.container import container
- from services.handlers.ai import handle_ai_chat_model
-
- ai_service = container.ai_service()
- payload = params.model_dump(by_alias=True)
- response = await handle_ai_chat_model(
- ai_service=ai_service,
- node_id=ctx.node_id,
- node_type=self.type,
- parameters=payload,
- context=ctx.raw,
- )
- if response.get("success"):
- return response.get("result") or response
- raise RuntimeError(response.get("error") or "Gemini chat failed")
diff --git a/server/nodes/model/groq_chat_model.py b/server/nodes/model/groq_chat_model.py
new file mode 100644
index 00000000..1bde3fdb
--- /dev/null
+++ b/server/nodes/model/groq_chat_model.py
@@ -0,0 +1,25 @@
+from typing import Literal, Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class GroqChatModelParams(ChatModelParams):
+ thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
+ reasoning_format: Optional[Literal["parsed", "hidden"]] = Field(
+ default="parsed", alias="reasoningFormat",
+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},
+ )
+
+
+class GroqChatModelNode(ChatModelBase):
+ type = "groqChatModel"
+ display_name = "Groq"
+ subtitle = "Chat Model"
+ icon = "lobehub:groq"
+ color = "#F55036"
+ group = ("model",)
+ description = "Groq ultra-fast LLM inference (Llama, Qwen3, GPT-OSS)"
+
+ Params = GroqChatModelParams
diff --git a/server/nodes/model/kimi_chat_model.py b/server/nodes/model/kimi_chat_model.py
new file mode 100644
index 00000000..d8386cc4
--- /dev/null
+++ b/server/nodes/model/kimi_chat_model.py
@@ -0,0 +1,11 @@
+from ._base import ChatModelBase
+
+
+class KimiChatModelNode(ChatModelBase):
+ type = "kimiChatModel"
+ display_name = "Kimi"
+ subtitle = "Chat Model"
+ icon = "lobehub:kimi"
+ color = "#bd93f9"
+ group = ("model",)
+ description = "Kimi K2 models by Moonshot AI with 256K context (thinking on by default)"
diff --git a/server/nodes/model/mistral_chat_model.py b/server/nodes/model/mistral_chat_model.py
new file mode 100644
index 00000000..a9b06d27
--- /dev/null
+++ b/server/nodes/model/mistral_chat_model.py
@@ -0,0 +1,11 @@
+from ._base import ChatModelBase
+
+
+class MistralChatModelNode(ChatModelBase):
+ type = "mistralChatModel"
+ display_name = "Mistral"
+ subtitle = "Chat Model"
+ icon = "lobehub:mistral"
+ color = "#ffb86c"
+ group = ("model",)
+ description = "Mistral AI models for reasoning, coding, and multilingual tasks"
diff --git a/server/nodes/model/openai_chat_model.py b/server/nodes/model/openai_chat_model.py
new file mode 100644
index 00000000..395c1218
--- /dev/null
+++ b/server/nodes/model/openai_chat_model.py
@@ -0,0 +1,36 @@
+from typing import Literal, Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class OpenAIChatModelParams(ChatModelParams):
+ frequency_penalty: Optional[float] = Field(
+ default=0.0, alias="frequencyPenalty", ge=-2.0, le=2.0,
+ json_schema_extra={"numberStepSize": 0.1},
+ )
+ presence_penalty: Optional[float] = Field(
+ default=0.0, alias="presencePenalty", ge=-2.0, le=2.0,
+ json_schema_extra={"numberStepSize": 0.1},
+ )
+ response_format: Optional[Literal["text", "json_object"]] = Field(
+ default="text", alias="responseFormat",
+ )
+ thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
+ reasoning_effort: Optional[Literal["minimal", "low", "medium", "high"]] = Field(
+ default="medium", alias="reasoningEffort",
+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},
+ )
+
+
+class OpenAIChatModelNode(ChatModelBase):
+ type = "openaiChatModel"
+ display_name = "OpenAI"
+ subtitle = "Chat Model"
+ icon = "lobehub:openai"
+ color = "#00A67E"
+ group = ("model",)
+ description = "OpenAI GPT models for chat completion and generation"
+
+ Params = OpenAIChatModelParams
diff --git a/server/nodes/model/openrouter_chat_model.py b/server/nodes/model/openrouter_chat_model.py
new file mode 100644
index 00000000..8958c966
--- /dev/null
+++ b/server/nodes/model/openrouter_chat_model.py
@@ -0,0 +1,26 @@
+from typing import Optional
+
+from pydantic import Field
+
+from ._base import ChatModelBase, ChatModelParams
+
+
+class OpenRouterChatModelParams(ChatModelParams):
+ frequency_penalty: Optional[float] = Field(
+ default=0.0, alias="frequencyPenalty", ge=-2.0, le=2.0,
+ )
+ presence_penalty: Optional[float] = Field(
+ default=0.0, alias="presencePenalty", ge=-2.0, le=2.0,
+ )
+
+
+class OpenRouterChatModelNode(ChatModelBase):
+ type = "openrouterChatModel"
+ display_name = "OpenRouter"
+ subtitle = "Chat Model"
+ icon = "lobehub:openrouter"
+ color = "#6366F1"
+ group = ("model",)
+ description = "OpenRouter unified API - access OpenAI, Claude, Gemini, Llama, and more"
+
+ Params = OpenRouterChatModelParams
diff --git a/server/nodes/services.py b/server/nodes/services.py
index 2079a05d..df57fa5b 100644
--- a/server/nodes/services.py
+++ b/server/nodes/services.py
@@ -61,15 +61,7 @@ register_node(type="mediaControl", metadata={"displayName": "Media Con
# 2. AI chat models (9) + memory + skill — model dispatch + accent colors
# ---------------------------------------------------------------------------
-register_node(type="openaiChatModel", metadata={"displayName": "OpenAI", "subtitle": "Chat Model", "icon": "lobehub:openai", "color": "#00A67E", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "OpenAI GPT models for chat completion and generation", "version": 1})
-register_node(type="anthropicChatModel", metadata={"displayName": "Claude", "subtitle": "Chat Model", "icon": "lobehub:claude", "color": "#FF6B35", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "Anthropic Claude models for conversation and analysis", "version": 1})
-# geminiChatModel — migrated to nodes/model/gemini_chat_model.py (Wave 11.C).
-register_node(type="openrouterChatModel", metadata={"displayName": "OpenRouter", "subtitle": "Chat Model", "icon": "lobehub:openrouter", "color": "#6366F1", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "OpenRouter unified API - access OpenAI, Claude, Gemini, Llama, and more", "version": 1})
-register_node(type="groqChatModel", metadata={"displayName": "Groq", "subtitle": "Chat Model", "icon": "lobehub:groq", "color": "#F55036", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "Groq ultra-fast LLM inference (Llama, Qwen3, GPT-OSS)", "version": 1})
-register_node(type="cerebrasChatModel", metadata={"displayName": "Cerebras", "subtitle": "Chat Model", "icon": "lobehub:cerebras", "color": "#ffb86c", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "Cerebras ultra-fast inference on custom AI hardware", "version": 1})
-register_node(type="deepseekChatModel", metadata={"displayName": "DeepSeek", "subtitle": "Chat Model", "icon": "lobehub:deepseek", "color": "#8be9fd", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "DeepSeek V3 models (deepseek-chat, deepseek-reasoner with always-on CoT)", "version": 1})
-register_node(type="kimiChatModel", metadata={"displayName": "Kimi", "subtitle": "Chat Model", "icon": "lobehub:kimi", "color": "#bd93f9", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "Kimi K2 models by Moonshot AI with 256K context (thinking on by default)", "version": 1})
-register_node(type="mistralChatModel", metadata={"displayName": "Mistral", "subtitle": "Chat Model", "icon": "lobehub:mistral", "color": "#ffb86c", "group": ["model"], "componentKind": "model", "handles": _MODEL_OUT, "description": "Mistral AI models for reasoning, coding, and multilingual tasks", "version": 1})
+# All 9 chat models — migrated to nodes/model/*.py (Wave 11.C).
register_node(
type="simpleMemory",
diff --git a/server/nodes/social/social_receive.py b/server/nodes/social/social_receive.py
new file mode 100644
index 00000000..00188033
--- /dev/null
+++ b/server/nodes/social/social_receive.py
@@ -0,0 +1,78 @@
+"""Social Receive — Wave 11.C migration.
+
+Normalises messages from any platform trigger (whatsappReceive,
+telegramReceive, etc.) into a unified shape and fans out across four
+right-side output handles: message / media / contact / metadata.
+
+Reads ``connected_outputs`` from the executor's enriched context;
+delegates the per-platform unwrap to the existing handler.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Optional
+
+from pydantic import BaseModel, ConfigDict
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+
+_SOCIAL_SIZE = {"width": 260, "height": 160}
+
+
+class SocialReceiveParams(BaseModel):
+ """Pure passthrough — no user-facing params; all data flows from
+ upstream trigger nodes via connected_outputs."""
+
+ model_config = ConfigDict(extra="allow")
+
+
+class SocialReceiveOutput(BaseModel):
+ message: Optional[Any] = None
+ media: Optional[Any] = None
+ contact: Optional[Any] = None
+ metadata: Optional[Any] = None
+
+ model_config = ConfigDict(extra="allow")
+
+
+class SocialReceiveNode(ActionNode):
+ type = "socialReceive"
+ display_name = "Social Receive"
+ subtitle = "Normalize Message"
+ icon = "asset:social"
+ color = "#bd93f9"
+ group = ("social",)
+ description = "Normalizes messages from platform triggers into unified format"
+ component_kind = "agent" # multi-handle layout uses AIAgentNode
+ handles = (
+ {"name": "output-message", "kind": "output", "position": "right", "offset": "20%", "label": "Message", "role": "main"},
+ {"name": "output-media", "kind": "output", "position": "right", "offset": "40%", "label": "Media", "role": "main"},
+ {"name": "output-contact", "kind": "output", "position": "right", "offset": "60%", "label": "Contact", "role": "main"},
+ {"name": "output-metadata", "kind": "output", "position": "right", "offset": "80%", "label": "Metadata", "role": "main"},
+ )
+ ui_hints = _SOCIAL_SIZE
+ annotations = {"destructive": False, "readonly": True, "open_world": False}
+ task_queue = TaskQueue.DEFAULT
+
+ Params = SocialReceiveParams
+ Output = SocialReceiveOutput
+
+ @Operation("normalize")
+ async def normalize(self, ctx: NodeContext, params: SocialReceiveParams) -> Any:
+ from services.handlers.social import handle_social_receive
+ outputs = ctx.raw.get("connected_outputs") or {}
+ source_nodes = ctx.raw.get("source_nodes") or []
+ response = await handle_social_receive(
+ node_id=ctx.node_id, node_type=self.type,
+ parameters=params.model_dump(by_alias=True), context=ctx.raw,
+ connected_outputs=outputs, source_nodes=source_nodes,
+ )
+ if response.get("success") is False:
+ raise RuntimeError(response.get("error") or "social receive failed")
+ return response.get("result") or {}
+
+
+# socialReceive needs the executor's connected_outputs injection
+# (alongside console / pythonExecutor / webhookResponse / socialReceive
+# already in _NEEDS_CONNECTED_OUTPUTS); the legacy entry stays.
diff --git a/server/nodes/social/social_send.py b/server/nodes/social/social_send.py
new file mode 100644
index 00000000..cb92466d
--- /dev/null
+++ b/server/nodes/social/social_send.py
@@ -0,0 +1,67 @@
+"""Social Send — Wave 11.C migration.
+
+Unified send action for any social platform (WhatsApp / Telegram /
+Discord / Slack / SMS / etc.). Multi-input handle topology:
+message / media / contact / metadata as separate left-side handles.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Dict, Optional
+
+from pydantic import BaseModel, ConfigDict
+
+from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+
+
+_SOCIAL_SIZE = {"width": 260, "height": 160}
+
+
+class SocialSendParams(BaseModel):
+ platform: Optional[str] = None
+ recipient: Optional[str] = None
+ text: Optional[str] = None
+
+ model_config = ConfigDict(extra="allow")
+
+
+class SocialSendOutput(BaseModel):
+ sent: Optional[bool] = None
+ message_id: Optional[str] = None
+
+ model_config = ConfigDict(extra="allow")
+
+
+class SocialSendNode(ActionNode):
+ type = "socialSend"
+ display_name = "Social Send"
+ subtitle = "Send Message"
+ icon = "asset:social"
+ color = "#bd93f9"
+ group = ("social", "tool")
+ description = "Unified send action for any social platform"
+ component_kind = "agent" # multi-handle layout uses AIAgentNode component
+ handles = (
+ {"name": "input-message", "kind": "input", "position": "left", "offset": "15%", "label": "Message", "role": "main"},
+ {"name": "input-media", "kind": "input", "position": "left", "offset": "35%", "label": "Media", "role": "main"},
+ {"name": "input-contact", "kind": "input", "position": "left", "offset": "55%", "label": "Contact", "role": "main"},
+ {"name": "input-metadata", "kind": "input", "position": "left", "offset": "75%", "label": "Metadata", "role": "main"},
+ )
+ ui_hints = _SOCIAL_SIZE
+ annotations = {"destructive": False, "readonly": False, "open_world": True}
+ task_queue = TaskQueue.MESSAGING
+ usable_as_tool = True
+
+ Params = SocialSendParams
+ Output = SocialSendOutput
+
+ @Operation("send", cost={"service": "social", "action": "send", "count": 1})
+ async def send(self, ctx: NodeContext, params: SocialSendParams) -> Any:
+ from services.handlers.social import handle_social_send
+ response = await handle_social_send(
+ node_id=ctx.node_id, node_type=self.type,
+ parameters=params.model_dump(by_alias=True), context=ctx.raw,
+ )
+ if response.get("success"):
+ return response.get("result") or response
+ raise RuntimeError(response.get("error") or "social send failed")
diff --git a/server/services/node_executor.py b/server/services/node_executor.py
index 14c0a5d8..f876b1a2 100644
--- a/server/services/node_executor.py
+++ b/server/services/node_executor.py
@@ -141,26 +141,8 @@ class NodeExecutor:
'start': handle_start,
'cronScheduler': handle_cron_scheduler,
'timer': handle_timer,
- # AI
- # aiAgent + chatAgent: migrated to nodes/agent/{ai_agent,chat_agent}.py (Wave 11.C).
- # Plugin handler wins via registry merge.
- # Specialized Agents (use chatAgent handler - same skill/memory/tools architecture)
- 'android_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'coding_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'web_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'task_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'social_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'travel_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'tool_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'productivity_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'payments_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'consumer_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'autonomous_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'orchestrator_agent': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'ai_employee': partial(handle_chat_agent, ai_service=self.ai_service, database=self.database),
- 'deep_agent': partial(handle_deep_agent, ai_service=self.ai_service, database=self.database),
- 'rlm_agent': partial(handle_rlm_agent, ai_service=self.ai_service, database=self.database),
- 'claude_code_agent': partial(handle_claude_code_agent, ai_service=self.ai_service, database=self.database),
+ # AI agents — all migrated to nodes/agent/*.py (Wave 11.C).
+ # Plugin handlers win via registry.update(_PLUGIN_HANDLERS) merge below.
'simpleMemory': handle_simple_memory,
# Maps
'gmaps_create': partial(handle_create_map, maps_service=self.maps_service),
@@ -195,7 +177,7 @@ class NodeExecutor:
# perplexitySearch: migrated to nodes/search/perplexity_search.py (Wave 11.C). Plugin handler wins.
# Social (unified messaging)
# Note: socialReceive handled in _dispatch with connected_outputs
- 'socialSend': handle_social_send,
+ # socialSend: migrated to nodes/social/social_send.py (Wave 11.C).
# Chat
'chatSend': handle_chat_send,
'chatHistory': handle_chat_history,
@@ -234,9 +216,8 @@ class NodeExecutor:
# Note: 'console' handled in _dispatch with connected_outputs
}
- # Register AI chat models
- for node_type in AI_CHAT_MODEL_TYPES:
- registry[node_type] = partial(handle_ai_chat_model, ai_service=self.ai_service)
+ # AI chat models — all 9 migrated to nodes/model/*.py (Wave 11.C).
+ # Plugin handlers register themselves via _PLUGIN_HANDLERS merge below.
# Register Android services
for node_type in ANDROID_SERVICE_NODE_TYPES:
@@ -397,12 +378,9 @@ class NodeExecutor:
return await handler(node_id, node_type, params, context)
# Legacy special handlers — invoked when no plugin is registered.
- # console: migrated to nodes/utility/console.py (Wave 11.C); plugin wins above.
+ # console + socialReceive: migrated to nodes/{utility,social}/ (Wave 11.C); plugins win above.
if node_type in self._NEEDS_CONNECTED_OUTPUTS:
outputs = context['connected_outputs']
- source_nodes = context['source_nodes']
- if node_type == 'socialReceive':
- return await handle_social_receive(node_id, node_type, params, context, outputs, source_nodes)
handlers = {
'pythonExecutor': handle_python_executor,
'javascriptExecutor': handle_javascript_executor,