Yuki Takei 9 месяцев назад
Родитель
Сommit
bc28a02731

+ 1 - 28
apps/app/src/features/openai/client/services/editor-assistant/index.ts

@@ -1,28 +1 @@
-/**
- * GROWI Editor Assistant - Client-side Services
- * Phase 2A: Browser-optimized engine implementation
- *
- * Compatible with existing useEditorAssistant hook and GROWI CodeMirror setup.
- * Provides specialized components for search/replace processing.
- */
-
-// Core Processing Components
-export { ClientFuzzyMatcher } from './fuzzy-matching';
-export {
-  clientNormalizeString,
-  normalizeForBrowserFuzzyMatch,
-  quickNormalizeForFuzzyMatch,
-  defaultFuzzyNormalizer,
-  quickNormalizer,
-} from './text-normalization';
-export { ClientErrorHandler } from './error-handling';
-export { ClientDiffApplicationEngine } from './diff-application';
-export { ClientSearchReplaceProcessor } from './processor';
-
-// Re-export commonly used types
-export type {
-  ProcessingOptions,
-  ProcessingResult,
-  ProgressCallback,
-  MatchResult,
-} from '../../../interfaces/editor-assistant/types';
+export * from './use-editor-assistant';

+ 10 - 12
apps/app/src/features/openai/client/services/editor-assistant.tsx → apps/app/src/features/openai/client/services/editor-assistant/use-editor-assistant.tsx

@@ -25,16 +25,14 @@ import { handleIfSuccessfullyParsed } from '~/features/openai/utils/handle-if-su
 import { useIsEnableUnifiedMergeView } from '~/stores-universal/context';
 import { useCurrentPageId } from '~/stores/page';
 
-import type { AiAssistantHasId } from '../../interfaces/ai-assistant';
-import type { MessageLog } from '../../interfaces/message';
-import type { IThreadRelationHasId } from '../../interfaces/thread-relation';
-import { ThreadType } from '../../interfaces/thread-relation';
-import { AiAssistantDropdown } from '../components/AiAssistant/AiAssistantSidebar/AiAssistantDropdown';
-import { QuickMenuList } from '../components/AiAssistant/AiAssistantSidebar/QuickMenuList';
-import { useAiAssistantSidebar } from '../stores/ai-assistant';
-
-// Client Engine Integration
-import useClientEngineIntegration, { shouldUseClientProcessing } from './client-engine-integration';
+import type { AiAssistantHasId } from '../../../interfaces/ai-assistant';
+import type { MessageLog } from '../../../interfaces/message';
+import type { IThreadRelationHasId } from '../../../interfaces/thread-relation';
+import { ThreadType } from '../../../interfaces/thread-relation';
+import { AiAssistantDropdown } from '../../components/AiAssistant/AiAssistantSidebar/AiAssistantDropdown';
+import { QuickMenuList } from '../../components/AiAssistant/AiAssistantSidebar/QuickMenuList';
+import { useAiAssistantSidebar } from '../../stores/ai-assistant';
+import { useClientEngineIntegration, shouldUseClientProcessing } from '../client-engine-integration';
 
 interface CreateThread {
   (): Promise<IThreadRelationHasId>;
@@ -216,7 +214,7 @@ export const useEditorAssistant: UseEditorAssistant = () => {
 
 
   // Enhanced processMessage with client engine support (保持)
-  const processMessageWithClientEngine = useCallback(async(data: unknown, handler: {
+  const processMessage = useCallback(async(data: unknown, handler: {
     onMessage: (data: SseMessage) => void;
     onDetectedDiff: (data: SseDetectedDiff) => void;
     onFinalized: (data: SseFinalized) => void;
@@ -478,7 +476,7 @@ export const useEditorAssistant: UseEditorAssistant = () => {
   return {
     createThread,
     postMessage,
-    processMessage: processMessageWithClientEngine,
+    processMessage,
     form,
     resetForm,
     isTextSelected,