feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)
This commit is contained in:
parent
f49acf0105
commit
10af20a0ad
157 changed files with 29455 additions and 913 deletions
|
|
@ -20,6 +20,8 @@ import {
|
|||
renderInstructionPrompt,
|
||||
buildInstructionInvocation,
|
||||
resolveSystemPrompt,
|
||||
resolveTargetLanguage,
|
||||
SUPPORTED_TARGET_LANGUAGES,
|
||||
buildSuggestionPrompt,
|
||||
DEFAULT_TARGET_LANGUAGE,
|
||||
BASE_SYSTEM_PROMPTS,
|
||||
|
|
@ -28,6 +30,7 @@ import {
|
|||
FREE_PROMPT_SYSTEM_PROMPT,
|
||||
} from '../../../src/main/services/llm-prompts'
|
||||
import { buildCaptionRefinePrompt, buildTypoCheckPrompt } from '../../../src/main/services/llm-prompts'
|
||||
import * as ConfigServiceModule from '../../../src/main/services/ConfigService'
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
|
|
@ -153,6 +156,23 @@ describe('resolveSystemPrompt', () => {
|
|||
expect(resolveSystemPrompt('translate')).toContain(`${DEFAULT_TARGET_LANGUAGE}로 번역`)
|
||||
})
|
||||
|
||||
it('ConfigService에 targetLanguage가 설정되어 있으면 명시 인자 생략 시 설정값을 사용한다', () => {
|
||||
const spy = vi.spyOn(ConfigServiceModule, 'getConfigService').mockReturnValue({
|
||||
get: (key: string) => (key === 'targetLanguage' ? 'Japanese' : undefined),
|
||||
} as never)
|
||||
try {
|
||||
expect(resolveTargetLanguage()).toBe('Japanese')
|
||||
expect(resolveTargetLanguage('Spanish')).toBe('Spanish')
|
||||
expect(resolveSystemPrompt('translate')).toContain('Japanese로 번역')
|
||||
expect(
|
||||
renderInstructionPrompt('{{targetLanguage}}로 번역해줘', { text: '안녕' }),
|
||||
).toBe('Japanese로 번역해줘')
|
||||
expect(SUPPORTED_TARGET_LANGUAGES).toContain('Japanese')
|
||||
} finally {
|
||||
spy.mockRestore()
|
||||
}
|
||||
})
|
||||
|
||||
// 수정 대상이 아닌 일반 액션들이 각자의 프롬프트로 해석되는지 잠근다.
|
||||
// 이들이 refine으로 조용히 폴백하면 커스텀 경로와 같은 사고가 난다.
|
||||
it.each(['refine', 'summarize', 'grammar', 'expand'] as const)(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue