From 8f16de40cce77960fc56ffb0513a86aacd037a17 Mon Sep 17 00:00:00 2001 From: kappa Date: Thu, 5 Feb 2026 09:43:07 +0900 Subject: [PATCH] refactor: move troubleshoot-agent to agents directory - Move troubleshoot-agent.ts to src/agents/ - Update import paths in dependent files Co-Authored-By: Claude Opus 4.5 --- src/{ => agents}/troubleshoot-agent.ts | 10 +++++----- src/openai-service.ts | 2 +- src/tools/troubleshoot-tool.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/{ => agents}/troubleshoot-agent.ts (98%) diff --git a/src/troubleshoot-agent.ts b/src/agents/troubleshoot-agent.ts similarity index 98% rename from src/troubleshoot-agent.ts rename to src/agents/troubleshoot-agent.ts index 3cbca17..3c7c195 100644 --- a/src/troubleshoot-agent.ts +++ b/src/agents/troubleshoot-agent.ts @@ -14,10 +14,10 @@ * 4. Expected: Session deleted */ -import type { Env, TroubleshootSession } from './types'; -import { createLogger } from './utils/logger'; -import { executeSearchWeb, executeLookupDocs } from './tools/search-tool'; -import { TROUBLESHOOT_STATUS } from './constants'; +import type { Env, TroubleshootSession } from '../types'; +import { createLogger } from '../utils/logger'; +import { executeSearchWeb, executeLookupDocs } from '../tools/search-tool'; +import { TROUBLESHOOT_STATUS } from '../constants'; const logger = createLogger('troubleshoot-agent'); @@ -184,7 +184,7 @@ async function callTroubleshootExpertAI( throw new Error('OPENAI_API_KEY not configured'); } - const { getOpenAIUrl } = await import('./utils/api-urls'); + const { getOpenAIUrl } = await import('../utils/api-urls'); // Build conversation history const conversationHistory = session.messages.map(m => ({ diff --git a/src/openai-service.ts b/src/openai-service.ts index 50e4ba8..99bd617 100644 --- a/src/openai-service.ts +++ b/src/openai-service.ts @@ -7,7 +7,7 @@ import { metrics } from './utils/metrics'; import { getOpenAIUrl } from './utils/api-urls'; import { ERROR_MESSAGES } from './constants/messages'; import { getServerSession, processServerConsultation } from './agents/server-agent'; -import { getTroubleshootSession, processTroubleshoot } from './troubleshoot-agent'; +import { getTroubleshootSession, processTroubleshoot } from './agents/troubleshoot-agent'; import { sendMessage } from './telegram'; const logger = createLogger('openai'); diff --git a/src/tools/troubleshoot-tool.ts b/src/tools/troubleshoot-tool.ts index 9883591..8849501 100644 --- a/src/tools/troubleshoot-tool.ts +++ b/src/tools/troubleshoot-tool.ts @@ -35,7 +35,7 @@ export async function executeManageTroubleshoot( return '🚫 νŠΈλŸ¬λΈ”μŠˆνŒ… κΈ°λŠ₯을 μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€.'; } - const { getTroubleshootSession, saveTroubleshootSession, deleteTroubleshootSession } = await import('../troubleshoot-agent'); + const { getTroubleshootSession, saveTroubleshootSession, deleteTroubleshootSession } = await import('../agents/troubleshoot-agent'); if (action === 'cancel') { await deleteTroubleshootSession(env.SESSION_KV, telegramUserId);