diff --git a/apps/desktop/electron.vite.config.ts b/apps/desktop/electron.vite.config.ts index bc321a5..0f47991 100644 --- a/apps/desktop/electron.vite.config.ts +++ b/apps/desktop/electron.vite.config.ts @@ -2,17 +2,20 @@ import { resolve } from 'path' import { defineConfig, externalizeDepsPlugin } from 'electron-vite' import react from '@vitejs/plugin-react' +const sharedAlias = { + '@shared': resolve(__dirname, 'src/shared'), + '@d3ro/core': resolve(__dirname, '../../packages/core/src') +} + export default defineConfig({ main: { - plugins: [externalizeDepsPlugin({ exclude: ['nanoid', 'electron-store'] })], - resolve: { - alias: { - '@shared': resolve('src/shared') - } - } + plugins: [ + externalizeDepsPlugin({ exclude: ['nanoid', 'electron-store', '@d3ro/core'] }) + ], + resolve: { alias: sharedAlias } }, preload: { - plugins: [externalizeDepsPlugin()], + plugins: [externalizeDepsPlugin({ exclude: ['@d3ro/core'] })], build: { rollupOptions: { input: { @@ -21,11 +24,7 @@ export default defineConfig({ } } }, - resolve: { - alias: { - '@shared': resolve('src/shared') - } - } + resolve: { alias: sharedAlias } }, renderer: { build: { @@ -55,11 +54,7 @@ export default defineConfig({ } } }, - resolve: { - alias: { - '@shared': resolve('src/shared') - } - }, + resolve: { alias: sharedAlias }, plugins: [react()] } }) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index dfe2a7f..59b9324 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -40,6 +40,7 @@ "vitest": "^2.1.0" }, "dependencies": { + "@d3ro/core": "*", "@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/utils": "^4.0.0", "@emotion/react": "^11.14.0", diff --git a/apps/desktop/src/main/bootstrap.ts b/apps/desktop/src/main/bootstrap.ts index 7f78a67..262de2b 100644 --- a/apps/desktop/src/main/bootstrap.ts +++ b/apps/desktop/src/main/bootstrap.ts @@ -157,7 +157,7 @@ async function initPopupWindows(): Promise { unregisterPopupNavKeys() } else { const instructions = getCustomInstructionService().getAll() - const activeId = configGet('activeInstructionId' as keyof import('@shared/types').AppConfig) as unknown as string + const activeId = configGet('activeInstructionId' as keyof import('@d3ro/core/types').AppConfig) as unknown as string showCommandPopup(instructions as unknown as Array>, activeId || null) registerPopupNavKeys('command') } @@ -345,12 +345,12 @@ function setupCommandPopupIPC(): void { if (data.id) { // 명령어 선택 → 활성 명령어로 설정 - configSet('activeInstructionId' as keyof import('@shared/types').AppConfig, data.id as never) + configSet('activeInstructionId' as keyof import('@d3ro/core/types').AppConfig, data.id as never) configSet('defaultLLMAction', 'custom') logger.info(`Active command set: ${data.name} (${data.id})`) } else { // 선택 해제 → 명령어 없음 (원본 삽입) - configSet('activeInstructionId' as keyof import('@shared/types').AppConfig, '' as never) + configSet('activeInstructionId' as keyof import('@d3ro/core/types').AppConfig, '' as never) configSet('defaultLLMAction', 'none') logger.info('Active command cleared (none)') } diff --git a/apps/desktop/src/main/ipc/audio-handlers.ts b/apps/desktop/src/main/ipc/audio-handlers.ts index ef8f4d4..d675f26 100644 --- a/apps/desktop/src/main/ipc/audio-handlers.ts +++ b/apps/desktop/src/main/ipc/audio-handlers.ts @@ -1,13 +1,13 @@ // src/main/ipc/audio-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getAudioCaptureService, calculateRMS } from '../services/AudioCaptureService' import { getMainWindow } from '../windows/WindowManager' import { configGet, configSet } from '../services/ConfigService' import { getLogger } from '../services/LoggerService' -import type { SetDeviceParams } from '@shared/types' +import type { SetDeviceParams } from '@d3ro/core/types' const logger = getLogger('audio-handlers') diff --git a/apps/desktop/src/main/ipc/caption-handlers.ts b/apps/desktop/src/main/ipc/caption-handlers.ts index 621481e..4e54599 100644 --- a/apps/desktop/src/main/ipc/caption-handlers.ts +++ b/apps/desktop/src/main/ipc/caption-handlers.ts @@ -2,10 +2,10 @@ // Phase 10.1: Live Caption IPC 핸들러 import { ipcMain, session, desktopCapturer } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getCaptionService } from '../services/CaptionService' -import type { CaptionConfig } from '@shared/types' +import type { CaptionConfig } from '@d3ro/core/types' export function registerCaptionHandlers(): void { // 시스템 오디오 루프백: setDisplayMediaRequestHandler로 audio: 'loopback' 설정 diff --git a/apps/desktop/src/main/ipc/chain-handlers.ts b/apps/desktop/src/main/ipc/chain-handlers.ts index 8042d73..70a10c5 100644 --- a/apps/desktop/src/main/ipc/chain-handlers.ts +++ b/apps/desktop/src/main/ipc/chain-handlers.ts @@ -2,15 +2,15 @@ // Phase 10.4: Multi-LLM Chain IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode, D3ROError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode, D3ROError } from '@d3ro/core/errors' import { getChainService } from '../services/ChainService' import type { CreateChainParams, UpdateChainParams, DeleteChainParams, ExecuteChainParams -} from '@shared/types' +} from '@d3ro/core/types' export function registerChainHandlers(): void { ipcMain.handle(IPC_CHANNELS.CHAIN.GET_ALL, async () => { diff --git a/apps/desktop/src/main/ipc/config-handlers.ts b/apps/desktop/src/main/ipc/config-handlers.ts index b2d12be..ad281b7 100644 --- a/apps/desktop/src/main/ipc/config-handlers.ts +++ b/apps/desktop/src/main/ipc/config-handlers.ts @@ -1,8 +1,8 @@ // src/main/ipc/config-handlers.ts import { ipcMain, BrowserWindow } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { configGet, configSet, configGetAll, configReset } from '../services/ConfigService' import { getAutoLaunchService } from '../services/AutoLaunchService' import { reapplyThemeToAllPopups } from '../windows/WindowManager' @@ -22,7 +22,7 @@ import type { SetAutoLaunchParams, SetCloseToTrayParams, AppConfig -} from '@shared/types' +} from '@d3ro/core/types' export function registerConfigHandlers(): void { ipcMain.handle(IPC_CHANNELS.CONFIG.GET, async (_event, params: ConfigGetParams) => { diff --git a/apps/desktop/src/main/ipc/context-handlers.ts b/apps/desktop/src/main/ipc/context-handlers.ts index 795fb16..25e469d 100644 --- a/apps/desktop/src/main/ipc/context-handlers.ts +++ b/apps/desktop/src/main/ipc/context-handlers.ts @@ -2,8 +2,8 @@ // Phase 10.2 스크린 컨텍스트 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getScreenContextService } from '../services/ScreenContextService' export function registerContextHandlers(): void { diff --git a/apps/desktop/src/main/ipc/dictionary-handlers.ts b/apps/desktop/src/main/ipc/dictionary-handlers.ts index 163bde1..6800367 100644 --- a/apps/desktop/src/main/ipc/dictionary-handlers.ts +++ b/apps/desktop/src/main/ipc/dictionary-handlers.ts @@ -1,8 +1,8 @@ // src/main/ipc/dictionary-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getDictionaryService } from '../services/DictionaryService' import type { DictionaryQueryParams, @@ -10,7 +10,7 @@ import type { DictionaryUpdateParams, DictionaryDeleteParams, DictionarySearchParams -} from '@shared/types' +} from '@d3ro/core/types' export function registerDictionaryHandlers(): void { ipcMain.handle(IPC_CHANNELS.DICTIONARY.GET_ALL, async (_event, params: DictionaryQueryParams) => { diff --git a/apps/desktop/src/main/ipc/file-transcription-handlers.ts b/apps/desktop/src/main/ipc/file-transcription-handlers.ts index 56fc8de..4d99625 100644 --- a/apps/desktop/src/main/ipc/file-transcription-handlers.ts +++ b/apps/desktop/src/main/ipc/file-transcription-handlers.ts @@ -2,11 +2,11 @@ // Phase 12.1: 파일 전사 IPC 핸들러 import { ipcMain, dialog } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getFileTranscriptionService } from '../services/FileTranscriptionService' import { getLogger } from '../services/LoggerService' -import type { FileTranscriptionStartParams } from '@shared/types' +import type { FileTranscriptionStartParams } from '@d3ro/core/types' const logger = getLogger('file-transcription-handlers') diff --git a/apps/desktop/src/main/ipc/history-handlers.ts b/apps/desktop/src/main/ipc/history-handlers.ts index 05467d7..580adbe 100644 --- a/apps/desktop/src/main/ipc/history-handlers.ts +++ b/apps/desktop/src/main/ipc/history-handlers.ts @@ -1,15 +1,15 @@ // src/main/ipc/history-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getHistoryService } from '../services/HistoryService' import type { HistoryQueryParams, HistoryGetByIdParams, HistoryDeleteParams, HistorySearchParams -} from '@shared/types' +} from '@d3ro/core/types' export function registerHistoryHandlers(): void { ipcMain.handle(IPC_CHANNELS.HISTORY.GET_ALL, async (_event, params: HistoryQueryParams) => { diff --git a/apps/desktop/src/main/ipc/hotkey-handlers.ts b/apps/desktop/src/main/ipc/hotkey-handlers.ts index b1d5d1f..30e17a6 100644 --- a/apps/desktop/src/main/ipc/hotkey-handlers.ts +++ b/apps/desktop/src/main/ipc/hotkey-handlers.ts @@ -1,11 +1,11 @@ // src/main/ipc/hotkey-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getHotkeyService } from '../services/HotkeyService' import { configGet, configSet } from '../services/ConfigService' -import type { SetHotkeyParams, SetEnabledParams } from '@shared/types' +import type { SetHotkeyParams, SetEnabledParams } from '@d3ro/core/types' export function registerHotkeyHandlers(): void { ipcMain.handle(IPC_CHANNELS.HOTKEY.GET_DICTATION_SHORTCUT, async () => { diff --git a/apps/desktop/src/main/ipc/instruction-handlers.ts b/apps/desktop/src/main/ipc/instruction-handlers.ts index f9884d9..4fe3097 100644 --- a/apps/desktop/src/main/ipc/instruction-handlers.ts +++ b/apps/desktop/src/main/ipc/instruction-handlers.ts @@ -1,7 +1,7 @@ // src/main/ipc/instruction-handlers.ts import { ipcMain } from 'electron' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getCustomInstructionService } from '../services/CustomInstructionService' import type { CustomInstruction } from '../services/CustomInstructionService' diff --git a/apps/desktop/src/main/ipc/license-handlers.ts b/apps/desktop/src/main/ipc/license-handlers.ts index 6f3b622..bd5d2dd 100644 --- a/apps/desktop/src/main/ipc/license-handlers.ts +++ b/apps/desktop/src/main/ipc/license-handlers.ts @@ -2,15 +2,15 @@ // Phase 11: 라이센스 IPC 핸들러 import { ipcMain, BrowserWindow } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getLicenseService } from '../services/LicenseService' import type { ActivateLicenseParams, UpgradePromptEvent, LicenseInfo, -} from '@shared/types' -import { Feature } from '@shared/types' +} from '@d3ro/core/types' +import { Feature } from '@d3ro/core/types' /** 업그레이드 유도 이벤트를 모든 렌더러에 broadcast */ function broadcastUpgradePrompt(event: UpgradePromptEvent): void { diff --git a/apps/desktop/src/main/ipc/llm-handlers.ts b/apps/desktop/src/main/ipc/llm-handlers.ts index 11f73ed..5ac8036 100644 --- a/apps/desktop/src/main/ipc/llm-handlers.ts +++ b/apps/desktop/src/main/ipc/llm-handlers.ts @@ -1,12 +1,12 @@ // src/main/ipc/llm-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getLocalLLMService } from '../services/LocalLLMService' import { configGet, configSet } from '../services/ConfigService' import { getMainWindow } from '../windows/WindowManager' -import type { SetLLMModelParams, SetServerUrlParams, LLMProcessParams } from '@shared/types' +import type { SetLLMModelParams, SetServerUrlParams, LLMProcessParams } from '@d3ro/core/types' export function registerLLMHandlers(): void { // LLM 가용성 변경 시 렌더러에 상태 전파 diff --git a/apps/desktop/src/main/ipc/meeting-doc-template-handlers.ts b/apps/desktop/src/main/ipc/meeting-doc-template-handlers.ts index a6db9c3..2cf788c 100644 --- a/apps/desktop/src/main/ipc/meeting-doc-template-handlers.ts +++ b/apps/desktop/src/main/ipc/meeting-doc-template-handlers.ts @@ -2,15 +2,15 @@ // Phase 14.5: Meeting Document Template IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getMeetingDocTemplateService } from '../services/MeetingDocTemplateService' import { getLogger } from '../services/LoggerService' import type { CreateMeetingDocTemplateParams, UpdateMeetingDocTemplateParams, DeleteMeetingDocTemplateParams, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('meeting-doc-template-handlers') diff --git a/apps/desktop/src/main/ipc/meeting-mode-handlers.ts b/apps/desktop/src/main/ipc/meeting-mode-handlers.ts index 5c89014..80e1bab 100644 --- a/apps/desktop/src/main/ipc/meeting-mode-handlers.ts +++ b/apps/desktop/src/main/ipc/meeting-mode-handlers.ts @@ -2,8 +2,8 @@ // Phase 14 / 14.5: Meeting Mode IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getMeetingModeService } from '../services/MeetingModeService' import { getLogger } from '../services/LoggerService' import type { @@ -15,7 +15,7 @@ import type { MeetingGenerateDocParams, MeetingExportFormat, MeetingChatSendParams, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('meeting-mode-handlers') diff --git a/apps/desktop/src/main/ipc/meeting-summary-handlers.ts b/apps/desktop/src/main/ipc/meeting-summary-handlers.ts index 35f0113..354a293 100644 --- a/apps/desktop/src/main/ipc/meeting-summary-handlers.ts +++ b/apps/desktop/src/main/ipc/meeting-summary-handlers.ts @@ -2,11 +2,11 @@ // Phase 12.2: 회의록 요약 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getMeetingSummaryService } from '../services/MeetingSummaryService' import { getLogger } from '../services/LoggerService' -import type { MeetingSummarizeParams, MeetingSummaryGetParams, MeetingSummaryExportParams } from '@shared/types' +import type { MeetingSummarizeParams, MeetingSummaryGetParams, MeetingSummaryExportParams } from '@d3ro/core/types' const logger = getLogger('meeting-summary-handlers') diff --git a/apps/desktop/src/main/ipc/memo-handlers.ts b/apps/desktop/src/main/ipc/memo-handlers.ts index ddb92e3..2a70592 100644 --- a/apps/desktop/src/main/ipc/memo-handlers.ts +++ b/apps/desktop/src/main/ipc/memo-handlers.ts @@ -2,8 +2,8 @@ // Phase 10.3: 음성 메모 태그 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode, D3ROError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode, D3ROError } from '@d3ro/core/errors' import { getMemoService } from '../services/MemoService' import type { GetTagsParams, @@ -11,7 +11,7 @@ import type { RemoveTagParams, SearchByTagParams, ExportMemoParams -} from '@shared/types' +} from '@d3ro/core/types' export function registerMemoHandlers(): void { ipcMain.handle(IPC_CHANNELS.MEMO.GET_TAGS, async (_event, params: GetTagsParams) => { diff --git a/apps/desktop/src/main/ipc/rag-handlers.ts b/apps/desktop/src/main/ipc/rag-handlers.ts index 2478ed1..098f884 100644 --- a/apps/desktop/src/main/ipc/rag-handlers.ts +++ b/apps/desktop/src/main/ipc/rag-handlers.ts @@ -2,11 +2,11 @@ // Phase 13.2: 로컬 RAG IPC 핸들러 import { ipcMain, dialog } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getRAGService } from '../services/RAGService' import { getLogger } from '../services/LoggerService' -import type { RAGQueryParams, RAGRemoveDocumentParams } from '@shared/types' +import type { RAGQueryParams, RAGRemoveDocumentParams } from '@d3ro/core/types' const logger = getLogger('rag-handlers') diff --git a/apps/desktop/src/main/ipc/stt-handlers.ts b/apps/desktop/src/main/ipc/stt-handlers.ts index 324882d..a030412 100644 --- a/apps/desktop/src/main/ipc/stt-handlers.ts +++ b/apps/desktop/src/main/ipc/stt-handlers.ts @@ -1,11 +1,11 @@ // src/main/ipc/stt-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getLocalSTTService } from '../services/LocalSTTService' import { configGet, configSet } from '../services/ConfigService' -import type { SetSTTModelParams, SetSTTLanguageParams } from '@shared/types' +import type { SetSTTModelParams, SetSTTLanguageParams } from '@d3ro/core/types' export function registerSTTHandlers(): void { ipcMain.handle(IPC_CHANNELS.STT.GET_STATUS, async () => { diff --git a/apps/desktop/src/main/ipc/system-handlers.ts b/apps/desktop/src/main/ipc/system-handlers.ts index 17deced..5d6dcbb 100644 --- a/apps/desktop/src/main/ipc/system-handlers.ts +++ b/apps/desktop/src/main/ipc/system-handlers.ts @@ -1,9 +1,9 @@ // src/main/ipc/system-handlers.ts import { ipcMain, app, systemPreferences } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess } from '@shared/errors' -import type { PermissionStatus, PlaySoundParams, SetSoundEnabledParams } from '@shared/types' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess } from '@d3ro/core/errors' +import type { PermissionStatus, PlaySoundParams, SetSoundEnabledParams } from '@d3ro/core/types' import { getSoundEffectService } from '../services/SoundEffectService' export function registerSystemHandlers(): void { diff --git a/apps/desktop/src/main/ipc/template-handlers.ts b/apps/desktop/src/main/ipc/template-handlers.ts index 87a9132..41d53a0 100644 --- a/apps/desktop/src/main/ipc/template-handlers.ts +++ b/apps/desktop/src/main/ipc/template-handlers.ts @@ -2,8 +2,8 @@ // Phase 12.3: 딕테이션 템플릿 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getDictationTemplateService } from '../services/DictationTemplateService' import { getLogger } from '../services/LoggerService' import type { @@ -12,7 +12,7 @@ import type { DeleteTemplateParams, StartTemplateSessionParams, SetFieldValueParams, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('template-handlers') @@ -33,7 +33,7 @@ export function registerTemplateHandlers(): void { // 라이센스 체크 try { const { getLicenseService } = await import('../services/LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.DICTATION_TEMPLATE) if (!access.allowed) { diff --git a/apps/desktop/src/main/ipc/voice-action-handlers.ts b/apps/desktop/src/main/ipc/voice-action-handlers.ts index c966f64..8897af2 100644 --- a/apps/desktop/src/main/ipc/voice-action-handlers.ts +++ b/apps/desktop/src/main/ipc/voice-action-handlers.ts @@ -2,11 +2,11 @@ // Phase 13.3: OS 자동화 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getVoiceActionService } from '../services/VoiceActionService' import { getLogger } from '../services/LoggerService' -import type { VoiceActionExecuteParams } from '@shared/types' +import type { VoiceActionExecuteParams } from '@d3ro/core/types' const logger = getLogger('voice-action-handlers') diff --git a/apps/desktop/src/main/ipc/voice-command-handlers.ts b/apps/desktop/src/main/ipc/voice-command-handlers.ts index fa497eb..0ae1148 100644 --- a/apps/desktop/src/main/ipc/voice-command-handlers.ts +++ b/apps/desktop/src/main/ipc/voice-command-handlers.ts @@ -2,10 +2,10 @@ // Phase 10.5: 음성 단축키 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getVoiceCommandService } from '../services/VoiceCommandService' -import type { SetVoiceCommandKeywordsParams, SetVoiceCommandEnabledParams } from '@shared/types' +import type { SetVoiceCommandKeywordsParams, SetVoiceCommandEnabledParams } from '@d3ro/core/types' export function registerVoiceCommandHandlers(): void { const CH = IPC_CHANNELS.VOICE_COMMAND diff --git a/apps/desktop/src/main/ipc/voice-conversation-handlers.ts b/apps/desktop/src/main/ipc/voice-conversation-handlers.ts index cfc9141..9c92be3 100644 --- a/apps/desktop/src/main/ipc/voice-conversation-handlers.ts +++ b/apps/desktop/src/main/ipc/voice-conversation-handlers.ts @@ -2,11 +2,11 @@ // Phase 13.1: 음성 대화 모드 IPC 핸들러 import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ErrorCode, ipcSuccess, ipcError } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ErrorCode, ipcSuccess, ipcError } from '@d3ro/core/errors' import { getVoiceConversationService } from '../services/VoiceConversationService' import { getLogger } from '../services/LoggerService' -import type { ConversationSendParams } from '@shared/types' +import type { ConversationSendParams } from '@d3ro/core/types' const logger = getLogger('voice-conversation-handlers') diff --git a/apps/desktop/src/main/ipc/voice-handlers.ts b/apps/desktop/src/main/ipc/voice-handlers.ts index cac9f15..bbf5473 100644 --- a/apps/desktop/src/main/ipc/voice-handlers.ts +++ b/apps/desktop/src/main/ipc/voice-handlers.ts @@ -1,10 +1,10 @@ // src/main/ipc/voice-handlers.ts import { ipcMain } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors' import { getVoiceModeService } from '../services/VoiceModeService' -import type { StartRecordingParams, StopRecordingParams, CancelRecordingParams, SetVoiceModeParams } from '@shared/types' +import type { StartRecordingParams, StopRecordingParams, CancelRecordingParams, SetVoiceModeParams } from '@d3ro/core/types' export function registerVoiceHandlers(): void { ipcMain.handle(IPC_CHANNELS.VOICE.START_RECORDING, async (_event, params: StartRecordingParams) => { diff --git a/apps/desktop/src/main/ipc/window-handlers.ts b/apps/desktop/src/main/ipc/window-handlers.ts index 3e65547..c7dfed1 100644 --- a/apps/desktop/src/main/ipc/window-handlers.ts +++ b/apps/desktop/src/main/ipc/window-handlers.ts @@ -1,8 +1,8 @@ // src/main/ipc/window-handlers.ts import { ipcMain, shell } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { ipcSuccess } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { ipcSuccess } from '@d3ro/core/errors' import { getMainWindow, hideResultPopup, hideRecordingTip } from '../windows/WindowManager' export function registerWindowHandlers(): void { diff --git a/apps/desktop/src/main/services/AudioCaptureService.ts b/apps/desktop/src/main/services/AudioCaptureService.ts index 90ea84f..ac2cd46 100644 --- a/apps/desktop/src/main/services/AudioCaptureService.ts +++ b/apps/desktop/src/main/services/AudioCaptureService.ts @@ -10,9 +10,9 @@ import type { Readable } from 'stream' import { getLogger } from './LoggerService' import { configGet } from './ConfigService' import { getSoxPath } from '../utils/paths' -import type { AudioDevice } from '@shared/types' -import { AUDIO_FORMAT, TIMING } from '@shared/constants' -import { D3ROError, ErrorCode } from '@shared/errors' +import type { AudioDevice } from '@d3ro/core/types' +import { AUDIO_FORMAT, TIMING } from '@d3ro/core/constants' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' const logger = getLogger('AudioCaptureService') diff --git a/apps/desktop/src/main/services/CaptionService.ts b/apps/desktop/src/main/services/CaptionService.ts index dac9e63..cf8ea51 100644 --- a/apps/desktop/src/main/services/CaptionService.ts +++ b/apps/desktop/src/main/services/CaptionService.ts @@ -15,14 +15,14 @@ import { hideCaptionOverlay, sendToCaptionOverlay, } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { CaptionState, CaptionSegment, CaptionConfig, CaptionSessionSummary, -} from '@shared/types' +} from '@d3ro/core/types' import { getMainWindow } from '../windows/WindowManager' const logger = getLogger('CaptionService') @@ -139,7 +139,7 @@ class CaptionService extends EventEmitter { this._totalFrameCount = 0 // ConfigService에서 저장된 오디오 소스 읽기 - const savedSource = configGet('captionAudioSource' as keyof import('@shared/types').AppConfig) as unknown as string + const savedSource = configGet('captionAudioSource' as keyof import('@d3ro/core/types').AppConfig) as unknown as string if (savedSource && (savedSource === 'mic' || savedSource === 'system' || savedSource === 'both')) { this._config.audioSource = savedSource as 'mic' | 'system' | 'both' } diff --git a/apps/desktop/src/main/services/ChainService.ts b/apps/desktop/src/main/services/ChainService.ts index ba1532c..c5ec9c2 100644 --- a/apps/desktop/src/main/services/ChainService.ts +++ b/apps/desktop/src/main/services/ChainService.ts @@ -8,8 +8,8 @@ import { configGet } from './ConfigService' import { getCustomInstructionService } from './CustomInstructionService' import { getLocalLLMService } from './LocalLLMService' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { LLMChain, ChainStep, @@ -17,7 +17,7 @@ import type { UpdateChainParams, ChainProgress, ChainExecutionResult -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('chain-service') diff --git a/apps/desktop/src/main/services/ConfigService.ts b/apps/desktop/src/main/services/ConfigService.ts index 6c9e481..4f6c750 100644 --- a/apps/desktop/src/main/services/ConfigService.ts +++ b/apps/desktop/src/main/services/ConfigService.ts @@ -2,7 +2,7 @@ // electron-store 기반 설정 관리. 설계서 02의 AppConfig 타입 사용. import { EventEmitter } from 'events' -import type { AppConfig, ConfigChangedEvent } from '@shared/types' +import type { AppConfig, ConfigChangedEvent } from '@d3ro/core/types' import { getLogger } from './LoggerService' const logger = getLogger('ConfigService') diff --git a/apps/desktop/src/main/services/DictationTemplateService.ts b/apps/desktop/src/main/services/DictationTemplateService.ts index 90e80ef..6f59d94 100644 --- a/apps/desktop/src/main/services/DictationTemplateService.ts +++ b/apps/desktop/src/main/services/DictationTemplateService.ts @@ -7,8 +7,8 @@ import { nanoid } from 'nanoid' import Store from 'electron-store' import { getLogger } from './LoggerService' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { DictationTemplate, TemplateField, @@ -18,7 +18,7 @@ import type { TemplateSessionCompletedEvent, CreateTemplateParams, UpdateTemplateParams, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('DictationTemplateService') diff --git a/apps/desktop/src/main/services/DictionaryService.ts b/apps/desktop/src/main/services/DictionaryService.ts index 7774892..bade304 100644 --- a/apps/desktop/src/main/services/DictionaryService.ts +++ b/apps/desktop/src/main/services/DictionaryService.ts @@ -14,7 +14,7 @@ import type { DictionaryAddParams, DictionaryUpdateParams, DictionarySearchParams -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('DictionaryService') diff --git a/apps/desktop/src/main/services/FileTranscriptionService.ts b/apps/desktop/src/main/services/FileTranscriptionService.ts index 09f0631..b9189d3 100644 --- a/apps/desktop/src/main/services/FileTranscriptionService.ts +++ b/apps/desktop/src/main/services/FileTranscriptionService.ts @@ -13,15 +13,15 @@ import { getHistoryService } from './HistoryService' import { configGet } from './ConfigService' import { getFfmpegPath } from '../utils/paths' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { FileTranscriptionState, FileTranscriptionProgress, FileTranscriptionResult, FileTranscriptionSegment, FileTranscriptionStateInfo, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('FileTranscriptionService') @@ -75,7 +75,7 @@ class FileTranscriptionService extends EventEmitter { // 라이센스 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.FILE_TRANSCRIPTION) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/HistoryService.ts b/apps/desktop/src/main/services/HistoryService.ts index fe83bcc..09a31e0 100644 --- a/apps/desktop/src/main/services/HistoryService.ts +++ b/apps/desktop/src/main/services/HistoryService.ts @@ -13,7 +13,7 @@ import type { HistoryPage, HistorySearchParams, StatsSummary -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('HistoryService') diff --git a/apps/desktop/src/main/services/HotkeyService.ts b/apps/desktop/src/main/services/HotkeyService.ts index eb71a4c..26d1fde 100644 --- a/apps/desktop/src/main/services/HotkeyService.ts +++ b/apps/desktop/src/main/services/HotkeyService.ts @@ -7,9 +7,9 @@ import { uIOhook, UiohookKey } from 'uiohook-napi' import type { UiohookKeyboardEvent } from 'uiohook-napi' import { getLogger } from './LoggerService' import { configGet } from './ConfigService' -import { D3ROError, ErrorCode } from '@shared/errors' -import { TIMING } from '@shared/constants' -import type { HotkeyBinding } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import { TIMING } from '@d3ro/core/constants' +import type { HotkeyBinding } from '@d3ro/core/types' const logger = getLogger('HotkeyService') diff --git a/apps/desktop/src/main/services/LicenseService.ts b/apps/desktop/src/main/services/LicenseService.ts index 39b50fe..bbad399 100644 --- a/apps/desktop/src/main/services/LicenseService.ts +++ b/apps/desktop/src/main/services/LicenseService.ts @@ -8,7 +8,7 @@ import { eq, and } from 'drizzle-orm' import { getLogger } from './LoggerService' import { getDatabase } from '../db' import { dailyUsage } from '../db/schema' -import { D3ROError, ErrorCode } from '@shared/errors' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { LicenseTier, LicenseInfo, @@ -17,8 +17,8 @@ import type { UpgradePromptEvent, ActivateLicenseResult, TierComparison, -} from '@shared/types' -import { Feature } from '@shared/types' +} from '@d3ro/core/types' +import { Feature } from '@d3ro/core/types' const logger = getLogger('license') diff --git a/apps/desktop/src/main/services/LocalLLMService.ts b/apps/desktop/src/main/services/LocalLLMService.ts index 58cdb3d..39b3625 100644 --- a/apps/desktop/src/main/services/LocalLLMService.ts +++ b/apps/desktop/src/main/services/LocalLLMService.ts @@ -8,8 +8,8 @@ import * as fs from 'fs' import * as path from 'path' import { getLogger } from './LoggerService' import { configGet } from './ConfigService' -import { D3ROError, ErrorCode } from '@shared/errors' -import type { LLMStatus, LLMModel, LLMAction, LLMConnectionState } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import type { LLMStatus, LLMModel, LLMAction, LLMConnectionState } from '@d3ro/core/types' const logger = getLogger('LocalLLMService') @@ -410,7 +410,7 @@ class LocalLLMService extends EventEmitter { // Phase 11: LLM 처리 쿼터 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.LLM_PROCESS) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/LocalSTTService.ts b/apps/desktop/src/main/services/LocalSTTService.ts index 4a070e6..60d134d 100644 --- a/apps/desktop/src/main/services/LocalSTTService.ts +++ b/apps/desktop/src/main/services/LocalSTTService.ts @@ -8,8 +8,8 @@ import { type ChildProcess, spawn } from 'child_process' import { getLogger } from './LoggerService' import { configGet } from './ConfigService' import { getSidecarCommand } from '../utils/paths' -import { D3ROError, ErrorCode } from '@shared/errors' -import type { STTModel, STTStatus, STTEngineState } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import type { STTModel, STTStatus, STTEngineState } from '@d3ro/core/types' // ── 내부 타입 정의 ──────────────────────────────────────── diff --git a/apps/desktop/src/main/services/MeetingDocTemplateService.ts b/apps/desktop/src/main/services/MeetingDocTemplateService.ts index 51204df..e54fa61 100644 --- a/apps/desktop/src/main/services/MeetingDocTemplateService.ts +++ b/apps/desktop/src/main/services/MeetingDocTemplateService.ts @@ -5,13 +5,13 @@ import { EventEmitter } from 'events' import { nanoid } from 'nanoid' import Store from 'electron-store' import { getLogger } from './LoggerService' -import { D3ROError, ErrorCode } from '@shared/errors' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { MeetingDocTemplate, CreateMeetingDocTemplateParams, UpdateMeetingDocTemplateParams, MeetingDocTemplateType, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('MeetingDocTemplateService') diff --git a/apps/desktop/src/main/services/MeetingModeService.ts b/apps/desktop/src/main/services/MeetingModeService.ts index d5bde69..bc8718f 100644 --- a/apps/desktop/src/main/services/MeetingModeService.ts +++ b/apps/desktop/src/main/services/MeetingModeService.ts @@ -12,8 +12,8 @@ import { configGet, configSet } from './ConfigService' import { getMainWindow } from '../windows/WindowManager' import { getDatabase } from '../db' import { meetingSessions, meetingMemos, meetingDocuments } from '../db/schema' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import { parseMinutes, buildExportMarkdown, @@ -21,8 +21,8 @@ import { formatTime, formatDateFile, formatDateRange, -} from '../utils/meeting-markdown' -import { markdownToDocx } from '../utils/markdown-to-docx' +} from '@d3ro/core/utils/meeting-markdown' +import { markdownToDocx } from '@d3ro/core/utils/markdown-to-docx' import type { MeetingModeState, MeetingMemo, @@ -39,7 +39,7 @@ import type { MeetingExportFormat, MeetingDocGeneratingProgress, CaptionSegment, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('MeetingModeService') @@ -145,7 +145,7 @@ class MeetingModeService extends EventEmitter { // 회의 모드는 마이크 캡처 강제 — ConfigService 값도 임시 변경 // (CaptionService.start()가 ConfigService에서 다시 읽기 때문) - type AppConfigKey = keyof import('@shared/types').AppConfig + type AppConfigKey = keyof import('@d3ro/core/types').AppConfig const prevAudioSource = configGet('captionAudioSource' as AppConfigKey) as unknown as string configSet('captionAudioSource' as AppConfigKey, 'mic' as never) diff --git a/apps/desktop/src/main/services/MeetingSummaryService.ts b/apps/desktop/src/main/services/MeetingSummaryService.ts index 286eafd..ad7d2e7 100644 --- a/apps/desktop/src/main/services/MeetingSummaryService.ts +++ b/apps/desktop/src/main/services/MeetingSummaryService.ts @@ -12,9 +12,9 @@ import { getLocalLLMService } from './LocalLLMService' import { getDatabase } from '../db' import { history } from '../db/schema' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' -import type { MeetingSummaryResult, MeetingSummaryProgress } from '@shared/types' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import type { MeetingSummaryResult, MeetingSummaryProgress } from '@d3ro/core/types' const logger = getLogger('MeetingSummaryService') @@ -41,7 +41,7 @@ class MeetingSummaryService extends EventEmitter { // 라이센스 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.MEETING_SUMMARY) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/MemoService.ts b/apps/desktop/src/main/services/MemoService.ts index 6d23333..ba04a21 100644 --- a/apps/desktop/src/main/services/MemoService.ts +++ b/apps/desktop/src/main/services/MemoService.ts @@ -10,7 +10,7 @@ import { getDatabase } from '../db' import { memoTags, history } from '../db/schema' import type { MemoTagRow } from '../db/schema' import { getLogger } from './LoggerService' -import { D3ROError, ErrorCode } from '@shared/errors' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { MemoTag, TagCount, @@ -18,7 +18,7 @@ import type { ExportMemoParams, HistoryEntry, HistoryPage -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('MemoService') diff --git a/apps/desktop/src/main/services/RAGService.ts b/apps/desktop/src/main/services/RAGService.ts index 7e42230..772a369 100644 --- a/apps/desktop/src/main/services/RAGService.ts +++ b/apps/desktop/src/main/services/RAGService.ts @@ -13,15 +13,15 @@ import { configGet } from './ConfigService' import { getDatabase } from '../db' import { ragDocuments, ragChunks } from '../db/schema' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { RAGDocument, RAGQueryResult, RAGState, RAGStateInfo, RAGIndexProgress, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('RAGService') @@ -74,7 +74,7 @@ class RAGService extends EventEmitter { // 라이센스 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.LOCAL_RAG) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/ScreenContextService.ts b/apps/desktop/src/main/services/ScreenContextService.ts index af6dba6..4d52f36 100644 --- a/apps/desktop/src/main/services/ScreenContextService.ts +++ b/apps/desktop/src/main/services/ScreenContextService.ts @@ -5,8 +5,8 @@ import { clipboard } from 'electron' import { getLogger } from './LoggerService' import { configGet, configSet } from './ConfigService' -import { D3ROError, ErrorCode } from '@shared/errors' -import type { ScreenContext, CaptureContextResult } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import type { ScreenContext, CaptureContextResult } from '@d3ro/core/types' const logger = getLogger('screen-context') diff --git a/apps/desktop/src/main/services/TTSPlaybackService.ts b/apps/desktop/src/main/services/TTSPlaybackService.ts index 7231eb3..7eda1a8 100644 --- a/apps/desktop/src/main/services/TTSPlaybackService.ts +++ b/apps/desktop/src/main/services/TTSPlaybackService.ts @@ -7,7 +7,7 @@ import { EventEmitter } from 'events' import { spawn, type ChildProcess } from 'child_process' import { getLogger } from './LoggerService' import { configGet } from './ConfigService' -import { D3ROError, ErrorCode } from '@shared/errors' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' const logger = getLogger('TTSPlaybackService') diff --git a/apps/desktop/src/main/services/TextInsertService.ts b/apps/desktop/src/main/services/TextInsertService.ts index 47da68b..52fdc69 100644 --- a/apps/desktop/src/main/services/TextInsertService.ts +++ b/apps/desktop/src/main/services/TextInsertService.ts @@ -6,7 +6,7 @@ import { EventEmitter } from 'events' import { clipboard } from 'electron' import { getLogger } from './LoggerService' -import { D3ROError, ErrorCode } from '@shared/errors' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' const logger = getLogger('TextInsertService') diff --git a/apps/desktop/src/main/services/VoiceActionService.ts b/apps/desktop/src/main/services/VoiceActionService.ts index b0edbc2..b951e68 100644 --- a/apps/desktop/src/main/services/VoiceActionService.ts +++ b/apps/desktop/src/main/services/VoiceActionService.ts @@ -10,8 +10,8 @@ import { getLogger } from './LoggerService' import { getLocalLLMService } from './LocalLLMService' import { configGet } from './ConfigService' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { VoiceActionPlan, VoiceActionPreset, @@ -19,7 +19,7 @@ import type { VoiceActionPlannedEvent, VoiceActionExecutedEvent, VoiceActionErrorEvent, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('VoiceActionService') @@ -112,7 +112,7 @@ class VoiceActionService extends EventEmitter { // 라이센스 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.OS_AUTOMATION) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/VoiceCommandService.ts b/apps/desktop/src/main/services/VoiceCommandService.ts index 9d6e2d8..fa6f99d 100644 --- a/apps/desktop/src/main/services/VoiceCommandService.ts +++ b/apps/desktop/src/main/services/VoiceCommandService.ts @@ -10,7 +10,7 @@ import type { VoiceCommandKeyword, VoiceCommandMatch, KeywordMatchMode -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('voice-command') diff --git a/apps/desktop/src/main/services/VoiceConversationService.ts b/apps/desktop/src/main/services/VoiceConversationService.ts index 4ce9004..3c83bda 100644 --- a/apps/desktop/src/main/services/VoiceConversationService.ts +++ b/apps/desktop/src/main/services/VoiceConversationService.ts @@ -11,8 +11,8 @@ import { getAudioCaptureService } from './AudioCaptureService' import { getTTSPlaybackService } from './TTSPlaybackService' import { configGet } from './ConfigService' import { getMainWindow } from '../windows/WindowManager' -import { IPC_CHANNELS } from '@shared/ipc-channels' -import { D3ROError, ErrorCode } from '@shared/errors' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' import type { ConversationState, ConversationMessage, @@ -20,7 +20,7 @@ import type { ConversationAssistantDelta, ConversationAssistantMessage, ConversationError, -} from '@shared/types' +} from '@d3ro/core/types' const logger = getLogger('VoiceConversationService') @@ -67,7 +67,7 @@ class VoiceConversationService extends EventEmitter { // 라이센스 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.VOICE_CONVERSATION) if (!access.allowed) { diff --git a/apps/desktop/src/main/services/VoiceModeService.ts b/apps/desktop/src/main/services/VoiceModeService.ts index 9f63eb3..f9e0c57 100644 --- a/apps/desktop/src/main/services/VoiceModeService.ts +++ b/apps/desktop/src/main/services/VoiceModeService.ts @@ -17,10 +17,10 @@ import type { HotkeyConfig } from './HotkeyService' import { configGet } from './ConfigService' import { getTextInsertService } from './TextInsertService' import { getLocalLLMService } from './LocalLLMService' -import { D3ROError, ErrorCode } from '@shared/errors' -import { TIMING } from '@shared/constants' -import { RecognitionState, AudioState } from '@shared/types' -import type { VoiceMode, VoiceState } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import { TIMING } from '@d3ro/core/constants' +import { RecognitionState, AudioState } from '@d3ro/core/types' +import type { VoiceMode, VoiceState } from '@d3ro/core/types' import { showRecordingTip, hideRecordingTip, @@ -28,7 +28,7 @@ import { sendAudioLevelToTip, showResultPopup, } from '../windows/WindowManager' -import type { ScreenContext } from '@shared/types' +import type { ScreenContext } from '@d3ro/core/types' const logger = getLogger('VoiceModeService') @@ -189,7 +189,7 @@ class VoiceModeService extends EventEmitter { // Phase 11: 라이센스 쿼터 체크 try { const { getLicenseService } = await import('./LicenseService') - const { Feature } = await import('@shared/types') + const { Feature } = await import('@d3ro/core/types') const license = getLicenseService() const access = license.canUse(Feature.DICTATION) if (!access.allowed) { @@ -220,7 +220,7 @@ class VoiceModeService extends EventEmitter { const { getScreenContextService } = await import('./ScreenContextService') const ctx = getScreenContextService() if (ctx.isEnabled()) { - const captureSelected = configGet('screenContextEnabled' as keyof import('@shared/types').AppConfig) as unknown as boolean + const captureSelected = configGet('screenContextEnabled' as keyof import('@d3ro/core/types').AppConfig) as unknown as boolean const result = await ctx.captureContext(captureSelected) screenContext = result.context logger.info(`Screen context captured: ${screenContext.appName ?? 'unknown'}`) @@ -555,7 +555,7 @@ class VoiceModeService extends EventEmitter { if (action === 'chain') { try { const { getChainService } = await import('./ChainService') - const activeChainId = configGet('activeChainId' as keyof import('@shared/types').AppConfig) as unknown as string + const activeChainId = configGet('activeChainId' as keyof import('@d3ro/core/types').AppConfig) as unknown as string if (activeChainId) { const chainResult = await getChainService().execute(activeChainId, contextPrefix + transcribedText) if (this._isInTerminalState()) return @@ -572,7 +572,7 @@ class VoiceModeService extends EventEmitter { // 음성 단축키 오버라이드 또는 활성 명령어 const effectiveInstructionId = overrideInstructionId - ?? (configGet('activeInstructionId' as keyof import('@shared/types').AppConfig) as unknown as string) + ?? (configGet('activeInstructionId' as keyof import('@d3ro/core/types').AppConfig) as unknown as string) if (action === 'custom' || overrideInstructionId) { let customPrompt = contextPrefix + transcribedText diff --git a/apps/desktop/src/main/utils/feature-gate.ts b/apps/desktop/src/main/utils/feature-gate.ts index fbe786d..19b5039 100644 --- a/apps/desktop/src/main/utils/feature-gate.ts +++ b/apps/desktop/src/main/utils/feature-gate.ts @@ -3,9 +3,9 @@ // 서비스에서 기능 사용 전 호출하여 접근 권한 확인 + 쿼터 차단 import { getLicenseService } from '../services/LicenseService' -import { D3ROError, ErrorCode } from '@shared/errors' -import type { FeatureAccess } from '@shared/types' -import { Feature } from '@shared/types' +import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import type { FeatureAccess } from '@d3ro/core/types' +import { Feature } from '@d3ro/core/types' /** * 기능 접근 권한을 확인하고, 불가 시 D3ROError를 throw한다. diff --git a/apps/desktop/src/main/windows/WindowManager.ts b/apps/desktop/src/main/windows/WindowManager.ts index 02e5763..d15560f 100644 --- a/apps/desktop/src/main/windows/WindowManager.ts +++ b/apps/desktop/src/main/windows/WindowManager.ts @@ -4,7 +4,7 @@ import { BrowserWindow, shell, screen, ipcMain, Menu } from 'electron' import { join } from 'path' import { is } from '@electron-toolkit/utils' -import { WINDOW_SIZE } from '@shared/constants' +import { WINDOW_SIZE } from '@d3ro/core/constants' import { getLogger } from '../services/LoggerService' import { getIsQuitting } from '../lifecycle' import { configGet } from '../services/ConfigService' diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.ts index f118139..bb69760 100644 --- a/apps/desktop/src/preload/index.ts +++ b/apps/desktop/src/preload/index.ts @@ -2,7 +2,7 @@ // contextBridge로 렌더러에 노출할 API 정의 import { contextBridge, ipcRenderer } from 'electron' -import { IPC_CHANNELS } from '@shared/ipc-channels' +import { IPC_CHANNELS } from '@d3ro/core/ipc-channels' import type { AudioDevice, SetDeviceParams, @@ -166,9 +166,9 @@ import type { MeetingChatSendParams, MeetingChatDelta, DiarizeSessionParams, -} from '@shared/types' -import { Feature } from '@shared/types' -import type { IPCResult } from '@shared/errors' +} from '@d3ro/core/types' +import { Feature } from '@d3ro/core/types' +import type { IPCResult } from '@d3ro/core/errors' type Unsubscribe = () => void diff --git a/apps/desktop/src/renderer/App.tsx b/apps/desktop/src/renderer/App.tsx index 7df1855..64397bf 100644 --- a/apps/desktop/src/renderer/App.tsx +++ b/apps/desktop/src/renderer/App.tsx @@ -9,7 +9,7 @@ import { I18nProvider } from './i18n' import { AppLayout } from './components/AppLayout' import { UpgradePromptModal } from './components/UpgradePromptModal' import { startSystemAudioCapture, stopSystemAudioCapture } from './utils/systemAudioCapture' -import type { ThemeMode, ConfigChangedEvent } from '@shared/types' +import type { ThemeMode, ConfigChangedEvent } from '@d3ro/core/types' export function App(): React.ReactElement { const [themeMode, setThemeMode] = useState('auto') diff --git a/apps/desktop/src/renderer/components/AppLayout.tsx b/apps/desktop/src/renderer/components/AppLayout.tsx index b961e78..1fb9893 100644 --- a/apps/desktop/src/renderer/components/AppLayout.tsx +++ b/apps/desktop/src/renderer/components/AppLayout.tsx @@ -26,7 +26,7 @@ import { StatusBar } from './StatusBar' import { d3roPalette, d3roFontMono, d3roTypo, d3roShadow, d3roRadius } from '../theme' import { useI18n } from '../i18n' import type { TranslationKey } from '../i18n' -import type { LicenseTier } from '@shared/types' +import type { LicenseTier } from '@d3ro/core/types' type Route = 'dashboard' | 'history' | 'dictionary' | 'commands' | 'conversation' | 'knowledge' | 'meeting' diff --git a/apps/desktop/src/renderer/components/FileDropZone.tsx b/apps/desktop/src/renderer/components/FileDropZone.tsx index 02ac956..6f86a87 100644 --- a/apps/desktop/src/renderer/components/FileDropZone.tsx +++ b/apps/desktop/src/renderer/components/FileDropZone.tsx @@ -13,7 +13,7 @@ import type { FileTranscriptionProgress, FileTranscriptionResult, FileTranscriptionState, -} from '@shared/types' +} from '@d3ro/core/types' const SUPPORTED_EXTENSIONS = [ '.mp3', '.wav', '.m4a', '.ogg', '.flac', '.wma', '.aac', diff --git a/apps/desktop/src/renderer/components/HotkeyRecordModal.tsx b/apps/desktop/src/renderer/components/HotkeyRecordModal.tsx index 849db25..f0f0dda 100644 --- a/apps/desktop/src/renderer/components/HotkeyRecordModal.tsx +++ b/apps/desktop/src/renderer/components/HotkeyRecordModal.tsx @@ -17,7 +17,7 @@ import { } from '@mui/material' import { d3roPalette } from '../theme' import { useI18n } from '../i18n' -import type { HotkeyBinding } from '@shared/types' +import type { HotkeyBinding } from '@d3ro/core/types' // ── 키 이름 매핑 (Windows) ────────────────────────────── const KEY_DISPLAY_MAP: Record = { diff --git a/apps/desktop/src/renderer/components/LicenseModal.tsx b/apps/desktop/src/renderer/components/LicenseModal.tsx index 21e7037..d1b68d4 100644 --- a/apps/desktop/src/renderer/components/LicenseModal.tsx +++ b/apps/desktop/src/renderer/components/LicenseModal.tsx @@ -24,7 +24,7 @@ import CancelIcon from '@mui/icons-material/Cancel' import { MetalCard, PhosphorText, Led, ScreenPanel, PhysicalButton } from './ds' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius, d3roShadow } from '../theme' import { useI18n } from '../i18n' -import type { LicenseInfo, LicenseTier, TierComparison, UsageQuota } from '@shared/types' +import type { LicenseInfo, LicenseTier, TierComparison, UsageQuota } from '@d3ro/core/types' interface LicenseModalProps { open: boolean diff --git a/apps/desktop/src/renderer/components/LicenseTab.tsx b/apps/desktop/src/renderer/components/LicenseTab.tsx index 16d89ce..b3da07a 100644 --- a/apps/desktop/src/renderer/components/LicenseTab.tsx +++ b/apps/desktop/src/renderer/components/LicenseTab.tsx @@ -20,7 +20,7 @@ import type { UsageQuota, TierComparison, ActivateLicenseResult, -} from '@shared/types' +} from '@d3ro/core/types' export function LicenseTab(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/components/OnboardingModal.tsx b/apps/desktop/src/renderer/components/OnboardingModal.tsx index 3c6c14d..c68a452 100644 --- a/apps/desktop/src/renderer/components/OnboardingModal.tsx +++ b/apps/desktop/src/renderer/components/OnboardingModal.tsx @@ -19,7 +19,7 @@ import { d3roPalette, d3roFontMono, d3roShadow } from '../theme' import { Led } from './ds' import { HotkeyRecordModal } from './HotkeyRecordModal' import { useI18n } from '../i18n' -import type { HotkeyBinding, AudioDevice } from '@shared/types' +import type { HotkeyBinding, AudioDevice } from '@d3ro/core/types' interface OnboardingModalProps { open: boolean @@ -47,7 +47,7 @@ export function OnboardingModal({ open, onClose }: OnboardingModalProps): React. const handleFinish = () => { // 온보딩 완료 플래그 저장 - window.electronAPI.config.set({ key: 'onboardingCompleted' as keyof import('@shared/types').AppConfig, value: true as never }) + window.electronAPI.config.set({ key: 'onboardingCompleted' as keyof import('@d3ro/core/types').AppConfig, value: true as never }) onClose() } diff --git a/apps/desktop/src/renderer/components/ProBadge.tsx b/apps/desktop/src/renderer/components/ProBadge.tsx index b303ce3..e8c6dea 100644 --- a/apps/desktop/src/renderer/components/ProBadge.tsx +++ b/apps/desktop/src/renderer/components/ProBadge.tsx @@ -7,7 +7,7 @@ import LockIcon from '@mui/icons-material/Lock' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius } from '../theme' import { useProFeature } from '../hooks/useProFeature' import { useI18n } from '../i18n' -import type { Feature } from '@shared/types' +import type { Feature } from '@d3ro/core/types' interface ProBadgeProps { feature: Feature diff --git a/apps/desktop/src/renderer/components/SettingsModal.tsx b/apps/desktop/src/renderer/components/SettingsModal.tsx index 6e50535..ca31706 100644 --- a/apps/desktop/src/renderer/components/SettingsModal.tsx +++ b/apps/desktop/src/renderer/components/SettingsModal.tsx @@ -36,8 +36,8 @@ import { HotkeyRecordModal } from './HotkeyRecordModal' import { LicenseTab } from './LicenseTab' import { useI18n, LOCALE_META } from '../i18n' import type { Locale } from '../i18n' -import type { ThemeMode, AppConfig, HotkeyBinding, AudioDevice } from '@shared/types' -import { Feature } from '@shared/types' +import type { ThemeMode, AppConfig, HotkeyBinding, AudioDevice } from '@d3ro/core/types' +import { Feature } from '@d3ro/core/types' interface SettingsModalProps { open: boolean @@ -840,7 +840,7 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac size="small" onClick={() => { window.electronAPI.config.set({ - key: 'onboardingCompleted' as keyof import('@shared/types').AppConfig, + key: 'onboardingCompleted' as keyof import('@d3ro/core/types').AppConfig, value: false as never, }) onClose() diff --git a/apps/desktop/src/renderer/components/StatusBar.tsx b/apps/desktop/src/renderer/components/StatusBar.tsx index 2b65d69..ecf746b 100644 --- a/apps/desktop/src/renderer/components/StatusBar.tsx +++ b/apps/desktop/src/renderer/components/StatusBar.tsx @@ -9,7 +9,7 @@ import { Led } from './ds' import { d3roPalette, d3roFontMono, d3roTypo, d3roShadow, d3roRadius } from '../theme' import { OllamaGuideModal } from './OllamaGuideModal' import { useI18n } from '../i18n' -import type { LLMStatus } from '@shared/types' +import type { LLMStatus } from '@d3ro/core/types' export function StatusBar(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/components/TemplateSection.tsx b/apps/desktop/src/renderer/components/TemplateSection.tsx index 92caa3c..dcbfcde 100644 --- a/apps/desktop/src/renderer/components/TemplateSection.tsx +++ b/apps/desktop/src/renderer/components/TemplateSection.tsx @@ -11,7 +11,7 @@ import { MetalCard, PhosphorText, Led, PhysicalButton } from './ds' import { PageHeader, EmptyStateCard } from './shared' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius } from '../theme' import { useI18n } from '../i18n' -import type { DictationTemplate, TemplateField, TemplateSessionInfo } from '@shared/types' +import type { DictationTemplate, TemplateField, TemplateSessionInfo } from '@d3ro/core/types' export function TemplateSection(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/components/UpgradePromptModal.tsx b/apps/desktop/src/renderer/components/UpgradePromptModal.tsx index 129cc4b..a2a31d3 100644 --- a/apps/desktop/src/renderer/components/UpgradePromptModal.tsx +++ b/apps/desktop/src/renderer/components/UpgradePromptModal.tsx @@ -16,7 +16,7 @@ import LockIcon from '@mui/icons-material/Lock' import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius, d3roShadow } from '../theme' import { useI18n } from '../i18n' -import type { UpgradePromptEvent, UsageQuota } from '@shared/types' +import type { UpgradePromptEvent, UsageQuota } from '@d3ro/core/types' export function UpgradePromptModal(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/components/meeting/DocumentTab.tsx b/apps/desktop/src/renderer/components/meeting/DocumentTab.tsx index 45dea9a..b8f9dde 100644 --- a/apps/desktop/src/renderer/components/meeting/DocumentTab.tsx +++ b/apps/desktop/src/renderer/components/meeting/DocumentTab.tsx @@ -9,7 +9,7 @@ import { ExportMenu } from './ExportMenu' import { PhysicalButton } from '../ds/PhysicalButton' import { d3roPalette, d3roTypo } from '../../theme' import { useI18n } from '../../i18n' -import type { MeetingExportFormat } from '@shared/types' +import type { MeetingExportFormat } from '@d3ro/core/types' interface DocumentTabDoc { id: string diff --git a/apps/desktop/src/renderer/components/meeting/ExportMenu.tsx b/apps/desktop/src/renderer/components/meeting/ExportMenu.tsx index e364497..717d534 100644 --- a/apps/desktop/src/renderer/components/meeting/ExportMenu.tsx +++ b/apps/desktop/src/renderer/components/meeting/ExportMenu.tsx @@ -7,7 +7,7 @@ import FileDownloadIcon from '@mui/icons-material/FileDownload' import { PhysicalButton } from '../ds/PhysicalButton' import { d3roPalette, d3roTypo, d3roFontMono, d3roRadius, d3roShadow } from '../../theme' import { useI18n } from '../../i18n' -import type { MeetingExportFormat } from '@shared/types' +import type { MeetingExportFormat } from '@d3ro/core/types' interface ExportMenuProps { onExport: (format: MeetingExportFormat) => void diff --git a/apps/desktop/src/renderer/components/meeting/MeetingChatPanel.tsx b/apps/desktop/src/renderer/components/meeting/MeetingChatPanel.tsx index e283644..a173e37 100644 --- a/apps/desktop/src/renderer/components/meeting/MeetingChatPanel.tsx +++ b/apps/desktop/src/renderer/components/meeting/MeetingChatPanel.tsx @@ -11,7 +11,7 @@ import { PhosphorText } from '../ds/PhosphorText' import { PhysicalButton } from '../ds/PhysicalButton' import { d3roPalette, d3roFontMono, d3roTypo, d3roShadow } from '../../theme' import { useI18n } from '../../i18n' -import type { MeetingChatMessage } from '@shared/types' +import type { MeetingChatMessage } from '@d3ro/core/types' interface MeetingChatPanelProps { sessionId: string diff --git a/apps/desktop/src/renderer/components/meeting/MeetingDetailTabs.tsx b/apps/desktop/src/renderer/components/meeting/MeetingDetailTabs.tsx index 3fd7853..fe36eac 100644 --- a/apps/desktop/src/renderer/components/meeting/MeetingDetailTabs.tsx +++ b/apps/desktop/src/renderer/components/meeting/MeetingDetailTabs.tsx @@ -26,7 +26,7 @@ import type { MeetingDocument, MeetingDocTemplate, MeetingExportFormat, -} from '@shared/types' +} from '@d3ro/core/types' interface MeetingDetailTabsProps { detail: MeetingSessionDetail diff --git a/apps/desktop/src/renderer/components/shared/HistoryEntryCard.tsx b/apps/desktop/src/renderer/components/shared/HistoryEntryCard.tsx index 51736f5..1cdfbe6 100644 --- a/apps/desktop/src/renderer/components/shared/HistoryEntryCard.tsx +++ b/apps/desktop/src/renderer/components/shared/HistoryEntryCard.tsx @@ -14,7 +14,7 @@ import { MetalCard, Led } from '../ds' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius } from '../../theme' import { useI18n } from '../../i18n' import { formatDuration } from '../../utils/formatters' -import type { HistoryEntry, MemoTag, MeetingSummaryResult } from '@shared/types' +import type { HistoryEntry, MemoTag, MeetingSummaryResult } from '@d3ro/core/types' interface HistoryEntryCardProps { entry: HistoryEntry diff --git a/apps/desktop/src/renderer/hooks/useProFeature.ts b/apps/desktop/src/renderer/hooks/useProFeature.ts index 5b3424c..dc23b0d 100644 --- a/apps/desktop/src/renderer/hooks/useProFeature.ts +++ b/apps/desktop/src/renderer/hooks/useProFeature.ts @@ -2,8 +2,8 @@ // Pro feature gating hook: checks access, subscribes to tier changes import { useState, useEffect, useCallback } from 'react' -import { Feature } from '@shared/types' -import type { FeatureAccess } from '@shared/types' +import { Feature } from '@d3ro/core/types' +import type { FeatureAccess } from '@d3ro/core/types' interface UseProFeatureResult { /** Feature is unlocked for current tier */ diff --git a/apps/desktop/src/renderer/pages/CommandsPage.tsx b/apps/desktop/src/renderer/pages/CommandsPage.tsx index 3c72583..47d8fa2 100644 --- a/apps/desktop/src/renderer/pages/CommandsPage.tsx +++ b/apps/desktop/src/renderer/pages/CommandsPage.tsx @@ -15,7 +15,7 @@ import { PageHeader, EmptyStateCard } from '../components/shared' import { d3roPalette, d3roFontMono, d3roTypo, d3roRadius } from '../theme' import { useI18n } from '../i18n' import { TemplateSection } from '../components/TemplateSection' -import type { VoiceCommandRule, VoiceCommandKeyword, KeywordMatchMode, LLMChain, ChainStep } from '@shared/types' +import type { VoiceCommandRule, VoiceCommandKeyword, KeywordMatchMode, LLMChain, ChainStep } from '@d3ro/core/types' interface CustomInstruction { id: string @@ -69,10 +69,10 @@ export function CommandsPage(): React.ReactElement { const newId = activeId === id ? null : id setActiveId(newId) if (newId) { - window.electronAPI.config.set({ key: 'activeInstructionId' as keyof import('@shared/types').AppConfig, value: newId as never }) + window.electronAPI.config.set({ key: 'activeInstructionId' as keyof import('@d3ro/core/types').AppConfig, value: newId as never }) window.electronAPI.config.set({ key: 'defaultLLMAction', value: 'custom' }) } else { - window.electronAPI.config.set({ key: 'activeInstructionId' as keyof import('@shared/types').AppConfig, value: '' as never }) + window.electronAPI.config.set({ key: 'activeInstructionId' as keyof import('@d3ro/core/types').AppConfig, value: '' as never }) window.electronAPI.config.set({ key: 'defaultLLMAction', value: 'none' }) } } diff --git a/apps/desktop/src/renderer/pages/DashboardPage.tsx b/apps/desktop/src/renderer/pages/DashboardPage.tsx index ee38e84..959c406 100644 --- a/apps/desktop/src/renderer/pages/DashboardPage.tsx +++ b/apps/desktop/src/renderer/pages/DashboardPage.tsx @@ -10,7 +10,7 @@ import { d3roPalette, d3roTypo } from '../theme' import { useI18n } from '../i18n' import { formatRecordingTime, formatRecordingTimeUnit, formatNumber, getDateKey } from '../utils/formatters' import { FileDropZone } from '../components/FileDropZone' -import type { StatsSummary, HistoryEntry, HotkeyBinding, CaptionState, LicenseTier, UsageQuota } from '@shared/types' +import type { StatsSummary, HistoryEntry, HotkeyBinding, CaptionState, LicenseTier, UsageQuota } from '@d3ro/core/types' // ── 메인 컴포넌트 ───────────────────────────────────── diff --git a/apps/desktop/src/renderer/pages/DictionaryPage.tsx b/apps/desktop/src/renderer/pages/DictionaryPage.tsx index efe555c..98c938e 100644 --- a/apps/desktop/src/renderer/pages/DictionaryPage.tsx +++ b/apps/desktop/src/renderer/pages/DictionaryPage.tsx @@ -10,7 +10,7 @@ import { MetalCard, PhosphorText } from '../components/ds' import { PageHeader, SearchInput, EmptyStateCard } from '../components/shared' import { d3roPalette, d3roFontMono, d3roTypo } from '../theme' import { useI18n } from '../i18n' -import type { DictionaryEntry, DictionaryPage as DictPageData } from '@shared/types' +import type { DictionaryEntry, DictionaryPage as DictPageData } from '@d3ro/core/types' const PAGE_SIZE = 50 diff --git a/apps/desktop/src/renderer/pages/HistoryPage.tsx b/apps/desktop/src/renderer/pages/HistoryPage.tsx index 67f6f33..477169e 100644 --- a/apps/desktop/src/renderer/pages/HistoryPage.tsx +++ b/apps/desktop/src/renderer/pages/HistoryPage.tsx @@ -10,7 +10,7 @@ import { d3roPalette, d3roTypo, d3roFontMono, d3roRadius } from '../theme' import { useI18n } from '../i18n' import { getDateKey } from '../utils/formatters' import { EmptyStateCard, SearchInput, PageHeader, HistoryEntryCard } from '../components/shared' -import type { HistoryEntry, HistoryPage as HistoryPageData, TagCount } from '@shared/types' +import type { HistoryEntry, HistoryPage as HistoryPageData, TagCount } from '@d3ro/core/types' const PAGE_SIZE = 50 diff --git a/apps/desktop/src/renderer/pages/KnowledgeBasePage.tsx b/apps/desktop/src/renderer/pages/KnowledgeBasePage.tsx index 9442492..444ba57 100644 --- a/apps/desktop/src/renderer/pages/KnowledgeBasePage.tsx +++ b/apps/desktop/src/renderer/pages/KnowledgeBasePage.tsx @@ -14,7 +14,7 @@ import { MetalCard, PhosphorText, Led, PhysicalButton, ScreenPanel } from '../co import { PageHeader, EmptyStateCard } from '../components/shared' import { d3roPalette, d3roFontMono, d3roTypo } from '../theme' import { useI18n } from '../i18n' -import type { RAGDocument, RAGQueryResult, RAGIndexProgress } from '@shared/types' +import type { RAGDocument, RAGQueryResult, RAGIndexProgress } from '@d3ro/core/types' export function KnowledgeBasePage(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/pages/MeetingModePage.tsx b/apps/desktop/src/renderer/pages/MeetingModePage.tsx index 1e22f0e..586c7b7 100644 --- a/apps/desktop/src/renderer/pages/MeetingModePage.tsx +++ b/apps/desktop/src/renderer/pages/MeetingModePage.tsx @@ -25,7 +25,7 @@ import type { MeetingProcessingProgress, CaptionSegment, MeetingMemo, -} from '@shared/types' +} from '@d3ro/core/types' type MeetingView = 'list' | 'recording' | 'detail' diff --git a/apps/desktop/src/renderer/pages/VoiceConversationPage.tsx b/apps/desktop/src/renderer/pages/VoiceConversationPage.tsx index 6dd1ad8..4765992 100644 --- a/apps/desktop/src/renderer/pages/VoiceConversationPage.tsx +++ b/apps/desktop/src/renderer/pages/VoiceConversationPage.tsx @@ -17,7 +17,7 @@ import type { ConversationState, ConversationMessage, ConversationAssistantDelta, -} from '@shared/types' +} from '@d3ro/core/types' export function VoiceConversationPage(): React.ReactElement { const { t } = useI18n() diff --git a/apps/desktop/src/renderer/theme.ts b/apps/desktop/src/renderer/theme.ts index 8764e24..594a396 100644 --- a/apps/desktop/src/renderer/theme.ts +++ b/apps/desktop/src/renderer/theme.ts @@ -3,7 +3,7 @@ // CSS Custom Properties 기반: d3roPalette가 var()를 사용하여 테마 전환 시 자동 반응. import { createTheme, type Theme } from '@mui/material/styles' -import type { ThemeMode } from '@shared/types' +import type { ThemeMode } from '@d3ro/core/types' // ── 테마 키 타입 ──────────────────────────────────────────── type ThemeKey = 'dark' | 'light' | 'nord' | 'solarized' | 'catppuccin' | 'dracula' diff --git a/apps/desktop/tsconfig.node.json b/apps/desktop/tsconfig.node.json index 666444e..5e7ba84 100644 --- a/apps/desktop/tsconfig.node.json +++ b/apps/desktop/tsconfig.node.json @@ -5,7 +5,9 @@ "outDir": "./out", "baseUrl": ".", "paths": { - "@shared/*": ["src/shared/*"] + "@shared/*": ["src/shared/*"], + "@d3ro/core": ["../../packages/core/src/index.ts"], + "@d3ro/core/*": ["../../packages/core/src/*"] }, "strict": true, "noImplicitAny": true, diff --git a/apps/desktop/tsconfig.web.json b/apps/desktop/tsconfig.web.json index b42c268..faf1d56 100644 --- a/apps/desktop/tsconfig.web.json +++ b/apps/desktop/tsconfig.web.json @@ -5,7 +5,9 @@ "outDir": "./out", "baseUrl": ".", "paths": { - "@shared/*": ["src/shared/*"] + "@shared/*": ["src/shared/*"], + "@d3ro/core": ["../../packages/core/src/index.ts"], + "@d3ro/core/*": ["../../packages/core/src/*"] }, "jsx": "react-jsx", "strict": true, diff --git a/apps/desktop/vitest.config.ts b/apps/desktop/vitest.config.ts index 7c72f47..d1b8aa6 100644 --- a/apps/desktop/vitest.config.ts +++ b/apps/desktop/vitest.config.ts @@ -17,7 +17,8 @@ export default defineConfig({ }, resolve: { alias: { - '@shared': resolve(__dirname, 'src/shared') + '@shared': resolve(__dirname, 'src/shared'), + '@d3ro/core': resolve(__dirname, '../../packages/core/src') } } }) diff --git a/memory/project_status.md b/memory/project_status.md index 06597aa..51262d6 100644 --- a/memory/project_status.md +++ b/memory/project_status.md @@ -7,7 +7,8 @@ **V1 (Electron) 완료** → **V2 (Monorepo) 진행 중** - Phase V2-1a ✅ 완료 (Monorepo 구조 이동) -- 다음: Phase V2-1b (packages/core 추출) — 별도 세션 +- Phase V2-1b ✅ 완료 (packages/core 추출) +- 다음: Phase V2-1c (packages/ui 추출) — 별도 세션 ## V1 완료 페이즈 @@ -36,10 +37,34 @@ | Sub-phase | 범위 | 상태 | |---|---|---| | V2-1a | npm workspaces + apps/desktop으로 V1 이동 | ✅ 완료 | -| V2-1b | packages/core 추출 (types, errors, utils) | ⏸️ 대기 | -| V2-1c | packages/ui 추출 (DS 컴포넌트 + theme) | ⏸️ 대기 | +| V2-1b | packages/core 추출 (types, errors, ipc-channels, constants, utils) | ✅ 완료 | +| V2-1c | packages/ui 추출 (DS 컴포넌트 + theme + theme-vars) | ⏸️ 대기 | | V2-1d | packages/i18n 추출 (locale JSON + 훅) | ⏸️ 대기 | +**V2-1b 완료 내역** +- `packages/core/` 패키지 신규: `@d3ro/core`, subpath exports (types/errors/ipc-channels/constants/utils/*), docx dep 포함 +- 6개 파일 `git mv`로 `packages/core/src/`로 이동: + - `apps/desktop/src/shared/{types,errors,ipc-channels,constants}.ts` + - `apps/desktop/src/main/utils/{meeting-markdown,markdown-to-docx}.ts` +- `packages/core/src/index.ts` barrel export 추가 +- `apps/desktop/package.json`에 `"@d3ro/core": "*"` dep 추가 +- `apps/desktop/tsconfig.node.json`, `tsconfig.web.json`의 `paths`에 `@d3ro/core/*` 추가, `@shared/*`는 theme-vars용으로 유지 +- `apps/desktop/electron.vite.config.ts` alias 3개 섹션에 `@d3ro/core` 추가 + **M1 수정**: `resolve('src/shared')` → `resolve(__dirname, 'src/shared')` +- `externalizeDepsPlugin` exclude에 `@d3ro/core` 추가 (main/preload 둘 다) +- `apps/desktop/vitest.config.ts`에 `@d3ro/core` alias 추가 +- **일괄 치환**: `@shared/{types,errors,ipc-channels,constants}` → `@d3ro/core/*` (사용자 79개 파일, 167건) + - static import (`from '@shared/...'`) + - dynamic import (`import('@shared/...')`) + - type expression import (`keyof import('@shared/...').AppConfig`) +- `MeetingModeService.ts`의 상대 경로 utils import (`../utils/meeting-markdown`, `../utils/markdown-to-docx`)를 `@d3ro/core/utils/*`로 교체 +- `packages/core` 내부 자기 참조: `meeting-markdown.ts`의 `@shared/types` → `../types` 상대 경로 + +**V2-1b 검증** +- `npm run typecheck` ✅ +- `npm run build` ✅ (main+preload+renderer) +- `npm run dev` 런타임 실행 ✅ (DB/핫키/Ollama 모두 정상) +- `apps/desktop/src/shared/`에는 `theme-vars.ts` 1개만 남음 (V2-1c에서 이동 예정) + **V2-1a 완료 내역** - 루트 `package.json`을 npm workspaces 루트로 재구성 (workspaces: apps/*, packages/*) - `turbo.json`, `tsconfig.base.json` 추가 (Turborepo 자체 설치는 뒤로 미룸) diff --git a/package-lock.json b/package-lock.json index 51812e5..1d6d5ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@d3ro/core": "*", "@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/utils": "^4.0.0", "@emotion/react": "^11.14.0", @@ -390,6 +391,10 @@ "node": ">=6.9.0" } }, + "node_modules/@d3ro/core": { + "resolved": "packages/core", + "link": true + }, "node_modules/@d3ro/desktop": { "resolved": "apps/desktop", "link": true @@ -12798,6 +12803,17 @@ "type": "github", "url": "https://github.com/sponsors/wooorm" } + }, + "packages/core": { + "name": "@d3ro/core", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "docx": "^9.6.1" + }, + "devDependencies": { + "@types/node": "^22.13.0" + } } } } diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..2c0569d --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,45 @@ +{ + "name": "@d3ro/core", + "version": "1.0.0", + "private": true, + "description": "D3RO Voice 공유 비즈니스 로직 — 타입, 에러, IPC 채널, 상수, 유틸", + "license": "MIT", + "main": "./src/index.ts", + "types": "./src/index.ts", + "exports": { + ".": { + "types": "./src/index.ts", + "default": "./src/index.ts" + }, + "./types": { + "types": "./src/types.ts", + "default": "./src/types.ts" + }, + "./errors": { + "types": "./src/errors.ts", + "default": "./src/errors.ts" + }, + "./ipc-channels": { + "types": "./src/ipc-channels.ts", + "default": "./src/ipc-channels.ts" + }, + "./constants": { + "types": "./src/constants.ts", + "default": "./src/constants.ts" + }, + "./utils/meeting-markdown": { + "types": "./src/utils/meeting-markdown.ts", + "default": "./src/utils/meeting-markdown.ts" + }, + "./utils/markdown-to-docx": { + "types": "./src/utils/markdown-to-docx.ts", + "default": "./src/utils/markdown-to-docx.ts" + } + }, + "dependencies": { + "docx": "^9.6.1" + }, + "devDependencies": { + "@types/node": "^22.13.0" + } +} diff --git a/apps/desktop/src/shared/constants.ts b/packages/core/src/constants.ts similarity index 100% rename from apps/desktop/src/shared/constants.ts rename to packages/core/src/constants.ts diff --git a/apps/desktop/src/shared/errors.ts b/packages/core/src/errors.ts similarity index 100% rename from apps/desktop/src/shared/errors.ts rename to packages/core/src/errors.ts diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 0000000..9a69340 --- /dev/null +++ b/packages/core/src/index.ts @@ -0,0 +1,8 @@ +// packages/core — barrel export +// 개별 sub-path import 권장: '@d3ro/core/types', '@d3ro/core/errors' 등 +// 본 파일은 편의를 위한 통합 re-export + +export * from './types' +export * from './errors' +export * from './ipc-channels' +export * from './constants' diff --git a/apps/desktop/src/shared/ipc-channels.ts b/packages/core/src/ipc-channels.ts similarity index 100% rename from apps/desktop/src/shared/ipc-channels.ts rename to packages/core/src/ipc-channels.ts diff --git a/apps/desktop/src/shared/types.ts b/packages/core/src/types.ts similarity index 100% rename from apps/desktop/src/shared/types.ts rename to packages/core/src/types.ts diff --git a/apps/desktop/src/main/utils/markdown-to-docx.ts b/packages/core/src/utils/markdown-to-docx.ts similarity index 100% rename from apps/desktop/src/main/utils/markdown-to-docx.ts rename to packages/core/src/utils/markdown-to-docx.ts diff --git a/apps/desktop/src/main/utils/meeting-markdown.ts b/packages/core/src/utils/meeting-markdown.ts similarity index 97% rename from apps/desktop/src/main/utils/meeting-markdown.ts rename to packages/core/src/utils/meeting-markdown.ts index 7069cbb..251414a 100644 --- a/apps/desktop/src/main/utils/meeting-markdown.ts +++ b/packages/core/src/utils/meeting-markdown.ts @@ -1,7 +1,7 @@ -// src/main/utils/meeting-markdown.ts +// packages/core/src/utils/meeting-markdown.ts // Phase 14.5: MeetingModeService에서 추출한 마크다운 유틸리티 -import type { MeetingMinutes, MeetingSessionDetail } from '@shared/types' +import type { MeetingMinutes, MeetingSessionDetail } from '../types' export function formatTime(ms: number): string { const totalSeconds = Math.floor(ms / 1000) diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..53576c2 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "lib": ["ES2022", "DOM"] + }, + "include": ["src/**/*"] +}