From d5915bb32198e90d51a7927647888cbbcd019fcf Mon Sep 17 00:00:00 2001 From: Udhay-Adithya Date: Sun, 21 Sep 2025 11:51:15 +0530 Subject: [PATCH] refactor: Move AutoFixService, RequestApplyService, PromptBuilder, and UrlEnvService to core services - Deleted old implementations of AutoFixService, RequestApplyService, PromptBuilder, and UrlEnvService from the chat feature. - Introduced new implementations of AutoFixService, RequestApplyService, PromptBuilder, and UrlEnvService in the core services directory. - Updated import paths to reflect the new structure. - Ensured all functionalities remain intact after the refactor. --- .../chat => core}/services/actions/auto_fix_service.dart | 2 +- .../services/actions/request_apply_service.dart | 2 +- .../chat => core}/services/agent/prompt_builder.dart | 2 +- .../chat => core}/services/base/url_env_service.dart | 0 .../features/chat/providers/service_providers.dart | 8 ++++---- 5 files changed, 7 insertions(+), 7 deletions(-) rename lib/dashbot/{features/chat => core}/services/actions/auto_fix_service.dart (99%) rename lib/dashbot/{features/chat => core}/services/actions/request_apply_service.dart (99%) rename lib/dashbot/{features/chat => core}/services/agent/prompt_builder.dart (98%) rename lib/dashbot/{features/chat => core}/services/base/url_env_service.dart (100%) diff --git a/lib/dashbot/features/chat/services/actions/auto_fix_service.dart b/lib/dashbot/core/services/actions/auto_fix_service.dart similarity index 99% rename from lib/dashbot/features/chat/services/actions/auto_fix_service.dart rename to lib/dashbot/core/services/actions/auto_fix_service.dart index bb085853..10226ac7 100644 --- a/lib/dashbot/features/chat/services/actions/auto_fix_service.dart +++ b/lib/dashbot/core/services/actions/auto_fix_service.dart @@ -1,7 +1,7 @@ import 'package:apidash_core/apidash_core.dart'; import 'package:apidash/models/models.dart'; -import '../../models/chat_models.dart'; +import '../../../features/chat/models/chat_models.dart'; import 'request_apply_service.dart'; class AutoFixService { diff --git a/lib/dashbot/features/chat/services/actions/request_apply_service.dart b/lib/dashbot/core/services/actions/request_apply_service.dart similarity index 99% rename from lib/dashbot/features/chat/services/actions/request_apply_service.dart rename to lib/dashbot/core/services/actions/request_apply_service.dart index 1390a6cb..5ee56021 100644 --- a/lib/dashbot/features/chat/services/actions/request_apply_service.dart +++ b/lib/dashbot/core/services/actions/request_apply_service.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:apidash_core/apidash_core.dart'; -import '../../models/chat_models.dart'; +import '../../../features/chat/models/chat_models.dart'; import '../base/url_env_service.dart'; class ApplyResult { diff --git a/lib/dashbot/features/chat/services/agent/prompt_builder.dart b/lib/dashbot/core/services/agent/prompt_builder.dart similarity index 98% rename from lib/dashbot/features/chat/services/agent/prompt_builder.dart rename to lib/dashbot/core/services/agent/prompt_builder.dart index bee7d217..4107fdc3 100644 --- a/lib/dashbot/features/chat/services/agent/prompt_builder.dart +++ b/lib/dashbot/core/services/agent/prompt_builder.dart @@ -1,7 +1,7 @@ import 'package:apidash/models/models.dart'; import 'package:apidash/dashbot/core/constants/dashbot_prompts.dart' as dash; -import '../../models/chat_models.dart'; +import '../../../features/chat/models/chat_models.dart'; class PromptBuilder { String buildSystemPrompt( diff --git a/lib/dashbot/features/chat/services/base/url_env_service.dart b/lib/dashbot/core/services/base/url_env_service.dart similarity index 100% rename from lib/dashbot/features/chat/services/base/url_env_service.dart rename to lib/dashbot/core/services/base/url_env_service.dart diff --git a/lib/dashbot/features/chat/providers/service_providers.dart b/lib/dashbot/features/chat/providers/service_providers.dart index 7cdac0ae..c8889749 100644 --- a/lib/dashbot/features/chat/providers/service_providers.dart +++ b/lib/dashbot/features/chat/providers/service_providers.dart @@ -1,9 +1,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../services/agent/prompt_builder.dart'; -import '../services/base/url_env_service.dart'; -import '../services/actions/auto_fix_service.dart'; -import '../services/actions/request_apply_service.dart'; +import '../../../core/services/agent/prompt_builder.dart'; +import '../../../core/services/base/url_env_service.dart'; +import '../../../core/services/actions/auto_fix_service.dart'; +import '../../../core/services/actions/request_apply_service.dart'; import '../../../../providers/providers.dart'; import 'package:apidash_core/apidash_core.dart';