@actalk/inkos-core 1.6.3 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/agent/agent-session.d.ts.map +1 -1
  2. package/dist/agent/agent-session.js +21 -11
  3. package/dist/agent/agent-session.js.map +1 -1
  4. package/dist/agent/agent-system-prompt.d.ts.map +1 -1
  5. package/dist/agent/agent-system-prompt.js +14 -8
  6. package/dist/agent/agent-system-prompt.js.map +1 -1
  7. package/dist/agent/agent-tools.d.ts +34 -2
  8. package/dist/agent/agent-tools.d.ts.map +1 -1
  9. package/dist/agent/agent-tools.js +236 -54
  10. package/dist/agent/agent-tools.js.map +1 -1
  11. package/dist/agent/chapter-import-source.d.ts +15 -0
  12. package/dist/agent/chapter-import-source.d.ts.map +1 -0
  13. package/dist/agent/chapter-import-source.js +41 -0
  14. package/dist/agent/chapter-import-source.js.map +1 -0
  15. package/dist/agent/film-authoring-tools.d.ts +5 -3
  16. package/dist/agent/film-authoring-tools.d.ts.map +1 -1
  17. package/dist/agent/film-authoring-tools.js +34 -19
  18. package/dist/agent/film-authoring-tools.js.map +1 -1
  19. package/dist/agent/index.d.ts +1 -1
  20. package/dist/agent/index.d.ts.map +1 -1
  21. package/dist/agent/index.js +1 -1
  22. package/dist/agent/index.js.map +1 -1
  23. package/dist/agents/base.d.ts +1 -0
  24. package/dist/agents/base.d.ts.map +1 -1
  25. package/dist/agents/base.js +2 -0
  26. package/dist/agents/base.js.map +1 -1
  27. package/dist/agents/script-storyboard.d.ts +3 -0
  28. package/dist/agents/script-storyboard.d.ts.map +1 -1
  29. package/dist/agents/script-storyboard.js +221 -14
  30. package/dist/agents/script-storyboard.js.map +1 -1
  31. package/dist/agents/short-fiction.d.ts +13 -2
  32. package/dist/agents/short-fiction.d.ts.map +1 -1
  33. package/dist/agents/short-fiction.js +77 -43
  34. package/dist/agents/short-fiction.js.map +1 -1
  35. package/dist/index.d.ts +8 -5
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +10 -8
  38. package/dist/index.js.map +1 -1
  39. package/dist/interaction/action-envelope.d.ts +53 -1
  40. package/dist/interaction/action-envelope.d.ts.map +1 -1
  41. package/dist/interaction/action-envelope.js +9 -0
  42. package/dist/interaction/action-envelope.js.map +1 -1
  43. package/dist/interaction/intents.d.ts +2 -2
  44. package/dist/interaction/project-control.d.ts +1 -1
  45. package/dist/interactive-film/generate.d.ts +1 -0
  46. package/dist/interactive-film/generate.d.ts.map +1 -1
  47. package/dist/interactive-film/generate.js +15 -5
  48. package/dist/interactive-film/generate.js.map +1 -1
  49. package/dist/llm/provider.d.ts +1 -0
  50. package/dist/llm/provider.d.ts.map +1 -1
  51. package/dist/llm/provider.js +64 -18
  52. package/dist/llm/provider.js.map +1 -1
  53. package/dist/llm/providers/endpoints/openrouter.d.ts.map +1 -1
  54. package/dist/llm/providers/endpoints/openrouter.js +3 -2
  55. package/dist/llm/providers/endpoints/openrouter.js.map +1 -1
  56. package/dist/llm/think-tag-stripper.d.ts +15 -0
  57. package/dist/llm/think-tag-stripper.d.ts.map +1 -0
  58. package/dist/llm/think-tag-stripper.js +60 -0
  59. package/dist/llm/think-tag-stripper.js.map +1 -0
  60. package/dist/materials/ingest.d.ts.map +1 -1
  61. package/dist/materials/ingest.js +4 -3
  62. package/dist/materials/ingest.js.map +1 -1
  63. package/dist/materials/retrieve.d.ts.map +1 -1
  64. package/dist/materials/retrieve.js +3 -1
  65. package/dist/materials/retrieve.js.map +1 -1
  66. package/dist/models/book.d.ts +28 -0
  67. package/dist/models/book.d.ts.map +1 -1
  68. package/dist/models/book.js +22 -0
  69. package/dist/models/book.js.map +1 -1
  70. package/dist/models/project.d.ts +40 -0
  71. package/dist/models/project.d.ts.map +1 -1
  72. package/dist/models/project.js +5 -0
  73. package/dist/models/project.js.map +1 -1
  74. package/dist/notify/dispatcher.d.ts.map +1 -1
  75. package/dist/notify/dispatcher.js +8 -5
  76. package/dist/notify/dispatcher.js.map +1 -1
  77. package/dist/notify/feishu.d.ts +2 -1
  78. package/dist/notify/feishu.d.ts.map +1 -1
  79. package/dist/notify/feishu.js +12 -6
  80. package/dist/notify/feishu.js.map +1 -1
  81. package/dist/notify/format.d.ts +12 -0
  82. package/dist/notify/format.d.ts.map +1 -0
  83. package/dist/notify/format.js +11 -0
  84. package/dist/notify/format.js.map +1 -0
  85. package/dist/notify/telegram.d.ts +2 -1
  86. package/dist/notify/telegram.d.ts.map +1 -1
  87. package/dist/notify/telegram.js +3 -2
  88. package/dist/notify/telegram.js.map +1 -1
  89. package/dist/notify/wechat-work.d.ts +2 -1
  90. package/dist/notify/wechat-work.d.ts.map +1 -1
  91. package/dist/notify/wechat-work.js +5 -5
  92. package/dist/notify/wechat-work.js.map +1 -1
  93. package/dist/pipeline/runner.d.ts +13 -1
  94. package/dist/pipeline/runner.d.ts.map +1 -1
  95. package/dist/pipeline/runner.js +41 -7
  96. package/dist/pipeline/runner.js.map +1 -1
  97. package/dist/pipeline/script-storyboard-runner.d.ts +3 -0
  98. package/dist/pipeline/script-storyboard-runner.d.ts.map +1 -1
  99. package/dist/pipeline/script-storyboard-runner.js +86 -43
  100. package/dist/pipeline/script-storyboard-runner.js.map +1 -1
  101. package/dist/pipeline/short-fiction-runner.d.ts +3 -1
  102. package/dist/pipeline/short-fiction-runner.d.ts.map +1 -1
  103. package/dist/pipeline/short-fiction-runner.js +80 -33
  104. package/dist/pipeline/short-fiction-runner.js.map +1 -1
  105. package/dist/play/play-runner.d.ts +8 -0
  106. package/dist/play/play-runner.d.ts.map +1 -1
  107. package/dist/play/play-runner.js +14 -0
  108. package/dist/play/play-runner.js.map +1 -1
  109. package/dist/prompts/short-fiction.d.ts +14 -13
  110. package/dist/prompts/short-fiction.d.ts.map +1 -1
  111. package/dist/prompts/short-fiction.js +253 -14
  112. package/dist/prompts/short-fiction.js.map +1 -1
  113. package/dist/state/manager.d.ts +16 -2
  114. package/dist/state/manager.d.ts.map +1 -1
  115. package/dist/state/manager.js +218 -31
  116. package/dist/state/manager.js.map +1 -1
  117. package/dist/translation/epub.d.ts +10 -0
  118. package/dist/translation/epub.d.ts.map +1 -0
  119. package/dist/translation/epub.js +86 -0
  120. package/dist/translation/epub.js.map +1 -0
  121. package/dist/translation/export.d.ts +6 -0
  122. package/dist/translation/export.d.ts.map +1 -0
  123. package/dist/translation/export.js +68 -0
  124. package/dist/translation/export.js.map +1 -0
  125. package/dist/translation/index.d.ts +9 -0
  126. package/dist/translation/index.d.ts.map +1 -0
  127. package/dist/translation/index.js +9 -0
  128. package/dist/translation/index.js.map +1 -0
  129. package/dist/translation/llm-model.d.ts +8 -0
  130. package/dist/translation/llm-model.d.ts.map +1 -0
  131. package/dist/translation/llm-model.js +134 -0
  132. package/dist/translation/llm-model.js.map +1 -0
  133. package/dist/translation/project.d.ts +3 -0
  134. package/dist/translation/project.d.ts.map +1 -0
  135. package/dist/translation/project.js +76 -0
  136. package/dist/translation/project.js.map +1 -0
  137. package/dist/translation/run-store.d.ts +11 -0
  138. package/dist/translation/run-store.d.ts.map +1 -0
  139. package/dist/translation/run-store.js +53 -0
  140. package/dist/translation/run-store.js.map +1 -0
  141. package/dist/translation/runner.d.ts +6 -0
  142. package/dist/translation/runner.d.ts.map +1 -0
  143. package/dist/translation/runner.js +88 -0
  144. package/dist/translation/runner.js.map +1 -0
  145. package/dist/translation/source.d.ts +12 -0
  146. package/dist/translation/source.d.ts.map +1 -0
  147. package/dist/translation/source.js +66 -0
  148. package/dist/translation/source.js.map +1 -0
  149. package/dist/translation/text.d.ts +10 -0
  150. package/dist/translation/text.d.ts.map +1 -0
  151. package/dist/translation/text.js +77 -0
  152. package/dist/translation/text.js.map +1 -0
  153. package/dist/translation/types.d.ts +96 -0
  154. package/dist/translation/types.d.ts.map +1 -0
  155. package/dist/translation/types.js +2 -0
  156. package/dist/translation/types.js.map +1 -0
  157. package/dist/utils/effective-llm-config.js +19 -1
  158. package/dist/utils/effective-llm-config.js.map +1 -1
  159. package/dist/utils/posix-path.d.ts +2 -0
  160. package/dist/utils/posix-path.d.ts.map +1 -0
  161. package/dist/utils/posix-path.js +7 -0
  162. package/dist/utils/posix-path.js.map +1 -0
  163. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"short-fiction.d.ts","sourceRoot":"","sources":["../../src/prompts/short-fiction.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,gCAAgC,CAAC;CACvD;AAED,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,SAAS,CAAC,EAAE,gCAAgC,CAAC;CACvD;AAED,MAAM,WAAW,sCAAuC,SAAQ,oCAAoC;IAClG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,wCAAyC,SAAQ,4BAA4B;IAC5F,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC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ACpC,MAAM,CA6DR;AAED,wBAAgB,oCAAoC,CAAC,QAAQ,GAAE,oBAA2B,GAAG,MAAM,CAalG;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,8BAA8B,EACrC,QAAQ,GAAE,oBAA2B,GACpC,MAAM,CA2CR"}
@@ -1,4 +1,13 @@
1
- export function buildShortFictionOutlineSystemPrompt() {
1
+ export function buildShortFictionOutlineSystemPrompt(language = "zh") {
2
+ if (language === "en") {
3
+ return [
4
+ "You are the managing editor for short web fiction. Your job is to turn one creative direction into a complete short-story plan.",
5
+ "Work only from this direction and any reference text the user supplied; never claim to have read, quoted, or inherited material that was not provided.",
6
+ "Content comes first: the title, the opening, the pressure on the protagonist, the evidence/relationship/identity leverage, the escalation chain, the reversal chain, and the payoff landing must be strong enough to carry a single-pass full draft.",
7
+ "Do not over-structure and do not output JSON/YAML. Write human-readable Markdown, but the chapter plan must be dense enough that a writer can draft the whole story in one pass.",
8
+ "A short defaults to 12-18 chapters at roughly 600-800 words per chapter. The story must be complete — not the first five chapters of a novel starter kit.",
9
+ ].join("\n");
10
+ }
2
11
  return [
3
12
  "你是短篇小说总编,负责把一个创作方向做成完整短篇故事方案。",
4
13
  "只基于本次创作方向和用户提供的参考文本创作;没有提供的资料,不要声称读过、引用过或继承过。",
@@ -7,7 +16,28 @@ export function buildShortFictionOutlineSystemPrompt() {
7
16
  "短篇默认 12-18 章,每章约 900-1200 字。故事要完整,不是长篇前 5 章启动包。",
8
17
  ].join("\n");
9
18
  }
10
- export function buildShortFictionOutlineUserPrompt(input) {
19
+ export function buildShortFictionOutlineUserPrompt(input, language = "zh") {
20
+ if (language === "en") {
21
+ return [
22
+ "## Creative Direction",
23
+ input.direction,
24
+ "",
25
+ "## Target Spec",
26
+ `A complete short story of ${input.chapterCount} chapters, about ${input.charsPerChapter} words per chapter.`,
27
+ "",
28
+ input.reference?.text ? "## Optional Reference Text\n" + input.reference.text.trim() + "\n" : "",
29
+ "## Deliverable",
30
+ "Start with one platform-ready clickable title, then the full story plan. The plan must make clear why the protagonist is pinned down, what payoff the reader is waiting for, how the protagonist turns the tables, how evidence/relationships/identity/rules escalate step by step, why the antagonist strikes back, and how the ending lands.",
31
+ "The chapter plan must spell out, chapter by chapter: the direction of the chapter title, the key on-page scene, the characters' actions, the escalation or payoff, and the reason to keep reading at the chapter break.",
32
+ "Tags are allowed, but do not enumerate a tag table; tags serve premise selection and writing — they never replace the story.",
33
+ "",
34
+ "## Output Format",
35
+ "=== SHORT_FICTION_PLAN_TITLE ===",
36
+ "Exactly one platform-ready title on a single line",
37
+ "=== SHORT_FICTION_PLAN ===",
38
+ "The full story plan in Markdown, covering: genre/audience, title direction, the opening hook, characters and relationships, the core pressure, how the protagonist wins, the escalation chain, the reversal chain, the ending payoff, and the chapter-by-chapter plan.",
39
+ ].filter(Boolean).join("\n");
40
+ }
11
41
  return [
12
42
  "## 创作方向",
13
43
  input.direction,
@@ -28,7 +58,15 @@ export function buildShortFictionOutlineUserPrompt(input) {
28
58
  "用 Markdown 写完整故事方案,包含:题材/受众、标题方向、开篇小钩子、人物与关系、核心压力、主角赢法、升级链、反转链、结尾回报、逐章方案。",
29
59
  ].filter(Boolean).join("\n");
30
60
  }
31
- export function buildShortFictionOutlineReviewSystemPrompt() {
61
+ export function buildShortFictionOutlineReviewSystemPrompt(language = "zh") {
62
+ if (language === "en") {
63
+ return [
64
+ "You are a short-fiction outline reviewer. You do not assign scores and you do not police plagiarism.",
65
+ "Your job is to judge whether this story plan can carry a single-pass full draft: is the genre engine clear, do character motivations hold, does the pressure chain escalate, is the antagonist's counterattack believable, is the ending payoff big enough.",
66
+ "Review like a real reader and a real editor, not a checklist machine.",
67
+ "Output Markdown. Name the flaws that would make the finished draft fall flat, and the strengths worth keeping.",
68
+ ].join("\n");
69
+ }
32
70
  return [
33
71
  "你是短篇审纲编辑。你不负责打分,也不负责判抄。",
34
72
  "你的任务是判断这个故事方案能不能支撑一次写完整篇:题材发动机是否清楚、人物动机是否成立、压力链是否递进、反派反扑是否可信、结尾回报是否够。",
@@ -36,7 +74,24 @@ export function buildShortFictionOutlineReviewSystemPrompt() {
36
74
  "输出 Markdown,直接指出会导致成稿不好看的硬伤和可保留优点。",
37
75
  ].join("\n");
38
76
  }
39
- export function buildShortFictionOutlineReviewUserPrompt(input) {
77
+ export function buildShortFictionOutlineReviewUserPrompt(input, language = "zh") {
78
+ if (language === "en") {
79
+ return [
80
+ "## Creative Direction",
81
+ input.direction,
82
+ "",
83
+ input.reference?.text ? "## Optional Reference Text\n" + input.reference.text.trim() + "\n" : "",
84
+ "## Story Plan Under Review",
85
+ input.outline.rawContent,
86
+ "",
87
+ "## Review Focus",
88
+ "- Is this a complete short story, rather than a partial tryout plan?",
89
+ "- Do the title, the opening, and the first three chapters give readers a reason to click and keep reading?",
90
+ "- Is the outline dense enough, or will the writer run out of material in the back half?",
91
+ "- Do the key scenes contain character action, counterattack, and payoff, instead of bare result summaries?",
92
+ "- Will readers be thrown out of the story by timeline, relationship, evidence-access, physical-state, or common-sense problems?",
93
+ ].filter(Boolean).join("\n");
94
+ }
40
95
  return [
41
96
  "## 创作方向",
42
97
  input.direction,
@@ -53,7 +108,24 @@ export function buildShortFictionOutlineReviewUserPrompt(input) {
53
108
  "- 读者会不会因为时间线、人物关系、证据权限、身体状态、常识问题出戏。",
54
109
  ].join("\n");
55
110
  }
56
- export function buildShortFictionOutlineRevisionFollowup(input) {
111
+ export function buildShortFictionOutlineRevisionFollowup(input, language = "zh") {
112
+ if (language === "en") {
113
+ return [
114
+ "Based on the outline review above, produce the complete second version of the story plan.",
115
+ "This is round two of the same project: do not start over from scratch, and do not output a list of edits instead of the plan.",
116
+ `Keep the structure at ${input.chapterCount} chapters of about ${input.charsPerChapter} words each.`,
117
+ "Keep the genre engine and relationships that work; fix the flaws that would make the finished draft fall flat.",
118
+ "",
119
+ "## Outline Review",
120
+ input.review.trim(),
121
+ "",
122
+ "## Output Format",
123
+ "=== SHORT_FICTION_PLAN_TITLE ===",
124
+ "Exactly one platform-ready title on a single line",
125
+ "=== SHORT_FICTION_PLAN ===",
126
+ "The complete second-version story plan in Markdown.",
127
+ ].join("\n");
128
+ }
57
129
  return [
58
130
  "根据上面的审纲意见,继续给出第二版完整故事方案。",
59
131
  "这是同一次创作的第二轮,不要另起炉灶,不要只写修改说明。",
@@ -70,7 +142,18 @@ export function buildShortFictionOutlineRevisionFollowup(input) {
70
142
  "用 Markdown 写完整第二版故事方案。",
71
143
  ].join("\n");
72
144
  }
73
- export function buildShortFictionWriterSystemPrompt() {
145
+ export function buildShortFictionWriterSystemPrompt(language = "zh") {
146
+ if (language === "en") {
147
+ return [
148
+ "You are an English short-fiction BatchWriter. You write the complete short story in one API pass, following the story plan.",
149
+ "Write natural, native English prose. Vary sentence length; mix short punchy sentences with longer flowing ones, and keep the narrative voice consistent throughout.",
150
+ "This is not serialized-novel continuation and not chapter synopsis. Every chapter needs drama happening on the page: character action, dialogue or reaction, a shift in the situation, and a reason to keep reading at the chapter break.",
151
+ "Keep the drama dialed up, web-fiction style: real-world pressure may be amplified as far as readers will still believe, but never so absurd that immersion breaks.",
152
+ "The story title and chapter titles must read like platform content, not literary summaries. Keep the prose paced for mobile reading — short paragraphs, but never telegram-style fragments.",
153
+ "The word count is a calibration, not an averaging exercise. Big scenes may run long and transitions short; a clearly short chapter usually means you wrote a synopsis and must add real scenes.",
154
+ "Output must strictly use the specified blocks. No author notes, no word-count remarks, no review comments, no format explanations.",
155
+ ].join("\n");
156
+ }
74
157
  return [
75
158
  "你是中文短篇 BatchWriter。你要根据故事方案一次 API 写完整短篇正文。",
76
159
  "这不是长篇连载续写,也不是章节梗概。每章都要有当场发生的戏:人物行动、对话或反应、局面变化、章尾继续读的理由。",
@@ -80,7 +163,37 @@ export function buildShortFictionWriterSystemPrompt() {
80
163
  "输出必须严格使用指定 block,不要写作者说明、字数说明、审稿意见或格式解释。",
81
164
  ].join("\n");
82
165
  }
83
- export function buildShortFictionWriterUserPrompt(input) {
166
+ export function buildShortFictionWriterUserPrompt(input, language = "zh") {
167
+ if (language === "en") {
168
+ return [
169
+ "## Task",
170
+ `Write the complete ${input.chapterCount}-chapter story in one pass, about ${input.charsPerChapter} words per chapter.`,
171
+ "Read the full story plan before writing. The prose must carry the plan's pressure chain, evidence chain, reversal chain, and emotional payoff — do not swerve into a different story midway.",
172
+ "",
173
+ buildShortFictionCraftPrompt("en"),
174
+ "",
175
+ "## Creative Direction",
176
+ input.direction,
177
+ "",
178
+ "## Story Plan",
179
+ input.outlineMarkdown,
180
+ "",
181
+ "## Output Format",
182
+ "=== SHORT_FICTION_TITLE ===",
183
+ "The story title — plain text, platform-ready, nothing else",
184
+ "=== SHORT_FICTION_OPENING_HOOK ===",
185
+ "An optional pre-story hook of about 130 words; if no standalone teaser is needed, still write the small first-screen scene that opens chapter 1",
186
+ ...Array.from({ length: input.chapterCount }, (_, index) => {
187
+ const chapter = index + 1;
188
+ return [
189
+ `=== CHAPTER ${chapter} TITLE ===`,
190
+ "Chapter title — plain text only, no #, no \"Chapter N\" prefix",
191
+ `=== CHAPTER ${chapter} CONTENT ===`,
192
+ `Chapter ${chapter} prose — full scenes, no synopsis, no author notes`,
193
+ ].join("\n");
194
+ }),
195
+ ].join("\n");
196
+ }
84
197
  return [
85
198
  "## 任务",
86
199
  `一次写完整 ${input.chapterCount} 章,每章约 ${input.charsPerChapter} 字。`,
@@ -110,8 +223,35 @@ export function buildShortFictionWriterUserPrompt(input) {
110
223
  }),
111
224
  ].join("\n");
112
225
  }
113
- export function buildShortFictionDraftContinuationUserPrompt(input) {
226
+ export function buildShortFictionDraftContinuationUserPrompt(input, language = "zh") {
114
227
  const missing = input.missingChapters.join(", ");
228
+ if (language === "en") {
229
+ return [
230
+ "## Task",
231
+ `The previous draft was truncated or skipped chapters. Write ONLY the missing chapters: ${missing}.`,
232
+ `Stay calibrated to the complete ${input.chapterCount}-chapter short at about ${input.charsPerChapter} words per chapter.`,
233
+ "Do not rewrite finished chapters, do not write summary notes, do not apologize, do not output review comments.",
234
+ "",
235
+ buildShortFictionCraftPrompt("en"),
236
+ "",
237
+ "## Creative Direction",
238
+ input.direction,
239
+ "",
240
+ "## Story Plan",
241
+ input.outlineMarkdown,
242
+ "",
243
+ "## Existing Draft (for continuity only — do not rewrite)",
244
+ input.existingDraftMarkdown,
245
+ "",
246
+ "## Output Format",
247
+ ...input.missingChapters.map((chapter) => [
248
+ `=== CHAPTER ${chapter} TITLE ===`,
249
+ "Chapter title — plain text only, no #, no \"Chapter N\" prefix",
250
+ `=== CHAPTER ${chapter} CONTENT ===`,
251
+ `Chapter ${chapter} prose — full scenes, no synopsis, no author notes`,
252
+ ].join("\n")),
253
+ ].join("\n");
254
+ }
115
255
  return [
116
256
  "## 任务",
117
257
  `上一次正文被截断或漏章。现在只补写缺失章节:${missing}。`,
@@ -138,7 +278,15 @@ export function buildShortFictionDraftContinuationUserPrompt(input) {
138
278
  ].join("\n")),
139
279
  ].join("\n");
140
280
  }
141
- export function buildShortFictionDraftReviewSystemPrompt() {
281
+ export function buildShortFictionDraftReviewSystemPrompt(language = "zh") {
282
+ if (language === "en") {
283
+ return [
284
+ "You are a short-fiction draft reviewer.",
285
+ "You judge only whether the content can sell, reads smoothly, and keeps pulling the reader forward; do not turn the review into deterministic scoring.",
286
+ "Focus on: the title, chapter titles, the opening, character motivation, the timeline, relationships, evidence and access, escalating pressure, the antagonist's counterattack, whether the back half sags, and whether the ending payoff lands.",
287
+ "Output Markdown. Separate the problems that would visibly stop readers from reading on from the small blemishes that are acceptable.",
288
+ ].join("\n");
289
+ }
142
290
  return [
143
291
  "你是短篇成稿审稿编辑。",
144
292
  "你只看内容是否能卖、是否顺、是否有继续读的欲望;不要把审稿变成确定性打分。",
@@ -146,7 +294,23 @@ export function buildShortFictionDraftReviewSystemPrompt() {
146
294
  "输出 Markdown,写清哪些问题会明显影响读者读下去,哪些只是可接受的小瑕疵。",
147
295
  ].join("\n");
148
296
  }
149
- export function buildShortFictionDraftReviewUserPrompt(input) {
297
+ export function buildShortFictionDraftReviewUserPrompt(input, language = "zh") {
298
+ if (language === "en") {
299
+ return [
300
+ "## Creative Direction",
301
+ input.direction,
302
+ "",
303
+ "## Original Story Plan",
304
+ input.outlineMarkdown,
305
+ "",
306
+ "## Draft Under Review",
307
+ input.draftMarkdown,
308
+ "",
309
+ "## Review Instructions",
310
+ "Talk like a person: where does this story pull, where does it break immersion, where does it read like a synopsis, where does the back half sag, which title or chapter titles would nobody tap?",
311
+ "Never condemn a chapter just for running slightly short or long; judge first whether the content is complete, dramatic, and paying off.",
312
+ ].join("\n");
313
+ }
150
314
  return [
151
315
  "## 创作方向",
152
316
  input.direction,
@@ -162,7 +326,38 @@ export function buildShortFictionDraftReviewUserPrompt(input) {
162
326
  "不要因为某章略短或略长就判死;先判断内容是否完整、有戏、有回报。",
163
327
  ].join("\n");
164
328
  }
165
- export function buildShortFictionDraftRevisionFollowup(input) {
329
+ export function buildShortFictionDraftRevisionFollowup(input, language = "zh") {
330
+ if (language === "en") {
331
+ return [
332
+ "Based on the review notes, write the complete second-version draft.",
333
+ "This is round two of the same story: keep what worked in the last version, fix what breaks immersion or kills the desire to keep reading.",
334
+ "Do not output a list of suggested edits, and do not patch just a few chapters — output the complete draft.",
335
+ "",
336
+ "## Review Notes",
337
+ input.review.trim(),
338
+ "",
339
+ "## Round-Two Priorities",
340
+ "- Fix the immersion-breaking problems: timeline, logic, relationships, evidence access, physical state.",
341
+ "- Add real scenes to the back half; never close on result summaries.",
342
+ "- Keep the title, opening, chapter titles, and main title consistent with the prose, though the title may be re-sharpened from the final draft for platform click appeal.",
343
+ "- Word count is calibration only: pad short chapters with real scenes; trim long ones by cutting explanation and repeated reactions.",
344
+ "",
345
+ "## Output Format",
346
+ "=== SHORT_FICTION_TITLE ===",
347
+ "The story title — plain text, platform-ready, nothing else",
348
+ "=== SHORT_FICTION_OPENING_HOOK ===",
349
+ "An optional pre-story hook of about 130 words; if no standalone teaser is needed, still write the small first-screen scene that opens chapter 1",
350
+ ...Array.from({ length: input.chapterCount }, (_, index) => {
351
+ const chapter = index + 1;
352
+ return [
353
+ `=== CHAPTER ${chapter} TITLE ===`,
354
+ "Chapter title — plain text only, no #, no \"Chapter N\" prefix",
355
+ `=== CHAPTER ${chapter} CONTENT ===`,
356
+ `Chapter ${chapter} prose — full scenes, no synopsis, no author notes`,
357
+ ].join("\n");
358
+ }),
359
+ ].join("\n");
360
+ }
166
361
  return [
167
362
  "根据审稿意见,继续写第二版完整正文。",
168
363
  "这是同一篇的第二轮写作:保留上一版能打的地方,修掉会让读者出戏或不想读的问题。",
@@ -193,14 +388,43 @@ export function buildShortFictionDraftRevisionFollowup(input) {
193
388
  }),
194
389
  ].join("\n");
195
390
  }
196
- export function buildShortFictionPackageSystemPrompt() {
391
+ export function buildShortFictionPackageSystemPrompt(language = "zh") {
392
+ if (language === "en") {
393
+ return [
394
+ "You are a short-fiction packaging editor. From the final draft you produce the synopsis, the selling points, and the cover-image prompt.",
395
+ "Never invent a main title different from the draft's. All packaging must revolve around the draft's actual title and plot.",
396
+ "Think of the cover prompt as a mobile portrait book cover: 3:4 vertical, a large title zone, strong character emotion, one or two instantly recognizable props, high-contrast colors — not a movie poster.",
397
+ ].join("\n");
398
+ }
197
399
  return [
198
400
  "你是短篇小说包装编辑,负责根据最终正文生成简介、卖点和封面提示词。",
199
401
  "不要另起一个和正文不同的主标题。包装必须围绕正文实际标题和剧情。",
200
402
  "封面提示词按手机端竖版书封思考:3:4 竖图、大标题区、强人物情绪、少量一眼可识别道具、高对比色彩,不要影视海报感。",
201
403
  ].join("\n");
202
404
  }
203
- export function buildShortFictionPackageUserPrompt(input) {
405
+ export function buildShortFictionPackageUserPrompt(input, language = "zh") {
406
+ if (language === "en") {
407
+ return [
408
+ "## Creative Direction",
409
+ input.direction,
410
+ "",
411
+ "## Story Plan",
412
+ input.outlineMarkdown.trim(),
413
+ "",
414
+ "## Final Draft",
415
+ input.draftMarkdown.trim(),
416
+ "",
417
+ "## Output Format",
418
+ "=== SHORT_FICTION_PACKAGE_TITLE ===",
419
+ input.draftTitle,
420
+ "=== SHORT_FICTION_INTRO ===",
421
+ "A 70-120 word platform synopsis that grabs the conflict, the pressure, and the payoff — never a spoiler-filled play-by-play.",
422
+ "=== SHORT_FICTION_SELLING_POINTS ===",
423
+ "- 3 to 6 selling points, one per line",
424
+ "=== SHORT_FICTION_COVER_PROMPT ===",
425
+ "An English cover-generation prompt: 3:4 portrait, main title zone, character emotion, props, color palette, typography style, and what to avoid.",
426
+ ].join("\n");
427
+ }
204
428
  return [
205
429
  "## 创作方向",
206
430
  input.direction,
@@ -222,7 +446,22 @@ export function buildShortFictionPackageUserPrompt(input) {
222
446
  "中文封面生成提示词:3:4竖图,主标题区,人物情绪,道具,配色,字体风格,避免事项。",
223
447
  ].join("\n");
224
448
  }
225
- function buildShortFictionCraftPrompt() {
449
+ function buildShortFictionCraftPrompt(language = "zh") {
450
+ if (language === "en") {
451
+ return [
452
+ "## Craft Reminders",
453
+ "- Salt dissolves in the soup: values and ambition show through action, never through slogans.",
454
+ "- Show, don't tell: let behavior, evidence, concrete detail, and staging make the reader feel a character's state.",
455
+ "- Simile restraint: do not lean on \"like / as if / as though\" as default rhetoric — at most one simile per scene; prefer a precise verb and a concrete action over a figure of speech.",
456
+ "- Anti-AI wording: ration AI-tell words (delve, tapestry, testament, intricate, pivotal); do not use the \"It wasn't X; it was Y\" construction as a crutch; keep analytical report language (\"core motivation\", \"strategic advantage\") out of the prose.",
457
+ "- No padding: every scene must advance conflict, causality, emotion, evidence, pressure, payoff, or a relationship.",
458
+ "- The climax is a scene, not a recap: eruptions of conflict, reversals, life-or-death beats, and reveals must play out beat by beat on the page (action, dialogue, the five senses). The heavier a chapter's information load, the more its key beat must be staged as a full scene — never compressed into one line like \"then he saved her and the rival was arrested.\"",
459
+ "- Payoffs need setup: every reversal, comeuppance, reconciliation, revenge, or identity reveal must ride a chain of evidence and causality.",
460
+ "- Side characters need motives: even the oppressor acts from interest, misjudgment, or fear — never a brainless plot device.",
461
+ "- Everyday detail must become bait: each detail carries evidence, emotion, characterization, or a later reversal.",
462
+ "- Mobile-first: short paragraphs, dense information, no vague lyricism or decorative filler.",
463
+ ].join("\n");
464
+ }
226
465
  return [
227
466
  "## 写法提醒",
228
467
  "- 盐溶于汤:人物价值观和野心靠行动表现,不靠口号。",
@@ -1 +1 @@
1
- {"version":3,"file":"short-fiction.js","sourceRoot":"","sources":["../../src/prompts/short-fiction.ts"],"names":[],"mappings":"AAoDA,MAAM,UAAU,oCAAoC;IAClD,OAAO;QACL,+BAA+B;QAC/B,+CAA+C;QAC/C,wDAAwD;QACxD,gEAAgE;QAChE,iDAAiD;KAClD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,KAAqC;IACtF,OAAO;QACL,SAAS;QACT,KAAK,CAAC,SAAS;QACf,EAAE;QACF,SAAS;QACT,QAAQ,KAAK,CAAC,YAAY,UAAU,KAAK,CAAC,eAAe,KAAK;QAC9D,EAAE;QACF,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE;QAC/E,SAAS;QACT,qFAAqF;QACrF,oDAAoD;QACpD,iCAAiC;QACjC,EAAE;QACF,SAAS;QACT,kCAAkC;QAClC,WAAW;QACX,4BAA4B;QAC5B,2EAA2E;KAC5E,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,0CAA0C;IACxD,OAAO;QACL,yBAAyB;QACzB,uEAAuE;QACvE,wBAAwB;QACxB,oCAAoC;KACrC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,wCAAwC,CAAC,KAA2C;IAClG,OAAO;QACL,SAAS;QACT,KAAK,CAAC,SAAS;QACf,EA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CAAC,IAAI,EAAE;QAC5B,EAAE;QACF,SAAS;QACT,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;QAC1B,EAAE;QACF,SAAS;QACT,qCAAqC;QACrC,KAAK,CAAC,UAAU;QAChB,6BAA6B;QAC7B,oCAAoC;QACpC,sCAAsC;QACtC,eAAe;QACf,oCAAoC;QACpC,4CAA4C;KAC7C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,4BAA4B;IACnC,OAAO;QACL,SAAS;QACT,4BAA4B;QAC5B,4CAA4C;QAC5C,4DAA4D;QAC5D,oCAAoC;QACpC,qGAAqG;QACrG,sCAAsC;QACtC,mCAAmC;QACnC,mCAAmC;QACnC,+BAA+B;KAChC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"short-fiction.js","sourceRoot":"","sources":["../../src/prompts/short-fiction.ts"],"names":[],"mappings":"AAsDA,MAAM,UAAU,oCAAoC,CAAC,WAAiC,IAAI;IACxF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO;YACL,iIAAiI;YACjI,wJAAwJ;YACxJ,sPAAsP;YACtP,kLAAkL;YAClL,2JAA2J;SAC5J,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IACD,OAAO;QACL,+BAA+B;QAC/B,+CAA+C;QAC/C,wDAAwD;QACxD,gEAAgE;QAChE,iDAAiD;KAClD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,KAAqC,EACrC,WAAiC,IAAI;IAErC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO;YACL,uBAAuB;YACvB,KAAK,CAAC,SAAS;YACf,EAAE;YACF,gBAAgB;YAChB,6BAA6B,KAAK,CAAC,YAAY,oBAAoB,KAAK,CAAC,eAAe,qBAAqB;YAC7G,EAAE;YACF,KAAK,CAAC,SAA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/F,oHAAoH;YACpH,0LAA0L;YAC1L,+PAA+P;YAC/P,qHAAqH;YACrH,6WAA6W;YAC7W,6IAA6I;YAC7I,8HAA8H;YAC9H,mHAAmH;YACnH,8FAA8F;SAC/F,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IACD,OAAO;QACL,SAAS;QACT,4BAA4B;QAC5B,4CAA4C;QAC5C,4DAA4D;QAC5D,oCAAoC;QACpC,qGAAqG;QACrG,sCAAsC;QACtC,mCAAmC;QACnC,mCAAmC;QACnC,+BAA+B;KAChC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -1,9 +1,13 @@
1
1
  import type { BookConfig } from "../models/book.js";
2
2
  import type { ChapterMeta } from "../models/chapter.js";
3
+ export declare class BookWriteLockError extends Error {
4
+ readonly bookId: string;
5
+ readonly lockPath: string;
6
+ readonly code = "BOOK_BUSY";
7
+ constructor(bookId: string, lockPath: string, lockData?: string);
8
+ }
3
9
  export declare class StateManager {
4
10
  private readonly projectRoot;
5
- /** Books actively being written by this process — used for same-process stale lock detection. */
6
- private readonly activeWrites;
7
11
  constructor(projectRoot: string);
8
12
  private static defaultAuthorIntent;
9
13
  private static defaultCurrentFocus;
@@ -16,6 +20,16 @@ export declare class StateManager {
16
20
  }>;
17
21
  private resolveControlDocumentLanguage;
18
22
  acquireBookLock(bookId: string): Promise<() => Promise<void>>;
23
+ private normalizeLockKey;
24
+ private serializeLock;
25
+ private describeLock;
26
+ private createLockFile;
27
+ private parseLockMetadata;
28
+ private readLockSnapshot;
29
+ private isStaleLock;
30
+ private removeStaleLock;
31
+ private startLockHeartbeat;
32
+ private unlinkWithRetry;
19
33
  private extractLockPid;
20
34
  private isProcessAlive;
21
35
  get booksDir(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/state/manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC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