Phase 10 킬러 피처: - MemoService: 태그 CRUD + 마크다운 내보내기 (memo_tags DB) - VoiceCommandService: 키워드→명령어 매칭, 프리셋 4종 - ScreenContextService: PowerShell 활성 윈도우 + Ctrl+C 선택 텍스트 - ChainService: LLM 명령어 순차 실행 파이프라인 - CaptionService: 6초 청크 연속 전사 + 시스템 오디오 루프백 VoiceModeService 파이프라인 통합: - 녹음 시작 → 컨텍스트 캡처 → STT → 키워드 매칭 → LLM(체인/컨텍스트 주입) → 삽입 시스템 오디오 캡처: - setDisplayMediaRequestHandler + audio: 'loopback' (IPC 브릿지) - electron-audio-loopback 패키지 contextIsolation 호환 불가 → 직접 구현 Phase 11 수익화: - LicenseService: Free/Pro/Pro+ 3티어, LemonSqueezy API - Feature Gate: requireFeature/checkFeature/consumeFeature - 일일 쿼터: Free dictation 20/일, LLM 10/일 (SQLite daily_usage) - LicenseModal, ProBadge, UpgradePromptModal UI 디자인 보강: - d3roTypo(13종), d3roShadow(10종), d3roRadius(7종) 토큰 시스템 - ScreenPanel, ButtonGroup DS 컴포넌트 신규 - PhosphorText 4→13종 변형, MetalDial conic-gradient 광택 - 공유 컴포넌트: EmptyStateCard, SearchInput, PageHeader, HistoryEntryCard 기타: - 자막 핫키 SSOT 전체 연동 (Config→Hotkey→VoiceMode→Caption→Settings) - StatusBar 자막 LED + 효과음, 자막 로딩 UI - LLM 상태 이벤트 전파 수정 (폴링 제거 → onStatusChanged) - 커맨드 팝업 "선택 해제" 항목 추가
47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
// src/main/ipc/context-handlers.ts
|
|
// Phase 10.2 스크린 컨텍스트 IPC 핸들러
|
|
|
|
import { ipcMain } from 'electron'
|
|
import { IPC_CHANNELS } from '@shared/ipc-channels'
|
|
import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors'
|
|
import { getScreenContextService } from '../services/ScreenContextService'
|
|
|
|
export function registerContextHandlers(): void {
|
|
// context:capture — 활성 윈도우 + 선택 텍스트 캡처
|
|
ipcMain.handle(
|
|
IPC_CHANNELS.CONTEXT.CAPTURE,
|
|
async (_event, params?: { captureSelectedText?: boolean }) => {
|
|
try {
|
|
const service = getScreenContextService()
|
|
const captureSelectedText = params?.captureSelectedText ?? true
|
|
const result = await service.captureContext(captureSelectedText)
|
|
return ipcSuccess(result)
|
|
} catch (error) {
|
|
const message = error instanceof Error ? error.message : String(error)
|
|
return ipcError(ErrorCode.ContextCaptureFailed, message)
|
|
}
|
|
}
|
|
)
|
|
|
|
// context:isEnabled — 스크린 컨텍스트 활성화 여부
|
|
ipcMain.handle(IPC_CHANNELS.CONTEXT.IS_ENABLED, async () => {
|
|
return ipcSuccess(getScreenContextService().isEnabled())
|
|
})
|
|
|
|
// context:setEnabled — 스크린 컨텍스트 활성화/비활성화
|
|
ipcMain.handle(
|
|
IPC_CHANNELS.CONTEXT.SET_ENABLED,
|
|
async (_event, params: { enabled: boolean }) => {
|
|
getScreenContextService().setEnabled(params.enabled)
|
|
return ipcSuccess(undefined)
|
|
}
|
|
)
|
|
|
|
// context:getConfig — 현재 설정 조회 (향후 앱별 설정 확장용)
|
|
ipcMain.handle(IPC_CHANNELS.CONTEXT.GET_CONFIG, async () => {
|
|
const service = getScreenContextService()
|
|
return ipcSuccess({
|
|
enabled: service.isEnabled(),
|
|
})
|
|
})
|
|
}
|