feat(V2-1a): Monorepo 구조 전환 — apps/desktop으로 V1 이동

- npm workspaces 루트 (apps/*, packages/*) 세팅
- V1 전체를 apps/desktop/으로 git mv (src, resources, tests, sidecar,
  scripts, electron.vite.config.ts, electron-builder.yml, vitest.config.ts,
  tsconfig.node.json, tsconfig.web.json)
- apps/desktop/package.json 신규 (name=@d3ro/desktop)
- productName: 'd3ro-voice' 명시 — app.getName()을 고정하여 userData 경로
  %APPDATA%\d3ro-voice\ 그대로 유지 (기존 DB/설정 연속성 보장)
- 루트 package.json을 workspace 루트로 재구성, 공통 devDep만 유지
  (typescript, eslint, prettier)
- turbo.json, tsconfig.base.json 추가 (Turborepo 자체 설치는 별도 sub-phase)
- memory/project_status.md 생성 (규칙 13)

검증:
- npm run typecheck 통과
- npm run build 통과 (electron-vite main+preload+renderer)
- npm run dev 실제 실행 → DB/핫키/Ollama 자동 실행 모두 정상
This commit is contained in:
yunchan8804 2026-04-08 14:04:41 +09:00
parent 3a160b9032
commit 45a580878a
178 changed files with 214 additions and 0 deletions

View file

@ -0,0 +1,58 @@
// src/shared/constants.ts
/** 타이밍 상수 (Speakly 리버스엔지니어링 기반) */
export const TIMING = {
/** 더블프레스 감지 간격 (ms) */
DOUBLE_PRESS_DURATION: 300,
/** 최소 녹음 시간 (ms) — 이하 자동 취소 */
MIN_AUDIO_DURATION: 700,
/** 녹음 후 STT 대기 시간 (ms) */
POST_RECORDING_WAIT: 4000,
/** 녹음 후 STT 대기 (버퍼 있을 때) (ms) */
POST_RECORDING_WAIT_BUFFERED: 6000,
/** STT 아이들 타임아웃 (ms) */
STT_IDLE_TIMEOUT: 30000,
/** 절대 최대 대기 시간 (ms) */
ABSOLUTE_MAX_WAIT: 120000,
/** 오디오 레벨 전송 간격 (ms) */
AUDIO_LEVEL_INTERVAL: 100,
/** 서비스 종료 타임아웃 (ms) */
SERVICE_DESTROY_TIMEOUT: 3000,
/** 사이드카 헬스체크 지연 (ms) */
SIDECAR_HEALTH_DELAY: 3000,
/** LLM 요청 타임아웃 (ms) */
LLM_REQUEST_TIMEOUT: 30000
} as const
/** 웨이브 바 상수 (RecordingTip) */
export const WAVE_BAR = {
COUNT: 9,
ANIMATION_INTERVAL: 100,
/** 코사인 분포 가중치 (Speakly 패턴) */
COS_WEIGHTS: Array.from({ length: 9 }, (_, i) => Math.cos((i - 4) * (Math.PI / 9)))
} as const
/** 오디오 포맷 */
export const AUDIO_FORMAT = {
SAMPLE_RATE: 16000,
CHANNELS: 1,
BIT_DEPTH: 16,
BYTES_PER_SAMPLE: 2
} as const
/** 윈도우 크기 */
export const WINDOW_SIZE = {
MAIN: { width: 1104, height: 816 },
RECORDING_TIP: { width: 280, height: 80 },
RESULT_POPUP: { width: 400, height: 200 }
} as const