Phase 12~13 전체 구현: Pro+ 피처 6종 + 음성 대화 + RAG + OS 자동화
Phase 12: - FileTranscriptionService: ffmpeg PCM 변환 + 30초 청크 순차 STT - MeetingSummaryService: 자막 세션 → LLM 자동 요약 + DB summaryText - DictationTemplateService: 필드별 음성 입력 상태 머신 + 프리셋 3개 Phase 13.1: - VoiceConversationService: STT→Ollama /api/chat→TTS 대화 루프 (10턴) - TTSPlaybackService: Windows SAPI 문장 단위 큐 재생 - LocalLLMService.chatStream: Ollama /api/chat 스트리밍 Phase 13.2: - RAGService: Ollama 임베딩 + SQLite 벡터 + 코사인 유사도 검색 - KnowledgeBasePage: 문서 관리 + 질문/답변 UI - PDF 파서: zlib FlateDecode 해제 + BT/ET 텍스트 추출 Phase 13.3: - VoiceActionService: LLM JSON 액션 플랜 생성 + 실행 - 프리셋 6개 (크롬/메모장/탐색기/볼륨), 위험 명령 차단 공통: IPC ~70채널, 에러코드 780-878, i18n 100+키 버그픽스: 라이선스 로컬 키 우선, i18n featureLabel, DOM 중첩
This commit is contained in:
parent
a31f96bbb8
commit
eb83682269
38 changed files with 5678 additions and 19 deletions
|
|
@ -113,6 +113,44 @@ export enum ErrorCode {
|
|||
CaptionAlreadyActive = 771,
|
||||
CaptionSTTFailed = 772,
|
||||
|
||||
// === Phase 12: File Transcription (780-784) ===
|
||||
FileTranscriptionFFmpegFailed = 780,
|
||||
FileTranscriptionInvalidFormat = 781,
|
||||
FileTranscriptionChunkFailed = 782,
|
||||
FileTranscriptionCancelled = 783,
|
||||
FileTranscriptionFileTooLarge = 784,
|
||||
|
||||
// === Phase 12: Meeting Summary (785-789) ===
|
||||
MeetingSummaryGenerationFailed = 785,
|
||||
MeetingSummaryNoTranscript = 786,
|
||||
MeetingSummaryExportFailed = 787,
|
||||
|
||||
// === Phase 12: Dictation Template (790-794) ===
|
||||
TemplateNotFound = 790,
|
||||
TemplateSessionAlreadyActive = 791,
|
||||
TemplateSessionNotActive = 792,
|
||||
TemplateFieldRecordingFailed = 793,
|
||||
TemplateInvalidFormat = 794,
|
||||
|
||||
// === Phase 13: Voice Conversation (795-799) ===
|
||||
ConversationSessionAlreadyActive = 795,
|
||||
ConversationNoActiveSession = 796,
|
||||
ConversationTTSFailed = 797,
|
||||
ConversationLLMFailed = 798,
|
||||
|
||||
// === Phase 13: Local RAG (870-874) ===
|
||||
RAGDocumentNotFound = 870,
|
||||
RAGIndexingFailed = 871,
|
||||
RAGEmbeddingFailed = 872,
|
||||
RAGQueryFailed = 873,
|
||||
RAGUnsupportedFormat = 874,
|
||||
|
||||
// === Phase 13: Voice Action (875-879) ===
|
||||
VoiceActionPlanFailed = 875,
|
||||
VoiceActionExecutionFailed = 876,
|
||||
VoiceActionBlocked = 877,
|
||||
VoiceActionInvalidPlan = 878,
|
||||
|
||||
// === Config (800-849) ===
|
||||
ConfigReadFailed = 800,
|
||||
ConfigWriteFailed = 801,
|
||||
|
|
|
|||
|
|
@ -221,6 +221,90 @@ export const IPC_CHANNELS = {
|
|||
STOP_SYSTEM_AUDIO: 'caption:stopSystemAudio',
|
||||
},
|
||||
|
||||
// ── Phase 12: File Transcription (12.1) ──
|
||||
FILE_TRANSCRIPTION: {
|
||||
START: 'fileTranscription:start',
|
||||
CANCEL: 'fileTranscription:cancel',
|
||||
GET_STATE: 'fileTranscription:getState',
|
||||
// Main → Renderer events
|
||||
PROGRESS: 'fileTranscription:progress',
|
||||
COMPLETE: 'fileTranscription:complete',
|
||||
ERROR: 'fileTranscription:error',
|
||||
},
|
||||
|
||||
// ── Phase 12: Meeting Summary (12.2) ──
|
||||
MEETING_SUMMARY: {
|
||||
SUMMARIZE: 'meetingSummary:summarize',
|
||||
GET_SUMMARY: 'meetingSummary:getSummary',
|
||||
EXPORT_MARKDOWN: 'meetingSummary:exportMarkdown',
|
||||
// Main → Renderer events
|
||||
SUMMARY_READY: 'meetingSummary:summaryReady',
|
||||
SUMMARY_PROGRESS: 'meetingSummary:progress',
|
||||
},
|
||||
|
||||
// ── Phase 12: Dictation Templates (12.3) ──
|
||||
DICTATION_TEMPLATE: {
|
||||
GET_ALL: 'dictationTemplate:getAll',
|
||||
CREATE: 'dictationTemplate:create',
|
||||
UPDATE: 'dictationTemplate:update',
|
||||
DELETE: 'dictationTemplate:delete',
|
||||
START_SESSION: 'dictationTemplate:startSession',
|
||||
CANCEL_SESSION: 'dictationTemplate:cancelSession',
|
||||
GET_SESSION_STATE: 'dictationTemplate:getSessionState',
|
||||
SET_FIELD_VALUE: 'dictationTemplate:setFieldValue',
|
||||
// Main → Renderer events
|
||||
SESSION_STATE_CHANGED: 'dictationTemplate:sessionStateChanged',
|
||||
FIELD_COMPLETED: 'dictationTemplate:fieldCompleted',
|
||||
SESSION_COMPLETED: 'dictationTemplate:sessionCompleted',
|
||||
},
|
||||
|
||||
// ── Phase 13: Voice Conversation (13.1) ──
|
||||
VOICE_CONVERSATION: {
|
||||
START_SESSION: 'voiceConversation:startSession',
|
||||
STOP_SESSION: 'voiceConversation:stopSession',
|
||||
SEND_MESSAGE: 'voiceConversation:sendMessage',
|
||||
GET_STATE: 'voiceConversation:getState',
|
||||
GET_HISTORY: 'voiceConversation:getHistory',
|
||||
CLEAR_HISTORY: 'voiceConversation:clearHistory',
|
||||
CANCEL_RESPONSE: 'voiceConversation:cancelResponse',
|
||||
// Main → Renderer events
|
||||
STATE_CHANGED: 'voiceConversation:stateChanged',
|
||||
USER_MESSAGE: 'voiceConversation:userMessage',
|
||||
ASSISTANT_DELTA: 'voiceConversation:assistantDelta',
|
||||
ASSISTANT_MESSAGE: 'voiceConversation:assistantMessage',
|
||||
TTS_STARTED: 'voiceConversation:ttsStarted',
|
||||
TTS_FINISHED: 'voiceConversation:ttsFinished',
|
||||
ERROR: 'voiceConversation:error',
|
||||
},
|
||||
|
||||
// ── Phase 13: Local RAG (13.2) ──
|
||||
RAG: {
|
||||
ADD_DOCUMENT: 'rag:addDocument',
|
||||
REMOVE_DOCUMENT: 'rag:removeDocument',
|
||||
GET_DOCUMENTS: 'rag:getDocuments',
|
||||
QUERY: 'rag:query',
|
||||
GET_STATE: 'rag:getState',
|
||||
REINDEX: 'rag:reindex',
|
||||
// Main → Renderer events
|
||||
INDEX_PROGRESS: 'rag:indexProgress',
|
||||
INDEX_COMPLETE: 'rag:indexComplete',
|
||||
QUERY_RESULT: 'rag:queryResult',
|
||||
},
|
||||
|
||||
// ── Phase 13: Voice Action / OS Automation (13.3) ──
|
||||
VOICE_ACTION: {
|
||||
EXECUTE: 'voiceAction:execute',
|
||||
GET_PRESETS: 'voiceAction:getPresets',
|
||||
GET_HISTORY: 'voiceAction:getHistory',
|
||||
CLEAR_HISTORY: 'voiceAction:clearHistory',
|
||||
SET_ENABLED: 'voiceAction:setEnabled',
|
||||
IS_ENABLED: 'voiceAction:isEnabled',
|
||||
// Main → Renderer events
|
||||
ACTION_PLANNED: 'voiceAction:actionPlanned',
|
||||
ACTION_EXECUTED: 'voiceAction:actionExecuted',
|
||||
ACTION_ERROR: 'voiceAction:actionError',
|
||||
},
|
||||
|
||||
// ── Phase 11: License & Monetization ──
|
||||
LICENSE: {
|
||||
GET_INFO: 'license:getInfo',
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ export interface HistoryEntry {
|
|||
focusedApp: string | null
|
||||
focusedAppName: string | null
|
||||
focusedAppWindowTitle: string | null
|
||||
mode: 'dictation' | 'translate' | 'command'
|
||||
mode: 'dictation' | 'translate' | 'command' | 'caption' | 'file-transcription'
|
||||
status: 'completed' | 'cancelled' | 'error'
|
||||
errorCode: string | null
|
||||
audioLocalPath: string | null
|
||||
|
|
@ -447,6 +447,8 @@ export interface HistoryEntry {
|
|||
createdAt: number
|
||||
updatedAt: number
|
||||
appVersion: string
|
||||
/** Phase 12.2: 회의록 요약 마크다운 */
|
||||
summaryText: string | null
|
||||
}
|
||||
|
||||
export interface HistoryQueryParams {
|
||||
|
|
@ -947,3 +949,316 @@ export interface TierComparison {
|
|||
pro: boolean | string
|
||||
proPlus: boolean | string
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 12: File Transcription (12.1)
|
||||
// ============================================================
|
||||
|
||||
export type FileTranscriptionState = 'idle' | 'converting' | 'transcribing' | 'completed' | 'error'
|
||||
|
||||
export interface FileTranscriptionStartParams {
|
||||
filePath: string
|
||||
language?: string
|
||||
}
|
||||
|
||||
export interface FileTranscriptionProgress {
|
||||
jobId: string
|
||||
currentChunk: number
|
||||
totalChunks: number
|
||||
percent: number
|
||||
currentText: string
|
||||
}
|
||||
|
||||
export interface FileTranscriptionSegment {
|
||||
text: string
|
||||
start: number
|
||||
end: number
|
||||
confidence: number
|
||||
}
|
||||
|
||||
export interface FileTranscriptionResult {
|
||||
jobId: string
|
||||
filePath: string
|
||||
fileName: string
|
||||
fullText: string
|
||||
segments: FileTranscriptionSegment[]
|
||||
totalDurationSec: number
|
||||
processingTimeMs: number
|
||||
}
|
||||
|
||||
export interface FileTranscriptionStateInfo {
|
||||
state: FileTranscriptionState
|
||||
jobId: string | null
|
||||
progress: FileTranscriptionProgress | null
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 12: Meeting Summary (12.2)
|
||||
// ============================================================
|
||||
|
||||
export interface MeetingSummaryResult {
|
||||
historyId: string
|
||||
summary: string
|
||||
decisions: string[]
|
||||
actionItems: string[]
|
||||
rawMarkdown: string
|
||||
generatedAt: number
|
||||
}
|
||||
|
||||
export interface MeetingSummarizeParams {
|
||||
historyId: string
|
||||
}
|
||||
|
||||
export interface MeetingSummaryGetParams {
|
||||
historyId: string
|
||||
}
|
||||
|
||||
export interface MeetingSummaryExportParams {
|
||||
historyId: string
|
||||
}
|
||||
|
||||
export interface MeetingSummaryProgress {
|
||||
historyId: string
|
||||
status: 'generating' | 'done' | 'error'
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 12: Dictation Templates (12.3)
|
||||
// ============================================================
|
||||
|
||||
export interface TemplateField {
|
||||
id: string
|
||||
name: string
|
||||
label: string
|
||||
promptText: string
|
||||
required: boolean
|
||||
maxDurationSec: number
|
||||
}
|
||||
|
||||
export interface DictationTemplate {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
fields: TemplateField[]
|
||||
outputFormat: string
|
||||
isBuiltin: boolean
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
}
|
||||
|
||||
export interface CreateTemplateParams {
|
||||
name: string
|
||||
description: string
|
||||
fields: TemplateField[]
|
||||
outputFormat: string
|
||||
}
|
||||
|
||||
export interface UpdateTemplateParams {
|
||||
id: string
|
||||
name?: string
|
||||
description?: string
|
||||
fields?: TemplateField[]
|
||||
outputFormat?: string
|
||||
}
|
||||
|
||||
export interface DeleteTemplateParams {
|
||||
id: string
|
||||
}
|
||||
|
||||
export type TemplateSessionState =
|
||||
| 'idle'
|
||||
| 'field-prompting'
|
||||
| 'field-recording'
|
||||
| 'completing'
|
||||
|
||||
export interface TemplateSessionInfo {
|
||||
templateId: string
|
||||
templateName: string
|
||||
state: TemplateSessionState
|
||||
currentFieldIndex: number
|
||||
totalFields: number
|
||||
currentField: TemplateField | null
|
||||
fieldValues: Record<string, string>
|
||||
}
|
||||
|
||||
export interface StartTemplateSessionParams {
|
||||
templateId: string
|
||||
}
|
||||
|
||||
export interface SetFieldValueParams {
|
||||
fieldId: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface TemplateFieldCompletedEvent {
|
||||
fieldId: string
|
||||
fieldName: string
|
||||
value: string
|
||||
nextField: TemplateField | null
|
||||
}
|
||||
|
||||
export interface TemplateSessionCompletedEvent {
|
||||
templateId: string
|
||||
outputText: string
|
||||
fieldValues: Record<string, string>
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 13: Voice Conversation (13.1)
|
||||
// ============================================================
|
||||
|
||||
export type ConversationState =
|
||||
| 'idle'
|
||||
| 'listening'
|
||||
| 'thinking'
|
||||
| 'speaking'
|
||||
|
||||
export type ConversationRole = 'user' | 'assistant' | 'system'
|
||||
|
||||
export interface ConversationMessage {
|
||||
id: string
|
||||
role: ConversationRole
|
||||
content: string
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
export interface ConversationSessionInfo {
|
||||
state: ConversationState
|
||||
messages: ConversationMessage[]
|
||||
isActive: boolean
|
||||
}
|
||||
|
||||
export interface ConversationSendParams {
|
||||
text: string
|
||||
}
|
||||
|
||||
export interface ConversationAssistantDelta {
|
||||
messageId: string
|
||||
delta: string
|
||||
accumulated: string
|
||||
}
|
||||
|
||||
export interface ConversationAssistantMessage {
|
||||
messageId: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export interface ConversationError {
|
||||
message: string
|
||||
phase: 'stt' | 'llm' | 'tts'
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 13: Local RAG (13.2)
|
||||
// ============================================================
|
||||
|
||||
export interface RAGDocument {
|
||||
id: string
|
||||
fileName: string
|
||||
filePath: string
|
||||
fileType: 'txt' | 'md' | 'pdf' | 'docx'
|
||||
chunkCount: number
|
||||
indexed: boolean
|
||||
indexedAt: number | null
|
||||
addedAt: number
|
||||
}
|
||||
|
||||
export interface RAGChunk {
|
||||
id: string
|
||||
documentId: string
|
||||
content: string
|
||||
embedding: number[]
|
||||
chunkIndex: number
|
||||
}
|
||||
|
||||
export interface RAGQueryParams {
|
||||
query: string
|
||||
topK?: number
|
||||
}
|
||||
|
||||
export interface RAGQueryResult {
|
||||
query: string
|
||||
results: Array<{
|
||||
documentId: string
|
||||
fileName: string
|
||||
content: string
|
||||
similarity: number
|
||||
}>
|
||||
/** LLM 답변 (컨텍스트 주입 후) */
|
||||
answer: string
|
||||
}
|
||||
|
||||
export interface RAGAddDocumentParams {
|
||||
filePath: string
|
||||
}
|
||||
|
||||
export interface RAGRemoveDocumentParams {
|
||||
documentId: string
|
||||
}
|
||||
|
||||
export interface RAGIndexProgress {
|
||||
documentId: string
|
||||
fileName: string
|
||||
currentChunk: number
|
||||
totalChunks: number
|
||||
percent: number
|
||||
}
|
||||
|
||||
export type RAGState = 'idle' | 'indexing' | 'querying'
|
||||
|
||||
export interface RAGStateInfo {
|
||||
state: RAGState
|
||||
documentCount: number
|
||||
totalChunks: number
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Phase 13: Voice Action / OS Automation (13.3)
|
||||
// ============================================================
|
||||
|
||||
export type VoiceActionType =
|
||||
| 'open_app'
|
||||
| 'open_url'
|
||||
| 'open_file'
|
||||
| 'keyboard_shortcut'
|
||||
| 'type_text'
|
||||
| 'system_command'
|
||||
|
||||
export interface VoiceActionPlan {
|
||||
action: VoiceActionType
|
||||
target: string
|
||||
description: string
|
||||
safe: boolean
|
||||
}
|
||||
|
||||
export interface VoiceActionExecuteParams {
|
||||
text: string
|
||||
}
|
||||
|
||||
export interface VoiceActionPreset {
|
||||
keywords: string[]
|
||||
action: VoiceActionPlan
|
||||
}
|
||||
|
||||
export interface VoiceActionHistoryEntry {
|
||||
id: string
|
||||
userText: string
|
||||
plan: VoiceActionPlan
|
||||
executed: boolean
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
export interface VoiceActionPlannedEvent {
|
||||
plan: VoiceActionPlan
|
||||
userText: string
|
||||
}
|
||||
|
||||
export interface VoiceActionExecutedEvent {
|
||||
plan: VoiceActionPlan
|
||||
success: boolean
|
||||
}
|
||||
|
||||
export interface VoiceActionErrorEvent {
|
||||
message: string
|
||||
userText: string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue