feat(imitation): accept pasted source content as an alternative to URL

- Make source_url optional and add source_content to the request; the
  two are normalized into a source kind ("url" | "content"), URL wins
  when both are present, and missing both returns source_required
- Skip web fetching in the generation worker when pasted content is
  provided; truncate it to the same 24,000-rune cap
- Label untitled pasted-content jobs with a locale-aware display title
  and mark the source kind in wizard state and prompt metadata
- Cover source normalization, truncation, and display title with tests
This commit is contained in:
2026-07-21 08:41:55 +08:00
parent 403ff91789
commit d62f7b3c91
3 changed files with 151 additions and 22 deletions
+2 -1
View File
@@ -1105,7 +1105,8 @@ export interface CreateArticleRequest {
}
export interface GenerateImitationRequest {
source_url: string
source_url?: string
source_content?: string
source_title?: string
locale?: string
brand_name: string