Phase 10~11 전체 구현: 킬러 피처 5종 + 수익화 시스템
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) - 커맨드 팝업 "선택 해제" 항목 추가
This commit is contained in:
parent
36d77ca224
commit
a31f96bbb8
97 changed files with 11853 additions and 1143 deletions
|
|
@ -61,8 +61,42 @@ import type {
|
|||
DictionaryDeleteParams,
|
||||
DictionarySearchParams,
|
||||
StatsSummary,
|
||||
PermissionStatus
|
||||
PermissionStatus,
|
||||
// Phase 10
|
||||
MemoTag,
|
||||
AddTagParams,
|
||||
RemoveTagParams,
|
||||
GetTagsParams,
|
||||
SearchByTagParams,
|
||||
ExportMemoParams,
|
||||
TagCount,
|
||||
VoiceCommandRule,
|
||||
VoiceCommandMatch,
|
||||
SetVoiceCommandKeywordsParams,
|
||||
SetVoiceCommandEnabledParams,
|
||||
CaptureContextResult,
|
||||
ScreenContext,
|
||||
LLMChain,
|
||||
CreateChainParams,
|
||||
UpdateChainParams,
|
||||
DeleteChainParams,
|
||||
ExecuteChainParams,
|
||||
ChainExecutionResult,
|
||||
ChainProgress,
|
||||
CaptionState,
|
||||
CaptionSegment,
|
||||
CaptionConfig,
|
||||
CaptionSessionSummary,
|
||||
// Phase 11
|
||||
LicenseInfo,
|
||||
ActivateLicenseParams,
|
||||
ActivateLicenseResult,
|
||||
FeatureAccess,
|
||||
UsageQuota,
|
||||
UpgradePromptEvent,
|
||||
TierComparison,
|
||||
} from '@shared/types'
|
||||
import { Feature } from '@shared/types'
|
||||
import type { IPCResult } from '@shared/errors'
|
||||
|
||||
type Unsubscribe = () => void
|
||||
|
|
@ -157,6 +191,14 @@ const electronAPI = {
|
|||
invoke<HotkeyBinding>(IPC_CHANNELS.HOTKEY.GET_HANDS_FREE_SHORTCUT),
|
||||
setHandsFreeShortcut: (params: SetHotkeyParams) =>
|
||||
invoke<void>(IPC_CHANNELS.HOTKEY.SET_HANDS_FREE_SHORTCUT, params),
|
||||
getCommandShortcut: () =>
|
||||
invoke<HotkeyBinding>(IPC_CHANNELS.HOTKEY.GET_COMMAND_SHORTCUT),
|
||||
setCommandShortcut: (params: SetHotkeyParams) =>
|
||||
invoke<void>(IPC_CHANNELS.HOTKEY.SET_COMMAND_SHORTCUT, params),
|
||||
getCaptionShortcut: () =>
|
||||
invoke<HotkeyBinding>(IPC_CHANNELS.HOTKEY.GET_CAPTION_SHORTCUT),
|
||||
setCaptionShortcut: (params: SetHotkeyParams) =>
|
||||
invoke<void>(IPC_CHANNELS.HOTKEY.SET_CAPTION_SHORTCUT, params),
|
||||
isEnabled: () => invoke<boolean>(IPC_CHANNELS.HOTKEY.IS_ENABLED),
|
||||
setEnabled: (params: SetEnabledParams) =>
|
||||
invoke<void>(IPC_CHANNELS.HOTKEY.SET_ENABLED, params),
|
||||
|
|
@ -251,7 +293,95 @@ const electronAPI = {
|
|||
app: {
|
||||
onDataChanged: (cb: (data: { type: string; activeId?: string }) => void): Unsubscribe =>
|
||||
on('app:dataChanged', cb),
|
||||
}
|
||||
},
|
||||
|
||||
// ── Phase 10: Memo Tags ─────────────────────────────────
|
||||
memo: {
|
||||
getTags: (params: GetTagsParams) => invoke<MemoTag[]>(IPC_CHANNELS.MEMO.GET_TAGS, params),
|
||||
addTag: (params: AddTagParams) => invoke<MemoTag>(IPC_CHANNELS.MEMO.ADD_TAG, params),
|
||||
removeTag: (params: RemoveTagParams) => invoke<void>(IPC_CHANNELS.MEMO.REMOVE_TAG, params),
|
||||
getAllTags: () => invoke<TagCount[]>(IPC_CHANNELS.MEMO.GET_ALL_TAGS),
|
||||
searchByTag: (params: SearchByTagParams) => invoke<HistoryPage>(IPC_CHANNELS.MEMO.SEARCH_BY_TAG, params),
|
||||
export: (params: ExportMemoParams) => invoke<string>(IPC_CHANNELS.MEMO.EXPORT, params),
|
||||
},
|
||||
|
||||
// ── Phase 10: Voice Commands ────────────────────────────
|
||||
voiceCommand: {
|
||||
getAll: () => invoke<VoiceCommandRule[]>(IPC_CHANNELS.VOICE_COMMAND.GET_ALL),
|
||||
setKeywords: (params: SetVoiceCommandKeywordsParams) => invoke<void>(IPC_CHANNELS.VOICE_COMMAND.SET_KEYWORDS, params),
|
||||
setEnabled: (params: SetVoiceCommandEnabledParams) => invoke<void>(IPC_CHANNELS.VOICE_COMMAND.SET_ENABLED, params),
|
||||
isEnabled: () => invoke<boolean>(IPC_CHANNELS.VOICE_COMMAND.IS_ENABLED),
|
||||
onMatched: (cb: (data: VoiceCommandMatch) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.VOICE_COMMAND.MATCHED, cb),
|
||||
},
|
||||
|
||||
// ── Phase 10: Screen Context ────────────────────────────
|
||||
context: {
|
||||
capture: (captureSelectedText?: boolean) => invoke<CaptureContextResult>(IPC_CHANNELS.CONTEXT.CAPTURE, { captureSelectedText }),
|
||||
isEnabled: () => invoke<boolean>(IPC_CHANNELS.CONTEXT.IS_ENABLED),
|
||||
setEnabled: (params: { enabled: boolean }) => invoke<void>(IPC_CHANNELS.CONTEXT.SET_ENABLED, params),
|
||||
},
|
||||
|
||||
// ── Phase 10: LLM Chain ─────────────────────────────────
|
||||
chain: {
|
||||
getAll: () => invoke<LLMChain[]>(IPC_CHANNELS.CHAIN.GET_ALL),
|
||||
create: (params: CreateChainParams) => invoke<LLMChain>(IPC_CHANNELS.CHAIN.CREATE, params),
|
||||
update: (params: UpdateChainParams) => invoke<LLMChain>(IPC_CHANNELS.CHAIN.UPDATE, params),
|
||||
delete: (params: DeleteChainParams) => invoke<void>(IPC_CHANNELS.CHAIN.DELETE, params),
|
||||
execute: (params: ExecuteChainParams) => invoke<ChainExecutionResult>(IPC_CHANNELS.CHAIN.EXECUTE, params),
|
||||
onProgress: (cb: (data: ChainProgress) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CHAIN.PROGRESS, cb),
|
||||
},
|
||||
|
||||
// ── Phase 10: Live Caption ──────────────────────────────
|
||||
caption: {
|
||||
start: () => invoke<void>(IPC_CHANNELS.CAPTION.START),
|
||||
stop: () => invoke<void>(IPC_CHANNELS.CAPTION.STOP),
|
||||
getState: () => invoke<CaptionState>(IPC_CHANNELS.CAPTION.GET_STATE),
|
||||
setConfig: (params: Partial<CaptionConfig>) => invoke<void>(IPC_CHANNELS.CAPTION.SET_CONFIG, params),
|
||||
getConfig: () => invoke<CaptionConfig>(IPC_CHANNELS.CAPTION.GET_CONFIG),
|
||||
onSegment: (cb: (data: CaptionSegment) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CAPTION.SEGMENT, cb),
|
||||
onDelta: (cb: (data: { text: string }) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CAPTION.DELTA, cb),
|
||||
onStateChanged: (cb: (data: { state: CaptionState }) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CAPTION.STATE_CHANGED, cb),
|
||||
/** 시스템 오디오 PCM 데이터를 메인에 전달 (렌더러 → 메인) */
|
||||
sendSystemAudioData: (data: ArrayBuffer) =>
|
||||
send(IPC_CHANNELS.CAPTION.SYSTEM_AUDIO_DATA, data),
|
||||
/** 메인에서 시스템 오디오 캡처 시작 요청 수신 */
|
||||
onStartSystemAudio: (cb: () => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CAPTION.START_SYSTEM_AUDIO, cb),
|
||||
/** 메인에서 시스템 오디오 캡처 중지 요청 수신 */
|
||||
onStopSystemAudio: (cb: () => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.CAPTION.STOP_SYSTEM_AUDIO, cb),
|
||||
/** 시스템 오디오 루프백 활성화 (getDisplayMedia 전에 호출) */
|
||||
enableLoopback: () => invoke<void>('system-audio:enable-loopback'),
|
||||
/** 시스템 오디오 루프백 비활성화 */
|
||||
disableLoopback: () => invoke<void>('system-audio:disable-loopback'),
|
||||
},
|
||||
|
||||
// ── License (Phase 11) ────────────────────────────────
|
||||
license: {
|
||||
getInfo: () =>
|
||||
invoke<LicenseInfo>(IPC_CHANNELS.LICENSE.GET_INFO),
|
||||
activate: (params: ActivateLicenseParams) =>
|
||||
invoke<ActivateLicenseResult>(IPC_CHANNELS.LICENSE.ACTIVATE, params),
|
||||
deactivate: () =>
|
||||
invoke<void>(IPC_CHANNELS.LICENSE.DEACTIVATE),
|
||||
checkFeature: (feature: Feature) =>
|
||||
invoke<FeatureAccess>(IPC_CHANNELS.LICENSE.CHECK_FEATURE, { feature }),
|
||||
getUsage: (feature: Feature) =>
|
||||
invoke<UsageQuota>(IPC_CHANNELS.LICENSE.GET_USAGE, { feature }),
|
||||
getAllUsage: () =>
|
||||
invoke<UsageQuota[]>(IPC_CHANNELS.LICENSE.GET_ALL_USAGE),
|
||||
getTierComparison: () =>
|
||||
invoke<TierComparison[]>(IPC_CHANNELS.LICENSE.GET_TIER_COMPARISON),
|
||||
onUpgradePrompt: (cb: (e: UpgradePromptEvent) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.LICENSE.UPGRADE_PROMPT, cb),
|
||||
onTierChanged: (cb: (e: LicenseInfo) => void): Unsubscribe =>
|
||||
on(IPC_CHANNELS.LICENSE.TIER_CHANGED, cb),
|
||||
},
|
||||
} as const
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', electronAPI)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue