- Extract prompt text into buildPolishPrompt() in polish-prompt.ts (no server-only), matching the pattern used by batch.ts/buildBatchPrompt and narrative.ts/buildNarrativePrompt so the prompt itself is unit testable. - Add MAX_NOTE_LENGTH guard to truncate excessively long notes before polishing. - Add early-return guard against empty input (non-retryable error). - Run getProvider() and getSystemPrompt() concurrently via Promise.all(). - Document that polishNote() throws (foreground user-initiated action). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| lib | ||
| middleware.ts | ||