From 7a86afa7b0a56063c67439d59477ee1064773c32 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Thu, 29 Oct 2026 19:05:01 +0900 Subject: [PATCH] feat(input,voice): instant first-word-after-focus PC layout fix and speech disfluency post-processing (INPUT-04, INPUT-19, AI-03, AI-05) --- CHANGELOG.md | 13 ++ .../main/services/CustomInstructionService.ts | 31 +++- .../main/services/InputTelemetryService.ts | 40 ++++-- .../src/main/services/MeetingModeService.ts | 2 +- .../src/main/services/VoiceModeService.ts | 4 + apps/desktop/src/main/services/llm-prompts.ts | 12 +- .../src/main/services/voice-command-policy.ts | 11 ++ .../services/CustomInstructionService.test.ts | 12 +- .../input-telemetry-focus-flicker.test.ts | 18 +++ .../tests/red/instruction.usecase.test.ts | 8 +- docs/map/00-index.md | 6 +- docs/map/03-shared-packages.md | 3 +- docs/map/04-desktop-app.md | 2 +- docs/map/10-feature-catalog.md | 8 +- .../core/__tests__/dictation-cleaner.test.ts | 34 +++++ .../core/__tests__/typo-correction.test.ts | 13 ++ packages/core/package.json | 4 + packages/core/src/dictation-cleaner.ts | 136 ++++++++++++++++++ packages/core/src/index.ts | 1 + packages/core/src/typo-correction.ts | 36 +++++ packages/i18n/src/locales/en.json | 2 +- packages/i18n/src/locales/ko.json | 2 +- 22 files changed, 359 insertions(+), 39 deletions(-) create mode 100644 packages/core/__tests__/dictation-cleaner.test.ts create mode 100644 packages/core/src/dictation-cleaner.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af01b1..15136aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Additional Whisper model management UI - Plugin system for custom pipelines +## [1.14.0] - 2026-10-29 + +> Published from an annotated tag. Installer and update metadata are served by the +> canonical Forgejo feed; no binaries are committed to this repository. + +### Added +- **First-word-after-focus (`pc` / `ㅔㅊ` / `ㅖㅊ` / `내ㅔㅊ`) instant Han/Eng conversion (검색창·새 입력칸 포커스 직후 첫 단어 및 `PC` 계열 한영 자동 전환).** + - Fixes the race where clicking into a search bar or switching windows and immediately typing `pc` (`ㅔㅊ` / `ㅖㅊ`) before the first UIA snapshot absorbed the typed word into `_textAtFocus` (`editedSinceFocus = false`), blocking auto-correction. + - Expands 2-letter loose-jamo acronyms (`ㅔㅊ` / `ㅖㅊ` → `PC`, `ㅐㄴ` / `ㅒㄴ` → `OS`, `ㅔㄱ` / `ㅖㄱ` → `PR`, `ㅊㅑ` → `CI`, `ㅍㅡ` → `VM`, `ㅔㅡ` / `ㅖㅡ` → `PM`, `ㅔㅐ` / `ㅖㅐ` → `PO`, `ㅗㄱ` → `HR`, `ㅑㄱ` → `IR`, `ㅇㅡ` → `DM`, `ㅡㅇ` → `MD`, `ㅔㅇ` / `ㅖㅇ` → `PD`, `ㅍㅔ` / `ㅍㅖ` → `VP`, `ㅠㅡ` → `BM`, `ㅆㅍ` → `TV`, `ㅑㅖ` → `IP`) and Korean-prefix + loose-jamo English compounds (`내ㅔㅊ` → `내PC`, `회사ㅔㅊ에서` → `회사PC에서`, `한글로ㅔㅊ라고` → `한글로PC라고`, `윈도우ㅐㄴ` → `윈도우OS`, `새ㅁㅔㅑ를` → `새API를`). +- **Speech disfluency, self-correction, redundancy & STT homophone post-processing (`@d3ro/core/dictation-cleaner` & `builtin-clean-speech`).** + - Adds deterministic zero-latency dictation cleanup (`cleanDictatedText`) right after STT transcription to remove standalone spoken fillers (`어`, `음`, `그 쓸데없는` — while preserving quoted mentions like `어라든가`, `아라든가` and demonstratives), mid-sentence self-corrections (`검색 아니 검색이 아니라 타이핑을` → `타이핑을`), word stutters (`내가 내가` → `내가`), redundant expressions (`쓸데없는 의미없는` → `불필요한`, `정리해 가지고 해 주는 거` → `정리해 주는 기능`), colloquial suffixes (`예를 들자면은` → `예를 들어`, `보면은` → `보면`), and clear contextual STT homophones (`스시가 영어로 변경되지` → `PC가 영어로 변경되지`, `그 길을 쓸 이유가` → `그 기능을 쓸 이유가`). + - Upgrades `refine` post-processing (`llm-prompts.ts`), meeting transcript auto-polish (`MeetingModeService.polishTranscript`), and adds the built-in command preset **`구어·추임새·중복 정리`** (`builtin-clean-speech`, voice trigger `정리해줘` / `clean this up`) so spoken transcripts are cleaned up while strictly preserving the speaker's original tone (반말 / 해요체 / 합쇼체). + ## [1.13.0] - 2026-10-29 > Published from an annotated tag. Installer and update metadata are served by the diff --git a/apps/desktop/src/main/services/CustomInstructionService.ts b/apps/desktop/src/main/services/CustomInstructionService.ts index 81ea0a1..e05f894 100644 --- a/apps/desktop/src/main/services/CustomInstructionService.ts +++ b/apps/desktop/src/main/services/CustomInstructionService.ts @@ -34,6 +34,21 @@ type CreateInput = Omit< // ============================================================ const BUILTIN_INSTRUCTIONS: ReadonlyArray> = [ + { + id: 'builtin-clean-speech', + name: '구어·추임새·중복 정리', + description: '어·음·아 추임새, 말 바꾸기, 불필요한 중복 표현을 제거하고 원래 말투(반말·존댓말) 유지', + prompt: `다음 음성 받아쓰기 텍스트에서 구어 군더더기와 음성 인식 오류를 정리해 읽기 좋은 문장으로 다듬어주세요. +1. 화자의 원래 말투(반말·해요체·합쇼체)는 절대 바꾸지 말고 그대로 유지하세요. +2. 무의미한 추임새('어', '음', '아', '그', '뭐', '막', '저기' 등)는 제거하되, 추임새 자체를 예시로 언급한 표현('어라든가 아라든가' 등)은 유지하세요. +3. 말하다가 고쳐 말한 부분('검색 아니 검색이 아니라 타이핑' → '타이핑')은 취소한 앞부분을 지우고 최종 의도만 남기세요. +4. 의미 중복('쓸데없는 의미없는' → '불필요한')과 같은 구절 반복은 한 번만 남기고 간결하게 정리하세요. +5. 문맥상 명백한 음성 인식 동음이의어 오인식('PC' 문맥의 '스시/피씨' → 'PC')과 구어 어미('~하면은' → '~하면', '예를 들자면은' → '예를 들어')를 바로잡으세요. +정리된 텍스트만 출력하세요.`, + icon: 'AutoFixHigh', + isBuiltin: true, + order: 0 + }, { id: 'builtin-translate', name: '번역', @@ -41,7 +56,7 @@ const BUILTIN_INSTRUCTIONS: ReadonlyArray i.id)) - return [...stored, ...builtinDefaults(now).filter((b) => !ids.has(b.id))] + const missing = builtinDefaults(now).filter((b) => !ids.has(b.id)) + if (missing.length === 0) return stored + return [...missing, ...stored].map((item, idx) => ({ ...item, order: idx })) } function saveInstructions(): void { diff --git a/apps/desktop/src/main/services/InputTelemetryService.ts b/apps/desktop/src/main/services/InputTelemetryService.ts index 2095938..508f020 100644 --- a/apps/desktop/src/main/services/InputTelemetryService.ts +++ b/apps/desktop/src/main/services/InputTelemetryService.ts @@ -225,6 +225,9 @@ class InputTelemetryService extends EventEmitter { private _rebaseFocusText = false /** 포커스 깜빡임 뒤 돌아온 칸 — 키보드로 친 채 돌아왔으므로 이미 편집한 칸으로 본다 */ private _typedIntoFocus = false + /** 현재 포커스/클릭 이후 실제로 글자 키를 쳤는가 (첫 스냅샷 전 빠른 입력 보존) */ + private _typedInCurrentFocus = false + private _lastTypedHwnd: number | null = null /** 직전 스냅샷이 편집 가능한 칸이었는가 / 어느 창이었는가 (포커스 깜빡임 판정) */ private _prevSnapshotEditable = false private _lastFocusHwnd: number | null = null @@ -553,7 +556,13 @@ class InputTelemetryService extends EventEmitter { this._lastKeyAt = Date.now() this._lastKeyClass = keyClass - if (TYPING_KEY_CLASSES.has(keyClass)) this._lastTypedAt = this._lastKeyAt + if (TYPING_KEY_CLASSES.has(keyClass)) { + this._lastTypedAt = this._lastKeyAt + this._typedInCurrentFocus = true + this._lastTypedHwnd = this._foreground.hwnd + } else if (keyClass === 'shortcut') { + this._typedInCurrentFocus = false + } // 진단: 키 값이 아니라 종류·수정자만 남긴다 (typed 판정이 왜 틀리는지 로그로 보이게) this._lastKeyDiag = `${keyClass}${vk === null ? `?${event.keycode}` : ''}${this._modifiers.ctrl ? '+C' : ''}${this._modifiers.alt ? '+A' : ''}${this._modifiers.meta ? '+M' : ''}` @@ -605,6 +614,7 @@ class InputTelemetryService extends EventEmitter { this._lastClickPos = position // 클릭은 다른 칸으로 옮겨 갔을 수 있다 — 다음 스냅샷의 텍스트를 새 기준으로 삼는다. this._rebaseFocusText = true + this._typedInCurrentFocus = false this._terminalTracker.onPointerOrFocusChange(this._foreground.hwnd) } @@ -656,7 +666,10 @@ class InputTelemetryService extends EventEmitter { if (isKeyboard) this._lastActiveTickAt = now this._lastEventAt = now - this._sampleForeground(now, isKeyboard && gap >= 250) + this._sampleForeground( + now, + isKeyboard && (gap >= 250 || this._rebaseFocusText || this._lastKeyClass === 'shortcut') + ) } /** @@ -684,6 +697,9 @@ class InputTelemetryService extends EventEmitter { const info = getForegroundWindowInfo() if (info) { + if (info.hwnd !== this._foreground.hwnd) { + this._typedInCurrentFocus = false + } this._foreground = { appName: info.appName || null, windowTitle: info.title || null, @@ -883,19 +899,27 @@ class InputTelemetryService extends EventEmitter { // 방금 친 글이 "들어올 때부터 있던 글" 이 되어 제안이 영영 안 뜬다. 클릭 없이 키보드로 치다가 // 읽을 수 없는 요소를 거쳐 같은 창의 입력칸으로 돌아온 것이면 이미 편집한 칸으로 본다. const now = Date.now() - this._typedIntoFocus = - !this._rebaseFocusText && - !clearedByEnter && + const typedAfterFocus = + this._typedInCurrentFocus && this._foreground.hwnd !== null && - this._foreground.hwnd === this._lastFocusHwnd && - !this._prevSnapshotEditable && - this._lastTypedAt > this._lastClickAt && + this._foreground.hwnd === this._lastTypedHwnd && + this._lastTypedAt >= this._lastClickAt && now - this._lastTypedAt <= SUGGESTION_DEFAULTS.recentTypingWindowMs + this._typedIntoFocus = + !clearedByEnter && + (typedAfterFocus || + (!this._rebaseFocusText && + this._foreground.hwnd !== null && + this._foreground.hwnd === this._lastFocusHwnd && + !this._prevSnapshotEditable && + this._lastTypedAt > this._lastClickAt && + now - this._lastTypedAt <= SUGGESTION_DEFAULTS.recentTypingWindowMs)) this._lastFocusKey = focusKey this._textAtFocus = textForFocus this._rebaseFocusText = false if (clearedByEnter) { this._lastTypedAt = 0 + this._typedInCurrentFocus = false context.typedRecently = false } } diff --git a/apps/desktop/src/main/services/MeetingModeService.ts b/apps/desktop/src/main/services/MeetingModeService.ts index 3e9d37f..2a63051 100644 --- a/apps/desktop/src/main/services/MeetingModeService.ts +++ b/apps/desktop/src/main/services/MeetingModeService.ts @@ -1300,7 +1300,7 @@ class MeetingModeService extends EventEmitter { const polished = await this._rewriteTranscriptInChunks( llm, transcript, - '다음 음성 전사 텍스트를 다듬어주세요. 필러 단어(음, 어, 그, 아 등)를 제거하고, 문장 구조를 자연스럽게 교정하되, 원래 의미와 내용은 절대 변경하지 마세요. 타임스탬프 형식 [MM:SS]과 화자 표기([화자 N] 등)는 그대로 유지하세요.', + '다음 음성 전사 텍스트를 다듬어주세요. 필러 단어(음, 어, 그, 아, 뭐 등), 말 바꾸기(A 아니 A가 아니라 B → B), 불필요한 어절·의미 중복을 제거하고 문장 구조를 자연스럽게 교정하되, 화자의 원래 말투(반말/존댓말)와 의미·내용은 절대 변경하지 마세요. 타임스탬프 형식 [MM:SS]과 화자 표기([화자 N] 등)는 그대로 유지하세요.', ErrorCode.MeetingPolishFailed, ) diff --git a/apps/desktop/src/main/services/VoiceModeService.ts b/apps/desktop/src/main/services/VoiceModeService.ts index 439727e..a368458 100644 --- a/apps/desktop/src/main/services/VoiceModeService.ts +++ b/apps/desktop/src/main/services/VoiceModeService.ts @@ -29,6 +29,7 @@ import { getLocalLLMService } from './LocalLLMService' import { getLlmGateway } from './llm/LlmGateway' import { buildInstructionInvocation, resolveTargetLanguage } from './llm-prompts' import { D3ROError, ErrorCode } from '@d3ro/core/errors' +import { cleanDictatedText } from '@d3ro/core/dictation-cleaner' import { TIMING } from '@d3ro/core/constants' import { RecognitionState, AudioState } from '@d3ro/core/types' import type { KeyBindingActionId, VoiceMode, VoiceState, LLMAction } from '@d3ro/core/types' @@ -948,6 +949,9 @@ class VoiceModeService extends EventEmitter { } if (!this._isCurrent(run)) return + // 결정적 구어 군더더기·추임새·말바꾸기·중복·동음이의어 1차 정리 (LLM 유무와 무관하게 0ms 즉시 적용) + effectiveText = cleanDictatedText(effectiveText) + const route = this._resolveLlmRoute(overrideInstructionId) if (route.kind === 'insert-raw') { if (route.reason === 'llm-unavailable') { diff --git a/apps/desktop/src/main/services/llm-prompts.ts b/apps/desktop/src/main/services/llm-prompts.ts index a422a57..fd638e5 100644 --- a/apps/desktop/src/main/services/llm-prompts.ts +++ b/apps/desktop/src/main/services/llm-prompts.ts @@ -26,9 +26,15 @@ const logger = getLogger('llm-prompts') * PremiumLLMService는 NO_THINK prefix 없이 바로 사용. */ const BASE_SYSTEM_PROMPTS: Record = { - refine: `다음 음성 전사 텍스트를 자연스럽고 격식 있는 문어체로 다듬어주세요. -원래 의미를 유지하면서 문법 오류를 수정하고, 불필요한 반복이나 필러를 제거하세요. -다듬어진 텍스트만 출력하세요. 설명이나 부가 문구를 붙이지 마세요.`, + refine: `다음 음성 받아쓰기 텍스트에서 구어 군더더기와 음성 인식 오류를 정리해 읽기 좋은 문장으로 다듬어주세요. + +규칙: +1. 말투(반말·해요체·합쇼체)는 화자가 말한 그대로 유지하세요. 반말을 존댓말로 바꾸거나 존댓말을 반말로 바꾸지 마세요. +2. 추임새와 무의미한 간투사('어', '음', '아', '그', '뭐', '막', '저기' 등)는 모두 제거하세요. 단, 문장 안에서 그런 표현 자체를 예시로 언급한 경우('어라든가 아라든가 같은 추임새')는 지우지 마세요. +3. 말하다가 고쳐 말한 부분('검색 아니 검색이 아니라 타이핑' → '타이핑', '내일 아니 모레' → '모레')은 취소한 앞부분을 지우고 최종 의도만 남기세요. +4. 같은 뜻이나 구절의 중복('쓸데없는 의미없는' → '불필요한', 'PC라고 타이핑했을 때 PC라고 타이핑하면' → 'PC라고 타이핑하면')은 한 번만 남기고 간결하게 정리하세요. +5. 문맥상 명백한 음성 인식(STT) 동음이의어 오인식(예: 'PC' 문맥의 '스시/피씨' → 'PC')과 어색한 구어 어미('~하면은' → '~하면', '예를 들자면은' → '예를 들어')를 자연스럽게 바로잡으세요. +6. 다듬어진 텍스트만 출력하세요. 설명이나 따옴표, 머리말을 절대 붙이지 마세요.`, translate: `다음 텍스트를 {{targetLanguage}}로 번역해주세요. 자연스럽고 정확한 번역만 출력하세요. 원문이나 설명을 붙이지 마세요.`, diff --git a/apps/desktop/src/main/services/voice-command-policy.ts b/apps/desktop/src/main/services/voice-command-policy.ts index 9cef383..f0c3a18 100644 --- a/apps/desktop/src/main/services/voice-command-policy.ts +++ b/apps/desktop/src/main/services/voice-command-policy.ts @@ -76,6 +76,17 @@ export const DEFAULT_VOICE_COMMAND_KEYWORDS: ReadonlyArray 'explain this' ]), priority: 3 + }, + { + instructionId: 'builtin-clean-speech', + keywords: prefixKeywords([ + '정리해 주세요', + '정리해주세요', + '정리해 줘', + '정리해줘', + 'clean this up' + ]), + priority: 4 } ] diff --git a/apps/desktop/tests/main/services/CustomInstructionService.test.ts b/apps/desktop/tests/main/services/CustomInstructionService.test.ts index 420b3ee..933cedb 100644 --- a/apps/desktop/tests/main/services/CustomInstructionService.test.ts +++ b/apps/desktop/tests/main/services/CustomInstructionService.test.ts @@ -36,12 +36,12 @@ beforeEach(async () => { describe('CustomInstructionService', () => { describe('initialize + getAll', () => { - it('첫 실행 시 5개 프리셋이 생성된다', () => { + it('첫 실행 시 6개 프리셋이 생성된다', () => { const svc = getCustomInstructionService() svc.initialize() const all = svc.getAll() - expect(all.length).toBe(5) + expect(all.length).toBe(6) expect(all.every((i) => i.isBuiltin)).toBe(true) }) @@ -88,7 +88,7 @@ describe('CustomInstructionService', () => { expect(created.isBuiltin).toBe(false) expect(created.name).toBe('My Custom') - expect(svc.getAll().length).toBe(6) + expect(svc.getAll().length).toBe(7) }) }) @@ -127,7 +127,7 @@ describe('CustomInstructionService', () => { svc.initialize() expect(svc.delete('builtin-translate')).toBe(false) - expect(svc.getAll().length).toBe(5) + expect(svc.getAll().length).toBe(6) }) it('사용자 정의 명령어는 삭제할 수 있다', () => { @@ -142,7 +142,7 @@ describe('CustomInstructionService', () => { }) expect(svc.delete(created.id)).toBe(true) - expect(svc.getAll().length).toBe(5) + expect(svc.getAll().length).toBe(6) }) it('없는 ID 삭제 시 false를 반환한다', () => { @@ -184,7 +184,7 @@ describe('CustomInstructionService', () => { const all = svc.getAll() const translate = all.find((i) => i.id === 'builtin-translate') expect(translate!.prompt).toContain('{{targetLanguage}}') // 원래 프롬프트 - expect(all.length).toBe(6) // 프리셋 5 + 사용자 1 + expect(all.length).toBe(7) // 프리셋 6 + 사용자 1 }) }) }) diff --git a/apps/desktop/tests/main/services/input-telemetry-focus-flicker.test.ts b/apps/desktop/tests/main/services/input-telemetry-focus-flicker.test.ts index 43f3526..9e09d73 100644 --- a/apps/desktop/tests/main/services/input-telemetry-focus-flicker.test.ts +++ b/apps/desktop/tests/main/services/input-telemetry-focus-flicker.test.ts @@ -102,4 +102,22 @@ describe('포커스 깜빡임', () => { const context = await capture(snapshot({ appName: 'notepad.exe', text: '원래 있던 글' })) expect(context?.editedSinceFocus).toBe(false) }) + + it('검색창 등을 클릭한 직후 첫 스냅샷이 찍히기 전에 글자 키(ㅔㅊ 등)를 쳤다면 첫 스냅샷부터 editedSinceFocus 가 true 이다', async () => { + const internal = service as unknown as Internal & { + _handleMouseDown(event: { x: number; y: number; button: number }): void + _handleKeyDown(event: { + keycode: number + ctrlKey?: boolean + altKey?: boolean + shiftKey?: boolean + metaKey?: boolean + }): void + } + internal._handleMouseDown({ x: 100, y: 100, button: 1 }) + internal._handleKeyDown({ keycode: 25 }) + const context = await capture(snapshot({ appName: 'SearchHost.exe', controlName: '검색 상자', text: 'ㅔㅊ' })) + expect(context?.editedSinceFocus).toBe(true) + expect(context?.typedRecently).toBe(true) + }) }) diff --git a/apps/desktop/tests/red/instruction.usecase.test.ts b/apps/desktop/tests/red/instruction.usecase.test.ts index 11d5a1b..5732a97 100644 --- a/apps/desktop/tests/red/instruction.usecase.test.ts +++ b/apps/desktop/tests/red/instruction.usecase.test.ts @@ -8,10 +8,10 @@ import { USER_TEXT } from './fixtures' useRedHarness() describe('유스케이스: 커스텀 명령어 CRUD / 프리셋 보호 / IPC', () => { - it('첫 실행 시 빌트인 5개가 있다', () => { + it('첫 실행 시 빌트인 6개가 있다', () => { const svc = getCustomInstructionService() svc.initialize() - expect(svc.getAll()).toHaveLength(5) + expect(svc.getAll()).toHaveLength(6) expect(svc.getAll().every((i) => i.isBuiltin)).toBe(true) }) @@ -27,7 +27,7 @@ describe('유스케이스: 커스텀 명령어 CRUD / 프리셋 보호 / IPC', ( expect(svc.getById('nope')).toBeNull() }) - it('사용자 명령어를 추가하면 목록이 6개가 된다', () => { + it('사용자 명령어를 추가하면 목록이 7개가 된다', () => { const svc = getCustomInstructionService() svc.initialize() const created = svc.create({ @@ -37,7 +37,7 @@ describe('유스케이스: 커스텀 명령어 CRUD / 프리셋 보호 / IPC', ( icon: 'Edit', }) expect(created.isBuiltin).toBe(false) - expect(svc.getAll()).toHaveLength(6) + expect(svc.getAll()).toHaveLength(7) }) it('빈 이름 명령어 추가는 거부된다', () => { diff --git a/docs/map/00-index.md b/docs/map/00-index.md index a289193..1f631ed 100644 --- a/docs/map/00-index.md +++ b/docs/map/00-index.md @@ -2,7 +2,9 @@ > Status: ACTIVE > Last full audit: 2026-09-13 -> Last update: 2026-10-29 — **v1.13.0 릴리스 + 그래프 관계성 기반 극한 개인화(`INPUT-06`, `INPUT-20`) + 한영 형태론·전방 구문 감지 및 단일-시스콜 초고속 인플레이스 수정(`INPUT-19`, `INPUT-22`) + 전 표면 디자인파카(`designpaca`) 순회 감사(`SHELL-11`, `SHELL-15`).** (1) **그래프 관계성 & 극한 개인화:** `@d3ro/core/personal-graph` 및 `PersonalGraphService`에 앱별 연속 단문 메시지 간 세션 `follows` 체이닝(`_lastIndexedByScope`), 엔터 전송 직후 비워진 채팅창 문맥 복원(`recentWrites`), 증분 `shares_terms` 엣지 연결, 조사 차이 무관 어간 연속 이어쓰기(`stemContinuationsFrom`), 2-홉 그래프 경로 랭킹(`rankTwoHopGraphTargets`), 개인 그래프·어투 일치 기반 LLM 후보 재정렬(`scoreCandidatePersonalization`), 어간 바이그램 폴백 및 빈도 가중 개인 n-gram(`PersonalNgramModel`)을 추가했다(제안 노출 빈도는 그대로 유지). (2) **영어 감지 강화 & 초고속 타이핑 중 무경합 교정:** `@d3ro/core/typo-correction`에 확장 영어 어간(`EXTENDED_ENGLISH_STEMS`, `kubernetes`/`microsoft` 등)과 생산적 접두·접미 파생 형태론(`matchesInflectedOrDerivedEnglish`), 전방 영어 구문 호응(`새 ㅠㄷ `→`to be `, `새 애 this `→`to do this `, `랙 솓 `→`for the ` vs `오늘 새 API를 만들었어` 보존), 영어 축약형·약어(`ㅊ무ㅅ`/`ㅊ무'ㅅ`/`ㅊ무ㅜ'ㅅ`→`can't`, `츤를`→`CMS를`, `눈를`→`SNS를` 등)를 추가하고, `sendWin32UnicodeReplacement`(`utils/win32-unicode-input.ts`)로 `(선택 Space) + N × VK_BACK + M × KEYEVENTF_UNICODE`를 **단일 `SendInput` 시스템콜(`< 0.5 ms`, 대기 `0 ms`)**로 원자적 주입하며, 타이핑 중 추가 입력된 꼬리 글자를 보존하는 델타 리베이싱(`rebaseTypoReplacementPlan`)을 구현했다. (3) `packages/ui`, `apps/web`, `apps/admin`, `apps/desktop/src/renderer`(메인·팝업 6종), `site/`, `apps/mobile-rn` 6개 표면을 전수 순회해 `design.md` 계약 위반을 모두 해소했다 (`npm run check:design` 0건). +> Last update: 2026-10-29 — **v1.14.0 릴리스 + 포커스 전환 직후 첫 단어(`pc`/`ㅔㅊ`/`ㅖㅊ`/`내ㅔㅊ`) 한영 자동 전환(`INPUT-04`, `INPUT-19`) + 받아쓰기 구어·추임새·중복·동음이의어 후처리 정리 고도화(`AI-03`, `AI-05`).** (1) **포커스 클릭 직후 첫 단어(`pc` 등) 자동 전환:** `InputTelemetryService`에서 마우스 클릭(`_rebaseFocusText`)·창 전환 직후 첫 스냅샷(40~680 ms)이 찍히기 전에 사용자가 곧바로 친 첫 단어(`ㅔㅊ`, `ㅖㅊ` 등)가 `_textAtFocus` 기준선에 삼켜져 `editedSinceFocus = false`가 되던 문제를 `_typedInCurrentFocus`·`_lastTypedHwnd` 추적 및 첫 글자 키 입력 시 포그라운드 창 즉시 샘플링으로 해결하고, `@d3ro/core/typo-correction`에 대소문자 2글자 영문 약어(`ㅔㅊ`/`ㅖㅊ`→`PC`, `ㅐㄴ`/`ㅒㄴ`→`OS`, `ㅔㄱ`/`ㅖㄱ`→`PR`, `ㅊㅑ`→`CI`, `ㅍㅡ`→`VM`, `ㅔㅡ`/`ㅖㅡ`→`PM`, `ㅔㅐ`/`ㅖㅐ`→`PO`, `ㅗㄱ`→`HR`, `ㅑㄱ`→`IR`, `ㅇㅡ`→`DM`, `ㅡㅇ`→`MD`, `ㅔㅇ`/`ㅖㅇ`→`PD`, `ㅍㅔ`/`ㅍㅖ`→`VP`, `ㅠㅡ`→`BM`, `ㅆㅍ`→`TV`, `ㅑㅖ`→`IP`) 및 한글 접두+낱자모 합성어(`내ㅔㅊ`→`내PC`, `회사ㅔㅊ에서`→`회사PC에서`, `한글로ㅔㅊ라고`→`한글로PC라고`, `윈도우ㅐㄴ`→`윈도우OS`, `새ㅁㅔㅑ를`→`새API를`)를 추가했다. (2) **받아쓰기 구어·추임새·말바꾸기·중복·STT 동음이의어 정리:** `@d3ro/core/dictation-cleaner`(`cleanDictatedText`)를 신설해 `VoiceModeService._transcribe` 직후 지연 0 ms로 단독 추임새(`어`, `음`, `그 쓸데없는` 등 — 단 인용된 `어라든가`, `아라든가` 보존), 발화 중 말바꾸기(`검색 아니 검색이 아니라 타이핑을`→`타이핑을`), 상투적 중복(`쓸데없는 의미없는`→`불필요한`, `정리해 가지고 해 주는 거`→`정리해 주는 기능`), 구어 잉여 어미(`예를 들자면은`→`예를 들어`, `보면은`→`보면`), 문맥상 명백한 STT 동음이의어(`스시가 영어로 변경되지`→`PC가 영어로 변경되지`, `그 길을 쓸 이유가`→`그 기능을 쓸 이유가`)를 즉시 정리하고, `BASE_SYSTEM_PROMPTS.refine`(`llm-prompts.ts`), `MeetingModeService.polishTranscript`, 신규 내장 프리셋 `builtin-clean-speech`(`구어·추임새·중복 정리`, `CustomInstructionService.ts`)가 화자의 원래 어투(반말/해요체/합쇼체)를 바꾸지 않고 추임새·말바꾸기·중복·비문만 자연스럽게 다듬도록 업그레이드했다. +> +> Previous update: 2026-10-29 — **v1.13.0 릴리스 + 그래프 관계성 기반 극한 개인화(`INPUT-06`, `INPUT-20`) + 한영 형태론·전방 구문 감지 및 단일-시스콜 초고속 인플레이스 수정(`INPUT-19`, `INPUT-22`) + 전 표면 디자인파카(`designpaca`) 순회 감사(`SHELL-11`, `SHELL-15`).** (1) **그래프 관계성 & 극한 개인화:** `@d3ro/core/personal-graph` 및 `PersonalGraphService`에 앱별 연속 단문 메시지 간 세션 `follows` 체이닝(`_lastIndexedByScope`), 엔터 전송 직후 비워진 채팅창 문맥 복원(`recentWrites`), 증분 `shares_terms` 엣지 연결, 조사 차이 무관 어간 연속 이어쓰기(`stemContinuationsFrom`), 2-홉 그래프 경로 랭킹(`rankTwoHopGraphTargets`), 개인 그래프·어투 일치 기반 LLM 후보 재정렬(`scoreCandidatePersonalization`), 어간 바이그램 폴백 및 빈도 가중 개인 n-gram(`PersonalNgramModel`)을 추가했다(제안 노출 빈도는 그대로 유지). (2) **영어 감지 강화 & 초고속 타이핑 중 무경합 교정:** `@d3ro/core/typo-correction`에 확장 영어 어간(`EXTENDED_ENGLISH_STEMS`, `kubernetes`/`microsoft` 등)과 생산적 접두·접미 파생 형태론(`matchesInflectedOrDerivedEnglish`), 전방 영어 구문 호응(`새 ㅠㄷ `→`to be `, `새 애 this `→`to do this `, `랙 솓 `→`for the ` vs `오늘 새 API를 만들었어` 보존), 영어 축약형·약어(`ㅊ무ㅅ`/`ㅊ무'ㅅ`/`ㅊ무ㅜ'ㅅ`→`can't`, `츤를`→`CMS를`, `눈를`→`SNS를` 등)를 추가하고, `sendWin32UnicodeReplacement`(`utils/win32-unicode-input.ts`)로 `(선택 Space) + N × VK_BACK + M × KEYEVENTF_UNICODE`를 **단일 `SendInput` 시스템콜(`< 0.5 ms`, 대기 `0 ms`)**로 원자적 주입하며, 타이핑 중 추가 입력된 꼬리 글자를 보존하는 델타 리베이싱(`rebaseTypoReplacementPlan`)을 구현했다. (3) `packages/ui`, `apps/web`, `apps/admin`, `apps/desktop/src/renderer`(메인·팝업 6종), `site/`, `apps/mobile-rn` 6개 표면을 전수 순회해 `design.md` 계약 위반을 모두 해소했다 (`npm run check:design` 0건). > > Previous update: 2026-10-27 — **v1.11.0 릴리스 + Araso 방식 한영 자동 변환·터미널/Vim/xterm.js 지원 완성 (`INPUT-19`, `GAP-INPUT-08`).** `nyttastudio/araso`를 분석해 `@d3ro/core/araso-layout` 및 `@d3ro/core/typo-correction`을 대폭 업그레이드하고 터미널·Vim·xterm.js(`Agent Switchboard`)까지 확장했다: 영어·약어·CamelCase+한국어 조사/단어 혼합어 분리(`githubdp`→`github에`, `PDFvkdlf`/`ㅖㅇㄹ파일`→`PDF파일`, `Reactzjavhsjsxm`→`React컴포넌트`, `dhsmfdmsgoogledptj`→`오늘은google에서`, `1:1ansdml`→`1:1문의`, 2글자 약어 받침 호응 `TMdms`→`TM은` vs `TMsms`→`쓰는`), 쌍자음 잔여 Shift 정규화(`djEJs`→`어떤`, `qkRNjTdj`→`바꿨어`), 한글 자판 상태 영어/혼합어 역변환(`ㅗ디ㅣㅐ 재깅`→`hello world`, `내ㅡㄷ샤ㅡㄷ`→`sometime`, `ㅎ샤ㅗㅕㅠ에`→`github에`, `ㅠㅕㅎ가`→`bug가`, 알파벳+조사 `ㄴ가`→`s가`, `ㄴ은`→`s은`), 문장 문맥 한영 전환(`Stay hungry, stay foolishsms wkqtmdml akfdlek.`), URL·경로·이메일 보호(`isUrlOrPathRun`), 터미널·Vim 명령(`:ㅈㅂ`→`:wq`, `:ㅂ!`→`:q!`, `퍄ㅡ `→`vim `, Vim 노멀 모드 교정 억제), `SendInput(KEYEVENTF_UNICODE)` 직접 유니코드 타이핑(클립보드 무접촉), 단어 경계(`25ms`)와 어절 내부(`650ms`) 유휴 분리 및 완성형 음절(`[가-힣]`) 한정 `commitComposition`으로 고속 타이핑 시 글자 삼킴·유령 공백·앞글자 중복을 완전히 해소했다. 통계 수집 동의(`inputTelemetryEnabled`)가 꺼져 있어도 기본 기능(`typoAutoCorrectEnabled: true`)으로 즉시 동작한다. > @@ -13,7 +15,7 @@ > Previous update: 2026-09-22 — **Gemma/Ollama 폭주 방어 계약을 기록했다.** 19:14:12 부팅 워밍업이 `keep_alive: 30m`으로 `gemma4:e4b`를 19:44:12까지 VRAM 3,226,342,521 bytes / context 4096으로 강제 상주시킨 것이 관측됐으며, 같은 시점 Windows GPU Engine PID 표본에는 Ollama의 활성 compute가 없었다. 즉 당시 상태는 무한 추론이 아니라 강제 residency였다. 19:11:17~19:11:58의 자동 제안 연속 생성은 기존 900 ms·12/min·5 candidates·128 tokens·한 글자 재생성 정책이 허용한 burst였다. 현재 구현 계약은 부팅 warmup 제거, `keep_alive: 2m`, 제안 600 ms / 최소 5 s 간격 / 기본 6회·hard max 12회 per min / 3 candidates / 64 tokens / 12-char growth / 8 s timeout, 그리고 요청별 취소·상한·종료 정리다. 독립 표적 검증은 6 test files / 69 tests passed / 0 failed, 변경 코드·테스트 ESLint와 `git diff --check`도 exit 0이다. Raw Ollama에서는 cold bounded 요청이 client hard timeout 15.044 s에 취소된 뒤 `/api/ps`가 비었고 `/api/version`은 80 ms에 회복했다. 명시 warmup은 HTTP 200 / 16.639 s, 후속 warm 요청은 body `options.num_predict=1`, `keep_alive='2m'`로 553 ms HTTP 200 / `done:true` / `eval_count:1` / `done_reason:length`였고 `/api/ps` expiry는 약 119.9 s였다. **19:48:59 +09:00에는 새 generate/unload/kill/retry 없이 충분히 지난 뒤 한 번의 `/api/ps`가 HTTP 200 / 45.8 ms / `{models:[]}`였고 `/api/version`은 HTTP 200 / 7.3 ms / `0.32.13`이었다.** 이는 raw API 수준의 expiry 뒤 unload 확인일 뿐 앱 재시작·GUI·실제 타이핑 증거는 아니므로 상태는 `[~]`로 유지한다 (`11` GAP-LLM-04, GAP-INPUT-06). > > Previous update: 2026-09-21 — **Input intelligence (입력 레메트리 + 다음 문장 제안) 신규**. 데스크톱에 입력 수집기(`InputTelemetryService`), UIA 컨텍스트 브리지(사이드카 `GET /uia/focus`), 제안 서비스(`SuggestionService`), 어렛 커 오버레이, 설정 > 입력 탭(동의·정책·주간 인사이트·개인 문구)을 추가했다. 카탈로그에 `INPUT-01`~`INPUT-08`(전부 데스크톱 `[~]` — 유닛 48건은 GREEN 이지만 **실앱 타이핑 검증 전**), 백로그에 GAP-INPUT-01~05 + GAP-LLM-03, §7 에 CONSTRAINT-INPUT-01(키 내용 미저장 — ActivityWatch 정책 채택)을 기록. 설계 근거는 조사 기반이다: 어렛은 `GetGUIThreadInfo` 가 아니라 UIA `TextPattern.GetSelection`(Chromium 은 `TextPattern2` 미구현), 타이핑 스트는 키코드 복원이 아니라 UIA 스냅샷 diff(한/일 IME 대응), 디바운스/토큰 한도는 인라인 컴플리션 실측값(Continue 350 / Tabby 250 / twinny 300 ms, 출력 64~256 토큰). 의존성: `koffi` 3.3.1(포그라운드 창 FFI), 사이드카 `uiautomation` 2.0.29 + `comtypes`. 데스크톱 유닛 총계 1409(+49), Electron ABI 실행에서 신규 실패 0건. 당시의 24.7초/4.9초 지연 설명과 `keep_alive: 30m`·부팅 워밍업 처방은 **현재 상태가 아닌 과거 가설/완화 이력**이며, 최신 운영 결론은 위 2026-09-22 항목과 `11` GAP-LLM-04를 따른다. 직전: LLM instruction-prompt fix (`9c2b4d4`): the custom-instruction path inserted the instruction's own wording instead of the processed result and had **never worked in any shipped release** (`v0.1.0-alpha`..`v1.4.0`, introduced `fea923d` 2026-04-05, not a regression). `llm-prompts.ts` is now the SSOT for prompt resolution and placeholder substitution, shared by `VoiceModeService` / `ChainService` / `LLM.PROCESS`. AI-04/05/06/07 are demoted to `[~]` on desktop — fixed with unit tests, but **not verified in a running app** and the four related `tests/red/*.usecase.test.ts` could not execute (`better-sqlite3` ABI). New: GAP-LLM-01 (no target-language setting), GAP-LLM-02 (this fix unverified); GAP-INFRA-06 amended (the ABI masks verification, not just dev-env switching cost); GAP-I18N-01 amended (`popup.error.default` missing in 10 locales). Earlier the same day: CAP-16 (desktop key bindings rebuilt on one `@d3ro/core/keybinding` SSOT — multiple bindings per action, mouse buttons, `HOTKEY` → `KEYBINDING` IPC group), verified on Windows by a manual run, so CAP-16 and CAP-02 are `[x]` and GAP-KEY-01 is closed. Still open: GAP-KEY-02/03, GAP-QA-02, GAP-I18N-01/02, GAP-INFRA-06, GAP-LLM-01/02, GAP-INPUT-01~05; `11` §7 holds accepted design constraints (things deliberately kept, not gaps) -> Scope: entire monorepo `D:/workspace/D3ROVoice` at product version `1.13.0` (`release/product-version.json`, released 2026-10-29) +> Scope: entire monorepo `D:/workspace/D3ROVoice` at product version `1.14.0` (`release/product-version.json`, released 2026-10-29) > Purpose: let any agent (or human) answer two questions in under a minute: > 1. **What infrastructure exists?** (build, CI, services, APIs, data, packages, deploy) > 2. **How far is each feature developed?** (per surface, with file anchors and status) diff --git a/docs/map/03-shared-packages.md b/docs/map/03-shared-packages.md index 29241d6..de84c42 100644 --- a/docs/map/03-shared-packages.md +++ b/docs/map/03-shared-packages.md @@ -18,7 +18,8 @@ The canonical place for types and cross-surface logic. Both desktop and web/mobi | IPC channels | `./ipc-channels` | `IPC_CHANNELS` object + `IPCChannel` union. **SSOT** for every desktop IPC channel (VOICE, AUDIO, STT, TTS, LLM, KEYBINDING, CONFIG, HISTORY, UNIFIED_SEARCH, DICTIONARY, WINDOW, SYSTEM, STATS, MEMO, VOICE_COMMAND, CONTEXT, CHAIN, CAPTION, FILE_TRANSCRIPTION, MEETING_SUMMARY, DICTATION_TEMPLATE, VOICE_CONVERSATION, RAG, VOICE_ACTION, MEETING_MODE, MEETING_DOC_TEMPLATE, MEETING_CHAT, LICENSE, CLOUD_SYNC, INSTRUCTION, SYSTEM_AUDIO, POPUP_RESULT, POPUP_HISTORY, POPUP_COMMAND, POPUP_CAPTION, VOICE_PARTIAL, CLIPBOARD, APP, ONLINE_AUTH, ADS, SUPPORT, INPUT_TELEMETRY, SUGGESTION, POPUP_SUGGESTION) | | Key bindings | `./keybinding` | **SSOT** for every global shortcut in the app: `KeyBinding` (`device`/`code`/`ctrl`/`alt`/`shift`/`meta`), `KEY_CATALOG` (10 selectable groups incl. mouse), `KEYBINDING_ACTIONS` (9 rebindable actions incl. the three suggestion actions), `bindingKey`/`normalizeBinding`/`validateBinding`/`detectBindingConflicts`/`formatBindingSegments`/`searchKeyCatalog`/`parseBindingMap`. Persisted as `AppConfig.keyBindings`. i18n keys are exposed as plain `string` so core stays independent of `@d3ro/i18n`; consumers narrow at the boundary (`asTranslationKey`) and a contract test guards the keys — accepted constraint, `11` §7 CONSTRAINT-I18N-01. Tests: `__tests__/keybinding*.test.ts` via `vitest.config.ts` (`npm run test --workspace=@d3ro/core`), 117 cases as of 2026-09-21 | | Input intelligence | `./input-intelligence` | **SSOT** for the input-telemetry and next-sentence-suggestion domain (added 2026-09-21): key classification (`classifyKeyStroke`), text metrics (`countWords`/`countSentences`/`endsSentence`/`textBeforeCaret`), `computeTypedDelta` (UIA snapshot diff — the IME-safe way to count typed text), `decideSuggestion` + `isAppExcluded` (when to request / skip / clear), `parseSuggestionCandidates`/`sanitizeSuggestionLine` (prompt-leak and prefix-echo defence), `anchorFloatingPanel` (caret-anchored overlay placement), `mergeActivityBucket`/`summarizeActivity`/`pixelsToMeters`, `extractPhrases`/`selectPhraseHints`, `INPUT_TELEMETRY_DEFAULTS`/`SUGGESTION_DEFAULTS` | -| Typo correction & Araso layout | `./typo-correction`, `./araso-layout` | **SSOT** for built-in automatic Han/Eng conversion and typo auto-correction (upgraded 2026-10-28): 2-set Korean/English layout conversion (`engToHangul`/`hangulToEng`), productive English derivational prefixes/suffixes (`matchesInflectedOrDerivedEnglish`, `EXTENDED_ENGLISH_STEMS`), phrase-level lookahead English detection (`TO_FOLLOWING_ENGLISH_WORDS`, `resolveTokenAsEnglishPreview`), lingering Shift normalization (`normalizeLingeringShift`/`lingersAfterKoreanShift`), mixed-word splitting with Korean particle batchim agreement (`splitMixedWord`/`particleAgrees`), reverse Hangul-to-English/mixed restoration, URL/path/email run protection (`isUrlOrPathRun`), deterministic spelling & jamo-noise rules (`detectTypos`/`detectJamoNoise`), delta-rebasing for in-flight typing (`rebaseTypoReplacementPlan`), and LLM typo validation (`validateModelCorrections`). | +| Typo correction & Araso layout | `./typo-correction`, `./araso-layout` | **SSOT** for built-in automatic Han/Eng conversion and typo auto-correction (upgraded 2026-10-29): 2-set Korean/English layout conversion (`engToHangul`/`hangulToEng`), shifted/unshifted 2-letter loose-jamo acronyms (`ㅔㅊ`/`ㅖㅊ`→`PC`, `ㅐㄴ`/`ㅒㄴ`→`OS`, `ㅔㄱ`/`ㅖㄱ`→`PR`, `ㅊㅑ`→`CI`, `ㅍㅡ`→`VM`, `ㅔㅡ`→`PM`, `ㅔㅐ`→`PO`, `ㅗㄱ`→`HR`, `ㅑㄱ`→`IR`, `ㅇㅡ`→`DM`, `ㅡㅇ`→`MD`, `ㅔㅇ`→`PD`, `ㅍㅔ`→`VP`, `ㅠㅡ`→`BM`, `ㅆㅍ`→`TV`, `ㅑㅖ`→`IP`) and Korean-prefix + loose-jamo compounds (`내ㅔㅊ`→`내PC`, `회사ㅔㅊ에서`→`회사PC에서`, `한글로ㅔㅊ라고`→`한글로PC라고`), productive English derivational prefixes/suffixes (`matchesInflectedOrDerivedEnglish`, `EXTENDED_ENGLISH_STEMS`), phrase-level lookahead English detection (`TO_FOLLOWING_ENGLISH_WORDS`, `resolveTokenAsEnglishPreview`), lingering Shift normalization (`normalizeLingeringShift`/`lingersAfterKoreanShift`), mixed-word splitting with Korean particle batchim agreement (`splitMixedWord`/`particleAgrees`), reverse Hangul-to-English/mixed restoration, URL/path/email run protection (`isUrlOrPathRun`), deterministic spelling & jamo-noise rules (`detectTypos`/`detectJamoNoise`), delta-rebasing for in-flight typing (`rebaseTypoReplacementPlan`), and LLM typo validation (`validateModelCorrections`). | +| Dictation cleaner | `./dictation-cleaner` | **SSOT** for deterministic zero-latency speech disfluency & dictation cleanup (`cleanDictatedText`, added 2026-10-29): strips standalone spoken fillers (`어`, `음`, `그 쓸데없는` while preserving quoted mentions like `어라든가`, `아라든가` and demonstratives), mid-sentence self-corrections (`X 아니 X이 아니라 Y` → `Y`), word stutters (`내가 내가` → `내가`), colloquial suffixes (`예를 들자면은` → `예를 들어`, `보면은` → `보면`), redundant expressions (`쓸데없는 의미없는` → `불필요한`), and clear contextual STT homophones (`스시가 영어로 변경되지` → `PC가 영어로 변경되지`, `그 길을 쓸 이유가` → `그 기능을 쓸 이유가`) while preserving speaker register. | | Personal graph & n-gram | `./personal-graph`, `./personal-ngram` | **SSOT** for relational personalization and n-gram continuation (upgraded 2026-10-28): exact & particle-invariant stemmed continuations (`continuationsFrom`/`stemContinuationsFrom`), IDF-weighted related node scoring (`scoreRelatedNodes`), 2-hop graph path ranking (`rankTwoHopGraphTargets` across `shares_terms→follows` and `follows→follows`), personalized candidate reranking (`scoreCandidatePersonalization`), and frequency-weighted n-gram indexing with Korean stemmed-word bigram fallback (`PersonalNgramModel`). | | Constants | `./constants` | Shared constants | | Crypto license | `./utils/crypto-license` | Ed25519 license sign/verify (used by admin issuer + desktop verifier) | diff --git a/docs/map/04-desktop-app.md b/docs/map/04-desktop-app.md index 5be6e1a..6b41133 100644 --- a/docs/map/04-desktop-app.md +++ b/docs/map/04-desktop-app.md @@ -83,7 +83,7 @@ Singleton + `EventEmitter` pattern (`getXService()` accessors). ### Input intelligence (2026-09-21; Local Flow Intelligence extension 2026-09-22) | Service / file | Purpose | |---|---| -| `InputTelemetryService` | Global input telemetry and context observer: keystroke/click/scroll counters, mouse travel (Manhattan sum of per-axis deltas), active time, per-hour-per-app buckets flushed every 5 s; typed-text learning via UIA snapshot diffs. **Since 2026-10-26**, the UIA context observer runs by default whenever `typoAutoCorrectEnabled !== false` (or `suggestionEnabled === true`), while SQLite `input_activity` persistence only runs when `inputTelemetryEnabled === true` (opt-in). **Since 2026-10-27**, includes `TerminalKeystrokeTracker` (`@d3ro/core/input-intelligence`) + `isForegroundKoreanIme` (`utils/win32-foreground.ts`) to reconstruct the active terminal/Vim line (`reconcileWithScreen` for UIA screen buffers like Windows Terminal/pwsh/cmd, `reconcileWithXtermValue` for `xterm.js` `