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:
parent
3a160b9032
commit
45a580878a
178 changed files with 214 additions and 0 deletions
|
|
@ -1,88 +0,0 @@
|
|||
// src/main/ipc/chain-handlers.ts
|
||||
// Phase 10.4: Multi-LLM Chain IPC 핸들러
|
||||
|
||||
import { ipcMain } from 'electron'
|
||||
import { IPC_CHANNELS } from '@shared/ipc-channels'
|
||||
import { ipcSuccess, ipcError, ErrorCode, D3ROError } from '@shared/errors'
|
||||
import { getChainService } from '../services/ChainService'
|
||||
import type {
|
||||
CreateChainParams,
|
||||
UpdateChainParams,
|
||||
DeleteChainParams,
|
||||
ExecuteChainParams
|
||||
} from '@shared/types'
|
||||
|
||||
export function registerChainHandlers(): void {
|
||||
ipcMain.handle(IPC_CHANNELS.CHAIN.GET_ALL, async () => {
|
||||
return ipcSuccess(getChainService().getAll())
|
||||
})
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.CHAIN.CREATE,
|
||||
async (_event, params: CreateChainParams) => {
|
||||
try {
|
||||
const result = getChainService().create(params)
|
||||
return ipcSuccess(result)
|
||||
} catch (err) {
|
||||
return ipcError(
|
||||
ErrorCode.ConfigWriteFailed,
|
||||
`Failed to create chain: ${err instanceof Error ? err.message : String(err)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.CHAIN.UPDATE,
|
||||
async (_event, params: UpdateChainParams) => {
|
||||
try {
|
||||
const result = getChainService().update(params)
|
||||
return ipcSuccess(result)
|
||||
} catch (err) {
|
||||
if (err instanceof D3ROError && err.code === ErrorCode.ChainNotFound) {
|
||||
return ipcError(ErrorCode.ChainNotFound, err.message)
|
||||
}
|
||||
return ipcError(
|
||||
ErrorCode.ConfigWriteFailed,
|
||||
`Failed to update chain: ${err instanceof Error ? err.message : String(err)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.CHAIN.DELETE,
|
||||
async (_event, params: DeleteChainParams) => {
|
||||
try {
|
||||
getChainService().delete(params.id)
|
||||
return ipcSuccess(undefined)
|
||||
} catch (err) {
|
||||
if (err instanceof D3ROError && err.code === ErrorCode.ChainNotFound) {
|
||||
return ipcError(ErrorCode.ChainNotFound, err.message)
|
||||
}
|
||||
return ipcError(
|
||||
ErrorCode.ConfigWriteFailed,
|
||||
`Failed to delete chain: ${err instanceof Error ? err.message : String(err)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.CHAIN.EXECUTE,
|
||||
async (_event, params: ExecuteChainParams) => {
|
||||
try {
|
||||
const result = await getChainService().execute(params.chainId, params.text)
|
||||
return ipcSuccess(result)
|
||||
} catch (err) {
|
||||
if (err instanceof D3ROError) {
|
||||
return ipcError(err.code, err.message)
|
||||
}
|
||||
return ipcError(
|
||||
ErrorCode.ChainExecutionFailed,
|
||||
`Chain execution failed: ${err instanceof Error ? err.message : String(err)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue