@waterwx/dsh-novel-forge 0.1.0 → 1.1.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.
- package/README.md +67 -25
- package/cordis.patch.yml +1 -1
- package/lib/client.js +4563 -1093
- package/lib/client.js.map +1 -1
- package/lib/index.js +1138 -92
- package/lib/index.js.map +1 -1
- package/lib/types/assets.d.ts +2 -2
- package/lib/types/assistant.d.ts +2 -0
- package/lib/types/bookshelf.d.ts +2 -0
- package/lib/types/client/api.d.ts +61 -2
- package/lib/types/client/locales.d.ts +24 -24
- package/lib/types/client/panel/AssetsTab.d.ts +6 -1
- package/lib/types/client/panel/CreateBookView.d.ts +9 -0
- package/lib/types/client/panel/NovelPanel.d.ts +1 -1
- package/lib/types/client/panel/ShelfView.d.ts +11 -0
- package/lib/types/client/panel/WorldTab.d.ts +10 -0
- package/lib/types/engine.d.ts +67 -6
- package/lib/types/index.d.ts +1 -1
- package/lib/types/protocol.d.ts +177 -0
- package/package.json +1 -13
- package/src/assets.ts +9 -7
- package/src/assistant.ts +152 -32
- package/src/bookshelf.ts +14 -0
- package/src/client/api.ts +80 -3
- package/src/client/locales.ts +24 -24
- package/src/client/panel/AssetsTab.tsx +139 -41
- package/src/client/panel/AssistantTab.tsx +136 -23
- package/src/client/panel/BookshelfBar.tsx +62 -8
- package/src/client/panel/CreateBookView.tsx +189 -0
- package/src/client/panel/NovelPanel.tsx +1834 -201
- package/src/client/panel/ShelfView.tsx +112 -0
- package/src/client/panel/WorldTab.tsx +202 -0
- package/src/client/panel/panel.module.css +1210 -59
- package/src/engine.ts +618 -29
- package/src/index.ts +1 -1
- package/src/protocol.ts +189 -1
- package/src/routes.ts +511 -14
package/lib/types/assets.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export declare const BUILTIN_PROGRESSION_MODES: ProgressionMode[];
|
|
|
21
21
|
export declare function emptyProjectAssets(): ProjectAssets;
|
|
22
22
|
/** 合并项目资产与内置库:返回「生效的反 AI 规则」(内置全局 + 项目自定义)。 */
|
|
23
23
|
export declare function effectiveAntiAiRules(assets: ProjectAssets | undefined): AntiAiRule[];
|
|
24
|
-
/**
|
|
24
|
+
/** 把生效规则渲染成提示词块(压缩:avoid/fix 截断,省 token)。 */
|
|
25
25
|
export declare function renderAntiAiRules(assets: ProjectAssets | undefined): string;
|
|
26
26
|
/** 渲染题材与推进模式提示词块。 */
|
|
27
27
|
export declare function renderGenreAndProgression(assets: ProjectAssets | undefined): string;
|
|
28
|
-
/**
|
|
28
|
+
/** 渲染写法资产提示词块(规则去重,省 token)。 */
|
|
29
29
|
export declare function renderStyleAssets(assets: ProjectAssets | undefined): string;
|
|
30
30
|
/** 渲染全部写作资产提示词(供生成/规划/审稿注入)。 */
|
|
31
31
|
export declare function renderAllAssets(assets: ProjectAssets | undefined): string;
|
package/lib/types/assistant.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ import { chapterFileName } from './engine.ts';
|
|
|
19
19
|
export declare const ASSISTANT_HISTORY_FILE = "novel-assistant.jsonl";
|
|
20
20
|
/** Load the persisted conversation (empty when none). */
|
|
21
21
|
export declare function loadAssistantHistory(outputDir: string): AssistantMessage[];
|
|
22
|
+
/** 清空助手对话记录(删除历史文件)。 */
|
|
23
|
+
export declare function clearAssistantHistory(outputDir: string): void;
|
|
22
24
|
/** Execute one action directive. Returns a text result (or throws). */
|
|
23
25
|
/**
|
|
24
26
|
* Execute one action directive as an async generator: yields live progress
|
package/lib/types/bookshelf.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare function activeBook(store: BookshelfStore): BookEntry | undefined
|
|
|
17
17
|
export declare function bookshelfSnapshot(store: BookshelfStore): BookshelfSnapshot;
|
|
18
18
|
/** 新建一本书(自动成为当前书)。 */
|
|
19
19
|
export declare function createBook(bookName: string, outputDir: string): BookEntry;
|
|
20
|
+
/** 更新某本书的书名(开书向导导入大纲后书名以大纲首行为准)。 */
|
|
21
|
+
export declare function renameBook(id: string, bookName: string): boolean;
|
|
20
22
|
/**
|
|
21
23
|
* 播种:书架为空时,把指定输出目录下已有的项目自动登记为第一本书。
|
|
22
24
|
* 兼容升级场景 —— 旧版插件直接在输出目录写项目,从未登记书架。
|
|
@@ -28,14 +28,59 @@ export declare class NovelApi {
|
|
|
28
28
|
foreshadow(req: ForeshadowRequest): Promise<ForeshadowResponse>;
|
|
29
29
|
exportBook(format: 'txt' | 'md'): Promise<ExportResponse>;
|
|
30
30
|
chapter(no: number): Promise<ChapterResponse>;
|
|
31
|
+
/** 审查手动编辑的正文(不落盘)。 */
|
|
32
|
+
chapterCheck(no: number, text: string): Promise<{
|
|
33
|
+
report: ReviewReport;
|
|
34
|
+
}>;
|
|
35
|
+
/** 保存手动编辑的正文(自动备份 .bak;带报告则沿用落盘,否则保存后自动审稿)。 */
|
|
36
|
+
chapterSave(no: number, text: string, report?: ReviewReport): Promise<import('../protocol.ts').ChapterSaveResponse>;
|
|
31
37
|
patchConfig(patch: ConfigPatch): Promise<{
|
|
32
38
|
config: NovelConfig;
|
|
33
39
|
}>;
|
|
34
40
|
openFolder(): Promise<void>;
|
|
35
41
|
/** 书架快照。 */
|
|
36
42
|
bookshelf(): Promise<import('../protocol.ts').BookshelfSnapshot>;
|
|
37
|
-
/**
|
|
38
|
-
bookCreate(bookName: string, outputDir?: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
|
|
43
|
+
/** 新建书并激活(开书向导:可携带大纲文本,创建即建项目)。 */
|
|
44
|
+
bookCreate(bookName: string, outputDir?: string, outline?: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
|
|
45
|
+
/** 重置项目(清空进度;可携带新大纲)。 */
|
|
46
|
+
reset(outline?: string): Promise<{
|
|
47
|
+
ok: boolean;
|
|
48
|
+
bookName: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** 全书一致性质检。 */
|
|
51
|
+
audit(): Promise<import('../protocol.ts').AuditResponse>;
|
|
52
|
+
/** 角色卡刷新(基于事实库聚合)。 */
|
|
53
|
+
charactersRefresh(): Promise<{
|
|
54
|
+
cards: import('../protocol.ts').RoleStatusCard[];
|
|
55
|
+
}>;
|
|
56
|
+
/** 事实库回填:对历史已生成章节批量抽取事实。 */
|
|
57
|
+
factsBackfill(): Promise<{
|
|
58
|
+
ok: boolean;
|
|
59
|
+
filled: number;
|
|
60
|
+
}>;
|
|
61
|
+
/** 设定圣经局部修补。 */
|
|
62
|
+
biblePatch(patch: import('../protocol.ts').BiblePatchRequest): Promise<{
|
|
63
|
+
bible: import('../protocol.ts').StoryBible;
|
|
64
|
+
}>;
|
|
65
|
+
/** 小说简介:AI 生成/补全(partial 留空 = 全量),或手动保存。 */
|
|
66
|
+
blurb(action: 'generate' | 'save', text?: string, partial?: string): Promise<{
|
|
67
|
+
blurb: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** 封面:读取(dataUrl;dir 指定某本书的输出目录,省略为当前书)。 */
|
|
70
|
+
coverGet(dir?: string): Promise<import('../protocol.ts').CoverResponse>;
|
|
71
|
+
/** 封面:上传(base64 data URL)或移除。 */
|
|
72
|
+
coverPost(action: 'upload' | 'remove', dataUrl?: string): Promise<{
|
|
73
|
+
ok: boolean;
|
|
74
|
+
coverPath?: string | null;
|
|
75
|
+
}>;
|
|
76
|
+
/** 重命名当前书(同步项目与书架条目)。 */
|
|
77
|
+
rename(bookName: string): Promise<{
|
|
78
|
+
bookName: string;
|
|
79
|
+
}>;
|
|
80
|
+
/** 大世界:AI 提炼(generate)或手动保存(save)。 */
|
|
81
|
+
world(action: 'generate' | 'save', world?: import('../protocol.ts').WorldState): Promise<{
|
|
82
|
+
world: import('../protocol.ts').WorldState;
|
|
83
|
+
}>;
|
|
39
84
|
/** 切换当前书。 */
|
|
40
85
|
bookActivate(id: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
|
|
41
86
|
/** 移除书架条目。 */
|
|
@@ -61,8 +106,22 @@ export declare class NovelApi {
|
|
|
61
106
|
rewrite(chapterNo: number, instructions: string, target: string, onFrame: (frame: JobFrame) => void): Promise<void>;
|
|
62
107
|
/** Polish (de-AI-ify) one chapter. */
|
|
63
108
|
polish(chapterNo: number, onFrame: (frame: JobFrame) => void): Promise<void>;
|
|
109
|
+
/** 采纳待确认草稿(润色/重写产物),覆盖正文文件。 */
|
|
110
|
+
draftApply(chapterNo: number): Promise<{
|
|
111
|
+
ok: boolean;
|
|
112
|
+
chars: number;
|
|
113
|
+
file: string;
|
|
114
|
+
}>;
|
|
115
|
+
/** 放弃待确认草稿,保留原稿。 */
|
|
116
|
+
draftDiscard(chapterNo: number): Promise<{
|
|
117
|
+
ok: boolean;
|
|
118
|
+
}>;
|
|
64
119
|
/** Run one assistant turn (NDJSON stream). */
|
|
65
120
|
assistant(message: string, onFrame: (frame: import('../protocol.ts').AssistantFrame) => void): Promise<void>;
|
|
66
121
|
/** Load the persisted assistant conversation. */
|
|
67
122
|
assistantHistory(): Promise<import('../protocol.ts').AssistantMessage[]>;
|
|
123
|
+
/** 清空助手对话记录。 */
|
|
124
|
+
assistantClear(): Promise<{
|
|
125
|
+
ok: boolean;
|
|
126
|
+
}>;
|
|
68
127
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/** zh dictionary. */
|
|
5
5
|
export declare const zh: {
|
|
6
6
|
readonly 'entry.label': "小说工坊";
|
|
7
|
-
readonly 'entry.tooltip': "AI
|
|
7
|
+
readonly 'entry.tooltip': "AI 编译小说工作台:总纲 → 道藏 → 卷计划 → 章节计划 → 逐章生成+审稿";
|
|
8
8
|
readonly 'panel.title': "小说工坊";
|
|
9
9
|
readonly 'common.close': "关闭";
|
|
10
10
|
readonly 'common.loading': "加载中…";
|
|
@@ -14,36 +14,36 @@ export declare const zh: {
|
|
|
14
14
|
readonly 'common.generating': "生成中…";
|
|
15
15
|
readonly 'common.chars': "字";
|
|
16
16
|
readonly 'tab.workflow': "工作流";
|
|
17
|
-
readonly 'tab.overview': "
|
|
17
|
+
readonly 'tab.overview': "总纲";
|
|
18
18
|
readonly 'tab.plan': "章节";
|
|
19
|
-
readonly 'tab.bible': "
|
|
20
|
-
readonly 'tab.foreshadow': "
|
|
19
|
+
readonly 'tab.bible': "道藏";
|
|
20
|
+
readonly 'tab.foreshadow': "暗线";
|
|
21
21
|
readonly 'tab.assistant': "AI 助手";
|
|
22
22
|
readonly 'tab.settings': "设置";
|
|
23
23
|
readonly 'workflow.title': "创作工作流";
|
|
24
|
-
readonly 'workflow.step1': "①
|
|
25
|
-
readonly 'workflow.step2': "②
|
|
24
|
+
readonly 'workflow.step1': "① 加载总纲";
|
|
25
|
+
readonly 'workflow.step2': "② 提炼道藏";
|
|
26
26
|
readonly 'workflow.step3': "③ 规划卷";
|
|
27
27
|
readonly 'workflow.step4': "④ 生成章节计划";
|
|
28
28
|
readonly 'workflow.step5': "⑤ 逐章写作 + AI 审稿";
|
|
29
29
|
readonly 'workflow.step6': "⑥ 润色 / 导出";
|
|
30
|
-
readonly 'workflow.loadOutline': "
|
|
31
|
-
readonly 'workflow.genBible': "
|
|
30
|
+
readonly 'workflow.loadOutline': "读取总纲";
|
|
31
|
+
readonly 'workflow.genBible': "提炼道藏";
|
|
32
32
|
readonly 'workflow.genVolumes': "生成卷计划";
|
|
33
33
|
readonly 'workflow.genPlan': "生成章节计划";
|
|
34
34
|
readonly 'workflow.done': "已完成";
|
|
35
35
|
readonly 'workflow.todo': "待办";
|
|
36
|
-
readonly 'workflow.bibleDone': "
|
|
36
|
+
readonly 'workflow.bibleDone': "道藏已生成({n} 条规则 / {c} 个人物 / {r} 条红线)";
|
|
37
37
|
readonly 'workflow.volumesDone': "卷计划已生成({n} 卷)";
|
|
38
38
|
readonly 'workflow.planDone': "章节计划已生成({n} 章)";
|
|
39
|
-
readonly 'workflow.progress': "
|
|
40
|
-
readonly 'overview.loadDocx': "从 docx
|
|
41
|
-
readonly 'overview.loadDocxDefault': "
|
|
39
|
+
readonly 'workflow.progress': "进度:总纲 ✓ · 道藏 {bible} · 卷 {volumes} · 计划 {plan} · 已完成 {done}/{total} 章";
|
|
40
|
+
readonly 'overview.loadDocx': "从 docx 读取总纲";
|
|
41
|
+
readonly 'overview.loadDocxDefault': "读取默认总纲";
|
|
42
42
|
readonly 'overview.loadingOutline': "正在解析 docx…";
|
|
43
|
-
readonly 'overview.outlineHint': "
|
|
44
|
-
readonly 'overview.outlineChars': "
|
|
45
|
-
readonly 'overview.saveOutline': "
|
|
46
|
-
readonly 'overview.saved': "
|
|
43
|
+
readonly 'overview.outlineHint': "总纲文本(可编辑)";
|
|
44
|
+
readonly 'overview.outlineChars': "总纲字数";
|
|
45
|
+
readonly 'overview.saveOutline': "保存总纲";
|
|
46
|
+
readonly 'overview.saved': "总纲已保存";
|
|
47
47
|
readonly 'overview.bookName': "书名";
|
|
48
48
|
readonly 'overview.loadCustom': "指定 docx 路径";
|
|
49
49
|
readonly 'overview.loadCustomHint': "绝对路径,留空使用默认";
|
|
@@ -78,17 +78,17 @@ export declare const zh: {
|
|
|
78
78
|
readonly 'plan.summary': "章节摘要";
|
|
79
79
|
readonly 'plan.volumes': "卷";
|
|
80
80
|
readonly 'plan.noVolume': "未分卷";
|
|
81
|
-
readonly 'bible.title': "
|
|
82
|
-
readonly 'bible.gen': "AI
|
|
81
|
+
readonly 'bible.title': "道藏";
|
|
82
|
+
readonly 'bible.gen': "AI 提炼道藏";
|
|
83
83
|
readonly 'bible.genre': "题材基调";
|
|
84
84
|
readonly 'bible.worldRules': "世界规则";
|
|
85
|
-
readonly 'bible.characters': "
|
|
85
|
+
readonly 'bible.characters': "人物志";
|
|
86
86
|
readonly 'bible.redLines': "写作红线";
|
|
87
87
|
readonly 'bible.style': "风格要求";
|
|
88
|
-
readonly 'bible.none': "
|
|
89
|
-
readonly 'foreshadow.title': "
|
|
90
|
-
readonly 'foreshadow.suggest': "AI
|
|
91
|
-
readonly 'foreshadow.none': "
|
|
88
|
+
readonly 'bible.none': "尚未生成道藏。生成后写作会严格遵守人设与金手指规则,审稿也会按红线检查。";
|
|
89
|
+
readonly 'foreshadow.title': "暗线管理";
|
|
90
|
+
readonly 'foreshadow.suggest': "AI 建议暗线";
|
|
91
|
+
readonly 'foreshadow.none': "暂无暗线";
|
|
92
92
|
readonly 'foreshadow.status': "状态";
|
|
93
93
|
readonly 'foreshadow.planned': "计划中";
|
|
94
94
|
readonly 'foreshadow.planted': "已埋设";
|
|
@@ -122,7 +122,7 @@ export declare const zh: {
|
|
|
122
122
|
readonly 'progress.rewriting': "正在修订第 {no} 章…";
|
|
123
123
|
readonly 'progress.polishing': "正在润色第 {no} 章…";
|
|
124
124
|
readonly 'progress.empty': "生成/审稿进度将显示在这里";
|
|
125
|
-
readonly 'assistant.hint': "和 AI
|
|
125
|
+
readonly 'assistant.hint': "和 AI 编辑讨论剧情、人设、暗线;达成一致后可让它直接修改总纲、道藏、章节内容。";
|
|
126
126
|
readonly 'assistant.placeholder': "例如:我想让第 2 章结尾加一个悬念——墟境里传来爷爷的声音…";
|
|
127
127
|
readonly 'assistant.send': "发送";
|
|
128
128
|
readonly 'assistant.toolStart': "⚙ 执行操作:{name}…";
|
|
@@ -2,6 +2,11 @@ import type { NovelApi } from '../api.ts';
|
|
|
2
2
|
/** Props. */
|
|
3
3
|
export interface AssetsTabProps {
|
|
4
4
|
api: NovelApi;
|
|
5
|
+
/** 初始子页(左侧导航直达对应资产分类)。 */
|
|
6
|
+
initialTab?: AssetSubTab;
|
|
5
7
|
}
|
|
8
|
+
/** 写作资产子页签。 */
|
|
9
|
+
type AssetSubTab = 'genre' | 'progression' | 'templates' | 'rules' | 'style';
|
|
6
10
|
/** 写作资产页签。 */
|
|
7
|
-
export declare function AssetsTab({ api }: AssetsTabProps): import("react").JSX.Element;
|
|
11
|
+
export declare function AssetsTab({ api, initialTab }: AssetsTabProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
/** 开书向导页。 */
|
|
3
|
+
export declare function CreateBookView({ api, onBack, onCreated, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
/** 返回书架。 */
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
/** 开书成功:进入新书工作台。 */
|
|
8
|
+
onCreated: (id: string) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NovelApi } from '../api.ts';
|
|
2
2
|
import type { PanelController } from './controller.ts';
|
|
3
3
|
/** The panel's tab identifiers. */
|
|
4
|
-
export type NovelTab = 'workflow' | 'overview' | 'plan' | 'bible' | '
|
|
4
|
+
export type NovelTab = 'workflow' | 'overview' | 'blurb' | 'plan' | 'bible' | 'world' | 'foreshadow' | 'assistant' | 'settings' | 'characters' | 'assetsGenre' | 'assetsProgression' | 'assetsTemplates' | 'assetsRules' | 'assetsStyle';
|
|
5
5
|
/** Panel shell props. */
|
|
6
6
|
export interface NovelPanelProps {
|
|
7
7
|
/** The panel state owner (open/close/toggle). */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { BookshelfSnapshot } from '../../protocol.ts';
|
|
3
|
+
/** 书架首页。 */
|
|
4
|
+
export declare function ShelfView({ api, shelf, onOpenBook, onAddBook, }: {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
shelf: BookshelfSnapshot;
|
|
7
|
+
/** 点击书卡:激活该书并进入工作台。 */
|
|
8
|
+
onOpenBook: (id: string) => void;
|
|
9
|
+
/** 点击+:进入开书向导页。 */
|
|
10
|
+
onAddBook: () => void;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { WorldState } from '../../protocol.ts';
|
|
3
|
+
/** 大世界页签。 */
|
|
4
|
+
export declare function WorldTab({ api, world, onChanged, }: {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
/** 当前项目的大世界数据(可能为空)。 */
|
|
7
|
+
world: WorldState | undefined;
|
|
8
|
+
/** 保存/提炼成功后由父组件刷新项目状态。 */
|
|
9
|
+
onChanged: (world: WorldState) => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* web-server dependencies), so routes stay thin and logic is testable.
|
|
7
7
|
*/
|
|
8
8
|
import type { Context } from '@deepseek-ai/cordis';
|
|
9
|
-
import type { ChapterPlan, Foreshadow, NovelConfig, ProjectState, ReviewReport, StoryBible, Volume } from './protocol.ts';
|
|
9
|
+
import type { AuditIssue, ChapterPlan, Foreshadow, NovelConfig, ProjectState, ReviewReport, RoleStatusCard, StoryBible, Volume, WorldState } from './protocol.ts';
|
|
10
10
|
/** Project state file name inside the output dir. */
|
|
11
11
|
export declare const PROJECT_FILE = "novel-project.json";
|
|
12
12
|
/** Chapter output file name, e.g. 第001章_开篇.md */
|
|
@@ -35,6 +35,11 @@ export declare function planVolumes(ctx: Context, config: NovelConfig, outline:
|
|
|
35
35
|
export declare function planChapters(ctx: Context, config: NovelConfig, project: ProjectState, chapterCount: number, volumeNo?: number): Promise<ChapterPlan[]>;
|
|
36
36
|
/** Run the AI review on one chapter. */
|
|
37
37
|
export declare function reviewChapter(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): Promise<ReviewReport>;
|
|
38
|
+
/**
|
|
39
|
+
* 审查「任意正文文本」(作者手动编辑后的草稿,不落盘)。
|
|
40
|
+
* 复用审稿提示词与红线/道藏/反AI规则;仅返回报告,不改文件不改状态。
|
|
41
|
+
*/
|
|
42
|
+
export declare function reviewChapterText(ctx: Context, config: NovelConfig, project: ProjectState, text: string): Promise<ReviewReport>;
|
|
38
43
|
/**
|
|
39
44
|
* Stream a chapter rewrite. With `target` (a passage of the body), only that
|
|
40
45
|
* passage's paragraph is rewritten and spliced back — everything else stays
|
|
@@ -47,20 +52,21 @@ export declare function rewriteChapterStream(ctx: Context, config: NovelConfig,
|
|
|
47
52
|
frame: 'delta';
|
|
48
53
|
text: string;
|
|
49
54
|
} | {
|
|
50
|
-
frame: '
|
|
51
|
-
file: string;
|
|
55
|
+
frame: 'drafted';
|
|
52
56
|
chars: number;
|
|
57
|
+
draft: string;
|
|
53
58
|
}, void, unknown>;
|
|
54
|
-
/** Stream a chapter polish (de-AI-ify).
|
|
59
|
+
/** Stream a chapter polish (de-AI-ify). Draft-mode: the polished body lands
|
|
60
|
+
* in `chapter.pendingDraft` and is only applied on draft/apply. */
|
|
55
61
|
export declare function polishChapterStream(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): AsyncGenerator<{
|
|
56
62
|
frame: 'start';
|
|
57
63
|
} | {
|
|
58
64
|
frame: 'delta';
|
|
59
65
|
text: string;
|
|
60
66
|
} | {
|
|
61
|
-
frame: '
|
|
62
|
-
file: string;
|
|
67
|
+
frame: 'drafted';
|
|
63
68
|
chars: number;
|
|
69
|
+
draft: string;
|
|
64
70
|
}, void, unknown>;
|
|
65
71
|
/** Generate one chapter (streaming). Yields progress frames; persists when done. */
|
|
66
72
|
export declare function generateChapterStream(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): AsyncGenerator<{
|
|
@@ -75,6 +81,61 @@ export declare function generateChapterStream(ctx: Context, config: NovelConfig,
|
|
|
75
81
|
}, void, unknown>;
|
|
76
82
|
/** Generate a chapter summary (narrative memory). */
|
|
77
83
|
export declare function summarizeChapter(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): Promise<string>;
|
|
84
|
+
/**
|
|
85
|
+
* 摘要 + 事实抽取合并为一次 LLM 调用(省一次调用与一次正文输入,
|
|
86
|
+
* 批量生成时整体开销约省 25%)。
|
|
87
|
+
* @returns 摘要与新增事实条数(失败返回空,调用方 best-effort)。
|
|
88
|
+
*/
|
|
89
|
+
export declare function summarizeAndExtractFacts(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): Promise<{
|
|
90
|
+
summary: string;
|
|
91
|
+
factCount: number;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* 抽取本章「已确立事实」追加到事实库/时间线(最多 300 条,最新优先)。
|
|
95
|
+
* 事实注入后续章节生成提示词,保证人物状态/境界/资源/关系长期一致。
|
|
96
|
+
* @returns 新增事实条数(失败返回 0,调用方 best-effort)。
|
|
97
|
+
*/
|
|
98
|
+
export declare function extractFacts(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, chapterNo: number): Promise<number>;
|
|
99
|
+
/** 全书一致性质检:LLM 分批扫描已生成章节 + 设定 + 事实库,聚合矛盾清单。 */
|
|
100
|
+
export declare function auditBook(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string): Promise<AuditIssue[]>;
|
|
101
|
+
/** 小说简介:AI 生成或按已写开头补全(面向读者的作品门面)。 */
|
|
102
|
+
export declare function generateBlurb(ctx: Context, config: NovelConfig, project: ProjectState, partial?: string): Promise<string>;
|
|
103
|
+
/**
|
|
104
|
+
* 组装全书上下文包(AI 助手 book_overview 工具)。
|
|
105
|
+
* 分片策略:章节要点默认只给最近 30 章(避免超长后爆上下文);
|
|
106
|
+
* scope='full' 全量;scope=数字 只给该卷章节。
|
|
107
|
+
*/
|
|
108
|
+
export declare function bookOverview(project: ProjectState, scope?: 'recent' | 'full' | number): string;
|
|
109
|
+
/** 一条影响分析结果(改动波及处)。 */
|
|
110
|
+
export interface ImpactItem {
|
|
111
|
+
/** 位置:章节号 / 大纲 / 设定圣经 / 大世界 / 事实库 / 简介。 */
|
|
112
|
+
location: string;
|
|
113
|
+
/** 原文片段(定位用)。 */
|
|
114
|
+
quote: string;
|
|
115
|
+
/** 修改建议。 */
|
|
116
|
+
suggestion: string;
|
|
117
|
+
/** must = 必须同步改;optional = 建议改;note = 备注(如保留旧称作古称)。 */
|
|
118
|
+
kind: 'must' | 'optional' | 'note';
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 影响分析:LLM 扫描全书(大纲/设定/大世界/事实库/已写章节),
|
|
122
|
+
* 定位一次改动波及的所有位置。助手在修改后主动调用,做连锁维护。
|
|
123
|
+
*/
|
|
124
|
+
export declare function analyzeImpact(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, change: string): Promise<ImpactItem[]>;
|
|
125
|
+
/** 把大世界结构化数据渲染成提示词块(境界体系按顺序强约束)。 */
|
|
126
|
+
export declare function renderWorld(world: WorldState | undefined): string;
|
|
127
|
+
/** AI 提炼大世界:从大纲 + 设定圣经生成结构化境界体系/区域/势力。 */
|
|
128
|
+
export declare function extractWorld(ctx: Context, config: NovelConfig, project: ProjectState): Promise<WorldState>;
|
|
129
|
+
/**
|
|
130
|
+
* 事实库回填:对历史已生成章节批量抽取事实(无事实记录的旧章节)。
|
|
131
|
+
* @returns 回填的章节数。
|
|
132
|
+
*/
|
|
133
|
+
export declare function backfillFacts(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string): Promise<number>;
|
|
134
|
+
/**
|
|
135
|
+
* 角色卡刷新:出场统计由服务端从正文精确计算(角色名出现过的章节数、
|
|
136
|
+
* 最近出现章节),LLM 只负责聚合「当前状态」一句话。
|
|
137
|
+
*/
|
|
138
|
+
export declare function refreshCharacters(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string): Promise<RoleStatusCard[]>;
|
|
78
139
|
/** Suggest foreshadows from the outline + plan. */
|
|
79
140
|
export declare function suggestForeshadows(ctx: Context, config: NovelConfig, project: ProjectState): Promise<Foreshadow[]>;
|
|
80
141
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface Config {
|
|
|
44
44
|
}
|
|
45
45
|
export declare const Config: z<Config>;
|
|
46
46
|
/** Model-facing announcement: plugin presence, capabilities, and limits. */
|
|
47
|
-
export declare const NOVEL_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-novel-forge \u63D2\u4EF6\uFF08AI \u7F16\u8BD1\u5C0F\u8BF4\u5DE5\u4F5C\u53F0\uFF09\uFF1A\u4FA7\u8FB9\u680F\u300C\u5C0F\u8BF4\u5DE5\u574A\u300D\u5165\u53E3\u3002\u80FD\u529B\uFF1A\u8BFB\u53D6 docx \u5927\u7EB2\uFF08\u9ED8\u8BA4\u684C\u9762\u300A\u5F52\u589F\u7389\u4E3B\u300B\u5927\u7EB2\uFF09\u6216\u7C98\u8D34\u5927\u7EB2\u6587\u672C\uFF1B\u7528 LLM \u63D0\u70BC\
|
|
47
|
+
export declare const NOVEL_GUIDANCE = "\u672C\u673A\u5DF2\u5B89\u88C5 dsh-novel-forge \u63D2\u4EF6\uFF08AI \u7F16\u8BD1\u5C0F\u8BF4\u5DE5\u4F5C\u53F0\uFF09\uFF1A\u4FA7\u8FB9\u680F\u300C\u5C0F\u8BF4\u5DE5\u574A\u300D\u5165\u53E3\u3002\u80FD\u529B\uFF1A\u8BFB\u53D6 docx \u5927\u7EB2\uFF08\u9ED8\u8BA4\u684C\u9762\u300A\u5F52\u589F\u7389\u4E3B\u300B\u5927\u7EB2\uFF09\u6216\u7C98\u8D34\u5927\u7EB2\u6587\u672C\uFF1B\u7528 LLM \u63D0\u70BC\u9053\u85CF\uFF08\u4EBA\u8BBE/\u4E16\u754C\u89C2/\u91D1\u624B\u6307\u89C4\u5219/\u5199\u4F5C\u7EA2\u7EBF\uFF0C\u5373\u8BBE\u5B9A\u5723\u7ECF\uFF09\uFF1B\u751F\u6210\u5377\u8BA1\u5212\u4E0E\u7AE0\u8282\u8BA1\u5212\uFF1B\u9010\u7AE0\u8C03\u7528 LLM \u751F\u6210 3000-4000 \u5B57\u6B63\u6587\u5E76\u4FDD\u5B58\u4E3A Markdown\uFF08\u9ED8\u8BA4\u8F93\u51FA\u5230 \u684C\u9762\\\u5F52\u589F\u7389\u4E3B\uFF09\uFF1B\u6BCF\u7AE0\u81EA\u52A8\u751F\u6210\u6458\u8981\uFF08\u53D9\u4E8B\u8BB0\u5FC6\uFF09\u3001\u81EA\u52A8 AI \u5BA1\u7A3F\uFF08\u4EBA\u8BBE/\u8BBE\u5B9A/\u7EA2\u7EBF/\u6587\u7B14/\u723D\u70B9/\u903B\u8F91\uFF09\uFF0C\u652F\u6301\u6309\u5BA1\u7A3F\u610F\u89C1\u91CD\u5199\u3001\u53BB AI \u5473\u6DA6\u8272\u3001\u6697\u7EBF\uFF08\u4F0F\u7B14\uFF09\u7BA1\u7406\u3001\u6279\u91CF\u8FDE\u5199\u4E0E\u5168\u672C\u5BFC\u51FA\uFF08txt/md\uFF09\u3002\u9650\u5236\uFF1A\u751F\u6210\u6D88\u8017 LLM API \u989D\u5EA6\uFF1B\u8F93\u51FA\u76EE\u5F55\u4E0E\u6A21\u578B\u53EF\u5728\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u4FEE\u6539\uFF1B\u7AE0\u8282\u6B63\u6587\u8D28\u91CF\u53D6\u51B3\u4E8E\u5927\u7EB2\u5B8C\u6574\u5EA6\u3002\u7528\u6237\u63D0\u5230\u300C\u5C0F\u8BF4 / \u5927\u7EB2 / \u5199\u5C0F\u8BF4 / \u7AE0\u8282 / \u5BA1\u7A3F / \u6DA6\u8272 / \u5F52\u589F\u7389\u4E3B\u300D\u65F6\u5373\u6307\u672C\u63D2\u4EF6\uFF0C\u8BF7\u636E\u6B64\u534F\u4F5C\u3002";
|
|
48
48
|
/** Resolve a config-like value into the full runtime config. */
|
|
49
49
|
export declare function resolveConfig(value: Partial<Config> | undefined): NovelConfig;
|
|
50
50
|
/**
|
package/lib/types/protocol.d.ts
CHANGED
|
@@ -18,13 +18,41 @@ export declare const NOVEL_API: {
|
|
|
18
18
|
readonly review: "/api/dsh-novel-forge/review";
|
|
19
19
|
readonly rewrite: "/api/dsh-novel-forge/rewrite";
|
|
20
20
|
readonly polish: "/api/dsh-novel-forge/polish";
|
|
21
|
+
/** 采纳待确认草稿(润色/重写产物)覆盖正文文件。 */
|
|
22
|
+
readonly draftApply: "/api/dsh-novel-forge/draft/apply";
|
|
23
|
+
/** 放弃待确认草稿,保留原稿。 */
|
|
24
|
+
readonly draftDiscard: "/api/dsh-novel-forge/draft/discard";
|
|
21
25
|
readonly summary: "/api/dsh-novel-forge/summary";
|
|
22
26
|
readonly foreshadow: "/api/dsh-novel-forge/foreshadow";
|
|
23
27
|
readonly exportBook: "/api/dsh-novel-forge/export";
|
|
24
28
|
readonly chapter: "/api/dsh-novel-forge/chapter";
|
|
29
|
+
/** 审查任意正文文本(作者手动编辑后,不落盘)。 */
|
|
30
|
+
readonly chapterCheck: "/api/dsh-novel-forge/chapter/check";
|
|
31
|
+
/** 保存手动编辑的正文(自动备份 .bak)。 */
|
|
32
|
+
readonly chapterSave: "/api/dsh-novel-forge/chapter/save";
|
|
25
33
|
readonly assistant: "/api/dsh-novel-forge/assistant";
|
|
26
34
|
readonly assistantHistory: "/api/dsh-novel-forge/assistant-history";
|
|
35
|
+
/** 清空助手对话记录。 */
|
|
36
|
+
readonly assistantClear: "/api/dsh-novel-forge/assistant/clear";
|
|
27
37
|
readonly bookshelf: "/api/dsh-novel-forge/bookshelf";
|
|
38
|
+
/** 重置项目(可选携带新大纲):清空设定/卷/章节/伏笔/资产/事实库。 */
|
|
39
|
+
readonly reset: "/api/dsh-novel-forge/reset";
|
|
40
|
+
/** 全书一致性质检:LLM 扫描已生成章节,输出矛盾问题清单。 */
|
|
41
|
+
readonly audit: "/api/dsh-novel-forge/audit";
|
|
42
|
+
/** 角色卡刷新:基于事实库与各章摘要聚合角色当前状态。 */
|
|
43
|
+
readonly charactersRefresh: "/api/dsh-novel-forge/characters/refresh";
|
|
44
|
+
/** 事实库回填:对历史已生成章节批量抽取事实(旧章节无事实记录时用)。 */
|
|
45
|
+
readonly factsBackfill: "/api/dsh-novel-forge/facts/backfill";
|
|
46
|
+
/** 设定圣经局部修补(如世界观规则编辑)。 */
|
|
47
|
+
readonly biblePatch: "/api/dsh-novel-forge/bible/patch";
|
|
48
|
+
/** 小说简介:生成(AI)/补全(AI)/保存。 */
|
|
49
|
+
readonly blurb: "/api/dsh-novel-forge/blurb";
|
|
50
|
+
/** 重命名当前书(同步项目与书架条目)。 */
|
|
51
|
+
readonly rename: "/api/dsh-novel-forge/rename";
|
|
52
|
+
/** 大世界:AI 提炼 / 保存结构化数据(境界/区域/势力)。 */
|
|
53
|
+
readonly world: "/api/dsh-novel-forge/world";
|
|
54
|
+
/** 封面:GET 读取(dataUrl)/ POST 上传或移除。 */
|
|
55
|
+
readonly cover: "/api/dsh-novel-forge/blurb/cover";
|
|
28
56
|
readonly config: "/api/dsh-novel-forge/config";
|
|
29
57
|
readonly openFolder: "/api/dsh-novel-forge/open-folder";
|
|
30
58
|
};
|
|
@@ -47,6 +75,8 @@ export interface BookshelfSnapshot {
|
|
|
47
75
|
done: number;
|
|
48
76
|
total: number;
|
|
49
77
|
hasProject: boolean;
|
|
78
|
+
hasCover: boolean;
|
|
79
|
+
blurb?: string;
|
|
50
80
|
}>;
|
|
51
81
|
/** 当前激活的书 id(无则 null)。 */
|
|
52
82
|
activeBookId: string | null;
|
|
@@ -55,6 +85,13 @@ export interface BookshelfSnapshot {
|
|
|
55
85
|
export interface BookCreateRequest {
|
|
56
86
|
bookName: string;
|
|
57
87
|
outputDir?: string;
|
|
88
|
+
/** 开书向导:创建时直接导入的大纲文本(提供则立即建立项目)。 */
|
|
89
|
+
outline?: string;
|
|
90
|
+
}
|
|
91
|
+
/** POST /reset 请求:重置项目(可选更新大纲)。 */
|
|
92
|
+
export interface ResetRequest {
|
|
93
|
+
/** 新大纲文本;提供则替换 outline,否则保留原大纲。 */
|
|
94
|
+
outline?: string;
|
|
58
95
|
}
|
|
59
96
|
/** POST /bookshelf/activate 请求:切换当前书。 */
|
|
60
97
|
export interface BookActivateRequest {
|
|
@@ -90,6 +127,11 @@ export interface ChapterPlan {
|
|
|
90
127
|
summary?: string;
|
|
91
128
|
/** Latest review report (present once reviewed). */
|
|
92
129
|
review?: ReviewReport;
|
|
130
|
+
/**
|
|
131
|
+
* 待确认草稿:润色(去AI味)或整章重写的产物正文。生成时先存这里,
|
|
132
|
+
* 用户看过对比后点「采纳」才覆盖正文文件;点「放弃」则丢弃。刷新页面不丢失。
|
|
133
|
+
*/
|
|
134
|
+
pendingDraft?: string;
|
|
93
135
|
}
|
|
94
136
|
/** One review finding. */
|
|
95
137
|
export interface ReviewIssue {
|
|
@@ -167,6 +209,122 @@ export interface Foreshadow {
|
|
|
167
209
|
/** Resolution note when resolved. */
|
|
168
210
|
resolvedNote?: string;
|
|
169
211
|
}
|
|
212
|
+
/** 一条已确立的叙事事实(事实库/时间线,注入后续章节生成)。 */
|
|
213
|
+
export interface ChapterFact {
|
|
214
|
+
/** 来源章节号。 */
|
|
215
|
+
chapterNo: number;
|
|
216
|
+
/** 事实文本(人物状态/境界资源/关系变化/伏笔落地等)。 */
|
|
217
|
+
text: string;
|
|
218
|
+
}
|
|
219
|
+
/** 一条全书质检发现的问题(一致性矛盾,定位到章)。 */
|
|
220
|
+
export interface AuditIssue {
|
|
221
|
+
/** 问题所在章节号(无法定位时 0)。 */
|
|
222
|
+
chapterNo: number;
|
|
223
|
+
severity: 'high' | 'medium' | 'low';
|
|
224
|
+
/** 矛盾描述。 */
|
|
225
|
+
item: string;
|
|
226
|
+
/** 修改建议。 */
|
|
227
|
+
suggestion: string;
|
|
228
|
+
}
|
|
229
|
+
/** POST /audit 响应。 */
|
|
230
|
+
export interface AuditResponse {
|
|
231
|
+
issues: AuditIssue[];
|
|
232
|
+
/** 参与质检的章节数。 */
|
|
233
|
+
auditedChapters: number;
|
|
234
|
+
/** 质检时间。 */
|
|
235
|
+
auditedAt: string;
|
|
236
|
+
}
|
|
237
|
+
/** 角色卡:角色当前状态(从事实库聚合)。 */
|
|
238
|
+
export interface RoleStatusCard {
|
|
239
|
+
name: string;
|
|
240
|
+
/** protagonist / supporting / antagonist / other。 */
|
|
241
|
+
role: string;
|
|
242
|
+
/** 当前状态一句话(境界/资源/伤势/心境)。 */
|
|
243
|
+
status: string;
|
|
244
|
+
/** 最近出场章节。 */
|
|
245
|
+
lastChapter: number;
|
|
246
|
+
/** 出场次数。 */
|
|
247
|
+
appearances: number;
|
|
248
|
+
}
|
|
249
|
+
/** POST /bible/patch 请求:局部修补设定圣经。 */
|
|
250
|
+
export interface BiblePatchRequest {
|
|
251
|
+
worldRules?: string[];
|
|
252
|
+
redLines?: string[];
|
|
253
|
+
style?: string[];
|
|
254
|
+
}
|
|
255
|
+
/** POST /blurb 请求:AI 生成/补全或手动保存小说简介。 */
|
|
256
|
+
export interface BlurbRequest {
|
|
257
|
+
action: 'generate' | 'save';
|
|
258
|
+
/** 已写好的开头(AI 补全时使用;留空 = 全量生成)。 */
|
|
259
|
+
partial?: string;
|
|
260
|
+
/** 手动保存的完整简介(action=save 时)。 */
|
|
261
|
+
text?: string;
|
|
262
|
+
}
|
|
263
|
+
/** POST /chapter/check|save 请求:审查/保存手动编辑的正文。 */
|
|
264
|
+
export interface ChapterTextRequest {
|
|
265
|
+
chapterNo: number;
|
|
266
|
+
/** 当前编辑中的正文全文。 */
|
|
267
|
+
text: string;
|
|
268
|
+
/** 保存时携带:已在工作区审查过的报告(沿用落盘,不重复审);缺省则保存后自动正式审稿一次。 */
|
|
269
|
+
report?: ReviewReport;
|
|
270
|
+
}
|
|
271
|
+
/** POST /chapter/save 响应。 */
|
|
272
|
+
export interface ChapterSaveResponse {
|
|
273
|
+
ok: boolean;
|
|
274
|
+
chars: number;
|
|
275
|
+
file: string;
|
|
276
|
+
/** 落盘的审稿报告(沿用工作区报告或保存后自动审稿)。 */
|
|
277
|
+
report?: ReviewReport;
|
|
278
|
+
}
|
|
279
|
+
/** POST /cover 请求:上传或移除封面。 */
|
|
280
|
+
export interface CoverRequest {
|
|
281
|
+
action: 'upload' | 'remove';
|
|
282
|
+
/** 上传时:data:image/...;base64,... 格式的图片数据。 */
|
|
283
|
+
dataUrl?: string;
|
|
284
|
+
}
|
|
285
|
+
/** POST /rename 请求:重命名当前书。 */
|
|
286
|
+
export interface RenameRequest {
|
|
287
|
+
bookName: string;
|
|
288
|
+
}
|
|
289
|
+
/** 大世界:一个境界等级。 */
|
|
290
|
+
export interface WorldRealm {
|
|
291
|
+
/** 境界名(练气/筑基/金丹…)。 */
|
|
292
|
+
name: string;
|
|
293
|
+
/** 描述:突破条件/寿命/标志等。 */
|
|
294
|
+
description: string;
|
|
295
|
+
}
|
|
296
|
+
/** 大世界:一个地理区域。 */
|
|
297
|
+
export interface WorldRegion {
|
|
298
|
+
name: string;
|
|
299
|
+
description: string;
|
|
300
|
+
/** 关联势力名(可空)。 */
|
|
301
|
+
faction?: string;
|
|
302
|
+
}
|
|
303
|
+
/** 大世界:一方势力。 */
|
|
304
|
+
export interface WorldFaction {
|
|
305
|
+
name: string;
|
|
306
|
+
/** 类型:宗门/家族/王朝/组织… */
|
|
307
|
+
kind: string;
|
|
308
|
+
description: string;
|
|
309
|
+
/** 驻地区域(可空)。 */
|
|
310
|
+
region?: string;
|
|
311
|
+
}
|
|
312
|
+
/** 大世界结构化数据。 */
|
|
313
|
+
export interface WorldState {
|
|
314
|
+
realms: WorldRealm[];
|
|
315
|
+
regions: WorldRegion[];
|
|
316
|
+
factions: WorldFaction[];
|
|
317
|
+
}
|
|
318
|
+
/** POST /world 请求:AI 提炼或手动保存。 */
|
|
319
|
+
export interface WorldRequest {
|
|
320
|
+
action: 'generate' | 'save';
|
|
321
|
+
/** action=save 时的完整世界数据。 */
|
|
322
|
+
world?: WorldState;
|
|
323
|
+
}
|
|
324
|
+
/** GET /cover 响应:封面的 dataUrl(无封面为 null)。 */
|
|
325
|
+
export interface CoverResponse {
|
|
326
|
+
dataUrl: string | null;
|
|
327
|
+
}
|
|
170
328
|
/** The persisted project: outline + bible + plan + progress. */
|
|
171
329
|
export interface ProjectState {
|
|
172
330
|
/** Book title (first non-empty line of the outline, usually). */
|
|
@@ -185,6 +343,14 @@ export interface ProjectState {
|
|
|
185
343
|
foreshadows: Foreshadow[];
|
|
186
344
|
/** 写作资产(题材基底/推进模式/反AI规则/写法资产)。 */
|
|
187
345
|
assets?: ProjectAssets;
|
|
346
|
+
/** 事实库/时间线:每章生成后抽取,注入后续章节保持一致性。 */
|
|
347
|
+
facts?: ChapterFact[];
|
|
348
|
+
/** 小说简介(面向读者的作品门面,AI 生成或手动保存)。 */
|
|
349
|
+
blurb?: string;
|
|
350
|
+
/** 封面文件名(相对输出目录,如 cover.png)。 */
|
|
351
|
+
coverPath?: string;
|
|
352
|
+
/** 大世界结构化数据(境界体系/区域/势力)。 */
|
|
353
|
+
world?: WorldState;
|
|
188
354
|
/** ISO timestamps. */
|
|
189
355
|
createdAt: string;
|
|
190
356
|
updatedAt: string;
|
|
@@ -292,6 +458,13 @@ export type JobFrame = {
|
|
|
292
458
|
no: number;
|
|
293
459
|
file: string;
|
|
294
460
|
chars: number;
|
|
461
|
+
}
|
|
462
|
+
/** 润色/重写完成,产物作为待确认草稿(尚未覆盖正文)。 */
|
|
463
|
+
| {
|
|
464
|
+
type: 'drafted';
|
|
465
|
+
no: number;
|
|
466
|
+
chars: number;
|
|
467
|
+
draft: string;
|
|
295
468
|
} | {
|
|
296
469
|
type: 'error';
|
|
297
470
|
no: number;
|
|
@@ -316,6 +489,10 @@ export interface RewriteRequest {
|
|
|
316
489
|
export interface PolishRequest {
|
|
317
490
|
chapterNo: number;
|
|
318
491
|
}
|
|
492
|
+
/** POST /draft/apply | /draft/discard request: 采纳或放弃待确认草稿。 */
|
|
493
|
+
export interface DraftDecisionRequest {
|
|
494
|
+
chapterNo: number;
|
|
495
|
+
}
|
|
319
496
|
/** POST /summary request: (re)generate a chapter summary. */
|
|
320
497
|
export interface SummaryRequest {
|
|
321
498
|
chapterNo: number;
|