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

@ -353,7 +353,7 @@ export function buildInstructionPrompt(instructionPrompt: string, input: string)
throw new CommandClientError('invalid-request', false)
}
const combined = prompt.includes('{{text}}')
? prompt.replace('{{text}}', normalizedInput)
? prompt.replace('{{text}}', () => normalizedInput) // 함수 replacer: `$&`·`$'`·`$$` 해석 방지
: `${prompt}\n\n${normalizedInput}`
if (combined.length > MESSAGE_MAX_CHARS) throw new CommandClientError('invalid-request', false)
return combined