diff --git a/backend/app/api/agent.py b/backend/app/api/agent.py index 0b6cfc35..87e4eb16 100644 --- a/backend/app/api/agent.py +++ b/backend/app/api/agent.py @@ -44,7 +44,8 @@ from app.schemas.gateway_coordination import ( from app.schemas.pagination import DefaultLimitOffsetPage from app.schemas.tasks import TaskCommentCreate, TaskCommentRead, TaskCreate, TaskRead, TaskUpdate from app.services.activity_log import record_activity -from app.services.openclaw import AgentLifecycleService, GatewayCoordinationService +from app.services.openclaw.agent_service import AgentLifecycleService +from app.services.openclaw.coordination_service import GatewayCoordinationService from app.services.task_dependencies import ( blocked_by_dependency_ids, dependency_status_by_id, diff --git a/backend/app/api/agents.py b/backend/app/api/agents.py index ac45c57b..7b50b41c 100644 --- a/backend/app/api/agents.py +++ b/backend/app/api/agents.py @@ -21,7 +21,7 @@ from app.schemas.agents import ( ) from app.schemas.common import OkResponse from app.schemas.pagination import DefaultLimitOffsetPage -from app.services.openclaw import AgentLifecycleService, AgentUpdateOptions +from app.services.openclaw.agent_service import AgentLifecycleService, AgentUpdateOptions from app.services.organizations import OrganizationContext if TYPE_CHECKING: diff --git a/backend/app/api/board_group_memory.py b/backend/app/api/board_group_memory.py index 91b21789..8593c7b3 100644 --- a/backend/app/api/board_group_memory.py +++ b/backend/app/api/board_group_memory.py @@ -34,7 +34,10 @@ from app.models.users import User from app.schemas.board_group_memory import BoardGroupMemoryCreate, BoardGroupMemoryRead from app.schemas.pagination import DefaultLimitOffsetPage from app.services.mentions import extract_mentions, matches_agent_mention -from app.services.openclaw import optional_gateway_config_for_board, send_gateway_agent_message +from app.services.openclaw.shared import ( + optional_gateway_config_for_board, + send_gateway_agent_message, +) from app.services.organizations import ( is_org_admin, list_accessible_board_ids, diff --git a/backend/app/api/board_groups.py b/backend/app/api/board_groups.py index 76f87b01..974dc9a7 100644 --- a/backend/app/api/board_groups.py +++ b/backend/app/api/board_groups.py @@ -30,7 +30,8 @@ from app.schemas.common import OkResponse from app.schemas.pagination import DefaultLimitOffsetPage from app.schemas.view_models import BoardGroupSnapshot from app.services.board_group_snapshot import build_group_snapshot -from app.services.openclaw import DEFAULT_HEARTBEAT_CONFIG, sync_gateway_agent_heartbeats +from app.services.openclaw.constants import DEFAULT_HEARTBEAT_CONFIG +from app.services.openclaw.provisioning import sync_gateway_agent_heartbeats from app.services.organizations import ( OrganizationContext, board_access_filter, diff --git a/backend/app/api/board_memory.py b/backend/app/api/board_memory.py index bc00951e..fd3ae058 100644 --- a/backend/app/api/board_memory.py +++ b/backend/app/api/board_memory.py @@ -30,7 +30,10 @@ from app.models.board_memory import BoardMemory from app.schemas.board_memory import BoardMemoryCreate, BoardMemoryRead from app.schemas.pagination import DefaultLimitOffsetPage from app.services.mentions import extract_mentions, matches_agent_mention -from app.services.openclaw import optional_gateway_config_for_board, send_gateway_agent_message +from app.services.openclaw.shared import ( + optional_gateway_config_for_board, + send_gateway_agent_message, +) if TYPE_CHECKING: from collections.abc import AsyncIterator diff --git a/backend/app/api/board_onboarding.py b/backend/app/api/board_onboarding.py index 183367e8..d1fa632c 100644 --- a/backend/app/api/board_onboarding.py +++ b/backend/app/api/board_onboarding.py @@ -33,13 +33,13 @@ from app.schemas.board_onboarding import ( BoardOnboardingUserProfile, ) from app.schemas.boards import BoardRead -from app.services.openclaw import ( - BoardOnboardingMessagingService, +from app.services.openclaw.onboarding_service import BoardOnboardingMessagingService +from app.services.openclaw.provisioning import ( LeadAgentOptions, LeadAgentRequest, ensure_board_lead_agent, - require_gateway_config_for_board, ) +from app.services.openclaw.shared import require_gateway_config_for_board if TYPE_CHECKING: from sqlmodel.ext.asyncio.session import AsyncSession diff --git a/backend/app/api/boards.py b/backend/app/api/boards.py index 0d2035ca..1551bfdd 100644 --- a/backend/app/api/boards.py +++ b/backend/app/api/boards.py @@ -40,7 +40,7 @@ from app.schemas.pagination import DefaultLimitOffsetPage from app.schemas.view_models import BoardGroupSnapshot, BoardSnapshot from app.services.board_group_snapshot import build_board_group_snapshot from app.services.board_snapshot import build_board_snapshot -from app.services.openclaw import cleanup_agent +from app.services.openclaw.provisioning import cleanup_agent from app.services.organizations import OrganizationContext, board_access_filter if TYPE_CHECKING: diff --git a/backend/app/api/gateway.py b/backend/app/api/gateway.py index c37b1a39..718715c9 100644 --- a/backend/app/api/gateway.py +++ b/backend/app/api/gateway.py @@ -24,7 +24,7 @@ from app.schemas.gateway_api import ( GatewaySessionsResponse, GatewaysStatusResponse, ) -from app.services.openclaw import GatewaySessionService +from app.services.openclaw.session_service import GatewaySessionService from app.services.organizations import OrganizationContext if TYPE_CHECKING: diff --git a/backend/app/api/gateways.py b/backend/app/api/gateways.py index a0c9e98a..ffb14478 100644 --- a/backend/app/api/gateways.py +++ b/backend/app/api/gateways.py @@ -23,7 +23,8 @@ from app.schemas.gateways import ( GatewayUpdate, ) from app.schemas.pagination import DefaultLimitOffsetPage -from app.services.openclaw import GatewayAdminLifecycleService, GatewayTemplateSyncQuery +from app.services.openclaw.admin_service import GatewayAdminLifecycleService +from app.services.openclaw.session_service import GatewayTemplateSyncQuery if TYPE_CHECKING: from fastapi_pagination.limit_offset import LimitOffsetPage diff --git a/backend/app/api/tasks.py b/backend/app/api/tasks.py index a1f1e277..8a7ee98b 100644 --- a/backend/app/api/tasks.py +++ b/backend/app/api/tasks.py @@ -43,7 +43,10 @@ from app.schemas.pagination import DefaultLimitOffsetPage from app.schemas.tasks import TaskCommentCreate, TaskCommentRead, TaskCreate, TaskRead, TaskUpdate from app.services.activity_log import record_activity from app.services.mentions import extract_mentions, matches_agent_mention -from app.services.openclaw import optional_gateway_config_for_board, send_gateway_agent_message +from app.services.openclaw.shared import ( + optional_gateway_config_for_board, + send_gateway_agent_message, +) from app.services.organizations import require_board_access from app.services.task_dependencies import ( blocked_by_dependency_ids, diff --git a/backend/app/services/board_snapshot.py b/backend/app/services/board_snapshot.py index d6fb1b59..56f2a342 100644 --- a/backend/app/services/board_snapshot.py +++ b/backend/app/services/board_snapshot.py @@ -15,7 +15,7 @@ from app.schemas.approvals import ApprovalRead from app.schemas.board_memory import BoardMemoryRead from app.schemas.boards import BoardRead from app.schemas.view_models import BoardSnapshot, TaskCardRead -from app.services.openclaw import AgentLifecycleService +from app.services.openclaw.agent_service import AgentLifecycleService from app.services.task_dependencies import ( blocked_by_dependency_ids, dependency_ids_by_task_id, diff --git a/backend/tests/test_agent_provisioning_utils.py b/backend/tests/test_agent_provisioning_utils.py index 611c6eca..de6f7f46 100644 --- a/backend/tests/test_agent_provisioning_utils.py +++ b/backend/tests/test_agent_provisioning_utils.py @@ -7,8 +7,8 @@ from uuid import UUID, uuid4 import pytest -from app.services.openclaw import GatewayAgentIdentity -from app.services.openclaw import provisioning as agent_provisioning +import app.services.openclaw.provisioning as agent_provisioning +from app.services.openclaw.shared import GatewayAgentIdentity def test_slugify_normalizes_and_trims(): diff --git a/backend/tests/test_lifecycle_services.py b/backend/tests/test_lifecycle_services.py index 9446ae26..e05dbee0 100644 --- a/backend/tests/test_lifecycle_services.py +++ b/backend/tests/test_lifecycle_services.py @@ -11,10 +11,10 @@ from uuid import UUID, uuid4 import pytest from fastapi import HTTPException, status +import app.services.openclaw.coordination_service as coordination_lifecycle +import app.services.openclaw.onboarding_service as onboarding_lifecycle from app.integrations.openclaw_gateway import GatewayConfig as GatewayClientConfig from app.integrations.openclaw_gateway import OpenClawGatewayError -from app.services.openclaw import coordination_service as coordination_lifecycle -from app.services.openclaw import onboarding_service as onboarding_lifecycle from app.services.openclaw.shared import GatewayAgentIdentity