novelforge-agent 0.1.1 → 0.3.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 (56) hide show
  1. package/README.md +45 -18
  2. package/dist/src/cli/index.js +81 -4
  3. package/dist/src/core/bibleStore.js +36 -0
  4. package/dist/src/core/characterStore.js +74 -0
  5. package/dist/src/core/contextBuilder.js +76 -1
  6. package/dist/src/core/fileNames.js +4 -0
  7. package/dist/src/core/index.js +4 -0
  8. package/dist/src/core/projectDiscovery.js +1 -0
  9. package/dist/src/core/projectOps.js +193 -0
  10. package/dist/src/core/projectStore.js +15 -1
  11. package/dist/src/core/prompts/en-US.js +247 -16
  12. package/dist/src/core/prompts/zh-CN.js +246 -15
  13. package/dist/src/core/retrieval/index.js +8 -0
  14. package/dist/src/core/schemas.js +121 -1
  15. package/dist/src/core/steps/architecture.js +7 -1
  16. package/dist/src/core/steps/architectureExtension.js +72 -0
  17. package/dist/src/core/steps/chapter.js +11 -1
  18. package/dist/src/core/steps/chapterReview.js +26 -1
  19. package/dist/src/core/steps/chapterRevision.js +17 -0
  20. package/dist/src/core/steps/index.js +4 -0
  21. package/dist/src/core/steps/memoryCard.js +26 -1
  22. package/dist/src/core/steps/novelMetadata.js +4 -2
  23. package/dist/src/core/steps/storyBible.js +1 -1
  24. package/dist/src/core/steps/styleGuide.js +12 -0
  25. package/dist/src/core/threadStore.js +150 -0
  26. package/dist/src/core/workflow.js +5 -3
  27. package/dist/src/mcp/tools.js +228 -20
  28. package/package.json +5 -1
  29. package/src/cli/index.ts +84 -3
  30. package/src/core/bibleStore.ts +57 -0
  31. package/src/core/characterStore.ts +93 -0
  32. package/src/core/contextBuilder.ts +74 -4
  33. package/src/core/fileNames.ts +5 -0
  34. package/src/core/index.ts +4 -0
  35. package/src/core/projectDiscovery.ts +2 -0
  36. package/src/core/projectOps.ts +251 -0
  37. package/src/core/projectStore.ts +19 -1
  38. package/src/core/prompts/en-US.ts +258 -25
  39. package/src/core/prompts/types.ts +4 -1
  40. package/src/core/prompts/zh-CN.ts +250 -17
  41. package/src/core/retrieval/index.ts +10 -0
  42. package/src/core/schemas.ts +133 -1
  43. package/src/core/steps/architecture.ts +7 -1
  44. package/src/core/steps/architectureExtension.ts +88 -0
  45. package/src/core/steps/chapter.ts +11 -1
  46. package/src/core/steps/chapterReview.ts +28 -1
  47. package/src/core/steps/chapterRevision.ts +18 -0
  48. package/src/core/steps/index.ts +4 -0
  49. package/src/core/steps/memoryCard.ts +27 -1
  50. package/src/core/steps/novelMetadata.ts +4 -2
  51. package/src/core/steps/storyBible.ts +1 -1
  52. package/src/core/steps/styleGuide.ts +13 -0
  53. package/src/core/threadStore.ts +173 -0
  54. package/src/core/types.ts +134 -1
  55. package/src/core/workflow.ts +5 -3
  56. package/src/mcp/tools.ts +351 -21
@@ -79,6 +79,56 @@ Rules:
79
79
  };
80
80
  }
81
81
 
82
+ function buildStyleGuidePrompt(input: PromptBuildInput): BuiltPrompt {
83
+ return {
84
+ purpose: 'style_guide',
85
+ expectedFormat: 'JSON matching StyleGuideSchema',
86
+ prompt: `You are the style editor for a long-form novel. From the user prompt, metadata, and story bible, create a style guide that chapter writing and review can enforce over the whole project.
87
+
88
+ ## User Prompt
89
+ ${input.state.initialPrompt}
90
+
91
+ ${input.context ? `## Existing Context\n${input.context}\n` : ''}## Output Requirements
92
+ Output valid JSON only, in this shape:
93
+ {
94
+ "narrativeVoice": "Narration person, POV distance, narrator texture, emotional temperature",
95
+ "pacing": "Rules for openings, transitions, conflict movement, and chapter-end hooks",
96
+ "diction": "Word choice, sentence density, genre terminology boundaries",
97
+ "dialogueRules": [
98
+ "Rules for core character dialogue length, tone, subtext, and forms of address"
99
+ ],
100
+ "prohibitedPatterns": [
101
+ "Patterns to avoid: modern memes, explanatory narration, lore dumping, voice drift, etc."
102
+ ],
103
+ "proseRhythm": {
104
+ "sentenceRhythm": "How short, medium, and long sentences should be used; short sentences should serve turns, danger, or emotional landings, not default narration",
105
+ "paragraphing": "Paragraphs should form complete narrative units; avoid consecutive one-sentence paragraphs and line breaks used as fake rhythm",
106
+ "interiorityMode": "How interiority should be refracted through action, hesitation, and sensory response; avoid frequent direct explanation of thoughts",
107
+ "emphasisBudget": "Budget for repetition, dashes, isolated short sentences, and other emphasis tools",
108
+ "antiPatterns": [
109
+ "3 or more consecutive one-sentence short paragraphs",
110
+ "many short sentences used to simulate tension",
111
+ "explaining psychology immediately after every action",
112
+ "repeating the same sentence pattern to create fake rhythm"
113
+ ]
114
+ },
115
+ "sampleParagraph": "A 120-250 word target-style sample. Do not turn it into plot outline.",
116
+ "consistencyChecks": [
117
+ "Concrete checks future chapter reviews should use to detect style drift"
118
+ ]
119
+ }
120
+
121
+ Rules:
122
+ - Match genre, premise, character identities, and reader expectations.
123
+ - Do not rely on abstract adjectives only; every field must guide actual prose.
124
+ - proseRhythm must not be fixed word-count rules; describe reviewable rhythm principles and anti-patterns.
125
+ - sampleParagraph demonstrates prose texture only. Do not reveal future plot.
126
+ - prohibitedPatterns must contain at least 3 entries; consistencyChecks must contain at least 3 entries.
127
+ - proseRhythm.antiPatterns must contain at least 4 entries.
128
+ ${strictJsonOutputRules()}`,
129
+ };
130
+ }
131
+
82
132
  function buildArchitecturePrompt(input: PromptBuildInput): BuiltPrompt {
83
133
  return {
84
134
  purpose: 'architecture',
@@ -89,7 +139,7 @@ return {
89
139
  ${input.state.initialPrompt}
90
140
 
91
141
  ## Goals
92
- - Generate at least ${input.state.targetChapters} chapter architectures for this first run.
142
+ - Whole-book target is about ${input.state.plannedTotalChapters ?? input.state.targetChapters} chapters; generate only the first ${input.state.targetChapters} chapter architectures in this first batch.
93
143
  - The full-book architecture should define the long-term main line and ending direction.
94
144
  - Volume architecture should define phase conflict, climax, and volume-end hooks.
95
145
  - Chapter architecture must cover only what should happen in that chapter and must not reveal later concrete events early.
@@ -106,6 +156,18 @@ Output valid JSON only, in this shape:
106
156
  "order": 1
107
157
  }
108
158
  ],
159
+ "volumePacing": [
160
+ {
161
+ "volumeId": "v1",
162
+ "start": "Volume starting state: protagonist/world/conflict",
163
+ "promise": "Core reader promise or question for this volume",
164
+ "keyTurns": ["Key turn 1", "Key turn 2"],
165
+ "midpoint": "Midpoint turn or changed understanding",
166
+ "climax": "Volume climax",
167
+ "payoffs": ["Threads or promises this volume plans to pay off"],
168
+ "lingeringMysteries": ["Mysteries intentionally left open at volume end"]
169
+ }
170
+ ],
109
171
  "chapters": [
110
172
  {
111
173
  "chapterNumber": 1,
@@ -119,52 +181,135 @@ Output valid JSON only, in this shape:
119
181
 
120
182
  Rules:
121
183
  - chapters.length must be at least ${input.state.targetChapters}.
184
+ - chapters do not need to cover the whole book; when writing reaches the boundary, the workflow will request architecture_extension.
122
185
  - chapterNumber must start at 1 and increase contiguously.
123
186
  - volumeId must reference an id from volumes.
187
+ - volumePacing must provide one pacing board for every volume.
124
188
  - requiredBeats must include at least one concrete, actionable beat.
125
189
  ${strictJsonOutputRules()}`,
126
190
  };
127
191
  }
128
192
 
193
+ function buildArchitectureExtensionPrompt(input: PromptBuildInput): BuiltPrompt {
194
+ const start = input.state.currentChapter;
195
+ const total = input.state.plannedTotalChapters ?? input.state.targetChapters;
196
+ const end = Math.min(total, start + input.state.targetChapters - 1);
197
+ return {
198
+ purpose: 'architecture_extension',
199
+ expectedFormat: 'JSON matching ArchitectureExtensionPayloadSchema',
200
+ prompt: `You are the chief architect for a long-form novel. The manuscript has reached the edge of the existing chapter plan; extend the architecture from current continuity.
201
+
202
+ ## Extension Range
203
+ - Start at chapter ${start}.
204
+ - This batch should plan through chapter ${end} at most.
205
+ - The whole-book target ends at chapter ${total}.
206
+
207
+ ## Extension Principles
208
+ - Do not rewrite existing chapter architecture; append only new chapter architecture.
209
+ - New chapters must follow recent memory, the character state table, active foreshadow threads, and volume pacing boards.
210
+ - If the next chapters enter a new volume, add volumes and volumePacing. If they remain in an existing volume, you may provide an updated pacing board for that volume.
211
+ - If the full-book direction needs adjustment because of written material, include fullUpdate. fullUpdate must be a complete replacement for architecture/full.md, not a change note.
212
+ - Chapter architecture must cover only what should happen in that chapter and must not reveal later concrete events early.
213
+
214
+ ${input.context ? `## Existing Context\n${input.context}\n` : ''}## Output Requirements
215
+ Output valid JSON only, in this shape:
216
+ {
217
+ "fullUpdate": "optional complete updated full-book architecture",
218
+ "volumes": [
219
+ {
220
+ "id": "v2",
221
+ "title": "New or updated volume title",
222
+ "summary": "Volume goal, conflict, climax, and end hook",
223
+ "order": 2
224
+ }
225
+ ],
226
+ "volumePacing": [
227
+ {
228
+ "volumeId": "v2",
229
+ "start": "Volume starting state",
230
+ "promise": "Volume promise",
231
+ "keyTurns": ["Key turn 1", "Key turn 2"],
232
+ "midpoint": "Midpoint turn",
233
+ "climax": "Volume climax",
234
+ "payoffs": ["Planned payoffs"],
235
+ "lingeringMysteries": ["Lingering mysteries"]
236
+ }
237
+ ],
238
+ "chapters": [
239
+ {
240
+ "chapterNumber": ${start},
241
+ "title": "Chapter title",
242
+ "volumeId": "v1",
243
+ "summary": "Chapter plot summary",
244
+ "requiredBeats": ["Required beat 1"]
245
+ }
246
+ ]
247
+ }
248
+
249
+ Rules:
250
+ - chapters[0].chapterNumber must equal ${start}.
251
+ - chapterNumber must increase contiguously and must not exceed ${total}.
252
+ - chapters.length should be ${end - start + 1} unless the book has reached its ending.
253
+ - requiredBeats must include at least one concrete, actionable beat.
254
+ - volumeId must reference an existing volume id or a volume id supplied in this response.
255
+ ${strictJsonOutputRules()}`,
256
+ };
257
+ }
258
+
129
259
  function buildChapterPrompt(input: PromptBuildInput): BuiltPrompt {
130
- return {
131
- purpose: 'chapter',
132
- expectedFormat: 'Markdown',
133
- prompt: `You are a professional long-form fiction writer. Write chapter ${input.state.currentChapter} directly.
260
+ const ch = input.state.currentChapter;
261
+ const isFirstChapter = ch <= 1;
262
+ return {
263
+ purpose: 'chapter',
264
+ expectedFormat: 'Markdown',
265
+ prompt: `You are a professional long-form fiction writer. Write chapter ${ch} directly.
134
266
 
135
267
  ## Priority Order
136
- 1. Strictly follow the current chapter architecture, user additions, story bible hard constraints, and previous-chapter continuity.
137
- 2. Use relevant memory and prior text evidence to preserve consistency.
268
+ 1. Strictly follow the current chapter architecture, user additions, story bible hard constraints, style guide, and previous-chapter continuity.
269
+ 2. Use relevant memory, prior text evidence, and active foreshadow threads.
138
270
  3. Treat full-book and volume plans as distant planning context only. Do not write concrete future events early.
139
271
 
140
- ## Style And Length
272
+ ## Length Target
273
+ - Default target: ~2500 words (±20%). If the chapter architecture specifies targetWords, follow it.
274
+ - Do not pad to hit the target; do not under-write to be brief at the cost of conflict.
275
+
276
+ ## Structure
277
+ ${isFirstChapter
278
+ ? '- This is chapter 1. No recap needed. Open with character and situation directly.'
279
+ : '- Start with a 2-3 sentence recap or bridge so a reader who skipped the last chapter can re-enter (unless the chapter architecture has requireRecap=false). Make it natural, not meta-narration like "previously...".'}
280
+ - The chapter must end on a clear hook: cliffhanger, mystery, emotional resonance, reveal, or volume close — per the chapter architecture endHookFocus. Default: cliffhanger.
281
+
282
+ ## Style
283
+ - Enforce the Style Guide from context. Treat sampleParagraph as prose texture only; do not copy its content.
284
+ - Enforce Style Guide.proseRhythm: short sentences, one-line paragraphs, repeated sentences, and dashes are emphasis tools, not default narration. Ordinary narration should form natural sentence groups.
141
285
  - Match the novel's genre, world, character identities, and emotional tone.
142
- - Keep the language natural, stable, and readable. Prioritize narrative progress, character work, and emotional accumulation.
143
- - Dialogue must fit each character's identity, relationship, and immediate situation.
144
- - Important emotion should appear through action, body language, pacing, and subtext where possible.
145
- - Scene description should provide useful sensory and atmospheric detail, but never stall the plot.
146
- - Conflict, turns, suspense, and the chapter-end hook should be clear.
286
+ - Natural, stable, readable language; prioritize narrative progress, character work, and emotional accumulation.
287
+ - Dialogue fits each character's identity, relationship, and situation.
288
+ - Important emotion comes through action, body language, pacing, and subtext.
289
+ - Scene description has useful sensory detail without stalling.
290
+ - POV: strictly follow the chapter architecture povCharacter (if set). No mid-chapter POV switch.
147
291
 
148
292
  ## Execution Rules
149
293
  - Write only what the current chapter architecture authorizes.
150
- - Do not introduce unauthorized major characters. Functional background characters should stay light.
151
- - Keep names, items, places, abilities, timeline, injuries, relationships, and knowledge boundaries consistent.
152
- - If the previous chapter ends mid-action, mid-dialogue, or in the same scene, this chapter must continue from that point.
294
+ - Do not introduce unauthorized major characters. Functional background characters stay light.
295
+ - Keep names, items, places, abilities, timelines, injuries, relationships, and knowledge boundaries consistent.
296
+ - If the previous chapter ends mid-action or mid-scene, this chapter must continue from that point.
297
+ - Active foreshadow threads may be advanced or paid off this chapter, but **never silently dropped** — even if you choose not to touch them, leave them coherent.
153
298
  - Avoid cost-free power jumps, forced stupidity, mechanical twists, info-dumps, and empty lyricism.
154
- - Do not output summaries, bullet points, lectures, or explanatory prefaces.
299
+ - Do not output summaries, bullet points, lectures, explanatory prefaces, or meta-text like "what I changed".
155
300
 
156
301
  ${input.context ? `## Generation Context\n${input.context}\n` : ''}## Output Requirements
157
302
  - Output Markdown.
158
303
  - First line must be the chapter title as H1, for example: # Chapter Title
159
304
  - After the H1, begin the prose directly.`,
160
- };
305
+ };
161
306
  }
162
307
 
163
308
  function buildMemoryPrompt(input: PromptBuildInput): BuiltPrompt {
164
- return {
165
- purpose: 'memory_card',
166
- expectedFormat: 'JSON matching MemoryCardSchema',
167
- prompt: `You are a continuity editor for a long-form novel. Extract a memory card from chapter ${input.state.currentChapter}.
309
+ return {
310
+ purpose: 'memory_card',
311
+ expectedFormat: 'JSON matching MemoryCardSchema',
312
+ prompt: `You are a continuity editor for a long-form novel. Extract a memory card from chapter ${input.state.currentChapter}.
168
313
 
169
314
  ${input.context ? `## Current Chapter Context\n${input.context}\n` : ''}## Output Requirements
170
315
  Output valid JSON only, in this shape:
@@ -192,19 +337,47 @@ Output valid JSON only, in this shape:
192
337
  "after": "After"
193
338
  }
194
339
  ],
195
- "openThreads": ["Unresolved promise, danger, question, or plot thread"]
340
+ "openThreads": ["Unresolved promise, danger, question, or plot thread"],
341
+ "wordCount": <approximate word count of this chapter as an integer>,
342
+ "threadActions": [
343
+ {
344
+ "kind": "plant | build | pay | drop",
345
+ "threadId": "id of an existing active thread (required for build/pay/drop; leave empty for plant — the system will assign one)",
346
+ "description": "for plant: what the new thread is; for others: one sentence on how this chapter advanced/paid/dropped that thread"
347
+ }
348
+ ],
349
+ "characterUpdates": [
350
+ {
351
+ "name": "Character name",
352
+ "role": "Role if confirmed or changed this chapter",
353
+ "goal": "Current goal at chapter end",
354
+ "belief": "Core belief or understanding driving them at chapter end",
355
+ "relationships": [
356
+ { "name": "Related character", "dynamic": "Relationship state at chapter end" }
357
+ ],
358
+ "abilities": ["Abilities, resources, or limits confirmed at chapter end"],
359
+ "secrets": ["Secrets still hidden or only partially known at chapter end"],
360
+ "emotionalState": "Emotional state at chapter end"
361
+ }
362
+ ]
196
363
  }
197
364
 
198
365
  Rules:
199
366
  - Record only information that happened or was confirmed in this chapter.
200
367
  - Do not speculate about future plot.
201
368
  - Make facts and stateChanges concrete enough for later chapter reference.
369
+ - wordCount: approximate word count (English) or character count (CJK). An integer estimate is fine.
370
+ - threadActions is critical:
371
+ · For any active foreshadow thread in the context's "Active Foreshadow Threads" section, if this chapter advanced it emit kind="build"; if this chapter paid it off emit kind="pay"; if this chapter abandoned it emit kind="drop". threadId is required.
372
+ · For any new thread this chapter plants, emit kind="plant" with a clear description.
373
+ · If an active thread was not touched, no action needed — but never silently delete it. Without a drop action, the thread stays active.
374
+ - characterUpdates maintains a separate character state table. Emit only important characters whose state changed or was reconfirmed in this chapter; goal, belief, relationships, abilities, secrets, and emotionalState must reflect the chapter ending.
202
375
  ${strictJsonOutputRules()}`,
203
- };
376
+ };
204
377
  }
205
378
 
206
379
  function buildContinuityReviewPrompt(input: PromptBuildInput): BuiltPrompt {
207
- const end = Math.max(input.state.targetChapters, input.state.currentChapter - 1);
380
+ const end = Math.max(input.state.plannedTotalChapters ?? input.state.targetChapters, input.state.currentChapter - 1);
208
381
  return {
209
382
  purpose: 'continuity_review',
210
383
  expectedFormat: 'JSON matching ContinuityReviewSchema',
@@ -250,6 +423,14 @@ return {
250
423
  prompt: `You are a strict editor reviewing a single chapter of a serial novel for in-chapter problems and conflicts with established context.
251
424
 
252
425
  ${input.context ? `## Review Context\n${input.context}\n` : ''}## Review Focus
426
+ - This is a mandatory chapter acceptance gate. If any acceptance item fails, status must be "issues_found" and the workflow must revise before continuing.
427
+ - Whether every requiredBeat is fulfilled; missing beats must appear in acceptance.requiredBeats.missingBeats.
428
+ - Whether this chapter advances the main line, character state, or active foreshadow threads. If it is static, at least one of narrativeProgress/characterProgress/foreshadowProgress must fail.
429
+ - Whether it violates the story bible, character state table, volume pacing board, or prior memory.
430
+ - Whether it violates the Style Guide: narrative voice, sentence density, genre diction, dialogue rules, or prohibited patterns.
431
+ - Whether it violates Style Guide.proseRhythm: excessive short-sentence density, consecutive one-sentence paragraphs, fake rhythm through line breaks, overly direct interior explanation, or repeated sentence patterns.
432
+ - Whether the ending has a clear hook that matches the chapter architecture endHookFocus.
433
+ - Whether it repeats prior chapter beats, conflict patterns, reveals, or dialogue functions.
253
434
  - Character voice, motivation, and state vs the story bible and prior memory.
254
435
  - World rules, item ownership, and ability limits.
255
436
  - Timeline, location, and continuity with the previous chapter ending.
@@ -261,6 +442,41 @@ Output valid JSON only, in this shape:
261
442
  {
262
443
  "chapterNumber": ${chapter},
263
444
  "status": "clean",
445
+ "acceptance": {
446
+ "requiredBeats": {
447
+ "status": "pass | fail",
448
+ "evidence": "Evidence for each requiredBeat",
449
+ "missingBeats": []
450
+ },
451
+ "narrativeProgress": {
452
+ "status": "pass | fail",
453
+ "evidence": "How this chapter advances the main line or phase objective"
454
+ },
455
+ "characterProgress": {
456
+ "status": "pass | fail",
457
+ "evidence": "How this chapter changes or confirms key character goal, belief, relationship, ability, secret, or emotion"
458
+ },
459
+ "foreshadowProgress": {
460
+ "status": "pass | fail",
461
+ "evidence": "How this chapter plants, advances, pays, or deliberately preserves foreshadow threads"
462
+ },
463
+ "storyBibleConsistency": {
464
+ "status": "pass | fail",
465
+ "evidence": "Whether it matches the story bible, character state table, and world rules"
466
+ },
467
+ "proseRhythm": {
468
+ "status": "pass | fail",
469
+ "evidence": "Whether it follows Style Guide.proseRhythm; explain whether short sentences, one-line paragraphs, repetition, and interior explanation are controlled"
470
+ },
471
+ "endingHook": {
472
+ "status": "pass | fail",
473
+ "evidence": "The ending hook passage and its function"
474
+ },
475
+ "repetition": {
476
+ "status": "pass | fail",
477
+ "evidence": "Whether it repeats prior beats; if not, explain why"
478
+ }
479
+ },
264
480
  "issues": [
265
481
  {
266
482
  "severity": "low | medium | high",
@@ -275,6 +491,8 @@ Output valid JSON only, in this shape:
275
491
  Rules:
276
492
  - If there are no issues, use status "clean" with an empty issues array.
277
493
  - Otherwise use status "issues_found".
494
+ - status may be "clean" only when every acceptance item is "pass".
495
+ - If any acceptance item is "fail", include a matching issue with a concrete fix.
278
496
  - evidence must be specific; do not write "possibly" or "maybe".
279
497
  ${strictJsonOutputRules()}`,
280
498
  };
@@ -347,8 +565,12 @@ function buildPromptForStep(input: PromptBuildInput): BuiltPrompt {
347
565
  return buildMetadataPrompt(input);
348
566
  case 'story_bible':
349
567
  return buildStoryBiblePrompt(input);
568
+ case 'style_guide':
569
+ return buildStyleGuidePrompt(input);
350
570
  case 'architecture':
351
571
  return buildArchitecturePrompt(input);
572
+ case 'architecture_extension':
573
+ return buildArchitectureExtensionPrompt(input);
352
574
  case 'chapter':
353
575
  return buildChapterPrompt(input);
354
576
  case 'memory_card':
@@ -361,6 +583,17 @@ function buildPromptForStep(input: PromptBuildInput): BuiltPrompt {
361
583
  return buildChapterRevisionPrompt(input);
362
584
  case 'cross_chapter_review':
363
585
  return buildCrossChapterReviewPrompt(input);
586
+ case 'story_bible_amend':
587
+ return {
588
+ purpose: 'story_bible',
589
+ expectedFormat: 'Markdown',
590
+ prompt: `Based on the current story bible and the amendment context, output the FULL revised story bible Markdown.
591
+
592
+ ${input.context ? `## Amendment Context\n${input.context}\n` : ''}## Output Requirements
593
+ - Output the entire story-bible.md content — it replaces the old one (old version auto-archived under story-bible-versions/).
594
+ - Preserve everything that still holds; modify / add / remove only what the amendment context justifies.
595
+ - Do not output diff markers, change logs, or bullet summaries — just the new full bible.`,
596
+ };
364
597
  case 'complete':
365
598
  return {
366
599
  purpose: 'continuity_review',
@@ -3,13 +3,16 @@ import { AgentState } from '../types.js';
3
3
  export type PromptPurpose =
4
4
  | 'novel_metadata'
5
5
  | 'story_bible'
6
+ | 'style_guide'
6
7
  | 'architecture'
8
+ | 'architecture_extension'
7
9
  | 'chapter'
8
10
  | 'memory_card'
9
11
  | 'continuity_review'
10
12
  | 'chapter_review'
11
13
  | 'chapter_revision'
12
- | 'cross_chapter_review';
14
+ | 'cross_chapter_review'
15
+ | 'story_bible_amend';
13
16
 
14
17
  export interface PromptBuildInput {
15
18
  state: AgentState;