refactor(instructions): share instruction template rendering via @d3ro/core

This commit is contained in:
Yun Chan 2026-09-28 00:53:44 +09:00
parent d311e8123f
commit ba0dbbd813
11 changed files with 423 additions and 36 deletions

View file

@ -6,6 +6,7 @@
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { IPC_CHANNELS } from '@d3ro/core/ipc-channels'
import type { LLMProcessParams } from '@d3ro/core/types'
import { FREE_PROMPT_SYSTEM_PROMPT } from '../../../src/main/services/llm-prompts'
vi.mock('../../../src/main/services/LoggerService', () => ({
getLogger: () => ({ info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() })
@ -108,7 +109,8 @@ describe('LLM.PROCESS — 지시문 인자 정규화', () => {
const [text, , , systemPrompt] = mockLocalLLM.processText.mock.calls[0]
expect(text).toBe('피보나치 짜줘')
expect(systemPrompt).toBe('피보나치 짜줘')
// 자유 프롬프트는 사용자 텍스트를 시스템 프롬프트로 올리지 않는다
expect(systemPrompt).toBe(FREE_PROMPT_SYSTEM_PROMPT)
})
it('{{text}}를 쓰는 지시문은 치환 결과를 처리 대상 텍스트로 넘긴다', async () => {