chore(deps): upgrade to Electron 43, Vite 8, Vitest 5 and pin Node 24

Electron 33.4.11 -> 43.8.10, electron-vite 6, Vite 8.3.8, Vitest 5.1.0, Node engines 24.x.
Electron 43 made clipboard text read/write asynchronous, so text insertion, selected-text
capture and the popup copy channel now await it; includes the async restore regression test.
Evidence: docs/evidence/2026-11-17-backlog-operations.md (GAP-SEC-01).
This commit is contained in:
Yun Chan 2026-11-20 15:16:08 +09:00
parent 876e72ea2f
commit e0b1ceaa75
16 changed files with 2755 additions and 3544 deletions

View file

@ -23,13 +23,14 @@
"@supabase/ssr": "^0.10.0", "@supabase/ssr": "^0.10.0",
"@supabase/supabase-js": "^2.103.0", "@supabase/supabase-js": "^2.103.0",
"lucide-react": "^1.33.0", "lucide-react": "^1.33.0",
"next": "16.3.1", "next": "16.4.6",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^22.13.0", "@types/node": "^24.0.0",
"@types/react": "^19.0.0", "@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0" "@types/react-dom": "^19.0.0",
"vitest": "^5.1.0"
} }
} }

View file

@ -7,8 +7,8 @@ export default defineConfig({
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, './src'),
}, },
}, },
esbuild: { oxc: {
jsx: 'automatic', jsx: { runtime: 'automatic' },
}, },
test: { test: {
globals: false, globals: false,

View file

@ -5,7 +5,7 @@ productName: D3RO Voice
copyright: Copyright © 2026 D3RO copyright: Copyright © 2026 D3RO
# monorepo(npm workspaces)에서 electron이 루트 node_modules로 호이스팅되어 # monorepo(npm workspaces)에서 electron이 루트 node_modules로 호이스팅되어
# 자동 감지가 실패하는 문제를 피하려고 명시적으로 버전 고정. # 자동 감지가 실패하는 문제를 피하려고 명시적으로 버전 고정.
electronVersion: "33.4.11" electronVersion: "43.8.10"
# 설치 크기 절감 — 지원 로케일만 포함한다 # 설치 크기 절감 — 지원 로케일만 포함한다
electronLanguages: electronLanguages:
- ko - ko

View file

@ -37,16 +37,16 @@
"@electron-toolkit/tsconfig": "^1.0.1", "@electron-toolkit/tsconfig": "^1.0.1",
"@playwright/test": "^1.62.1", "@playwright/test": "^1.62.1",
"@types/better-sqlite3": "^7.6.13", "@types/better-sqlite3": "^7.6.13",
"@types/node": "^22.13.0", "@types/node": "^24.0.0",
"@types/react": "^19.0.0", "@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0", "@types/react-dom": "^19.0.0",
"@types/ws": "^8.18.1", "@types/ws": "^8.18.1",
"@vitejs/plugin-react": "^4.3.0", "@vitejs/plugin-react": "^6.3.0",
"electron": "33.4.11", "electron": "43.8.10",
"electron-builder": "^26.8.1", "electron-builder": "^26.8.1",
"electron-vite": "^2.3.0", "electron-vite": "^6.0.0",
"vite": "^5.4.0", "vite": "^8.3.8",
"vitest": "^2.1.0" "vitest": "^5.1.0"
}, },
"dependencies": { "dependencies": {
"@d3ro/core": "*", "@d3ro/core": "*",

View file

@ -248,7 +248,7 @@ export class ScreenContextService {
// 1. 기존 클립보드 저장 + 온전히 되돌릴 수 있는지 판정 (삽입과 같은 정책) // 1. 기존 클립보드 저장 + 온전히 되돌릴 수 있는지 판정 (삽입과 같은 정책)
// 탐색기에서 복사한 파일·Excel 셀처럼 다 되돌릴 수 없으면 캡처를 건너뛴다 — 부가 문맥 하나 때문에 // 탐색기에서 복사한 파일·Excel 셀처럼 다 되돌릴 수 없으면 캡처를 건너뛴다 — 부가 문맥 하나 때문에
// 사용자가 복사해 둔 것을 지우면 안 된다(예전엔 파일 복사본이 '비어 있음'으로 보여 clear() 됐다). // 사용자가 복사해 둔 것을 지우면 안 된다(예전엔 파일 복사본이 '비어 있음'으로 보여 clear() 됐다).
const restore = planClipboardRestore(captureClipboard(port)) const restore = planClipboardRestore(await captureClipboard(port))
if (restore.kind === 'unrestorable' || (restore.kind === 'write' && restore.dropped.length > 0)) { if (restore.kind === 'unrestorable' || (restore.kind === 'write' && restore.dropped.length > 0)) {
logger.info('선택 텍스트 캡처 건너뜀: 클립보드를 온전히 되돌릴 수 없다') logger.info('선택 텍스트 캡처 건너뜀: 클립보드를 온전히 되돌릴 수 없다')
return null return null
@ -271,7 +271,7 @@ export class ScreenContextService {
await this._sleep(150) await this._sleep(150)
// 5. 클립보드에서 텍스트 읽기 // 5. 클립보드에서 텍스트 읽기
const text = port.readText() const text = await port.readText()
// 6. 클립보드 복원 // 6. 클립보드 복원
this._restoreClipboard(restore) this._restoreClipboard(restore)

View file

@ -210,7 +210,7 @@ export class TextInsertService extends EventEmitter {
*/ */
private async _insertViaClipboard(text: string): Promise<InsertMethod> { private async _insertViaClipboard(text: string): Promise<InsertMethod> {
// 1. 기존 클립보드 저장 + 복원 가능성 판정 // 1. 기존 클립보드 저장 + 복원 가능성 판정
const snapshot = this.saveClipboard() const snapshot = await this.saveClipboard()
const plan = planClipboardRestore(snapshot) const plan = planClipboardRestore(snapshot)
if (plan.kind === 'unrestorable') { if (plan.kind === 'unrestorable') {
logger.info( logger.info(
@ -225,7 +225,7 @@ export class TextInsertService extends EventEmitter {
try { try {
// 2. 클립보드에 텍스트 설정 // 2. 클립보드에 텍스트 설정
this._clipboard.writeText(text) await this._clipboard.writeText(text)
// 짧은 지연: 일부 앱이 클립보드 변경을 받아들일 시간 필요 // 짧은 지연: 일부 앱이 클립보드 변경을 받아들일 시간 필요
await this._sleep(20) await this._sleep(20)
@ -239,14 +239,14 @@ export class TextInsertService extends EventEmitter {
await this._sleep(250) await this._sleep(250)
// 5. 클립보드 복원 (원래 내용으로 되돌림) // 5. 클립보드 복원 (원래 내용으로 되돌림)
if (this._restoreIfStillOurs(text, snapshot)) { if (await this._restoreIfStillOurs(text, snapshot)) {
this.emit('clipboard-restored', {}) this.emit('clipboard-restored', {})
} }
return 'clipboard' return 'clipboard'
} catch (error) { } catch (error) {
// 실패 시에도 클립보드 복원 시도 // 실패 시에도 클립보드 복원 시도
try { try {
this._restoreIfStillOurs(text, snapshot) await this._restoreIfStillOurs(text, snapshot)
} catch { } catch {
logger.warn('Failed to restore clipboard after insert error') logger.warn('Failed to restore clipboard after insert error')
} }
@ -258,8 +258,8 @@ export class TextInsertService extends EventEmitter {
* 클립보드가 아직 우리가 넣은 텍스트일 때만 되돌린다. 그 사이 사용자가 새로 복사했다면 * 클립보드가 아직 우리가 넣은 텍스트일 때만 되돌린다. 그 사이 사용자가 새로 복사했다면
* 그 내용을 덮어쓰지 않는다 (writeText 자체가 실패한 경우도 여기서 걸러진다). * 그 내용을 덮어쓰지 않는다 (writeText 자체가 실패한 경우도 여기서 걸러진다).
*/ */
private _restoreIfStillOurs(text: string, snapshot: ClipboardSnapshot<ClipboardImage>): boolean { private async _restoreIfStillOurs(text: string, snapshot: ClipboardSnapshot<ClipboardImage>): Promise<boolean> {
if (this._clipboard.readText() !== text) { if (await this._clipboard.readText() !== text) {
logger.debug('Clipboard changed during insert; skipping restore') logger.debug('Clipboard changed during insert; skipping restore')
return false return false
} }
@ -277,7 +277,7 @@ export class TextInsertService extends EventEmitter {
/** /**
* 현재 클립보드 상태를 모든 포맷으로 캡처한다. * 현재 클립보드 상태를 모든 포맷으로 캡처한다.
*/ */
saveClipboard(): ClipboardSnapshot<ClipboardImage> { saveClipboard(): Promise<ClipboardSnapshot<ClipboardImage>> {
return captureClipboard(this._clipboard) return captureClipboard(this._clipboard)
} }

View file

@ -29,7 +29,7 @@ export interface ClipboardWriteData<TImage extends ClipboardImage> {
/** 클립보드 IO 포트. 운영은 Electron clipboard, 테스트는 메모리 구현을 꽂는다. */ /** 클립보드 IO 포트. 운영은 Electron clipboard, 테스트는 메모리 구현을 꽂는다. */
export interface ClipboardPort<TImage extends ClipboardImage = ClipboardImage> { export interface ClipboardPort<TImage extends ClipboardImage = ClipboardImage> {
availableFormats(): string[] availableFormats(): string[]
readText(): string readText(): string | Promise<string>
readHTML(): string readHTML(): string
readRTF(): string readRTF(): string
readImage(): TImage readImage(): TImage
@ -88,9 +88,9 @@ export function isStandardClipboardFormat(format: string): boolean {
export const UNKNOWN_FORMATS = '<unknown>' export const UNKNOWN_FORMATS = '<unknown>'
/** 현재 클립보드의 모든 포맷을 캡처한다. */ /** 현재 클립보드의 모든 포맷을 캡처한다. */
export function captureClipboard<TImage extends ClipboardImage>( export async function captureClipboard<TImage extends ClipboardImage>(
port: ClipboardPort<TImage> port: ClipboardPort<TImage>
): ClipboardSnapshot<TImage> { ): Promise<ClipboardSnapshot<TImage>> {
const buffers: ClipboardBufferEntry[] = [] const buffers: ClipboardBufferEntry[] = []
const unreadable: string[] = [] const unreadable: string[] = []
@ -121,7 +121,7 @@ export function captureClipboard<TImage extends ClipboardImage>(
return { return {
formats, formats,
text: port.readText() || null, text: (await port.readText()) || null,
html: port.readHTML() || null, html: port.readHTML() || null,
rtf: port.readRTF() || null, rtf: port.readRTF() || null,
image: image && !image.isEmpty() ? image : null, image: image && !image.isEmpty() ? image : null,

View file

@ -1072,5 +1072,7 @@ export function reapplyThemeToAllPopups(): void {
// ── clipboard:copy IPC (ResultPopup에서 사용) ───────── // ── clipboard:copy IPC (ResultPopup에서 사용) ─────────
ipcMain.on(IPC_CHANNELS.CLIPBOARD.COPY, (_event, text: string) => { ipcMain.on(IPC_CHANNELS.CLIPBOARD.COPY, (_event, text: string) => {
clipboard.writeText(text) void Promise.resolve(clipboard.writeText(text)).catch((error: unknown) => {
logger.error('Clipboard copy failed', error)
})
}) })

View file

@ -42,7 +42,6 @@ import {
LEARNING_EXCLUDED_APPS, LEARNING_EXCLUDED_APPS,
isAppScopedLearning, isAppScopedLearning,
TERMINAL_APPS, TERMINAL_APPS,
isAppExcluded,
isLearnablePhrase, isLearnablePhrase,
withoutPlaceholderText, withoutPlaceholderText,
emptyFocusSnapshot emptyFocusSnapshot

View file

@ -94,7 +94,7 @@ function makeKeyboard(clip: MemoryClipboard, pasted: string[], typed: string[]):
return { return {
backspace: vi.fn(async () => undefined), backspace: vi.fn(async () => undefined),
paste: vi.fn(async () => { paste: vi.fn(async () => {
pasted.push(clip.readText()) pasted.push(await clip.readText())
}), }),
type: vi.fn(async (text: string) => { type: vi.fn(async (text: string) => {
typed.push(text) typed.push(text)
@ -129,6 +129,19 @@ describe('TextInsertService 클립보드 복원 (redteam r1-2)', () => {
expect(result.success).toBe(true) expect(result.success).toBe(true)
}) })
it('비동기 클립보드 읽기가 끝난 뒤 원본을 복원한다', async () => {
const clip = new MemoryClipboard()
clip.text = 'original'
vi.spyOn(clip, 'readText').mockImplementation(() => Promise.resolve(clip.text))
const { service, pasted } = makeService(clip)
const result = await service.insertText('dictated', 'clipboard')
expect(pasted).toEqual(['dictated'])
expect(result.method).toBe('clipboard')
expect(clip.text).toBe('original')
})
it('Word/브라우저 서식(텍스트+HTML+RTF+이미지)을 모두 되돌린다', async () => { it('Word/브라우저 서식(텍스트+HTML+RTF+이미지)을 모두 되돌린다', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
const img = new FakeImage(false, 'table-picture') const img = new FakeImage(false, 'table-picture')
@ -293,12 +306,12 @@ describe('clipboard-snapshot 정책', () => {
expect(isStandardClipboardFormat('FileNameW')).toBe(false) expect(isStandardClipboardFormat('FileNameW')).toBe(false)
}) })
it('표준 내용이 있으면 함께 쓰고, 같이 쓸 수 없는 포맷은 dropped 로 보고한다', () => { it('표준 내용이 있으면 함께 쓰고, 같이 쓸 수 없는 포맷은 dropped 로 보고한다', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
clip.text = 't' clip.text = 't'
clip.html = 'h' clip.html = 'h'
clip.buffers.set('vscode-editor-data', Buffer.from('{}')) clip.buffers.set('vscode-editor-data', Buffer.from('{}'))
const plan = planClipboardRestore(captureClipboard(clip)) const plan = planClipboardRestore(await captureClipboard(clip))
expect(plan).toEqual({ expect(plan).toEqual({
kind: 'write', kind: 'write',
data: { text: 't', html: 'h' }, data: { text: 't', html: 'h' },
@ -306,37 +319,37 @@ describe('clipboard-snapshot 정책', () => {
}) })
}) })
it('사용자 정의 포맷이 여럿이면 되돌릴 수 없다고 판정한다 (clear 금지)', () => { it('사용자 정의 포맷이 여럿이면 되돌릴 수 없다고 판정한다 (clear 금지)', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
clip.buffers.set('A', Buffer.from('a')) clip.buffers.set('A', Buffer.from('a'))
clip.buffers.set('B', Buffer.from('b')) clip.buffers.set('B', Buffer.from('b'))
expect(planClipboardRestore(captureClipboard(clip)).kind).toBe('unrestorable') expect(planClipboardRestore(await captureClipboard(clip)).kind).toBe('unrestorable')
}) })
it('readBuffer 가 예외를 던지는 포맷은 읽지 못한 포맷으로 분류한다', () => { it('readBuffer 가 예외를 던지는 포맷은 읽지 못한 포맷으로 분류한다', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
clip.opaque = ['weird'] clip.opaque = ['weird']
vi.spyOn(clip, 'readBuffer').mockImplementation(() => { vi.spyOn(clip, 'readBuffer').mockImplementation(() => {
throw new Error('nope') throw new Error('nope')
}) })
const snap = captureClipboard(clip) const snap = await captureClipboard(clip)
expect(snap.unreadable).toEqual(['weird']) expect(snap.unreadable).toEqual(['weird'])
expect(planClipboardRestore(snap).kind).toBe('unrestorable') expect(planClipboardRestore(snap).kind).toBe('unrestorable')
}) })
it('availableFormats 가 실패하면 비어 있다고 가정하지 않는다', () => { it('availableFormats 가 실패하면 비어 있다고 가정하지 않는다', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
vi.spyOn(clip, 'availableFormats').mockImplementation(() => { vi.spyOn(clip, 'availableFormats').mockImplementation(() => {
throw new Error('locked') throw new Error('locked')
}) })
const snap = captureClipboard(clip) const snap = await captureClipboard(clip)
expect(snap.unreadable).toEqual([UNKNOWN_FORMATS]) expect(snap.unreadable).toEqual([UNKNOWN_FORMATS])
expect(planClipboardRestore(snap).kind).toBe('unrestorable') expect(planClipboardRestore(snap).kind).toBe('unrestorable')
}) })
it('표준 포맷만 광고되고 내용이 비었으면 clear 로 되돌린다', () => { it('표준 포맷만 광고되고 내용이 비었으면 clear 로 되돌린다', async () => {
const clip = new MemoryClipboard() const clip = new MemoryClipboard()
vi.spyOn(clip, 'availableFormats').mockReturnValue(['text/plain']) vi.spyOn(clip, 'availableFormats').mockReturnValue(['text/plain'])
expect(planClipboardRestore(captureClipboard(clip))).toEqual({ kind: 'clear' }) expect(planClipboardRestore(await captureClipboard(clip))).toEqual({ kind: 'clear' })
}) })
}) })

View file

@ -28,8 +28,8 @@
"@supabase/ssr": "^0.10.0", "@supabase/ssr": "^0.10.0",
"@supabase/supabase-js": "^2.103.0", "@supabase/supabase-js": "^2.103.0",
"lucide-react": "^1.33.0", "lucide-react": "^1.33.0",
"mermaid": "^11.14.0", "mermaid": "^12.3.0",
"next": "16.3.1", "next": "16.4.6",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0", "react-dom": "^19.0.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",
@ -37,9 +37,9 @@
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.62.1", "@playwright/test": "^1.62.1",
"@types/node": "^22.13.0", "@types/node": "^24.0.0",
"@types/react": "^19.0.0", "@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0", "@types/react-dom": "^19.0.0",
"vitest": "^2.1.0" "vitest": "^5.1.0"
} }
} }

View file

@ -7,8 +7,8 @@ export default defineConfig({
'@': path.resolve(__dirname, './src'), '@': path.resolve(__dirname, './src'),
}, },
}, },
esbuild: { oxc: {
jsx: 'automatic', jsx: { runtime: 'automatic' },
}, },
test: { test: {
globals: false, globals: false,

6183
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,6 +5,9 @@
"description": "D3RO Voice — 멀티플랫폼 AI 음성 어시스턴트 (Monorepo)", "description": "D3RO Voice — 멀티플랫폼 AI 음성 어시스턴트 (Monorepo)",
"author": "D3RO", "author": "D3RO",
"license": "MIT", "license": "MIT",
"engines": {
"node": "24.x"
},
"workspaces": [ "workspaces": [
"apps/desktop", "apps/desktop",
"apps/web", "apps/web",
@ -87,9 +90,11 @@
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0", "@typescript-eslint/parser": "^8.0.0",
"electron": "43.8.10",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"prettier": "^3.3.0", "prettier": "^3.3.0",
"typescript": "^5.7.0" "typescript": "^5.7.0",
"vitest": "^5.1.0"
} }
} }

View file

@ -37,7 +37,7 @@ const sourcePackageJson = JSON.parse(
readFileSync(join(root, 'apps', 'desktop', 'package.json'), 'utf8'), readFileSync(join(root, 'apps', 'desktop', 'package.json'), 'utf8'),
) )
const electronVersion = const electronVersion =
sourcePackageJson.devDependencies?.electron?.replace(/[^0-9.]/g, '') ?? '33.4.11' sourcePackageJson.devDependencies?.electron?.replace(/[^0-9.]/g, '') ?? '43.8.10'
const arch = process.arch === 'arm64' ? 'arm64' : 'x64' const arch = process.arch === 'arm64' ? 'arm64' : 'x64'
const relativeBinary = join( const relativeBinary = join(

View file

@ -90,7 +90,7 @@ for (const path of packageManifestPaths) {
updateJson(path, (document) => { updateJson(path, (document) => {
document.version = metadata.version document.version = metadata.version
if (path === 'apps/desktop/package.json') { if (path === 'apps/desktop/package.json') {
document.devDependencies.electron = '33.4.11' document.devDependencies.electron = '43.8.10'
} }
}) })
} }
@ -103,7 +103,7 @@ updateJson('package-lock.json', (document) => {
if (document.packages[key]) document.packages[key].version = metadata.version if (document.packages[key]) document.packages[key].version = metadata.version
} }
if (document.packages['apps/desktop']?.devDependencies) { if (document.packages['apps/desktop']?.devDependencies) {
document.packages['apps/desktop'].devDependencies.electron = '33.4.11' document.packages['apps/desktop'].devDependencies.electron = '43.8.10'
} }
}) })