refactor(main): IPC 채널 SSOT 일원화 + AppConfig 타입 강화 (WS2)
- ipc-channels.ts SSOT에 9개 그룹/키 추가: INSTRUCTION, SYSTEM_AUDIO, POPUP_RESULT/HISTORY/COMMAND/CAPTION, VOICE_PARTIAL, CLIPBOARD, APP, VOICE_CONVERSATION.FINISH_LISTENING - WindowManager/handlers/bootstrap 하드코딩 채널 -> IPC_CHANNELS 교체. 불일치 4건(result:* vs window:tip*)은 preload 재검증 후 SSOT로 통일. notifyRenderer channel: string -> IPCChannel 타입 좁힘. - AppConfig에 7개 누락 키 추가(customInstructions, llmChains, voiceCommandRules, voiceCommandsEnabled, activeInstructionId, activeChainId, captionAudioSource) -> as never 16건 제거. - ChainService/CustomInstructionService/WindowManager dynamic require -> static import. - services/index.ts 데드 레지스트리 제거 (import 0건). SKIP: ipcSuccess/ipcError 헬퍼 통일, catch 패턴(별도) 정책: docs/REFACTOR_POLICY.md DP2, DP9
This commit is contained in:
parent
b820c789bb
commit
aef44289a5
15 changed files with 161 additions and 126 deletions
|
|
@ -145,9 +145,8 @@ class MeetingModeService extends EventEmitter {
|
|||
|
||||
// 회의 모드는 마이크 캡처 강제 — ConfigService 값도 임시 변경
|
||||
// (CaptionService.start()가 ConfigService에서 다시 읽기 때문)
|
||||
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)
|
||||
const prevAudioSource = configGet('captionAudioSource')
|
||||
configSet('captionAudioSource', 'mic')
|
||||
|
||||
try {
|
||||
await captionService.start()
|
||||
|
|
@ -156,12 +155,12 @@ class MeetingModeService extends EventEmitter {
|
|||
hideCaptionOverlay()
|
||||
// ConfigService 원래 값 복원
|
||||
if (prevAudioSource) {
|
||||
configSet('captionAudioSource' as AppConfigKey, prevAudioSource as never)
|
||||
configSet('captionAudioSource', prevAudioSource)
|
||||
}
|
||||
} catch (err) {
|
||||
// ConfigService 원래 값 복원
|
||||
if (prevAudioSource) {
|
||||
configSet('captionAudioSource' as AppConfigKey, prevAudioSource as never)
|
||||
configSet('captionAudioSource', prevAudioSource)
|
||||
}
|
||||
// 시작 실패 시 복원
|
||||
captionService.off('segment', this._segmentHandler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue