@waterwx/dsh-novel-forge 2.1.1-alpha → 2.1.1
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 +368 -472
- package/lib/client.js +19578 -21391
- package/lib/index.js +4640 -3932
- package/lib/types/action-guard.d.ts +61 -0
- package/lib/types/ai-scan.d.ts +0 -6
- package/lib/types/assets.d.ts +7 -9
- package/lib/types/assistant.d.ts +25 -0
- package/lib/types/author-assets.d.ts +1 -3
- package/lib/types/bookshelf.d.ts +13 -3
- package/lib/types/client/api.d.ts +49 -29
- package/lib/types/client/chip-prefs.d.ts +36 -0
- package/lib/types/client/docx.d.ts +2 -2
- package/lib/types/client/llmLive.d.ts +12 -14
- package/lib/types/client/locales.d.ts +12 -67
- package/lib/types/client/mount.d.ts +0 -2
- package/lib/types/client/panel/AdaptModeView.d.ts +1 -1
- package/lib/types/client/panel/AiTag.d.ts +1 -0
- package/lib/types/client/panel/AssetsTab.d.ts +1 -1
- package/lib/types/client/panel/AssistantTab.d.ts +4 -1
- package/lib/types/client/panel/AuthorAssetsView.d.ts +1 -1
- package/lib/types/client/panel/AuthorHome.d.ts +12 -12
- package/lib/types/client/panel/CmdPalette.d.ts +12 -0
- package/lib/types/client/panel/CreateBookView.d.ts +1 -1
- package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +1 -1
- package/lib/types/client/panel/ImportModal.d.ts +1 -1
- package/lib/types/client/panel/LiveFeedLog.d.ts +8 -0
- package/lib/types/client/panel/ModelManager.d.ts +2 -2
- package/lib/types/client/panel/NovelPanel.d.ts +7 -2
- package/lib/types/client/panel/PageHeader.d.ts +18 -0
- package/lib/types/client/panel/ProgressConsole.d.ts +1 -1
- package/lib/types/client/panel/PromptSlotsView.d.ts +11 -0
- package/lib/types/client/panel/ReaderView.d.ts +1 -1
- package/lib/types/client/panel/RunPanel.d.ts +1 -1
- package/lib/types/client/panel/SettingsView.d.ts +13 -10
- package/lib/types/client/panel/ShelfView.d.ts +11 -2
- package/lib/types/client/panel/SubPage.d.ts +27 -0
- package/lib/types/client/panel/TensionView.d.ts +18 -0
- package/lib/types/client/panel/TimelineView.d.ts +18 -0
- package/lib/types/client/panel/WorldTab.d.ts +1 -1
- package/lib/types/client/panel/helpers.d.ts +5 -3
- package/lib/types/client/panel/market-radar-state.d.ts +56 -0
- package/lib/types/client/panel/outline-markdown.d.ts +112 -0
- package/lib/types/client/panel/status-badge.d.ts +13 -0
- package/lib/types/client/panel/storage-parse.d.ts +46 -0
- package/lib/types/client/panel/toast.d.ts +2 -0
- package/lib/types/client/panel/usePersistentState.d.ts +17 -0
- package/lib/types/client/panel/views.d.ts +21 -35
- package/lib/types/client/run-status.d.ts +21 -0
- package/lib/types/client/sidebar-entry.d.ts +0 -2
- package/lib/types/digest-parse.d.ts +29 -0
- package/lib/types/docx-core.d.ts +16 -0
- package/lib/types/docx.d.ts +2 -3
- package/lib/types/engine.d.ts +122 -103
- package/lib/types/home.d.ts +11 -0
- package/lib/types/index.d.ts +21 -13
- package/lib/types/llm-live.d.ts +62 -36
- package/lib/types/llm-retry.d.ts +38 -0
- package/lib/types/market-radar-scan.d.ts +0 -1
- package/lib/types/market-radar-sources.d.ts +1 -1
- package/lib/types/migrate-output.d.ts +25 -0
- package/lib/types/model-capability.d.ts +119 -0
- package/lib/types/model-request.d.ts +36 -0
- package/lib/types/output-budget.d.ts +86 -0
- package/lib/types/plotline-align.d.ts +35 -0
- package/lib/types/prompt-slots.d.ts +57 -0
- package/lib/types/prompting.d.ts +2 -27
- package/lib/types/protocol.d.ts +479 -595
- package/lib/types/revision.d.ts +76 -0
- package/lib/types/routes.d.ts +9 -3
- package/lib/types/run-selection.d.ts +51 -0
- package/lib/types/run.d.ts +31 -0
- package/lib/types/settings-persist.d.ts +59 -0
- package/lib/types/snapshots.d.ts +46 -0
- package/lib/types/stage-contract.d.ts +58 -0
- package/lib/types/stream-fallback.d.ts +60 -0
- package/lib/types/strip-headings.d.ts +33 -0
- package/lib/types/tension.d.ts +53 -0
- package/lib/types/timeline.d.ts +37 -0
- package/package.json +41 -28
- package/assets/styles/arcane-thick-3d.webp +0 -0
- package/assets/styles/chinese-ink.webp +0 -0
- package/assets/styles/clay-stopmotion-3d.webp +0 -0
- package/assets/styles/dark-ghibli.webp +0 -0
- package/assets/styles/dark-gothic-3d.webp +0 -0
- package/assets/styles/film-photo.webp +0 -0
- package/assets/styles/guofeng-heavy.webp +0 -0
- package/assets/styles/guoman-2d-gufeng.webp +0 -0
- package/assets/styles/guoman-3d-tianyuan.webp +0 -0
- package/assets/styles/guoman-3d-xuanhuan.webp +0 -0
- package/assets/styles/horror-game-3d.webp +0 -0
- package/assets/styles/hyperreal-3d.webp +0 -0
- package/assets/styles/japan-cel-dark.webp +0 -0
- package/assets/styles/korean-webtoon.webp +0 -0
- package/assets/styles/low-cyberpunk-3d.webp +0 -0
- package/assets/styles/nextgen-cg.webp +0 -0
- package/assets/styles/noir-film.webp +0 -0
- package/assets/styles/openworld-survival.webp +0 -0
- package/assets/styles/paper-cut-3d.webp +0 -0
- package/assets/styles/pixar-adult-3d.webp +0 -0
- package/assets/styles/pop-marvel-2d.webp +0 -0
- package/assets/styles/sandiao-qban.webp +0 -0
- package/assets/styles/shinkai-anime.webp +0 -0
- package/assets/styles/tactical-stealth.webp +0 -0
- package/assets/styles/urban-lightreal-3d.webp +0 -0
- package/assets/styles/vaporwave-3d.webp +0 -0
- package/assets/styles/vhs90.webp +0 -0
- package/lib/types/client/panel/BookshelfBar.d.ts +0 -11
- package/lib/types/client/panel/FlowGuide.d.ts +0 -22
- package/lib/types/client/panel/MangaRoleLibrary.d.ts +0 -20
- package/lib/types/client/panel/MangaWorkspace.d.ts +0 -12
- package/lib/types/client/panel/ModelPicker.d.ts +0 -11
- package/lib/types/client/panel/ProgressHomeView.d.ts +0 -5
- package/lib/types/client/panel/PropLibrary.d.ts +0 -8
- package/lib/types/client/panel/SceneLibrary.d.ts +0 -16
- package/lib/types/client/panel/StoryboardTab.d.ts +0 -19
- package/lib/types/client/panel/StyleCard.d.ts +0 -8
- package/lib/types/client/panel/StyleGallery.d.ts +0 -1
- package/lib/types/comic-presets.d.ts +0 -12
- package/lib/types/manga-genre-rules.d.ts +0 -22
- package/lib/types/prompt-utils.d.ts +0 -35
- package/lib/types/review-policy.d.ts +0 -97
- package/lib/types/shot-language.d.ts +0 -46
- package/lib/types/src/ai-scan.d.ts +0 -36
- package/lib/types/src/assets.d.ts +0 -37
- package/lib/types/src/assistant.d.ts +0 -45
- package/lib/types/src/author-assets.d.ts +0 -25
- package/lib/types/src/bookshelf.d.ts +0 -42
- package/lib/types/src/client/api.d.ts +0 -234
- package/lib/types/src/client/docx.d.ts +0 -15
- package/lib/types/src/client/index.d.ts +0 -14
- package/lib/types/src/client/locales.d.ts +0 -212
- package/lib/types/src/client/mount.d.ts +0 -9
- package/lib/types/src/client/panel/AdaptModeView.d.ts +0 -5
- package/lib/types/src/client/panel/AssetsTab.d.ts +0 -12
- package/lib/types/src/client/panel/AssistantTab.d.ts +0 -7
- package/lib/types/src/client/panel/AuthorAssetsView.d.ts +0 -4
- package/lib/types/src/client/panel/AuthorHome.d.ts +0 -32
- package/lib/types/src/client/panel/BookshelfBar.d.ts +0 -11
- package/lib/types/src/client/panel/CreateBookView.d.ts +0 -9
- package/lib/types/src/client/panel/FlowGuide.d.ts +0 -22
- package/lib/types/src/client/panel/GlobalAssetLibraryView.d.ts +0 -4
- package/lib/types/src/client/panel/ImportModal.d.ts +0 -7
- package/lib/types/src/client/panel/MangaRoleLibrary.d.ts +0 -20
- package/lib/types/src/client/panel/MangaWorkspace.d.ts +0 -12
- package/lib/types/src/client/panel/ModelManager.d.ts +0 -14
- package/lib/types/src/client/panel/NovelPanel.d.ts +0 -13
- package/lib/types/src/client/panel/ProgressConsole.d.ts +0 -17
- package/lib/types/src/client/panel/ProgressHomeView.d.ts +0 -5
- package/lib/types/src/client/panel/PropLibrary.d.ts +0 -8
- package/lib/types/src/client/panel/ReaderView.d.ts +0 -8
- package/lib/types/src/client/panel/ReasoningSection.d.ts +0 -10
- package/lib/types/src/client/panel/RunPanel.d.ts +0 -5
- package/lib/types/src/client/panel/SceneLibrary.d.ts +0 -16
- package/lib/types/src/client/panel/SettingsView.d.ts +0 -16
- package/lib/types/src/client/panel/ShelfView.d.ts +0 -15
- package/lib/types/src/client/panel/StoryboardTab.d.ts +0 -19
- package/lib/types/src/client/panel/StyleCard.d.ts +0 -8
- package/lib/types/src/client/panel/StyleGallery.d.ts +0 -1
- package/lib/types/src/client/panel/WorldTab.d.ts +0 -10
- package/lib/types/src/client/panel/controller.d.ts +0 -19
- package/lib/types/src/client/panel/helpers.d.ts +0 -18
- package/lib/types/src/client/panel/views.d.ts +0 -77
- package/lib/types/src/client/sidebar-entry.d.ts +0 -13
- package/lib/types/src/client/text.d.ts +0 -9
- package/lib/types/src/comic-presets.d.ts +0 -12
- package/lib/types/src/docx.d.ts +0 -19
- package/lib/types/src/engine.d.ts +0 -402
- package/lib/types/src/index.d.ts +0 -79
- package/lib/types/src/manga-genre-rules.d.ts +0 -22
- package/lib/types/src/novel-context.d.ts +0 -80
- package/lib/types/src/prompt-utils.d.ts +0 -35
- package/lib/types/src/protocol.d.ts +0 -2176
- package/lib/types/src/review-policy.d.ts +0 -97
- package/lib/types/src/routes.d.ts +0 -29
- package/lib/types/src/run.d.ts +0 -32
- package/lib/types/src/shot-language.d.ts +0 -46
- package/lib/types/src/story-beat-language.d.ts +0 -35
- package/lib/types/src/style-library.d.ts +0 -33
- package/lib/types/story-beat-language.d.ts +0 -35
- package/lib/types/style-library.d.ts +0 -33
- package/src/ai-scan.ts +0 -179
- package/src/assets.ts +0 -1774
- package/src/assistant.ts +0 -915
- package/src/author-assets.ts +0 -147
- package/src/bookshelf.ts +0 -167
- package/src/client/api.ts +0 -716
- package/src/client/css-modules.d.ts +0 -8
- package/src/client/docx.ts +0 -69
- package/src/client/index.ts +0 -34
- package/src/client/llmLive.ts +0 -101
- package/src/client/locales.ts +0 -418
- package/src/client/mount.tsx +0 -97
- package/src/client/mount.tsx._new +0 -97
- package/src/client/mount.tsx._nf +0 -97
- package/src/client/mount.tsx._tmp +0 -97
- package/src/client/panel/AdaptModeView.tsx +0 -535
- package/src/client/panel/AssetsTab.tsx +0 -458
- package/src/client/panel/AssistantTab.tsx +0 -339
- package/src/client/panel/AuthorAssetsView.tsx +0 -208
- package/src/client/panel/AuthorHome.tsx +0 -234
- package/src/client/panel/BookAnalysisView.tsx +0 -60
- package/src/client/panel/BookshelfBar.tsx +0 -170
- package/src/client/panel/CreateBookView.tsx +0 -371
- package/src/client/panel/DirectorView.tsx +0 -200
- package/src/client/panel/FlowGuide.tsx +0 -84
- package/src/client/panel/GlobalAssetLibraryView.tsx +0 -172
- package/src/client/panel/IdeaInspirationView.tsx +0 -71
- package/src/client/panel/ImportModal.tsx +0 -303
- package/src/client/panel/KnowledgeBaseView.tsx +0 -73
- package/src/client/panel/LiveFeedLog.tsx +0 -76
- package/src/client/panel/MangaRoleLibrary.tsx +0 -1002
- package/src/client/panel/MangaWorkspace.tsx +0 -715
- package/src/client/panel/MarketRadarView.tsx +0 -374
- package/src/client/panel/ModelManager.tsx +0 -205
- package/src/client/panel/NovelPanel.tsx +0 -4721
- package/src/client/panel/ProgressConsole.tsx +0 -63
- package/src/client/panel/ProgressHomeView.tsx +0 -87
- package/src/client/panel/PropLibrary.tsx +0 -175
- package/src/client/panel/ReaderView.tsx +0 -306
- package/src/client/panel/ReasoningSection.tsx +0 -31
- package/src/client/panel/RunPanel.tsx +0 -204
- package/src/client/panel/SceneLibrary.tsx +0 -453
- package/src/client/panel/SettingsView.tsx +0 -289
- package/src/client/panel/ShelfView.tsx +0 -242
- package/src/client/panel/StoryboardTab.tsx +0 -472
- package/src/client/panel/StyleCard.tsx +0 -90
- package/src/client/panel/StyleGallery.tsx +0 -58
- package/src/client/panel/WorldTab.tsx +0 -202
- package/src/client/panel/controller.ts +0 -45
- package/src/client/panel/helpers.ts +0 -67
- package/src/client/panel/panel.module.css +0 -4359
- package/src/client/panel/views.tsx +0 -314
- package/src/client/sidebar-entry.ts +0 -122
- package/src/client/text.ts +0 -28
- package/src/comic-presets.ts +0 -67
- package/src/docx.ts +0 -83
- package/src/engine.ts +0 -5636
- package/src/global-assets.ts +0 -59
- package/src/index.ts +0 -346
- package/src/llm-live.ts +0 -68
- package/src/manga-genre-rules.ts +0 -87
- package/src/market-radar-scan.ts +0 -41
- package/src/market-radar-sources.ts +0 -173
- package/src/novel-context.ts +0 -287
- package/src/prompt-utils.ts +0 -73
- package/src/prompting.ts +0 -159
- package/src/protocol.ts +0 -2565
- package/src/review-policy.ts +0 -161
- package/src/routes.ts +0 -3939
- package/src/run.ts +0 -338
- package/src/shot-language.ts +0 -181
- package/src/story-beat-language.ts +0 -130
- package/src/style-library.ts +0 -84
package/lib/types/protocol.d.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* state file format, and the NDJSON generation stream frames all live here so
|
|
5
5
|
* both halves spell exactly one vocabulary.
|
|
6
6
|
*/
|
|
7
|
-
import type { ShotSizeId, CameraMoveId, CompositionId, LightingId } from './shot-language.ts';
|
|
8
|
-
import type { StoryFunctionId, EmotionId } from './story-beat-language.ts';
|
|
9
7
|
/** The /api/dsh-novel-forge route family (same-origin, loopback-fenced). */
|
|
10
8
|
export declare const NOVEL_API: {
|
|
11
9
|
readonly status: "/api/dsh-novel-forge/status";
|
|
@@ -25,6 +23,20 @@ export declare const NOVEL_API: {
|
|
|
25
23
|
readonly director: "/api/dsh-novel-forge/director";
|
|
26
24
|
readonly directorTodos: "/api/dsh-novel-forge/director/todos";
|
|
27
25
|
readonly llmLive: "/api/dsh-novel-forge/llm-live/stream";
|
|
26
|
+
/** 查看某次调用实际发送的 Prompt(按 sessionId)。 */
|
|
27
|
+
readonly llmPrompt: "/api/dsh-novel-forge/llm-live/prompt";
|
|
28
|
+
/** 清零本次运行的用量账本。 */
|
|
29
|
+
readonly usageReset: "/api/dsh-novel-forge/usage/reset";
|
|
30
|
+
/** 章节历史版本(快照)。 */
|
|
31
|
+
readonly snapshot: "/api/dsh-novel-forge/snapshot";
|
|
32
|
+
/** 修订指令合并(POST:汇总审稿/时间线/张力为一轮)。 */
|
|
33
|
+
readonly revisionPlan: "/api/dsh-novel-forge/revision/plan";
|
|
34
|
+
/** 张力曲线(GET 数据 / POST 设置)。 */
|
|
35
|
+
readonly tension: "/api/dsh-novel-forge/tension";
|
|
36
|
+
/** 提示词槽位(GET 列表 / POST 写入)。 */
|
|
37
|
+
readonly promptSlots: "/api/dsh-novel-forge/prompt-slots";
|
|
38
|
+
/** 故事时间线(GET 列表 / POST 操作)。 */
|
|
39
|
+
readonly timeline: "/api/dsh-novel-forge/timeline";
|
|
28
40
|
readonly marketRadar: "/api/dsh-novel-forge/market-radar";
|
|
29
41
|
readonly marketRadarScan: "/api/dsh-novel-forge/market-radar/scan";
|
|
30
42
|
readonly marketRadarApply: "/api/dsh-novel-forge/market-radar/apply";
|
|
@@ -57,22 +69,6 @@ export declare const NOVEL_API: {
|
|
|
57
69
|
readonly bookshelfImportText: "/api/dsh-novel-forge/bookshelf/import-text";
|
|
58
70
|
/** 导入 txt/md 全本:拆章预览(不落盘)。 */
|
|
59
71
|
readonly bookshelfImportTextPreview: "/api/dsh-novel-forge/bookshelf/import-text/preview";
|
|
60
|
-
/** 漫剧方案管理:create/remove/activate。 */
|
|
61
|
-
readonly manhuaPlans: "/api/dsh-novel-forge/manhua/plans";
|
|
62
|
-
/** 漫剧角色库:从分镜提名(规则+LLM两段式)/ 建卡 / 更新 / 删除 / 形象锚点 / 精修提示词。 */
|
|
63
|
-
readonly mangaRoles: "/api/dsh-novel-forge/manga/roles";
|
|
64
|
-
/** 漫剧道具库:从已写章节提炼常驻道具(跨镜头需一致)/ 保存清单。 */
|
|
65
|
-
readonly mangaProps: "/api/dsh-novel-forge/manga/props";
|
|
66
|
-
/** 导出「即梦素材包」落盘到资产库 manga-assets/素材包/。 */
|
|
67
|
-
readonly exportPackage: "/api/dsh-novel-forge/manga/export-package";
|
|
68
|
-
/** 分镜·编剧级:单章 → 剧情骨架(节拍链)。 */
|
|
69
|
-
readonly storyboardSkeleton: "/api/dsh-novel-forge/storyboard/skeleton";
|
|
70
|
-
/** 分镜·导演级:骨架 → 分镜表(镜头级)。 */
|
|
71
|
-
readonly storyboardTable: "/api/dsh-novel-forge/storyboard/table";
|
|
72
|
-
/** 分镜·提示词级:分镜表 → 即梦可粘贴视频提示词。 */
|
|
73
|
-
readonly storyboardPrompts: "/api/dsh-novel-forge/storyboard/prompts";
|
|
74
|
-
/** 生图接口连通性测试(设置页每个模型条目用)。 */
|
|
75
|
-
readonly imageTest: "/api/dsh-novel-forge/image-test";
|
|
76
72
|
/** LLM 模型连通性测试:真实最小调用,验证 Key / 端点 / 模型可用。 */
|
|
77
73
|
readonly llmTest: "/api/dsh-novel-forge/llm-test";
|
|
78
74
|
/** 添加模型:厂商直填 key 或自定义路由,写进 DSH 凭据与 llm-pi-ai 路由。 */
|
|
@@ -99,16 +95,14 @@ export declare const NOVEL_API: {
|
|
|
99
95
|
readonly blurb: "/api/dsh-novel-forge/blurb";
|
|
100
96
|
/** 重命名当前书(同步项目与书架条目)。 */
|
|
101
97
|
readonly rename: "/api/dsh-novel-forge/rename";
|
|
102
|
-
/**
|
|
98
|
+
/** 大世界:提炼 / 保存结构化数据(境界/区域/势力)。 */
|
|
103
99
|
readonly world: "/api/dsh-novel-forge/world";
|
|
104
100
|
/** 封面:GET 读取(dataUrl)/ POST 上传或移除。 */
|
|
105
101
|
readonly cover: "/api/dsh-novel-forge/blurb/cover";
|
|
106
102
|
/** 剧情线管理:增删改 + 关联章节。 */
|
|
107
103
|
readonly plotlines: "/api/dsh-novel-forge/plotlines";
|
|
108
|
-
/**
|
|
104
|
+
/** 角色库:提炼 / 采纳 / 更新 / 删除。 */
|
|
109
105
|
readonly roles: "/api/dsh-novel-forge/roles";
|
|
110
|
-
readonly scenes: "/api/dsh-novel-forge/scenes";
|
|
111
|
-
readonly visualRules: "/api/dsh-novel-forge/visual-rules";
|
|
112
106
|
/** 作者复盘补跑:对已写章节补齐 authorReview(全书流式 / 单章 JSON)。 */
|
|
113
107
|
readonly reviewBackfill: "/api/dsh-novel-forge/review/backfill";
|
|
114
108
|
/** 章节复位:generating 卡死 → pending(可重新生成)。 */
|
|
@@ -117,15 +111,12 @@ export declare const NOVEL_API: {
|
|
|
117
111
|
readonly chapterApprove: "/api/dsh-novel-forge/chapter/approve";
|
|
118
112
|
/** 敏感词检查:全书已写章节或指定文本。 */
|
|
119
113
|
readonly sensitiveCheck: "/api/dsh-novel-forge/sensitive-check";
|
|
120
|
-
/** 开书想法 →
|
|
114
|
+
/** 开书想法 → 补全大纲:输入一句话想法,生成 2-3 个可选大纲方案。 */
|
|
121
115
|
readonly outlineSuggest: "/api/dsh-novel-forge/outline/suggest";
|
|
122
116
|
/** 反推大纲:从已写章节正文反向生成全书总纲(NDJSON 流)。 */
|
|
123
117
|
readonly outlineReverse: "/api/dsh-novel-forge/outline/reverse";
|
|
124
118
|
/** 拆书分析:对已写章节做结构/人物/文风/卖点四维体检(两阶段:源笔记→分节分析)。 */
|
|
125
119
|
readonly breakdown: "/api/dsh-novel-forge/breakdown";
|
|
126
|
-
/** 漫剧分镜生成:章节 → 角色锚点 + 分镜表(可适配豆包/Seedance/SD)。 */
|
|
127
|
-
/** 漫剧分集计划:读一卷 → 按故事弧线分集(高潮拆集/过渡并章)。 */
|
|
128
|
-
/** 漫画脚本:章节 → 分页分格漫画脚本(含角色视觉锚点)。 */
|
|
129
120
|
/** 生产单:启动批量生产(计划补足 + 逐章生成 + 被拒分级处理)。 */
|
|
130
121
|
readonly runStart: "/api/dsh-novel-forge/run/start";
|
|
131
122
|
/** 生产单控制:pause / resume / stop。 */
|
|
@@ -133,6 +124,10 @@ export declare const NOVEL_API: {
|
|
|
133
124
|
/** 生产单状态(含进度统计与日志)。 */
|
|
134
125
|
readonly runStatus: "/api/dsh-novel-forge/run/status";
|
|
135
126
|
readonly config: "/api/dsh-novel-forge/config";
|
|
127
|
+
/** 输出目录迁移:dryRun 预览 / 确认后搬文件并联动配置与书架。 */
|
|
128
|
+
readonly moveOutputDir: "/api/dsh-novel-forge/move-output-dir";
|
|
129
|
+
/** 本书参数:POST {} 读取;POST {patch} 合并保存(存 novel-project.json)。 */
|
|
130
|
+
readonly bookSettings: "/api/dsh-novel-forge/book-settings";
|
|
136
131
|
readonly openFolder: "/api/dsh-novel-forge/open-folder";
|
|
137
132
|
/** 插件自更新:在 DSH profile 目录拉取最新 npm 版(下载后需重启 DSH 生效)。 */
|
|
138
133
|
readonly pluginUpdate: "/api/dsh-novel-forge/plugin/update";
|
|
@@ -230,7 +225,7 @@ export interface BookImportTextRequest {
|
|
|
230
225
|
text?: string;
|
|
231
226
|
/** 模式二:原文件名(txt/md),用于推断书名与显示。 */
|
|
232
227
|
fileName?: string;
|
|
233
|
-
/**
|
|
228
|
+
/** 输出目录;缺省为「输出目录」设置下的书名子目录。 */
|
|
234
229
|
outputDir?: string;
|
|
235
230
|
}
|
|
236
231
|
/** POST /bookshelf/import-text 响应。 */
|
|
@@ -262,305 +257,6 @@ export interface BookImportTextPreviewResponse {
|
|
|
262
257
|
/** 因内容过短被跳过的章节标题列表。 */
|
|
263
258
|
skipped: string[];
|
|
264
259
|
}
|
|
265
|
-
/** 分镜·编剧级:剧情骨架中的一节拍。 */
|
|
266
|
-
export interface StoryboardBeat {
|
|
267
|
-
/** 节拍 id(如 b1、b2)。 */
|
|
268
|
-
id: string;
|
|
269
|
-
/** 事件一句话(发生了什么)。 */
|
|
270
|
-
event: string;
|
|
271
|
-
/** 情绪走向(情绪词 id 数组,来自 story-beat-language 词库,链式)。 */
|
|
272
|
-
emotion: EmotionId[];
|
|
273
|
-
/** 叙事功能(枚举 id,来自 story-beat-language 词库)。 */
|
|
274
|
-
function: StoryFunctionId;
|
|
275
|
-
/** 因果:承接上一节拍的原因(可选)。 */
|
|
276
|
-
cause?: string;
|
|
277
|
-
}
|
|
278
|
-
/** 分镜·编剧级:单章剧情骨架。 */
|
|
279
|
-
export interface StoryboardSkeleton {
|
|
280
|
-
chapterNo: number;
|
|
281
|
-
/** 本章弧线一句话(起承转合)。 */
|
|
282
|
-
arc: string;
|
|
283
|
-
/** 剧情节拍链(时间顺序,因果连贯)。 */
|
|
284
|
-
beats: StoryboardBeat[];
|
|
285
|
-
/** 本章全部出镜角色(正文中的确切称谓,去重;漫剧角色库提名地基)。 */
|
|
286
|
-
characters?: string[];
|
|
287
|
-
}
|
|
288
|
-
/** POST /storyboard/skeleton 请求:生成单章剧情骨架。 */
|
|
289
|
-
export interface StoryboardSkeletonRequest {
|
|
290
|
-
chapterNo: number;
|
|
291
|
-
}
|
|
292
|
-
/** POST /storyboard/skeleton 响应。 */
|
|
293
|
-
export interface StoryboardSkeletonResponse {
|
|
294
|
-
skeleton: StoryboardSkeleton;
|
|
295
|
-
}
|
|
296
|
-
/** 分镜·导演级:一个镜头。 */
|
|
297
|
-
export interface StoryboardShot {
|
|
298
|
-
/** 镜头 id(如 s1、s2)。 */
|
|
299
|
-
id: string;
|
|
300
|
-
/** 挂载的节拍 id(骨架中的 b1…)。 */
|
|
301
|
-
beatId: string;
|
|
302
|
-
/** 景别(枚举 id,来自 shot-language 词库)。 */
|
|
303
|
-
shot: ShotSizeId;
|
|
304
|
-
/** 机位与运镜(枚举 id 数组,来自 shot-language 词库)。 */
|
|
305
|
-
camera: CameraMoveId[];
|
|
306
|
-
/** 构图(可选,枚举 id)。 */
|
|
307
|
-
composition?: CompositionId;
|
|
308
|
-
/** 时长(秒,即梦白名单:5/6/7/8/10)。 */
|
|
309
|
-
duration: number;
|
|
310
|
-
/** 画面内容:角色动作 + 表情 + 服装/标志物 + 主体位置。 */
|
|
311
|
-
visual: string;
|
|
312
|
-
/** 台词/旁白(无则空字符串)。 */
|
|
313
|
-
line: string;
|
|
314
|
-
/** 音效(无则空字符串)。 */
|
|
315
|
-
sound: string;
|
|
316
|
-
/** 光效(枚举 id 数组,来自 shot-language 词库)。 */
|
|
317
|
-
light: LightingId[];
|
|
318
|
-
/** 承接上一镜头结尾状态(位置/动作/情绪/服装)。 */
|
|
319
|
-
prevState: string;
|
|
320
|
-
/** 本镜头结束状态。 */
|
|
321
|
-
nextState: string;
|
|
322
|
-
/** 本镜头出镜角色(引用小说库规范名/漫剧卡名,1-4 个;漫剧角色库提名地基)。 */
|
|
323
|
-
characters?: string[];
|
|
324
|
-
/** 本镜头已绑定漫剧卡的 id(定妆图引用,供出图/生视频时按卡取参考图)。 */
|
|
325
|
-
mangaRoleIds?: string[];
|
|
326
|
-
/** 即梦自然语言运镜描述(如「镜头从中景缓慢推进到近景」),提示词层直接使用,无需再转换。 */
|
|
327
|
-
jimengCamera?: string;
|
|
328
|
-
/** 本镜参考图 id 列表(角色定妆图+场景图),即梦图生视频时逐条投喂。 */
|
|
329
|
-
referenceImageIds?: string[];
|
|
330
|
-
}
|
|
331
|
-
/** 分镜·导演级:单章分镜表。 */
|
|
332
|
-
export interface StoryboardTable {
|
|
333
|
-
chapterNo: number;
|
|
334
|
-
shots: StoryboardShot[];
|
|
335
|
-
/** 生成时注入的场景卡名称(前端标注消费关系)。 */
|
|
336
|
-
usedScenes?: string[];
|
|
337
|
-
/** 本章全部出镜角色(各镜头 characters 去重汇总;骨架有则兜底)。 */
|
|
338
|
-
characters?: string[];
|
|
339
|
-
/** 本章已绑定漫剧卡的 id(去重汇总,定妆图引用)。 */
|
|
340
|
-
mangaRoleIds?: string[];
|
|
341
|
-
}
|
|
342
|
-
/** POST /storyboard/table 请求:骨架 → 分镜表。 */
|
|
343
|
-
export interface StoryboardTableRequest {
|
|
344
|
-
chapterNo: number;
|
|
345
|
-
/** 编剧级骨架(前端已生成/编辑后的版本)。 */
|
|
346
|
-
skeleton: StoryboardSkeleton;
|
|
347
|
-
/** 漫剧方案基底风格 id(style-library);提供时按风格措辞画面描述。 */
|
|
348
|
-
styleId?: string;
|
|
349
|
-
/** 可选滤镜风格 id(stackable)。 */
|
|
350
|
-
filterId?: string;
|
|
351
|
-
}
|
|
352
|
-
/** POST /storyboard/table 响应。 */
|
|
353
|
-
export interface StoryboardTableResponse {
|
|
354
|
-
table: StoryboardTable;
|
|
355
|
-
}
|
|
356
|
-
/** 分镜·提示词级:一个镜头的即梦视频提示词。 */
|
|
357
|
-
export interface StoryboardPrompt {
|
|
358
|
-
/** 对应镜头 id(s1…)。 */
|
|
359
|
-
shotId: string;
|
|
360
|
-
/** 即梦/视频模型可粘贴的中文提示词(画面+运镜+光效+风格词块)。 */
|
|
361
|
-
text: string;
|
|
362
|
-
/** 本镜头绑定的漫剧卡 id(定妆图引用:出图/生视频时按卡取 imageUrl/立绘)。 */
|
|
363
|
-
mangaRoleIds?: string[];
|
|
364
|
-
/** Seedance 专用:运镜方式(推/拉/摇/移/跟/升降/固定,含具体起止)。 */
|
|
365
|
-
camera?: string;
|
|
366
|
-
/** Seedance 专用:运动幅度(轻微/中等/强烈)。 */
|
|
367
|
-
motion?: 'low' | 'medium' | 'high';
|
|
368
|
-
/** 负面提示词(即梦末尾追加:不要文字/水印/变形/多手/多指等)。 */
|
|
369
|
-
negativePrompt?: string;
|
|
370
|
-
/** 本镜头场景名(绑定场景底图参考)。 */
|
|
371
|
-
sceneName?: string;
|
|
372
|
-
}
|
|
373
|
-
/** 分镜持久化:单章的分镜产出(骨架 + 分镜表 + 视频提示词,可分别存在)。 */
|
|
374
|
-
export interface ChapterStoryboard {
|
|
375
|
-
chapterNo: number;
|
|
376
|
-
skeleton?: StoryboardSkeleton;
|
|
377
|
-
table?: StoryboardTable;
|
|
378
|
-
prompts?: StoryboardPrompt[];
|
|
379
|
-
updatedAt: string;
|
|
380
|
-
}
|
|
381
|
-
/** POST /storyboard/prompts 请求:分镜表 → 视频提示词。 */
|
|
382
|
-
export interface StoryboardPromptsRequest {
|
|
383
|
-
chapterNo: number;
|
|
384
|
-
/** 分镜表(前端已生成的镜头列表)。 */
|
|
385
|
-
table: StoryboardTable;
|
|
386
|
-
/** 基底风格 id。 */
|
|
387
|
-
styleId?: string;
|
|
388
|
-
/** 可选滤镜风格 id。 */
|
|
389
|
-
filterId?: string;
|
|
390
|
-
}
|
|
391
|
-
/** POST /storyboard/prompts 响应。 */
|
|
392
|
-
export interface StoryboardPromptsResponse {
|
|
393
|
-
prompts: StoryboardPrompt[];
|
|
394
|
-
}
|
|
395
|
-
/** 漫剧方案:同一本书的多套视觉演绎(基底风格 + 可选滤镜)。 */
|
|
396
|
-
export interface MangaPlan {
|
|
397
|
-
/** 方案 id。 */
|
|
398
|
-
id: string;
|
|
399
|
-
/** 方案名(如《保质期》3D 皮克斯版)。 */
|
|
400
|
-
name: string;
|
|
401
|
-
/** 基底风格 id(style-library 中非 stackable 风格)。 */
|
|
402
|
-
styleId: string;
|
|
403
|
-
/** 可选滤镜风格 id(style-library 中 stackable 风格)。 */
|
|
404
|
-
filterId?: string;
|
|
405
|
-
/** 可选题材(玄幻/武侠/二次元/都市/科幻...),注入对应题材生成规则。 */
|
|
406
|
-
genre?: string;
|
|
407
|
-
/** 是否激活(分镜/角色图生成时使用)。 */
|
|
408
|
-
active: boolean;
|
|
409
|
-
createdAt: string;
|
|
410
|
-
updatedAt: string;
|
|
411
|
-
}
|
|
412
|
-
/** POST /manhua/plans 请求:漫剧方案管理。 */
|
|
413
|
-
export interface MangaPlansRequest {
|
|
414
|
-
op: 'create' | 'remove' | 'activate';
|
|
415
|
-
/** create:方案名。 */
|
|
416
|
-
name?: string;
|
|
417
|
-
/** create:基底风格 id。 */
|
|
418
|
-
styleId?: string;
|
|
419
|
-
/** create:可选滤镜风格 id。 */
|
|
420
|
-
filterId?: string;
|
|
421
|
-
/** create:题材(注入对应题材规则)。 */
|
|
422
|
-
genre?: string;
|
|
423
|
-
/** remove/activate:方案 id。 */
|
|
424
|
-
id?: string;
|
|
425
|
-
}
|
|
426
|
-
/** POST /manhua/plans 响应。 */
|
|
427
|
-
export interface MangaPlansResponse {
|
|
428
|
-
plans: MangaPlan[];
|
|
429
|
-
}
|
|
430
|
-
/** 漫剧角色卡:制作角色(要建模/出图/锁一致性的「上镜角色」),与小说角色库弱关联。 */
|
|
431
|
-
export interface MangaRoleCard {
|
|
432
|
-
/** 稳定 id。 */
|
|
433
|
-
id: string;
|
|
434
|
-
/** 来源小说角色名(只读追溯,非强外键;禁止反向写回小说库)。 */
|
|
435
|
-
sourceRoleName?: string;
|
|
436
|
-
/** 漫剧用名(可短剧化改名)。 */
|
|
437
|
-
name: string;
|
|
438
|
-
/** 身份一句话。 */
|
|
439
|
-
identity: string;
|
|
440
|
-
/** 核心功能:主角/导师/感情线/反派/搭档/线人/功能性。 */
|
|
441
|
-
coreFunction: 'protagonist' | 'mentor' | 'love_interest' | 'antagonist' | 'sidekick' | 'informant' | 'functional';
|
|
442
|
-
/** 与主角的关系。 */
|
|
443
|
-
protagonistRelation: 'enemy' | 'friend' | 'mentor' | 'lover' | 'exploit' | 'neutral';
|
|
444
|
-
/** 口头禅/说话方式(配音一致性)。 */
|
|
445
|
-
speechStyle: string;
|
|
446
|
-
/** ≤3 个极致性格标签。 */
|
|
447
|
-
traits: string[];
|
|
448
|
-
/** 1-2 个辨识度外貌点。 */
|
|
449
|
-
appearance: string;
|
|
450
|
-
/** 角色定妆级别:protagonist主角(完整四件套) / supporting配角(仅立绘) / extra路人(不做定妆)。默认 protagonist。 */
|
|
451
|
-
tier?: 'protagonist' | 'supporting' | 'extra';
|
|
452
|
-
/** 3-5 个关键剧情节点。 */
|
|
453
|
-
keyScenes: string[];
|
|
454
|
-
/** 上场集数(分镜提名导入时记录)。 */
|
|
455
|
-
appearsInEpisodes: number[];
|
|
456
|
-
/** 待匹配 → 待确认 → 已导入 → 已定妆 → 已归档。 */
|
|
457
|
-
status: 'pending_match' | 'pending_confirm' | 'imported' | 'anchored' | 'archived';
|
|
458
|
-
/** 形象资产(沿用小说角色库同款结构)。 */
|
|
459
|
-
imagePrompt?: RoleRecord['imagePrompt'];
|
|
460
|
-
/** 情绪表情清单(锚点提炼时产出)。 */
|
|
461
|
-
expressions?: string[];
|
|
462
|
-
/** 四类精修生图提示词(立绘/四视图/表情/细节)。 */
|
|
463
|
-
promptKit?: RoleRecord['promptKit'];
|
|
464
|
-
/** 角色参考图。 */
|
|
465
|
-
imageUrl?: string;
|
|
466
|
-
/** 图集(图像锚点)。 */
|
|
467
|
-
gallery?: RoleImage[];
|
|
468
|
-
/** 生成锚点/精修时的方案风格 id(旧风格检测用)。 */
|
|
469
|
-
promptStyleId?: string;
|
|
470
|
-
createdAt: string;
|
|
471
|
-
updatedAt: string;
|
|
472
|
-
}
|
|
473
|
-
/** 分镜提名 → 小说角色库匹配的一条候选。 */
|
|
474
|
-
export interface MangaRoleCandidate {
|
|
475
|
-
/** 分镜里的原始称谓(正文确切用法)。 */
|
|
476
|
-
rawName: string;
|
|
477
|
-
/** matched=命中小说角色;ambiguous=多个候选待定;not_in_library=小说库没有;already_imported=已建漫剧卡(跳过)。 */
|
|
478
|
-
verdict: 'matched' | 'ambiguous' | 'not_in_library' | 'already_imported';
|
|
479
|
-
/** 规则阶段候选短名单(≤5,精确名优先 + 身份/简称匹配)。 */
|
|
480
|
-
matches: Array<{
|
|
481
|
-
roleName: string;
|
|
482
|
-
reason: string;
|
|
483
|
-
}>;
|
|
484
|
-
/** LLM/规则确认的命中角色名(ambiguous 时可能为空)。 */
|
|
485
|
-
matchedRoleName?: string;
|
|
486
|
-
/** not_in_library 时给出建议:backfill=正文有该称谓但小说库漏提炼(回小说库补);manga_new=漫剧新增角色(直接建卡)。 */
|
|
487
|
-
novelHint?: 'backfill' | 'manga_new';
|
|
488
|
-
/** 智能分级:protagonist=主角(必做定妆)、supporting=配角(建议做定妆)、extra=路人/功能性(默认不导入,折叠显示)。 */
|
|
489
|
-
tier?: 'protagonist' | 'supporting' | 'extra';
|
|
490
|
-
/** 采纳时预填的漫剧卡建议。 */
|
|
491
|
-
suggested: {
|
|
492
|
-
name: string;
|
|
493
|
-
identity: string;
|
|
494
|
-
coreFunction: MangaRoleCard['coreFunction'];
|
|
495
|
-
protagonistRelation: MangaRoleCard['protagonistRelation'];
|
|
496
|
-
speechStyle: string;
|
|
497
|
-
traits: string[];
|
|
498
|
-
appearance: string;
|
|
499
|
-
keyScenes: string[];
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
/** POST /manga/roles 请求:漫剧角色库操作。 */
|
|
503
|
-
export interface MangaRolesRequest {
|
|
504
|
-
op: 'nominate' | 'adopt' | 'update' | 'remove' | 'visual' | 'promptKit' | 'image' | 'removeImage' | 'imageGenerate' | 'mode' | 'autoGenerate' | 'openAssets';
|
|
505
|
-
/** op='mode':短剧精简模式开关。 */
|
|
506
|
-
shortDramaMode?: boolean;
|
|
507
|
-
/** op='nominate':从哪章分镜提名角色。 */
|
|
508
|
-
chapterNo?: number;
|
|
509
|
-
/** op='adopt' / op='update':漫剧角色卡。 */
|
|
510
|
-
card?: MangaRoleCard;
|
|
511
|
-
/** op='remove' / 'visual' / 'promptKit' / 'image' / 'removeImage' / 'imageGenerate':漫剧卡 id。 */
|
|
512
|
-
id?: string;
|
|
513
|
-
/** op='visual' / 'promptKit':漫剧方案基底风格 id。 */
|
|
514
|
-
styleId?: string;
|
|
515
|
-
/** 可选滤镜风格 id。 */
|
|
516
|
-
filterId?: string;
|
|
517
|
-
/** op='image':定妆图 dataURL。 */
|
|
518
|
-
dataUrl?: string;
|
|
519
|
-
/** op='image':图集用途标签(立绘/四视图/表情-x/场景/细节);缺省视为角色参考图(imageUrl)。 */
|
|
520
|
-
label?: string;
|
|
521
|
-
/** op='imageGenerate':漫画风格预设 id(可选)。 */
|
|
522
|
-
style?: string;
|
|
523
|
-
/** op='imageGenerate':生图模型库条目 id(缺省用启用条目)。 */
|
|
524
|
-
modelId?: string;
|
|
525
|
-
/** op='autoGenerate' 时返回一键生成结果。 */
|
|
526
|
-
autoGenerate?: {
|
|
527
|
-
chapterNo: number;
|
|
528
|
-
skeletonBeats: number;
|
|
529
|
-
shotCount: number;
|
|
530
|
-
promptCount: number;
|
|
531
|
-
importedRoles: number;
|
|
532
|
-
needMakeupRoles: number;
|
|
533
|
-
extraRoles: number;
|
|
534
|
-
pendingCandidates: number;
|
|
535
|
-
pendingRoleNames: string[];
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
/** POST /manga/roles 响应。 */
|
|
539
|
-
export interface MangaRolesResponse {
|
|
540
|
-
cards: MangaRoleCard[];
|
|
541
|
-
/** op='nominate' 时的 AI 提名候选。 */
|
|
542
|
-
candidates?: MangaRoleCandidate[];
|
|
543
|
-
/** op='visual' 时的形象锚点(已写入漫剧卡)。 */
|
|
544
|
-
visual?: RoleRecord['imagePrompt'];
|
|
545
|
-
/** op='promptKit' 时的四类精修提示词包(已写入漫剧卡)。 */
|
|
546
|
-
promptKit?: RoleRecord['promptKit'];
|
|
547
|
-
/** op='image' / 'imageGenerate' 时的定妆图 dataURL(已写入漫剧卡)。 */
|
|
548
|
-
imageUrl?: string;
|
|
549
|
-
/** op='mode' 时的短剧精简模式状态。 */
|
|
550
|
-
shortDramaMode?: boolean;
|
|
551
|
-
/** op='autoGenerate' 时返回一键生成结果。 */
|
|
552
|
-
autoGenerate?: {
|
|
553
|
-
chapterNo: number;
|
|
554
|
-
skeletonBeats: number;
|
|
555
|
-
shotCount: number;
|
|
556
|
-
promptCount: number;
|
|
557
|
-
importedRoles: number;
|
|
558
|
-
needMakeupRoles: number;
|
|
559
|
-
extraRoles: number;
|
|
560
|
-
pendingCandidates: number;
|
|
561
|
-
pendingRoleNames: string[];
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
260
|
/** Chapter lifecycle states (the writing pipeline's state machine). */
|
|
565
261
|
export type ChapterStatus = 'pending' | 'generating' | 'written' | 'reviewing' | 'approved' | 'rejected' | 'error';
|
|
566
262
|
/** One chapter in the plan. */
|
|
@@ -607,6 +303,10 @@ export interface ChapterPlan {
|
|
|
607
303
|
review?: ReviewReport;
|
|
608
304
|
/** 作者复盘:钩子兑现/结尾钩子/剧情线推进/连续性/节奏趋势(生成后自动)。 */
|
|
609
305
|
authorReview?: AuthorReview;
|
|
306
|
+
/** 本章目标张力 0-100(规划或作者设定;用于张力曲线)。 */
|
|
307
|
+
tension?: number;
|
|
308
|
+
/** 本章实际张力 0-100(审稿时模型打分;缺省时回落到 review.tension)。 */
|
|
309
|
+
tensionActual?: number;
|
|
610
310
|
/**
|
|
611
311
|
* 待确认草稿:润色(去AI味)或整章重写的产物正文。生成时先存这里,
|
|
612
312
|
* 用户看过对比后点「采纳」才覆盖正文文件;点「放弃」则丢弃。刷新页面不丢失。
|
|
@@ -640,12 +340,14 @@ export interface AuthorReview {
|
|
|
640
340
|
/** 复盘时间。 */
|
|
641
341
|
reviewedAt: string;
|
|
642
342
|
}
|
|
643
|
-
/**
|
|
343
|
+
/** 审稿维度(结构化定位问题类别)。权威清单是 reviewSystemPrompt 里的九条维度。 */
|
|
644
344
|
export type ReviewDimension = 'character' | 'setting' | 'redline' | 'writing' | 'pacing' | 'logic' | 'anti-ai' | 'presentation' | 'compliance';
|
|
645
345
|
/** One review finding. */
|
|
346
|
+
/** 问题严重度(审稿 / 时间线 / 张力共用)。 */
|
|
347
|
+
export type Severity = 'high' | 'medium' | 'low';
|
|
646
348
|
export interface ReviewIssue {
|
|
647
349
|
/** Severity: high = must fix, medium = should fix, low = suggestion. */
|
|
648
|
-
severity:
|
|
350
|
+
severity: Severity;
|
|
649
351
|
/** 问题维度(可选;缺省由前端按 item 推断)。 */
|
|
650
352
|
dimension?: ReviewDimension;
|
|
651
353
|
/** What the problem is. */
|
|
@@ -684,6 +386,8 @@ export interface ReviewReport {
|
|
|
684
386
|
word: string;
|
|
685
387
|
count: number;
|
|
686
388
|
}>;
|
|
389
|
+
/** 本章张力 0-100(审稿模型评分;用于张力曲线的"实际"值)。 */
|
|
390
|
+
tension?: number;
|
|
687
391
|
/** When the review ran. */
|
|
688
392
|
reviewedAt: string;
|
|
689
393
|
}
|
|
@@ -827,6 +531,13 @@ export interface MarketRadarResult {
|
|
|
827
531
|
productionFoundation: ProductionFoundation;
|
|
828
532
|
/** 开书创意简报(可选;用「用信号创作」接口单独生成)。 */
|
|
829
533
|
creativeBrief?: MarketCreativeBrief;
|
|
534
|
+
/**
|
|
535
|
+
* 本次分析的报告 id(服务端生成)。
|
|
536
|
+
*
|
|
537
|
+
* 前端据此判断「是否换了一份新报告」:只有报告变了才重置信号勾选,否则重渲染/
|
|
538
|
+
* 轮询会把作者手选的信号冲掉。缺省(旧版产物)时前端按「首次看到」处理。
|
|
539
|
+
*/
|
|
540
|
+
reportId?: string;
|
|
830
541
|
}
|
|
831
542
|
/** POST /market-radar request。 */
|
|
832
543
|
export interface MarketRadarRequest {
|
|
@@ -878,6 +589,157 @@ export interface StoryBible {
|
|
|
878
589
|
generatedAt?: string;
|
|
879
590
|
}
|
|
880
591
|
/** A planted/active/resolved foreshadowing thread. */
|
|
592
|
+
/** 修订建议来源:审稿 / 时间线 / 张力。 */
|
|
593
|
+
export type RevisionSource = 'review' | 'timeline' | 'tension';
|
|
594
|
+
/** 一条待修订条目(合并层排序后的最小单位)。 */
|
|
595
|
+
export interface RevisionItem {
|
|
596
|
+
/** 稳定 id(source:chapter:index)。 */
|
|
597
|
+
id: string;
|
|
598
|
+
source: RevisionSource;
|
|
599
|
+
severity: Severity;
|
|
600
|
+
/** 归属章节号(0 = 全书级)。 */
|
|
601
|
+
chapterNo: number;
|
|
602
|
+
item: string;
|
|
603
|
+
suggestion: string;
|
|
604
|
+
/** 去重时合并掉的同类条数(>=2 时展示)。 */
|
|
605
|
+
count?: number;
|
|
606
|
+
}
|
|
607
|
+
/** POST /revision/plan 请求:把该章三类建议合并成一份修订指令。 */
|
|
608
|
+
export interface RevisionPlanRequest {
|
|
609
|
+
op: 'plan';
|
|
610
|
+
chapterNo?: number;
|
|
611
|
+
/** 显式指定的审稿意见(面板勾选后传入;缺省取已落盘报告)。 */
|
|
612
|
+
reviewIssues?: ReviewIssue[];
|
|
613
|
+
includeTimeline?: boolean;
|
|
614
|
+
includeTension?: boolean;
|
|
615
|
+
bookId?: string;
|
|
616
|
+
}
|
|
617
|
+
/** POST /revision/plan 响应。 */
|
|
618
|
+
export interface RevisionPlanResponse {
|
|
619
|
+
chapterNo: number;
|
|
620
|
+
items: RevisionItem[];
|
|
621
|
+
/** 唯一修订指令(面板直接把它交给 /rewrite)。 */
|
|
622
|
+
instruction: string;
|
|
623
|
+
counts: Record<RevisionSource, number>;
|
|
624
|
+
/** 因上限被截断的条数。 */
|
|
625
|
+
omitted: number;
|
|
626
|
+
/** 验证基准(复核时逐条核对本轮下发的全部条目)。 */
|
|
627
|
+
baseline: ReviewReport;
|
|
628
|
+
/** 一行摘要。 */
|
|
629
|
+
summary: string;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* 张力曲线形状预设:
|
|
633
|
+
* `escalation` 递进爬升 / `suspense` 悬疑加压 / `wave` 波浪呼吸 /
|
|
634
|
+
* `frontLoad` 前紧后稳 / `flat` 平稳推进 / `custom` 自定义。
|
|
635
|
+
*/
|
|
636
|
+
export type TensionCurvePreset = 'escalation' | 'suspense' | 'wave' | 'frontLoad' | 'flat' | 'custom';
|
|
637
|
+
/** 张力曲线配置(随项目保存)。 */
|
|
638
|
+
export interface TensionCurveConfig {
|
|
639
|
+
preset: TensionCurvePreset;
|
|
640
|
+
/** preset=custom 时的逐章采样(0-100;缺省按章节数取默认值)。 */
|
|
641
|
+
custom?: number[];
|
|
642
|
+
}
|
|
643
|
+
/** 张力曲线的一条问题(实际 vs 目标 / 曲线形状)。 */
|
|
644
|
+
export interface TensionIssue {
|
|
645
|
+
severity: 'high' | 'medium' | 'low';
|
|
646
|
+
chapters: number[];
|
|
647
|
+
item: string;
|
|
648
|
+
suggestion: string;
|
|
649
|
+
}
|
|
650
|
+
/** 张力曲线数据点(面板绘图用)。 */
|
|
651
|
+
export interface TensionCurvePoint {
|
|
652
|
+
no: number;
|
|
653
|
+
title: string;
|
|
654
|
+
/** 目标张力。 */
|
|
655
|
+
target?: number;
|
|
656
|
+
/** 实际张力(审稿打分)。 */
|
|
657
|
+
actual?: number;
|
|
658
|
+
/** 参考曲线在此处的取值。 */
|
|
659
|
+
reference?: number;
|
|
660
|
+
}
|
|
661
|
+
/** GET /tension 响应。 */
|
|
662
|
+
export interface TensionResponse {
|
|
663
|
+
preset: TensionCurvePreset;
|
|
664
|
+
points: TensionCurvePoint[];
|
|
665
|
+
/** 规则核对发现的问题。 */
|
|
666
|
+
issues: TensionIssue[];
|
|
667
|
+
}
|
|
668
|
+
/** POST /tension 请求。 */
|
|
669
|
+
export interface TensionRequest {
|
|
670
|
+
op: 'preset' | 'set' | 'clear';
|
|
671
|
+
preset?: TensionCurvePreset;
|
|
672
|
+
chapterNo?: number;
|
|
673
|
+
/** op=set 时的目标张力(0-100)。 */
|
|
674
|
+
tension?: number;
|
|
675
|
+
}
|
|
676
|
+
/** 允许作者编辑的提示词槽位 id(白名单)。 */
|
|
677
|
+
export type PromptSlotId = 'styleExtra' | 'antiAiExtra' | 'dialogueExtra' | 'endingHookExtra';
|
|
678
|
+
/** 一个提示词槽位的当前内容。 */
|
|
679
|
+
export interface PromptSlotState {
|
|
680
|
+
id: PromptSlotId;
|
|
681
|
+
label: string;
|
|
682
|
+
hint: string;
|
|
683
|
+
placeholder: string;
|
|
684
|
+
maxChars: number;
|
|
685
|
+
value: string;
|
|
686
|
+
}
|
|
687
|
+
/** GET /prompt-slots 响应。 */
|
|
688
|
+
export interface PromptSlotsResponse {
|
|
689
|
+
slots: PromptSlotState[];
|
|
690
|
+
}
|
|
691
|
+
/** POST /prompt-slots 请求:设置或清空一个槽位。 */
|
|
692
|
+
export interface PromptSlotsRequest {
|
|
693
|
+
id: PromptSlotId;
|
|
694
|
+
/** 空串 = 清空该槽位(恢复默认)。 */
|
|
695
|
+
value: string;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* 故事时间线事件:从章节正文抽取的「故事内时间点 + 地点 + 参与角色 + 事件」。
|
|
699
|
+
* 用途:后续章节的时间连续性与地点衔接(比编年录更强调"顺序")。
|
|
700
|
+
*/
|
|
701
|
+
export interface TimelineEvent {
|
|
702
|
+
/** 稳定 id(时间线内唯一)。 */
|
|
703
|
+
id: string;
|
|
704
|
+
/** 所属章节号。 */
|
|
705
|
+
chapterNo: number;
|
|
706
|
+
/** 故事内时间点(如「第三日黄昏」「入宗三个月后」「同日夜」)。 */
|
|
707
|
+
time: string;
|
|
708
|
+
/** 相对顺序(同书内递增;无法判断时缺省)。用于检测时间倒流。 */
|
|
709
|
+
order?: number;
|
|
710
|
+
/** 地点。 */
|
|
711
|
+
place: string;
|
|
712
|
+
/** 参与角色(角色名)。 */
|
|
713
|
+
characters: string[];
|
|
714
|
+
/** 事件一句话。 */
|
|
715
|
+
event: string;
|
|
716
|
+
/** 来源:模型抽取 / 作者手改。 */
|
|
717
|
+
source: 'extracted' | 'manual';
|
|
718
|
+
createdAt: string;
|
|
719
|
+
}
|
|
720
|
+
/** 时间线矛盾(规则初筛 + AI 复核)。 */
|
|
721
|
+
export interface TimelineIssue {
|
|
722
|
+
severity: 'high' | 'medium' | 'low';
|
|
723
|
+
/** 定位到的章节(可多个)。 */
|
|
724
|
+
chapters: number[];
|
|
725
|
+
/** 问题描述。 */
|
|
726
|
+
item: string;
|
|
727
|
+
/** 建议修法。 */
|
|
728
|
+
suggestion: string;
|
|
729
|
+
}
|
|
730
|
+
/** GET /timeline 响应。 */
|
|
731
|
+
export interface TimelineResponse {
|
|
732
|
+
events: TimelineEvent[];
|
|
733
|
+
/** 规则初筛发现的问题(瞬时计算,不落盘)。 */
|
|
734
|
+
issues?: TimelineIssue[];
|
|
735
|
+
}
|
|
736
|
+
/** POST /timeline 请求:op=extract 抽单章 / check 全量检查 / update 手改 / remove 删除 / clear 清空。 */
|
|
737
|
+
export interface TimelineRequest {
|
|
738
|
+
op: 'extract' | 'check' | 'update' | 'remove' | 'clear';
|
|
739
|
+
chapterNo?: number;
|
|
740
|
+
event?: TimelineEvent;
|
|
741
|
+
id?: string;
|
|
742
|
+
}
|
|
881
743
|
export interface Foreshadow {
|
|
882
744
|
/** Stable id. */
|
|
883
745
|
id: string;
|
|
@@ -984,7 +846,7 @@ export interface PlotlineHealthReport {
|
|
|
984
846
|
note: string;
|
|
985
847
|
}>;
|
|
986
848
|
}
|
|
987
|
-
/**
|
|
849
|
+
/** 剧情方案:下一阶段目标 + 建议新线。 */
|
|
988
850
|
export interface PlotlinePlan {
|
|
989
851
|
/** 下一阶段(未来 5-10 章)剧情方向。 */
|
|
990
852
|
direction: string;
|
|
@@ -994,12 +856,18 @@ export interface PlotlinePlan {
|
|
|
994
856
|
/** POST /plotlines 响应。 */
|
|
995
857
|
export interface PlotlinesResponse {
|
|
996
858
|
plotlines: Plotline[];
|
|
997
|
-
/** op=suggest 时的
|
|
859
|
+
/** op=suggest 时的 建议候选线。 */
|
|
998
860
|
suggestions?: Plotline[];
|
|
999
861
|
/** op=health 时的健康检查报告。 */
|
|
1000
862
|
health?: PlotlineHealthReport;
|
|
1001
863
|
/** op=plan 时的剧情方案。 */
|
|
1002
864
|
plan?: PlotlinePlan;
|
|
865
|
+
/**
|
|
866
|
+
* 部分失败时的说明(如批量刷新里有线没返回进度)。
|
|
867
|
+
* HTTP 仍是 200:整体成功,只是有遗漏——**如实上报**比静默留空好,
|
|
868
|
+
* 否则作者会以为"刷新过了但内容没变"。
|
|
869
|
+
*/
|
|
870
|
+
error?: string;
|
|
1003
871
|
}
|
|
1004
872
|
/** 一条敏感词命中。 */
|
|
1005
873
|
export interface SensitiveHit {
|
|
@@ -1103,7 +971,7 @@ export interface RoleStatusCard {
|
|
|
1103
971
|
/** 出场次数。 */
|
|
1104
972
|
appearances: number;
|
|
1105
973
|
}
|
|
1106
|
-
/** 角色库条目(主表:作者维护 +
|
|
974
|
+
/** 角色库条目(主表:作者维护 + 提炼 + 编年录自动聚合)。 */
|
|
1107
975
|
export interface RoleRecord {
|
|
1108
976
|
/** 角色名(唯一键)。 */
|
|
1109
977
|
name: string;
|
|
@@ -1123,192 +991,14 @@ export interface RoleRecord {
|
|
|
1123
991
|
knowledge: string[];
|
|
1124
992
|
/** 首次出场章节(编年录聚合,可手动修正)。 */
|
|
1125
993
|
firstChapter?: number;
|
|
1126
|
-
/** 动漫形象描述词(AI 绘图用:中文描述 + 英文标签 + 关键外貌标签)。 */
|
|
1127
|
-
imagePrompt?: {
|
|
1128
|
-
/** 中文外貌描述:连贯一段(发色/瞳色/服装/气质/标志物)。 */
|
|
1129
|
-
zh: string;
|
|
1130
|
-
/** 英文绘图标签:booru 风格逗号分隔。 */
|
|
1131
|
-
en: string;
|
|
1132
|
-
/** 中文关键标签(发色/瞳色/服装/气质/标志物)。 */
|
|
1133
|
-
tags: string[];
|
|
1134
|
-
/** 依据来源说明(哪几章哪些描写)。 */
|
|
1135
|
-
source?: string;
|
|
1136
|
-
/** 即梦/生图通用负面提示词(低质量/变形/多手/文字水印等)。 */
|
|
1137
|
-
negativePrompt?: string;
|
|
1138
|
-
};
|
|
1139
|
-
/** 角色参考图(dataURL 或 URL)。用于漫画/漫剧出图时锁定角色一致性。 */
|
|
1140
|
-
imageUrl?: string;
|
|
1141
|
-
/** 角色图集(图像锚点):立绘/四视图/表情/场景/细节等,label 标注用途。 */
|
|
1142
|
-
gallery?: RoleImage[];
|
|
1143
|
-
/** 该角色所需的情绪表情清单(提炼时 LLM 补全 6-12 个,如"疲惫/麻木/压抑悲伤")。 */
|
|
1144
|
-
expressions?: string[];
|
|
1145
|
-
/** LLM 精修的四类生图提示词包(前端拼装版之外的高质量版,promptKit 接口生成)。 */
|
|
1146
|
-
promptKit?: {
|
|
1147
|
-
/** 立绘:全身/半身正视图。 */
|
|
1148
|
-
portrait?: {
|
|
1149
|
-
zh: string;
|
|
1150
|
-
en: string;
|
|
1151
|
-
};
|
|
1152
|
-
/** 四视图:正面/侧面/背面设定表。 */
|
|
1153
|
-
sheet?: {
|
|
1154
|
-
zh: string;
|
|
1155
|
-
en: string;
|
|
1156
|
-
};
|
|
1157
|
-
/** 表情:同一脸部锚换情绪,每表情一段。 */
|
|
1158
|
-
expressions?: {
|
|
1159
|
-
name: string;
|
|
1160
|
-
zh: string;
|
|
1161
|
-
en: string;
|
|
1162
|
-
}[];
|
|
1163
|
-
/** 细节:标志物局部特写。 */
|
|
1164
|
-
details?: {
|
|
1165
|
-
zh: string;
|
|
1166
|
-
en: string;
|
|
1167
|
-
};
|
|
1168
|
-
};
|
|
1169
|
-
/** 生成形象锚点/精修提示词时的漫剧方案基底风格 id(= 方案 styleId;用于检测旧风格并提示重生成)。 */
|
|
1170
|
-
promptStyleId?: string;
|
|
1171
|
-
/** 漫画/漫剧重要性:main=必须建卡保证一致;support=有锚点即可;extra=路人随机生成不约束。 */
|
|
1172
|
-
importance?: 'main' | 'support' | 'extra';
|
|
1173
|
-
}
|
|
1174
|
-
/** 角色图集条目:一张已定型的角色图(图像锚点)。 */
|
|
1175
|
-
export interface RoleImage {
|
|
1176
|
-
/** 用途标签:立绘 / 四视图 / 表情-疲惫 / 场景 / 细节 等。 */
|
|
1177
|
-
label: string;
|
|
1178
|
-
/** dataURL 或 URL。 */
|
|
1179
|
-
dataUrl: string;
|
|
1180
994
|
}
|
|
1181
|
-
/**
|
|
1182
|
-
export interface Prop {
|
|
1183
|
-
/** 道具名(如「外卖电动车」)。 */
|
|
1184
|
-
name: string;
|
|
1185
|
-
/** 外观/统一描述(注入提示词保持一致)。 */
|
|
1186
|
-
desc: string;
|
|
1187
|
-
}
|
|
1188
|
-
/** POST /manga/props 请求。 */
|
|
1189
|
-
export interface MangaPropsRequest {
|
|
1190
|
-
op: 'extract' | 'save';
|
|
1191
|
-
/** op=save 时的道具清单(整体替换)。 */
|
|
1192
|
-
props?: Prop[];
|
|
1193
|
-
}
|
|
1194
|
-
/** POST /manga/props 响应。 */
|
|
1195
|
-
export interface MangaPropsResponse {
|
|
1196
|
-
props: Prop[];
|
|
1197
|
-
}
|
|
1198
|
-
/** 场景库条目:从正文提炼的「镜头场景」视觉锚点(漫剧分镜/生图用)。 */
|
|
1199
|
-
export interface SceneCard {
|
|
1200
|
-
/** 场景名(唯一键),如「旧茶渡·地下石殿」。 */
|
|
1201
|
-
name: string;
|
|
1202
|
-
/** 一句话定位:空间/氛围/功能。 */
|
|
1203
|
-
summary: string;
|
|
1204
|
-
/** 幕归属:第一幕·后场 / 第二幕·卖场 / …(便于按剧情段落组织)。 */
|
|
1205
|
-
act?: string;
|
|
1206
|
-
/** 时间光态:夜间闭店后 / 雨夜 / 凌晨 / 频闪灯… */
|
|
1207
|
-
moment?: string;
|
|
1208
|
-
/** 关键情节镜头 1-3 条:该场景拍什么(人物动作+情绪+镜头推进)。 */
|
|
1209
|
-
beats?: string[];
|
|
1210
|
-
/** 人物在场状态:主角/关键角色在该场景的状态一句话。 */
|
|
1211
|
-
characterState?: string;
|
|
1212
|
-
/** 环境构成:空间结构/陈设/标志物。 */
|
|
1213
|
-
elements: string[];
|
|
1214
|
-
/** 色调与光影(含 HEX 色板,可空)。 */
|
|
1215
|
-
palette: string[];
|
|
1216
|
-
/** 氛围关键词:压抑/神秘/空旷… */
|
|
1217
|
-
moods: string[];
|
|
1218
|
-
/** 中文生图提示词(连贯一段,写实电影感)。 */
|
|
1219
|
-
zh: string;
|
|
1220
|
-
/** 英文生图提示词(逗号分隔标签)。 */
|
|
1221
|
-
en: string;
|
|
1222
|
-
/** 关键标签。 */
|
|
1223
|
-
tags: string[];
|
|
1224
|
-
/** 依据来源(哪几章哪些描写)。 */
|
|
1225
|
-
source?: string;
|
|
1226
|
-
/** 场景图集(图像锚点):全景/局部/氛围 等。 */
|
|
1227
|
-
gallery?: RoleImage[];
|
|
1228
|
-
/** 生成时的漫剧方案基底风格 id(场景卡随方案风格措辞)。 */
|
|
1229
|
-
styleId?: string;
|
|
1230
|
-
/** 场景分级:core核心场景(反复出现,精修多图)/ secondary次要场景(1-2次,一张图)/ passing路过场景(不做图)。 */
|
|
1231
|
-
tier?: 'core' | 'secondary' | 'passing';
|
|
1232
|
-
/** 负面提示词(场景生图/生视频用,默认无人物无文字无水印)。 */
|
|
1233
|
-
negativePrompt?: string;
|
|
1234
|
-
/** 出场章节列表(用于自动分级统计)。 */
|
|
1235
|
-
appearsInChapters?: number[];
|
|
1236
|
-
}
|
|
1237
|
-
/** POST /scenes 请求:场景库提炼 / 采纳 / 更新 / 删除 / 图集。 */
|
|
1238
|
-
export interface ScenesRequest {
|
|
1239
|
-
op: 'extract' | 'adopt' | 'update' | 'remove' | 'image' | 'removeImage' | 'imageGenerate';
|
|
1240
|
-
/** op='extract' 时的漫剧基底风格 id(场景卡按方案风格措辞)。 */
|
|
1241
|
-
styleId?: string;
|
|
1242
|
-
/** op='extract' 时的可选滤镜风格 id。 */
|
|
1243
|
-
filterId?: string;
|
|
1244
|
-
/** op='extract' 时按章提取;不传则全书提取(前4章)。 */
|
|
1245
|
-
chapterNo?: number;
|
|
1246
|
-
/** adopt / update 时传入的场景卡(adopt 可修改后采纳)。 */
|
|
1247
|
-
scene?: SceneCard;
|
|
1248
|
-
/** remove / image 时的场景名。 */
|
|
1249
|
-
name?: string;
|
|
1250
|
-
/** op='image' 时的图片 dataURL 与用途标签(全景/局部/氛围)。 */
|
|
1251
|
-
dataUrl?: string;
|
|
1252
|
-
label?: string;
|
|
1253
|
-
/** op='imageGenerate' 时的生图模型 id(缺省用启用模型)。 */
|
|
1254
|
-
modelId?: string;
|
|
1255
|
-
}
|
|
1256
|
-
/** POST /visual-rules 请求:视觉世界观规则提炼 / 保存。 */
|
|
1257
|
-
export interface VisualRulesRequest {
|
|
1258
|
-
op: 'extract' | 'save';
|
|
1259
|
-
/** op=save 时的规则数组。 */
|
|
1260
|
-
rules?: string[];
|
|
1261
|
-
}
|
|
1262
|
-
/** POST /visual-rules 响应。 */
|
|
1263
|
-
export interface VisualRulesResponse {
|
|
1264
|
-
rules: string[];
|
|
1265
|
-
}
|
|
1266
|
-
/** POST /scenes 响应。 */
|
|
1267
|
-
export interface ScenesResponse {
|
|
1268
|
-
scenes: SceneCard[];
|
|
1269
|
-
/** op=extract 时的 AI 候选场景。 */
|
|
1270
|
-
candidates?: SceneCard[];
|
|
1271
|
-
/** op=imageGenerate 时返回的生成图 dataURL。 */
|
|
1272
|
-
dataUrl?: string;
|
|
1273
|
-
}
|
|
1274
|
-
/** POST /roles 请求:角色库增删改 + AI 提炼 + 参考图上传。 */
|
|
995
|
+
/** POST /roles 请求:角色库增删改 + 提炼 + 参考图上传。 */
|
|
1275
996
|
export interface RolesRequest {
|
|
1276
|
-
op: 'extract' | 'adopt' | 'update' | 'remove'
|
|
997
|
+
op: 'extract' | 'adopt' | 'update' | 'remove';
|
|
1277
998
|
/** adopt / update 时传入的角色(adopt 可修改后采纳)。 */
|
|
1278
999
|
role?: RoleRecord;
|
|
1279
1000
|
/** remove 时的角色名。 */
|
|
1280
1001
|
name?: string;
|
|
1281
|
-
/** op='image' 时的参考图 dataURL。 */
|
|
1282
|
-
dataUrl?: string;
|
|
1283
|
-
/** op='image' 时的图集用途标签(立绘/四视图/表情-x/场景/细节);缺省视为角色参考图(imageUrl)。 */
|
|
1284
|
-
label?: string;
|
|
1285
|
-
/** op='imageGenerate' 时的漫画风格预设 id(用于统一角色图与漫画页风格)。 */
|
|
1286
|
-
style?: string;
|
|
1287
|
-
/** op='imageGenerate' 时指定生图模型库条目 id(缺省用启用条目)。 */
|
|
1288
|
-
modelId?: string;
|
|
1289
|
-
/** op='visual' / op='promptKit' 时的漫剧基底风格 id(角色图按方案风格重出)。 */
|
|
1290
|
-
styleId?: string;
|
|
1291
|
-
/** op='visual' / op='promptKit' 时的可选滤镜风格 id。 */
|
|
1292
|
-
filterId?: string;
|
|
1293
|
-
}
|
|
1294
|
-
/** POST /image-test 请求:测一个生图接口的连通性与延迟(不落盘)。 */
|
|
1295
|
-
export interface ImageTestRequest {
|
|
1296
|
-
/** OpenAI 兼容生图接口地址。 */
|
|
1297
|
-
baseURL: string;
|
|
1298
|
-
/** API Key。 */
|
|
1299
|
-
apiKey: string;
|
|
1300
|
-
/** 模型 id(顺带校验是否在接口模型列表里,可选)。 */
|
|
1301
|
-
model?: string;
|
|
1302
|
-
}
|
|
1303
|
-
/** POST /image-test 响应。 */
|
|
1304
|
-
export interface ImageTestResponse {
|
|
1305
|
-
ok: boolean;
|
|
1306
|
-
/** 连通延迟(毫秒)。 */
|
|
1307
|
-
ms?: number;
|
|
1308
|
-
/** 失败原因。 */
|
|
1309
|
-
message?: string;
|
|
1310
|
-
/** 模型 id 是否出现在接口的模型列表(探测成功时才有)。 */
|
|
1311
|
-
modelFound?: boolean;
|
|
1312
1002
|
}
|
|
1313
1003
|
/** POST /llm-test 请求:对选中的提供商/模型发一次最小真实调用。 */
|
|
1314
1004
|
export interface LlmTestRequest {
|
|
@@ -1330,12 +1020,6 @@ export interface RolesResponse {
|
|
|
1330
1020
|
roles: RoleRecord[];
|
|
1331
1021
|
/** op=extract 时的 AI 候选角色。 */
|
|
1332
1022
|
candidates?: RoleRecord[];
|
|
1333
|
-
/** op=visual 时的动漫形象描述词(已写入角色卡)。 */
|
|
1334
|
-
visual?: RoleRecord['imagePrompt'];
|
|
1335
|
-
/** op=promptKit 时的四类提示词精修包(已写入角色卡)。 */
|
|
1336
|
-
promptKit?: RoleRecord['promptKit'];
|
|
1337
|
-
/** op=image 时的角色参考图 dataURL。 */
|
|
1338
|
-
imageUrl?: string;
|
|
1339
1023
|
}
|
|
1340
1024
|
/** POST /bible/patch 请求:局部修补道藏。 */
|
|
1341
1025
|
export interface BiblePatchRequest {
|
|
@@ -1345,10 +1029,10 @@ export interface BiblePatchRequest {
|
|
|
1345
1029
|
/** 角色卡整体替换(人物志编辑知情度等)。 */
|
|
1346
1030
|
characters?: CharacterCard[];
|
|
1347
1031
|
}
|
|
1348
|
-
/** POST /blurb
|
|
1032
|
+
/** POST /blurb 请求:生成/补全或手动保存小说简介。 */
|
|
1349
1033
|
export interface BlurbRequest {
|
|
1350
1034
|
action: 'generate' | 'save';
|
|
1351
|
-
/**
|
|
1035
|
+
/** 已写好的开头(补全时使用;留空 = 全量生成)。 */
|
|
1352
1036
|
partial?: string;
|
|
1353
1037
|
/** 手动保存的完整简介(action=save 时)。 */
|
|
1354
1038
|
text?: string;
|
|
@@ -1411,7 +1095,7 @@ export interface WorldState {
|
|
|
1411
1095
|
regions: WorldRegion[];
|
|
1412
1096
|
factions: WorldFaction[];
|
|
1413
1097
|
}
|
|
1414
|
-
/** POST /world
|
|
1098
|
+
/** POST /world 请求:提炼或手动保存。 */
|
|
1415
1099
|
export interface WorldRequest {
|
|
1416
1100
|
action: 'generate' | 'save';
|
|
1417
1101
|
/** action=save 时的完整世界数据。 */
|
|
@@ -1445,7 +1129,7 @@ export interface ProjectState {
|
|
|
1445
1129
|
knowledgeDocs?: KnowledgeDoc[];
|
|
1446
1130
|
/** 自动导演待办:风险/修复「采纳」后生成的随手清单。 */
|
|
1447
1131
|
todos?: DirectorTodo[];
|
|
1448
|
-
/**
|
|
1132
|
+
/** 小说简介(面向读者的作品门面,生成或手动保存)。 */
|
|
1449
1133
|
blurb?: string;
|
|
1450
1134
|
/** 开书定盘:书籍级承诺与流派定位(前30章承诺/主副模式/文风/平台)。 */
|
|
1451
1135
|
bookContract?: BookContract;
|
|
@@ -1455,47 +1139,45 @@ export interface ProjectState {
|
|
|
1455
1139
|
world?: WorldState;
|
|
1456
1140
|
/** 剧情线(主线/支线/人物线/悬念线)。 */
|
|
1457
1141
|
plotlines?: Plotline[];
|
|
1458
|
-
/** 角色库(作者维护 +
|
|
1142
|
+
/** 角色库(作者维护 + 提炼的主表)。 */
|
|
1459
1143
|
roles?: RoleRecord[];
|
|
1460
|
-
/** 漫剧角色库(制作角色投影:从分镜提名导入,独立于小说角色库)。 */
|
|
1461
|
-
mangaRoles?: MangaRoleCard[];
|
|
1462
|
-
/** 短剧精简模式:漫剧角色库按 5-8 上镜角色 / 功能标签 / 关系闭环 / 人设极致化约束。 */
|
|
1463
|
-
shortDramaMode?: boolean;
|
|
1464
|
-
/** 场景库(作者维护 + AI 提炼的主表)。 */
|
|
1465
|
-
scenes?: SceneCard[];
|
|
1466
|
-
/** 道具库:常驻道具(如外卖电动车/外卖箱),统一描述,注入提示词保持跨镜头一致。 */
|
|
1467
|
-
props?: Prop[];
|
|
1468
|
-
/** 视觉世界观规则(生图/生视频必须遵守,从道藏提炼,注入所有提示词)。 */
|
|
1469
|
-
visualRules?: string[];
|
|
1470
|
-
/** 分镜工作台产出(骨架/分镜表,按章持久化,刷新/切换不丢)。 */
|
|
1471
|
-
storyboards?: ChapterStoryboard[];
|
|
1472
|
-
/** 漫剧方案列表(同一本书的多套视觉演绎:基底风格 + 可选滤镜)。 */
|
|
1473
|
-
mangaPlans?: MangaPlan[];
|
|
1474
1144
|
/** 人物志:角色当前状态聚合结果(从编年录刷新后存档,打开页面直接显示)。 */
|
|
1475
1145
|
roleStatus?: RoleStatusCard[];
|
|
1476
|
-
/**
|
|
1477
|
-
|
|
1478
|
-
/**
|
|
1146
|
+
/** 故事时间线(逐章抽取:时间点 / 地点 / 参与角色 / 事件)。 */
|
|
1147
|
+
timeline?: TimelineEvent[];
|
|
1148
|
+
/** 张力曲线配置(形状预设 + 自定义采样)。 */
|
|
1149
|
+
tensionCurve?: TensionCurveConfig;
|
|
1150
|
+
/** 作者自定义的提示词槽位(白名单见 prompt-slots.ts)。 */
|
|
1151
|
+
promptSlots?: Partial<Record<PromptSlotId, string>>;
|
|
1152
|
+
/** 本书参数(写作/审稿/推理/模型快切;未设字段回退全局 config)。 */
|
|
1153
|
+
bookSettings?: BookSettings;
|
|
1479
1154
|
/** ISO timestamps. */
|
|
1480
1155
|
createdAt: string;
|
|
1481
1156
|
updatedAt: string;
|
|
1482
1157
|
}
|
|
1483
|
-
/**
|
|
1484
|
-
export interface
|
|
1485
|
-
/**
|
|
1486
|
-
|
|
1487
|
-
/**
|
|
1488
|
-
|
|
1489
|
-
/**
|
|
1490
|
-
|
|
1491
|
-
/**
|
|
1492
|
-
|
|
1493
|
-
/**
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
|
|
1158
|
+
/** 本书参数(存 novel-project.json.bookSettings;未设字段回退全局 config)。 */
|
|
1159
|
+
export interface BookSettings {
|
|
1160
|
+
/** 本书使用的提供方路由(快切器写入)。 */
|
|
1161
|
+
provider?: string;
|
|
1162
|
+
/** 本书使用的主模型 id。 */
|
|
1163
|
+
model?: string;
|
|
1164
|
+
/** 本书写作推理档位。 */
|
|
1165
|
+
reasoningEffort?: 'off' | 'low' | 'high' | 'max';
|
|
1166
|
+
/** 本书分析类任务推理档位。 */
|
|
1167
|
+
analysisReasoning?: 'off' | 'low' | 'high' | 'max';
|
|
1168
|
+
/** 本书每章目标字数。 */
|
|
1169
|
+
chapterChars?: number;
|
|
1170
|
+
/** 本书单章最大输出 tokens。 */
|
|
1171
|
+
maxTokens?: number;
|
|
1172
|
+
/** 本书审稿通过分。 */
|
|
1173
|
+
reviewPassScore?: number;
|
|
1174
|
+
/** 本书是否写完自动审稿。 */
|
|
1175
|
+
autoReview?: boolean;
|
|
1176
|
+
/** 本书是否自动作者复盘。 */
|
|
1177
|
+
autoAuthorReview?: boolean;
|
|
1178
|
+
/** 本书是否修稿后自动复审。 */
|
|
1179
|
+
autoReviewAfterRevise?: boolean;
|
|
1497
1180
|
}
|
|
1498
|
-
/** Runtime config surface exposed to the panel (subset of plugin Config). */
|
|
1499
1181
|
/** 手动添加的模型库条目(只存插件内,不改 DSH 全局)。 */
|
|
1500
1182
|
export interface SavedModel {
|
|
1501
1183
|
/** 唯一 id(前端生成的短 id)。 */
|
|
@@ -1568,24 +1250,6 @@ export interface RemoveProviderResponse {
|
|
|
1568
1250
|
ok: boolean;
|
|
1569
1251
|
message?: string;
|
|
1570
1252
|
}
|
|
1571
|
-
/** GET /llm-providers 响应:当前已注册的提供方路由。 */
|
|
1572
|
-
export interface LlmProvidersResponse {
|
|
1573
|
-
providers: {
|
|
1574
|
-
id: string;
|
|
1575
|
-
name: string;
|
|
1576
|
-
}[];
|
|
1577
|
-
}
|
|
1578
|
-
/** POST /llm-remove 请求:移除一个提供方(unset key + 移除 llm-pi-ai 路由)。 */
|
|
1579
|
-
export interface RemoveProviderRequest {
|
|
1580
|
-
provider: string;
|
|
1581
|
-
/** 该提供方对应的 DSH 凭据引用名(用于 unset)。 */
|
|
1582
|
-
apiKeyEnv?: string;
|
|
1583
|
-
}
|
|
1584
|
-
/** POST /llm-remove 响应。 */
|
|
1585
|
-
export interface RemoveProviderResponse {
|
|
1586
|
-
ok: boolean;
|
|
1587
|
-
message?: string;
|
|
1588
|
-
}
|
|
1589
1253
|
/** POST /llm-add 请求:添加一个模型(厂商直填 key,或自定义路由)。 */
|
|
1590
1254
|
export interface AddModelRequest {
|
|
1591
1255
|
mode: 'vendor' | 'custom';
|
|
@@ -1619,7 +1283,7 @@ export interface NovelConfig {
|
|
|
1619
1283
|
outputDir: string;
|
|
1620
1284
|
/** LLM provider route (e.g. deepseek-official). */
|
|
1621
1285
|
provider: string;
|
|
1622
|
-
/** LLM model id (e.g. deepseek-
|
|
1286
|
+
/** LLM model id (e.g. deepseek-flash). */
|
|
1623
1287
|
model: string;
|
|
1624
1288
|
/** 生成正文用模型(缺省用 model)。 */
|
|
1625
1289
|
generateModel?: string;
|
|
@@ -1627,6 +1291,23 @@ export interface NovelConfig {
|
|
|
1627
1291
|
reviewModel?: string;
|
|
1628
1292
|
/** 全书质检(审计)用模型(缺省用 model)。 */
|
|
1629
1293
|
auditModel?: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* 备用模型:主模型调用失败(网络/限流/额度/服务不可用)时自动切换重试一次。
|
|
1296
|
+
* 留空表示不切换。批量连写时能显著减少"整批中断"。
|
|
1297
|
+
*/
|
|
1298
|
+
fallbackModel?: string;
|
|
1299
|
+
/**
|
|
1300
|
+
* 备用模型的输出 token 上限(仅在设了 `fallbackModel` 时有意义)。
|
|
1301
|
+
*
|
|
1302
|
+
* 为什么需要它:模型能力表(model-capability.ts)不含上下文窗口数据,
|
|
1303
|
+
* 所以「换模型后自动下调 maxTokens」没有可靠依据,此处不猜。改为让作者按
|
|
1304
|
+
* 备用模型的**实际**输出上限填写——长文路径(正文/改写/润色)换到备用模型时
|
|
1305
|
+
* 会改用该值,避免沿用主模型的 20000 而必然撞 max-tokens 截断。
|
|
1306
|
+
* 留空 = 沿用主模型预算(行为与旧版一致)。
|
|
1307
|
+
*/
|
|
1308
|
+
fallbackMaxTokens?: number;
|
|
1309
|
+
/** 是否在出章后自动抽取故事时间线(失败不阻断出章)。默认开。 */
|
|
1310
|
+
autoTimeline?: boolean;
|
|
1630
1311
|
/** LLM reasoning effort: off = no thinking; low/high/max = thinking intensity. */
|
|
1631
1312
|
reasoningEffort: 'off' | 'low' | 'high' | 'max';
|
|
1632
1313
|
/** 分析类任务(提炼/拆书/反推大纲等)的推理档位;默认 low,不受上面写作档位影响。 */
|
|
@@ -1643,16 +1324,6 @@ export interface NovelConfig {
|
|
|
1643
1324
|
autoAuthorReview: boolean;
|
|
1644
1325
|
/** 修订/润色产出草稿后是否自动附带一次 AI 审查(工作区显示新稿评分与剩余问题)。 */
|
|
1645
1326
|
autoReviewAfterRevise: boolean;
|
|
1646
|
-
/** 生图模型库(多套并存,启用一条生效;旧 imageApiKey/imageApiModel 自动迁移为一条)。 */
|
|
1647
|
-
imageModels?: ImageModelConfig[];
|
|
1648
|
-
/** 运行时生效的生图接口地址(= 启用条目,兼容旧代码读取)。 */
|
|
1649
|
-
imageBaseUrl?: string;
|
|
1650
|
-
/** 运行时生效的生图 API Key(= 启用条目,兼容旧代码读取)。 */
|
|
1651
|
-
imageApiKey?: string;
|
|
1652
|
-
/** 运行时生效的生图模型 id(= 启用条目,兼容旧代码读取)。 */
|
|
1653
|
-
imageApiModel?: string;
|
|
1654
|
-
/** 是否启用生图(= 存在启用条目)。 */
|
|
1655
|
-
imageApiEnabled?: boolean;
|
|
1656
1327
|
/** 自定义背景图(URL 或 dataURL 或服务端路径引用;空 = 使用主题默认背景)。 */
|
|
1657
1328
|
themeBackground?: string;
|
|
1658
1329
|
/** 自定义背景遮罩/模糊强度 0-80(0 = 不遮罩)。 */
|
|
@@ -1664,7 +1335,170 @@ export interface NovelConfig {
|
|
|
1664
1335
|
/** 手动添加的模型库(「我的模型」条目;只存插件内)。 */
|
|
1665
1336
|
savedModels?: SavedModel[];
|
|
1666
1337
|
}
|
|
1338
|
+
/** POST /move-output-dir request:dryRun=true 仅预览;确认时须带 to。 */
|
|
1339
|
+
export interface MoveOutputDirRequest {
|
|
1340
|
+
/** 新输出目录(绝对路径)。 */
|
|
1341
|
+
to?: string;
|
|
1342
|
+
/** 只列出当前目录内容,不搬移。 */
|
|
1343
|
+
dryRun?: boolean;
|
|
1344
|
+
}
|
|
1345
|
+
/** POST /move-output-dir response。 */
|
|
1346
|
+
export interface MoveOutputDirResponse {
|
|
1347
|
+
from: string;
|
|
1348
|
+
to?: string;
|
|
1349
|
+
/** 当前(或迁移后)目录内容清单。 */
|
|
1350
|
+
files: string[];
|
|
1351
|
+
bytes: number;
|
|
1352
|
+
/** 联动重指向的书架条目数。 */
|
|
1353
|
+
movedBooks: number;
|
|
1354
|
+
/** settings 默认输出目录是否同步更新。 */
|
|
1355
|
+
defaultUpdated: boolean;
|
|
1356
|
+
}
|
|
1357
|
+
/** POST /book-settings request:patch 省略 = 读取;字段传 null = 删除本书覆盖(回退全局)。 */
|
|
1358
|
+
export interface BookSettingsRequest {
|
|
1359
|
+
patch?: {
|
|
1360
|
+
[K in keyof BookSettings]?: BookSettings[K] | null;
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
/** POST /book-settings response。 */
|
|
1364
|
+
export interface BookSettingsResponse {
|
|
1365
|
+
/** 本书已设置的参数(未设字段缺省 = 回退全局)。 */
|
|
1366
|
+
settings: BookSettings;
|
|
1367
|
+
/** 应用回退链后的生效配置(全局 + 本书覆盖)。 */
|
|
1368
|
+
effective: NovelConfig;
|
|
1369
|
+
/** 当前是否有打开的书。 */
|
|
1370
|
+
hasBook: boolean;
|
|
1371
|
+
}
|
|
1667
1372
|
/** GET /status response. */
|
|
1373
|
+
/**
|
|
1374
|
+
* 创作阶段契约(宿主计算的「当前阶段 → 本轮允许的动作」)。
|
|
1375
|
+
* 计算逻辑在 stage-contract.ts;这里是宿主与面板/助手共享的线上形状。
|
|
1376
|
+
*/
|
|
1377
|
+
export interface StageInfo {
|
|
1378
|
+
/** 阶段标识。 */
|
|
1379
|
+
id: 'outline' | 'bible' | 'plan' | 'write' | 'wait' | 'review' | 'revise' | 'export';
|
|
1380
|
+
/** 中文阶段名。 */
|
|
1381
|
+
label: string;
|
|
1382
|
+
/** 建议的下一步动作(助手工具名;无对应工具时为空数组)。 */
|
|
1383
|
+
recommend: string[];
|
|
1384
|
+
/** 本阶段允许的写操作(作者只说了「继续」时的唯一命令集)。 */
|
|
1385
|
+
allow: string[];
|
|
1386
|
+
/** 为什么处于该阶段。 */
|
|
1387
|
+
reason: string;
|
|
1388
|
+
}
|
|
1389
|
+
/** 单次 LLM 调用的 token 用量(来自 dsh-llm 的 usage chunk)。 */
|
|
1390
|
+
export interface LlmTokenUsage {
|
|
1391
|
+
inputTokens: number;
|
|
1392
|
+
outputTokens: number;
|
|
1393
|
+
/** 供应商给出的总用量(缺失时由输入+输出推导)。 */
|
|
1394
|
+
totalTokens?: number;
|
|
1395
|
+
/** 思考(reasoning)通道用量。 */
|
|
1396
|
+
reasoningTokens?: number;
|
|
1397
|
+
/** 命中缓存的输入用量。 */
|
|
1398
|
+
cacheReadTokens?: number;
|
|
1399
|
+
}
|
|
1400
|
+
/** LLM 实况帧:宿主 → 浏览器的 SSE 事件(每次调用一组 session_* 事件)。 */
|
|
1401
|
+
export interface LlmLiveFrame {
|
|
1402
|
+
type: 'session_started' | 'output_delta' | 'reasoning_delta' | 'phase_changed' | 'session_completed';
|
|
1403
|
+
/** 宿主生成,形如 ll-<base36>-<n>。 */
|
|
1404
|
+
sessionId: string;
|
|
1405
|
+
/** 本次调用用途(如 正文生成/审稿/章节规划)。 */
|
|
1406
|
+
label?: string;
|
|
1407
|
+
/** 使用模型。 */
|
|
1408
|
+
model?: string;
|
|
1409
|
+
/** 事件时间(ISO)。 */
|
|
1410
|
+
at: string;
|
|
1411
|
+
/** session_started:交互上下文。 */
|
|
1412
|
+
context?: {
|
|
1413
|
+
taskId?: string;
|
|
1414
|
+
interactionId: string;
|
|
1415
|
+
};
|
|
1416
|
+
/** output_delta / reasoning_delta:本次增量文本。 */
|
|
1417
|
+
content?: string;
|
|
1418
|
+
/** session 累计字符数。 */
|
|
1419
|
+
totalChars?: number;
|
|
1420
|
+
/** reasoning 累计字符数。 */
|
|
1421
|
+
totalReasoningChars?: number;
|
|
1422
|
+
/** phase_changed:新阶段。 */
|
|
1423
|
+
phase?: 'requesting' | 'streaming' | 'completed' | 'failed';
|
|
1424
|
+
/** phase_changed:阶段描述。 */
|
|
1425
|
+
phaseMessage?: string;
|
|
1426
|
+
/** session_completed:最终预览(截断)。 */
|
|
1427
|
+
preview?: string;
|
|
1428
|
+
/** session_completed:失败信息。 */
|
|
1429
|
+
error?: string;
|
|
1430
|
+
/** session_completed:本次用量(供应商未上报时缺省)。 */
|
|
1431
|
+
usage?: LlmTokenUsage;
|
|
1432
|
+
/** session_completed:本次调用耗时(毫秒)。 */
|
|
1433
|
+
elapsedMs?: number;
|
|
1434
|
+
/** session_completed:首字耗时(毫秒;未拿到文本时缺省)。 */
|
|
1435
|
+
firstTokenMs?: number;
|
|
1436
|
+
/** session_started:是否已记录可查看的 Prompt(面板据此显示「查看 Prompt」)。 */
|
|
1437
|
+
hasPrompt?: boolean;
|
|
1438
|
+
/** session_started:Prompt 字符数(system + user)。 */
|
|
1439
|
+
promptChars?: number;
|
|
1440
|
+
}
|
|
1441
|
+
/** 按用途分组的用量。 */
|
|
1442
|
+
export interface LlmUsageBucket {
|
|
1443
|
+
label: string;
|
|
1444
|
+
calls: number;
|
|
1445
|
+
failed: number;
|
|
1446
|
+
inputTokens: number;
|
|
1447
|
+
outputTokens: number;
|
|
1448
|
+
reasoningTokens: number;
|
|
1449
|
+
elapsedMs: number;
|
|
1450
|
+
}
|
|
1451
|
+
/** 本次运行(进程内,重启归零)的 LLM 用量汇总。 */
|
|
1452
|
+
export interface LlmUsageSummary {
|
|
1453
|
+
calls: number;
|
|
1454
|
+
failed: number;
|
|
1455
|
+
inputTokens: number;
|
|
1456
|
+
outputTokens: number;
|
|
1457
|
+
reasoningTokens: number;
|
|
1458
|
+
totalTokens: number;
|
|
1459
|
+
elapsedMs: number;
|
|
1460
|
+
/** 供应商未上报 usage 的调用次数(用于说明数据为何不完整)。 */
|
|
1461
|
+
callsWithoutUsage: number;
|
|
1462
|
+
byLabel: LlmUsageBucket[];
|
|
1463
|
+
}
|
|
1464
|
+
/** 一次调用的 Prompt 记录(供面板查看「实际发送了什么」)。 */
|
|
1465
|
+
export interface LlmPromptRecord {
|
|
1466
|
+
sessionId: string;
|
|
1467
|
+
label?: string;
|
|
1468
|
+
model?: string;
|
|
1469
|
+
at: string;
|
|
1470
|
+
system?: string;
|
|
1471
|
+
user?: string;
|
|
1472
|
+
/** system + user 的字符数(记录被截断时仍给出原始长度)。 */
|
|
1473
|
+
chars: number;
|
|
1474
|
+
/** 记录本身是否被截断。 */
|
|
1475
|
+
truncated?: boolean;
|
|
1476
|
+
}
|
|
1477
|
+
/** 章节历史版本(快照):覆盖写入前自动留存,可回滚。 */
|
|
1478
|
+
export interface ChapterSnapshot {
|
|
1479
|
+
id: string;
|
|
1480
|
+
chapterNo: number;
|
|
1481
|
+
/** 快照文件(相对书目录)。 */
|
|
1482
|
+
file: string;
|
|
1483
|
+
/** 留存原因(生成覆盖 / 采纳草稿 / 修订 / 手工)。 */
|
|
1484
|
+
reason: string;
|
|
1485
|
+
chars: number;
|
|
1486
|
+
at: string;
|
|
1487
|
+
}
|
|
1488
|
+
/** GET /snapshot 响应。 */
|
|
1489
|
+
export interface SnapshotResponse {
|
|
1490
|
+
snapshots: ChapterSnapshot[];
|
|
1491
|
+
/** 快照占用字节数。 */
|
|
1492
|
+
bytes: number;
|
|
1493
|
+
}
|
|
1494
|
+
/** POST /snapshot 请求:op=create 手工存档 / restore 回滚 / remove 删除 / prune 只留最近 N 个。 */
|
|
1495
|
+
export interface SnapshotRequest {
|
|
1496
|
+
op: 'create' | 'restore' | 'remove' | 'prune';
|
|
1497
|
+
chapterNo?: number;
|
|
1498
|
+
id?: string;
|
|
1499
|
+
/** prune:每章保留数量。 */
|
|
1500
|
+
keep?: number;
|
|
1501
|
+
}
|
|
1668
1502
|
export interface StatusResponse {
|
|
1669
1503
|
config: NovelConfig;
|
|
1670
1504
|
/** The persisted project, when one exists in the output dir. */
|
|
@@ -1673,10 +1507,25 @@ export interface StatusResponse {
|
|
|
1673
1507
|
generatedFiles: string[];
|
|
1674
1508
|
/** 全书质检实时状态(用于面板/外部读取进度)。 */
|
|
1675
1509
|
audit?: AuditStatus;
|
|
1510
|
+
/** 宿主按项目真实状态算出的创作阶段(面板角标 / 外部自动化共用)。 */
|
|
1511
|
+
stage?: StageInfo;
|
|
1512
|
+
/** 本次运行(进程内)的 LLM 用量汇总:调用次数 / 输入·输出·思考 token / 耗时。 */
|
|
1513
|
+
usage?: LlmUsageSummary;
|
|
1514
|
+
/**
|
|
1515
|
+
* 截断声明:本次响应中被裁掉的字段说明(如「编年录:共 320 条,仅返回最近 80 条」)。
|
|
1516
|
+
* 消费方不得把缺失字段当作"不存在",需要完整数据时走专用接口。
|
|
1517
|
+
*/
|
|
1518
|
+
truncations?: string[];
|
|
1676
1519
|
}
|
|
1677
1520
|
/** 生产单状态(生产单 = 区间批量生产执行器:计划补足 + 逐章生成 + 被拒分级处理)。 */
|
|
1678
1521
|
export interface RunState {
|
|
1679
1522
|
runId: string;
|
|
1523
|
+
/**
|
|
1524
|
+
* 本批次归属的书名(可选,兼容旧 run-state.json)。
|
|
1525
|
+
* 生产单是全局单实例,而 /run/status 恢复时会扫书架取第一个有 run-state 的目录,
|
|
1526
|
+
* 因此"这是哪本书的批次"必须显式带上,否则芯片/面板只能显示一个无法归属的状态。
|
|
1527
|
+
*/
|
|
1528
|
+
bookName?: string;
|
|
1680
1529
|
/** 区间起点(含)。 */
|
|
1681
1530
|
startNo: number;
|
|
1682
1531
|
/** 区间终点(含)。 */
|
|
@@ -1698,6 +1547,15 @@ export interface RunState {
|
|
|
1698
1547
|
};
|
|
1699
1548
|
/** 两轮修订仍不过、保留草稿待人工的章号。 */
|
|
1700
1549
|
pendingManual: number[];
|
|
1550
|
+
/**
|
|
1551
|
+
* 连续失败次数:章号 → 已失败几次。用于熔断,避免同一章反复烧 token。
|
|
1552
|
+
*
|
|
1553
|
+
* 为什么需要它:主循环只跳过 `approved` 章,失败章的 `status` 是 `error`,
|
|
1554
|
+
* 下一轮扫描仍会选中它 → 失败→重跑→失败形成死循环,每轮白烧一次正文生成。
|
|
1555
|
+
* 达 {@link MAX_CHAPTER_FAILURES} 次后该章转入 `pendingManual` 并跳过。
|
|
1556
|
+
* 落盘以保证 web 重启(`status()` 会把 running 降级为 paused)后熔断计数不丢。
|
|
1557
|
+
*/
|
|
1558
|
+
failedAttempts?: Record<string, number>;
|
|
1701
1559
|
/** 运行日志(保留最近 300 条)。 */
|
|
1702
1560
|
log: Array<{
|
|
1703
1561
|
at: string;
|
|
@@ -1876,13 +1734,31 @@ export interface ChapterResponse {
|
|
|
1876
1734
|
markdown: string;
|
|
1877
1735
|
}
|
|
1878
1736
|
/** POST /export request/response. */
|
|
1737
|
+
/**
|
|
1738
|
+
* 导出范围:
|
|
1739
|
+
* - `book` 整本正文(txt / md)
|
|
1740
|
+
* - `settings` 项目设定(总纲 / 道藏 / 大世界 / 写作资产 / 卷首语)
|
|
1741
|
+
* - `plan` 规划(卷计划 + 章节计划,含每章目标/要点/钩子/硬事实)
|
|
1742
|
+
* - `characters` 角色(角色库 + 人物志当前状态)
|
|
1743
|
+
* - `review` 质检记录(逐章审稿 + 作者复盘 + 伏笔/剧情线状态)
|
|
1744
|
+
* - `project` 项目 JSON(完整状态,用于备份/迁移;仅 json 格式)
|
|
1745
|
+
*/
|
|
1746
|
+
export type ExportScope = 'book' | 'settings' | 'plan' | 'characters' | 'review' | 'project';
|
|
1747
|
+
/** 导出范围全集(宿主校验用;顺序即 UI 展示顺序)。 */
|
|
1748
|
+
export declare const EXPORT_SCOPE_VALUES: readonly ExportScope[];
|
|
1749
|
+
/** 导出范围的中文标签。 */
|
|
1750
|
+
export declare const EXPORT_SCOPE_LABELS: Record<ExportScope, string>;
|
|
1879
1751
|
export interface ExportRequest {
|
|
1880
|
-
format: 'txt' | 'md';
|
|
1752
|
+
format: 'txt' | 'md' | 'json';
|
|
1753
|
+
/** 缺省 `book`(兼容旧调用)。 */
|
|
1754
|
+
scope?: ExportScope;
|
|
1881
1755
|
}
|
|
1882
1756
|
export interface ExportResponse {
|
|
1883
1757
|
file: string;
|
|
1884
1758
|
chars: number;
|
|
1885
1759
|
chapters: number;
|
|
1760
|
+
scope: ExportScope;
|
|
1761
|
+
format: 'txt' | 'md' | 'json';
|
|
1886
1762
|
}
|
|
1887
1763
|
/** POST /config request: patch any subset of the runtime config. */
|
|
1888
1764
|
export interface ConfigPatch {
|
|
@@ -1893,6 +1769,10 @@ export interface ConfigPatch {
|
|
|
1893
1769
|
generateModel?: string;
|
|
1894
1770
|
reviewModel?: string;
|
|
1895
1771
|
auditModel?: string;
|
|
1772
|
+
/** 备用模型(主模型失败时自动切换重试一次;空串 = 关闭)。 */
|
|
1773
|
+
fallbackModel?: string;
|
|
1774
|
+
/** 出章后自动抽取故事时间线(默认开)。 */
|
|
1775
|
+
autoTimeline?: boolean;
|
|
1896
1776
|
reasoningEffort?: 'off' | 'low' | 'high' | 'max';
|
|
1897
1777
|
analysisReasoning?: 'off' | 'low' | 'high' | 'max';
|
|
1898
1778
|
chapterChars?: number;
|
|
@@ -1901,9 +1781,6 @@ export interface ConfigPatch {
|
|
|
1901
1781
|
autoReview?: boolean;
|
|
1902
1782
|
autoAuthorReview?: boolean;
|
|
1903
1783
|
autoReviewAfterRevise?: boolean;
|
|
1904
|
-
imageApiKey?: string;
|
|
1905
|
-
imageApiModel?: string;
|
|
1906
|
-
imageApiEnabled?: boolean;
|
|
1907
1784
|
/** 自定义背景图(URL / dataURL / 服务端路径引用)。 */
|
|
1908
1785
|
themeBackground?: string;
|
|
1909
1786
|
/** 自定义背景遮罩/模糊强度 0-80。 */
|
|
@@ -1911,11 +1788,18 @@ export interface ConfigPatch {
|
|
|
1911
1788
|
/** 玻璃透明度 0-100(100=当前原样)。 */
|
|
1912
1789
|
themeOpacity?: number;
|
|
1913
1790
|
enableAdaptMode?: boolean;
|
|
1914
|
-
/** 生图模型库(完整替换保存)。 */
|
|
1915
|
-
imageModels?: ImageModelConfig[];
|
|
1916
1791
|
/** 手动添加的模型库(完整替换保存)。 */
|
|
1917
1792
|
savedModels?: SavedModel[];
|
|
1918
1793
|
}
|
|
1794
|
+
/** POST /config response: the config the host will read next, plus persistence caveats. */
|
|
1795
|
+
export interface ConfigResponse {
|
|
1796
|
+
config: NovelConfig;
|
|
1797
|
+
/**
|
|
1798
|
+
* 已生效但**未持久化**时的说明(宿主 settings 段不可寻址:段 id 未知或宿主
|
|
1799
|
+
* 未登记)。有值时设置只在本次进程内有效,重启回退,面板照此提示用户。
|
|
1800
|
+
*/
|
|
1801
|
+
settingsWarning?: string;
|
|
1802
|
+
}
|
|
1919
1803
|
/** One assistant conversation message (persisted per project). */
|
|
1920
1804
|
export interface AssistantMessage {
|
|
1921
1805
|
role: 'user' | 'assistant' | 'tool';
|
|
@@ -2040,7 +1924,7 @@ export interface AntiAiRule {
|
|
|
2040
1924
|
/** 作用域(缺省 all)。 */
|
|
2041
1925
|
scope?: Array<'writing' | 'review' | 'polish' | 'all'>;
|
|
2042
1926
|
}
|
|
2043
|
-
/**
|
|
1927
|
+
/** 预置叙事风格模板(一键绑定无需样本文本)。 */
|
|
2044
1928
|
export interface StyleTemplateNarrativeRules {
|
|
2045
1929
|
progressionMode?: string;
|
|
2046
1930
|
sceneUnitPattern?: string[];
|
|
@@ -2108,7 +1992,7 @@ export interface StyleTemplate {
|
|
|
2108
1992
|
/** 该模板默认绑定的反 AI 规则 key(内置规则名)。 */
|
|
2109
1993
|
defaultAntiAiRuleKeys: string[];
|
|
2110
1994
|
}
|
|
2111
|
-
/**
|
|
1995
|
+
/** 起始风格画像:无样本文本也能快速绑定一套写法。 */
|
|
2112
1996
|
export interface StarterStyleProfile {
|
|
2113
1997
|
/** stable key(如 starter-power-up)。 */
|
|
2114
1998
|
key: string;
|
|
@@ -2288,7 +2172,7 @@ export interface AdaptationDimension {
|
|
|
2288
2172
|
current: string;
|
|
2289
2173
|
/** 该值在正文中的出现证据(章节/频次,可空)。 */
|
|
2290
2174
|
evidence?: string;
|
|
2291
|
-
/**
|
|
2175
|
+
/** 建议的候选新值(可空,每套含名称与一句话说明)。 */
|
|
2292
2176
|
candidates?: Array<{
|
|
2293
2177
|
name: string;
|
|
2294
2178
|
desc?: string;
|
|
@@ -2431,7 +2315,7 @@ export interface AdaptSaveRequest {
|
|
|
2431
2315
|
text: string;
|
|
2432
2316
|
/** 新书名(缺省为「改编新书」;建议用「<原著>·改编版」)。 */
|
|
2433
2317
|
bookName?: string;
|
|
2434
|
-
/**
|
|
2318
|
+
/** 新书输出目录(缺省为「输出目录」设置下的书名子目录)。 */
|
|
2435
2319
|
outputDir?: string;
|
|
2436
2320
|
/** 可附带反推大纲(写进新项目,便于后续续写/编辑)。 */
|
|
2437
2321
|
outline?: string;
|
|
@@ -2455,7 +2339,7 @@ export interface AdaptMaterializeRequest {
|
|
|
2455
2339
|
text: string;
|
|
2456
2340
|
/** 新书名(缺省为「<源书名>·改编版」)。 */
|
|
2457
2341
|
bookName?: string;
|
|
2458
|
-
/**
|
|
2342
|
+
/** 新书输出目录(缺省为「输出目录」设置下的书名子目录)。 */
|
|
2459
2343
|
outputDir?: string;
|
|
2460
2344
|
/** 反推大纲(来自分析;缺少时用源文章题兜底)。 */
|
|
2461
2345
|
outline?: string;
|
|
@@ -2489,7 +2373,7 @@ export interface AdaptMaterializeResponse {
|
|
|
2489
2373
|
export interface AdaptMaterializeSaveRequest {
|
|
2490
2374
|
/** 新书名(缺省为「改编版」)。 */
|
|
2491
2375
|
bookName?: string;
|
|
2492
|
-
/**
|
|
2376
|
+
/** 新书输出目录(缺省为「输出目录」设置下的书名子目录)。 */
|
|
2493
2377
|
outputDir?: string;
|
|
2494
2378
|
/** 改编后总纲。 */
|
|
2495
2379
|
outline: string;
|