@waterwx/dsh-novel-forge 2.0.1-alpha → 2.1.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +97 -2
  2. package/lib/client.js +3291 -752
  3. package/lib/index.js +3557 -237
  4. package/lib/types/assets.d.ts +16 -3
  5. package/lib/types/assistant.d.ts +4 -0
  6. package/lib/types/client/api.d.ts +89 -0
  7. package/lib/types/client/llmLive.d.ts +33 -0
  8. package/lib/types/client/locales.d.ts +3 -3
  9. package/lib/types/client/panel/AdaptModeView.d.ts +1 -1
  10. package/lib/types/client/panel/AssetsTab.d.ts +1 -1
  11. package/lib/types/client/panel/AssistantTab.d.ts +1 -1
  12. package/lib/types/client/panel/AuthorAssetsView.d.ts +1 -1
  13. package/lib/types/client/panel/AuthorHome.d.ts +4 -2
  14. package/lib/types/client/panel/BookAnalysisView.d.ts +4 -0
  15. package/lib/types/client/panel/BookshelfBar.d.ts +1 -1
  16. package/lib/types/client/panel/CreateBookView.d.ts +6 -2
  17. package/lib/types/client/panel/DirectorView.d.ts +7 -0
  18. package/lib/types/client/panel/FlowGuide.d.ts +1 -1
  19. package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +1 -1
  20. package/lib/types/client/panel/IdeaInspirationView.d.ts +6 -0
  21. package/lib/types/client/panel/ImportModal.d.ts +1 -1
  22. package/lib/types/client/panel/KnowledgeBaseView.d.ts +4 -0
  23. package/lib/types/client/panel/LiveFeedLog.d.ts +5 -0
  24. package/lib/types/client/panel/MangaRoleLibrary.d.ts +1 -1
  25. package/lib/types/client/panel/MangaWorkspace.d.ts +1 -1
  26. package/lib/types/client/panel/MarketRadarView.d.ts +5 -0
  27. package/lib/types/client/panel/NovelPanel.d.ts +2 -2
  28. package/lib/types/client/panel/ProgressConsole.d.ts +1 -1
  29. package/lib/types/client/panel/ProgressHomeView.d.ts +1 -1
  30. package/lib/types/client/panel/PropLibrary.d.ts +1 -1
  31. package/lib/types/client/panel/ReaderView.d.ts +1 -1
  32. package/lib/types/client/panel/RunPanel.d.ts +1 -1
  33. package/lib/types/client/panel/SceneLibrary.d.ts +1 -1
  34. package/lib/types/client/panel/SettingsView.d.ts +1 -1
  35. package/lib/types/client/panel/ShelfView.d.ts +1 -1
  36. package/lib/types/client/panel/StoryboardTab.d.ts +1 -1
  37. package/lib/types/client/panel/StyleCard.d.ts +1 -1
  38. package/lib/types/client/panel/StyleGallery.d.ts +1 -1
  39. package/lib/types/client/panel/WorldTab.d.ts +1 -1
  40. package/lib/types/engine.d.ts +29 -1
  41. package/lib/types/global-assets.d.ts +6 -0
  42. package/lib/types/index.d.ts +6 -0
  43. package/lib/types/llm-live.d.ts +44 -0
  44. package/lib/types/market-radar-scan.d.ts +19 -0
  45. package/lib/types/market-radar-sources.d.ts +31 -0
  46. package/lib/types/prompting.d.ts +35 -0
  47. package/lib/types/protocol.d.ts +364 -8
  48. package/lib/types/run.d.ts +1 -1
  49. package/lib/types/src/ai-scan.d.ts +36 -0
  50. package/lib/types/src/assets.d.ts +37 -0
  51. package/lib/types/src/assistant.d.ts +45 -0
  52. package/lib/types/src/author-assets.d.ts +25 -0
  53. package/lib/types/src/bookshelf.d.ts +42 -0
  54. package/lib/types/src/client/api.d.ts +234 -0
  55. package/lib/types/src/client/docx.d.ts +15 -0
  56. package/lib/types/src/client/index.d.ts +14 -0
  57. package/lib/types/src/client/locales.d.ts +212 -0
  58. package/lib/types/src/client/mount.d.ts +9 -0
  59. package/lib/types/src/client/panel/AdaptModeView.d.ts +5 -0
  60. package/lib/types/src/client/panel/AssetsTab.d.ts +12 -0
  61. package/lib/types/src/client/panel/AssistantTab.d.ts +7 -0
  62. package/lib/types/src/client/panel/AuthorAssetsView.d.ts +4 -0
  63. package/lib/types/src/client/panel/AuthorHome.d.ts +32 -0
  64. package/lib/types/src/client/panel/BookshelfBar.d.ts +11 -0
  65. package/lib/types/src/client/panel/CreateBookView.d.ts +9 -0
  66. package/lib/types/src/client/panel/FlowGuide.d.ts +22 -0
  67. package/lib/types/src/client/panel/GlobalAssetLibraryView.d.ts +4 -0
  68. package/lib/types/src/client/panel/ImportModal.d.ts +7 -0
  69. package/lib/types/src/client/panel/MangaRoleLibrary.d.ts +20 -0
  70. package/lib/types/src/client/panel/MangaWorkspace.d.ts +12 -0
  71. package/lib/types/src/client/panel/ModelManager.d.ts +14 -0
  72. package/lib/types/src/client/panel/NovelPanel.d.ts +13 -0
  73. package/lib/types/src/client/panel/ProgressConsole.d.ts +17 -0
  74. package/lib/types/src/client/panel/ProgressHomeView.d.ts +5 -0
  75. package/lib/types/src/client/panel/PropLibrary.d.ts +8 -0
  76. package/lib/types/src/client/panel/ReaderView.d.ts +8 -0
  77. package/lib/types/src/client/panel/ReasoningSection.d.ts +10 -0
  78. package/lib/types/src/client/panel/RunPanel.d.ts +5 -0
  79. package/lib/types/src/client/panel/SceneLibrary.d.ts +16 -0
  80. package/lib/types/src/client/panel/SettingsView.d.ts +16 -0
  81. package/lib/types/src/client/panel/ShelfView.d.ts +15 -0
  82. package/lib/types/src/client/panel/StoryboardTab.d.ts +19 -0
  83. package/lib/types/src/client/panel/StyleCard.d.ts +8 -0
  84. package/lib/types/src/client/panel/StyleGallery.d.ts +1 -0
  85. package/lib/types/src/client/panel/WorldTab.d.ts +10 -0
  86. package/lib/types/src/client/panel/controller.d.ts +19 -0
  87. package/lib/types/src/client/panel/helpers.d.ts +18 -0
  88. package/lib/types/src/client/panel/views.d.ts +77 -0
  89. package/lib/types/src/client/sidebar-entry.d.ts +13 -0
  90. package/lib/types/src/client/text.d.ts +9 -0
  91. package/lib/types/src/comic-presets.d.ts +12 -0
  92. package/lib/types/src/docx.d.ts +19 -0
  93. package/lib/types/src/engine.d.ts +402 -0
  94. package/lib/types/src/index.d.ts +79 -0
  95. package/lib/types/src/manga-genre-rules.d.ts +22 -0
  96. package/lib/types/src/novel-context.d.ts +80 -0
  97. package/lib/types/src/prompt-utils.d.ts +35 -0
  98. package/lib/types/src/protocol.d.ts +2176 -0
  99. package/lib/types/src/review-policy.d.ts +97 -0
  100. package/lib/types/src/routes.d.ts +29 -0
  101. package/lib/types/src/run.d.ts +32 -0
  102. package/lib/types/src/shot-language.d.ts +46 -0
  103. package/lib/types/src/story-beat-language.d.ts +35 -0
  104. package/lib/types/src/style-library.d.ts +33 -0
  105. package/package.json +1 -1
  106. package/src/assets.ts +1774 -879
  107. package/src/assistant.ts +154 -9
  108. package/src/client/api.ts +105 -6
  109. package/src/client/llmLive.ts +101 -0
  110. package/src/client/locales.ts +4 -4
  111. package/src/client/panel/AdaptModeView.tsx +18 -3
  112. package/src/client/panel/AssistantTab.tsx +41 -3
  113. package/src/client/panel/AuthorHome.tsx +51 -20
  114. package/src/client/panel/BookAnalysisView.tsx +60 -0
  115. package/src/client/panel/CreateBookView.tsx +22 -3
  116. package/src/client/panel/DirectorView.tsx +200 -0
  117. package/src/client/panel/IdeaInspirationView.tsx +71 -0
  118. package/src/client/panel/KnowledgeBaseView.tsx +73 -0
  119. package/src/client/panel/LiveFeedLog.tsx +76 -0
  120. package/src/client/panel/MarketRadarView.tsx +374 -0
  121. package/src/client/panel/NovelPanel.tsx +117 -16
  122. package/src/client/panel/ProgressConsole.tsx +5 -6
  123. package/src/client/panel/SettingsView.tsx +3 -0
  124. package/src/client/panel/panel.module.css +2 -3
  125. package/src/engine.ts +459 -23
  126. package/src/global-assets.ts +59 -0
  127. package/src/index.ts +17 -1
  128. package/src/llm-live.ts +68 -0
  129. package/src/market-radar-scan.ts +41 -0
  130. package/src/market-radar-sources.ts +173 -0
  131. package/src/prompting.ts +159 -0
  132. package/src/protocol.ts +340 -8
  133. package/src/routes.ts +579 -59
  134. package/src/run.ts +15 -8
  135. package/skills/chapter-batch/SKILL.md +0 -81
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Writing assets — 题材基底库 / 推进模式库 / 反 AI 规则 / 写法引擎.
3
+ *
4
+ * Ported from AI-Novel-Writing-Assistant (Apache-2.0) built-in seed data:
5
+ * - 8 preset style templates (DEFAULT_STYLE_TEMPLATES)
6
+ * - 12 anti-AI rules with concrete detect patterns (DEFAULT_ANTI_AI_RULES)
7
+ * - genre tree + progression mode seeds
8
+ * Assets persist with the project (novel-project.json) and are injected into
9
+ * generation / planning / review prompts, and available to the AI assistant.
10
+ */
11
+ import type { AntiAiRule, GenreNode, PlotBeatTemplate, ProgressionMode, ProjectAssets, StyleAsset, StyleTemplate } from './protocol.ts';
12
+ /** 预置写法模板(来自 AI-Novel-Writing-Assistant 内置 DEFAULT_STYLE_TEMPLATES)。 */
13
+ export declare const BUILTIN_STYLE_TEMPLATES: StyleTemplate[];
14
+ /** 内置全局反 AI 规则(来自 AI-Novel-Writing-Assistant 内置 DEFAULT_ANTI_AI_RULES)。 */
15
+ export declare const BUILTIN_ANTI_AI_RULES: AntiAiRule[];
16
+ /** 内置题材基底库(常用网文题材树,跨书复用)。 */
17
+ export declare const BUILTIN_GENRE_LIBRARY: GenreNode[];
18
+ /** 内置常用推进模式。 */
19
+ export declare const BUILTIN_PROGRESSION_MODES: ProgressionMode[];
20
+ /** 剧情桥段库:可复用情节套路(作者阅读经验沉淀,非某本书的剧情线)。 */
21
+ export declare const BUILTIN_PLOT_BEATS: PlotBeatTemplate[];
22
+ /** 默认(空)项目写作资产。 */
23
+ export declare function emptyProjectAssets(): ProjectAssets;
24
+ /** 合并项目资产与内置库:返回「生效的反 AI 规则」(内置全局 + 项目自定义)。 */
25
+ export declare function effectiveAntiAiRules(assets: ProjectAssets | undefined): AntiAiRule[];
26
+ /** 把生效规则渲染成提示词块(禁止/鼓励分列,压缩省 token)。 */
27
+ export declare function renderAntiAiRules(assets: ProjectAssets | undefined): string;
28
+ /** 渲染题材与推进模式提示词块。 */
29
+ export declare function renderGenreAndProgression(assets: ProjectAssets | undefined): string;
30
+ /** 渲染写法资产提示词块(规则去重,省 token)。 */
31
+ export declare function renderStyleAssets(assets: ProjectAssets | undefined): string;
32
+ /** 渲染全部写作资产提示词(供生成/规划/审稿注入)。 */
33
+ export declare function renderAllAssets(assets: ProjectAssets | undefined): string;
34
+ /** 预置写法模板 → 可直接绑定的 StyleAsset。 */
35
+ export declare function styleTemplateToAsset(template: StyleTemplate): StyleAsset;
36
+ /** 写法引擎:从样本文本提取风格资产的系统提示词。 */
37
+ export declare function styleEngineSystemPrompt(): string;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * AI assistant engine — a conversational editor over the novel project.
3
+ *
4
+ * The user talks to the assistant about plot, characters, settings; the
5
+ * assistant can reply in prose AND emit action directives that the host
6
+ * executes (rewrite a paragraph, edit the bible, regenerate a chapter,
7
+ * export the book, ...). Conversation history persists next to the project
8
+ * as NDJSON, so a reload keeps the thread.
9
+ *
10
+ * Action protocol: the model emits a line of the form
11
+ * <dsh-action name="toolName">{jsonArgs}</dsh-action>
12
+ * anywhere in its reply. The host strips it, executes the tool, appends the
13
+ * result as a tool-role message, and continues the loop (bounded rounds).
14
+ */
15
+ import type { Context } from '@deepseek-ai/cordis';
16
+ import type { AssistantMessage, NovelConfig, ProjectState } from './protocol.ts';
17
+ import { chapterFileName } from './engine.ts';
18
+ /** History file name inside the output dir. */
19
+ export declare const ASSISTANT_HISTORY_FILE = "novel-assistant.jsonl";
20
+ /** Load the persisted conversation (empty when none). */
21
+ export declare function loadAssistantHistory(outputDir: string): AssistantMessage[];
22
+ /** 清空助手对话记录(删除历史文件)。 */
23
+ export declare function clearAssistantHistory(outputDir: string): void;
24
+ /** Execute one action directive. Returns a text result (or throws). */
25
+ /**
26
+ * Execute one action directive as an async generator: yields live progress
27
+ * text (chapter text being generated/rewritten), then yields the final result
28
+ * string. Throws on failure.
29
+ */
30
+ export declare function executeAction(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, name: string, args: Record<string, unknown>): AsyncGenerator<string, string, unknown>;
31
+ /** Run one user turn. Yields stream frames; persists history. */
32
+ export declare function runAssistantTurn(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, userMessage: string): AsyncGenerator<{
33
+ frame: 'delta';
34
+ text: string;
35
+ } | {
36
+ frame: 'tool';
37
+ name: string;
38
+ status: 'start' | 'done' | 'error';
39
+ detail?: string;
40
+ } | {
41
+ frame: 'toolDelta';
42
+ name: string;
43
+ text: string;
44
+ }, void, unknown>;
45
+ export { chapterFileName };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 作者资产库/总数据(跨书)— 按作者维度聚合的可复用资产。
3
+ * 与书架同惯例持久化到 ~/.dsh/dsh-novel-forge-author-assets.json。
4
+ * 提供读取/持久化/新增或更新/删除,以及「导入默认」:把书架书的写作资产/角色 +
5
+ * 内置全局库(题材/反AI规则/风格模板/推进模式)批量沉淀成资产条目(默认库)。
6
+ */
7
+ import type { AuthorAssetLibrary, AuthorStyleAsset } from './protocol.ts';
8
+ /** 作者资产库配置文件路径。 */
9
+ export declare function authorAssetsFile(): string;
10
+ /** 读取作者资产库(不存在/损坏则返回空库,不抛错)。 */
11
+ export declare function loadAuthorAssets(): AuthorAssetLibrary;
12
+ /** 持久化作者资产库。 */
13
+ export declare function saveAuthorAssets(library: AuthorAssetLibrary): void;
14
+ /** 新建一条资产(自动生成 id 与时间戳)。 */
15
+ export declare function createAuthorAsset(input: Omit<AuthorStyleAsset, 'id' | 'createdAt' | 'updatedAt'>): AuthorStyleAsset;
16
+ /** 按 id 更新一条资产;不存在则追加。 */
17
+ export declare function upsertAuthorAsset(input: AuthorStyleAsset): AuthorAssetLibrary;
18
+ /** 删除一条资产;返回更新后的资产库。 */
19
+ export declare function removeAuthorAsset(id: string): AuthorAssetLibrary;
20
+ /**
21
+ * 导入默认:把书架所有书的写作资产/角色 + 内置全局库批量沉淀到作者资产库。
22
+ * 按 `kind:name` 去重(已存在则跳过),不覆盖用户已有条目。
23
+ * @returns 更新后的资产库。
24
+ */
25
+ export declare function importDefaultAuthorAssets(): AuthorAssetLibrary;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 书架(Bookshelf)— 多书管理:一本书记录一个独立输出目录。
3
+ * 状态持久化到 ~/.dsh/dsh-novel-forge-bookshelf.json(跟随 dsh 配置惯例)。
4
+ */
5
+ import type { BookEntry, BookshelfSnapshot } from './protocol.ts';
6
+ /** 书架配置文件路径。 */
7
+ export declare function bookshelfFile(): string;
8
+ interface BookshelfStore {
9
+ books: BookEntry[];
10
+ activeBookId: string | null;
11
+ }
12
+ /** 读取书架(无则返回空)。 */
13
+ export declare function loadBookshelf(): BookshelfStore;
14
+ /** 当前激活的书。 */
15
+ export declare function activeBook(store: BookshelfStore): BookEntry | undefined;
16
+ /** 书架快照(含每本书的进度摘要)。 */
17
+ export declare function bookshelfSnapshot(store: BookshelfStore): BookshelfSnapshot;
18
+ /** 新建一本书(自动成为当前书)。 */
19
+ export declare function createBook(bookName: string, outputDir: string): BookEntry;
20
+ /** 更新某本书的书名(开书向导导入大纲后书名以大纲首行为准)。 */
21
+ export declare function renameBook(id: string, bookName: string): boolean;
22
+ /**
23
+ * 播种:书架为空时,把指定输出目录下已有的项目自动登记为第一本书。
24
+ * 兼容升级场景 —— 旧版插件直接在输出目录写项目,从未登记书架。
25
+ * @param outputDir - 候选输出目录(通常为 settings 的默认输出目录)。
26
+ * @returns 是否发生了播种。
27
+ */
28
+ export declare function seedBookshelfFromOutputDir(outputDir: string): boolean;
29
+ /** 导入已有项目目录到书架:校验 novel-project.json,已存在则直接激活。 */
30
+ export declare function importDir(outputDir: string): {
31
+ book: BookEntry;
32
+ existed: boolean;
33
+ };
34
+ /** 激活一本书。 */
35
+ export declare function activateBook(id: string): BookEntry | undefined;
36
+ /** 移除一本书。 */
37
+ export declare function removeBook(id: string): boolean;
38
+ /** 当前书输出目录(无书架则 undefined,回退 settings)。 */
39
+ export declare function activeBookOutputDir(): string | undefined;
40
+ /** 默认输出目录推断:~/.dsh/novels/书名。 */
41
+ export declare function defaultOutputDirFor(bookName: string): string;
42
+ export {};
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Browser-side API client for the /api/dsh-novel-forge route family. Plain
3
+ * fetch, same origin; generation/rewrite/polish ride NDJSON streams read
4
+ * incrementally.
5
+ */
6
+ import { type AssetsPatch, type AssetsResponse, type AddModelRequest, type AddModelResponse, type LlmModelsResponse, type LlmProvidersResponse, type LlmVendorsResponse, type RemoveProviderRequest, type RemoveProviderResponse, type BibleResponse, type ChapterResponse, type ConfigPatch, type ExportResponse, type ForeshadowRequest, type ForeshadowResponse, type JobFrame, type LoadOutlineResponse, type AdaptExecuteRequest, type AdaptRewriteFrame, type AdaptMaterializeSaveRequest, type AdaptMaterializeSaveResponse, type PluginUpdateResponse, type LlmTestResponse, type NovelConfig, type PlanResponse, type ReviewReport, type StatusResponse, type StyleEngineRequest, type StyleAsset, type VolumesResponse } from '../protocol.ts';
7
+ /** Error carrying the route's JSON error message. */
8
+ export declare class NovelApiError extends Error {
9
+ constructor(message: string);
10
+ }
11
+ /** The browser half's only data entry point. */
12
+ export declare class NovelApi {
13
+ status(): Promise<StatusResponse>;
14
+ loadOutline(path?: string, text?: string): Promise<LoadOutlineResponse>;
15
+ saveOutline(text: string): Promise<{
16
+ ok: boolean;
17
+ bookName: string;
18
+ }>;
19
+ /** 反推大纲:从已写章节正文反向生成全书总纲(NDJSON 流)。 */
20
+ outlineReverse(onFrame: (frame: JobFrame) => void): Promise<void>;
21
+ /** 分镜·导演级:骨架 → 分镜表(镜头级)。 */
22
+ storyboardTable(chapterNo: number, skeleton: import('../protocol.ts').StoryboardSkeleton, styleId?: string, filterId?: string): Promise<import('../protocol.ts').StoryboardTableResponse>;
23
+ /** 漫剧方案管理:create / remove / activate。 */
24
+ manhuaPlans(req: import('../protocol.ts').MangaPlansRequest): Promise<import('../protocol.ts').MangaPlansResponse>;
25
+ /** 分镜·提示词级:分镜表 → 即梦可粘贴视频提示词。 */
26
+ storyboardPrompts(chapterNo: number, table: import('../protocol.ts').StoryboardTable, styleId?: string, filterId?: string): Promise<import('../protocol.ts').StoryboardPromptsResponse>;
27
+ /** 分镜·编剧级:单章 → 剧情骨架(节拍链)。 */
28
+ storyboardSkeleton(chapterNo: number): Promise<import('../protocol.ts').StoryboardSkeletonResponse>;
29
+ /** 开书想法 → AI 大纲:生成 count 个方案(换批时传 exclude 避开已暂留方向)。 */
30
+ outlineSuggest(idea: string, count?: number, exclude?: string[]): Promise<import('../protocol.ts').OutlineSuggestResponse>;
31
+ /** 拆书分析:对已写章节做结构/人物/文风/卖点体检。 */
32
+ breakdown(scope?: string, preset?: 'quick' | 'standard', budgetTokens?: number): Promise<import('../protocol.ts').BreakdownResponse>;
33
+ plan(outline?: string, chapterCount?: number, volume?: number): Promise<PlanResponse>;
34
+ volumes(outline?: string): Promise<VolumesResponse>;
35
+ bible(outline?: string): Promise<BibleResponse>;
36
+ review(chapterNo: number): Promise<{
37
+ report: ReviewReport;
38
+ }>;
39
+ summarize(chapterNo: number): Promise<{
40
+ summary: string;
41
+ }>;
42
+ foreshadow(req: ForeshadowRequest): Promise<ForeshadowResponse>;
43
+ exportBook(format: 'txt' | 'md'): Promise<ExportResponse>;
44
+ chapter(no: number): Promise<ChapterResponse>;
45
+ /** 审查手动编辑的正文(不落盘)。previousReport 传入时走「验证模式」(核对原意见解决 + 只挑新增 high)。 */
46
+ chapterCheck(no: number, text: string, previousReport?: ReviewReport): Promise<{
47
+ report: ReviewReport;
48
+ }>;
49
+ /** 保存手动编辑的正文(自动备份 .bak;带报告则沿用落盘,否则保存后自动审稿)。 */
50
+ chapterSave(no: number, text: string, report?: ReviewReport): Promise<import('../protocol.ts').ChapterSaveResponse>;
51
+ patchConfig(patch: ConfigPatch): Promise<{
52
+ config: NovelConfig;
53
+ }>;
54
+ openFolder(): Promise<void>;
55
+ /** 插件自更新:在 DSH profile 目录拉取最新 npm 版(需重启 DSH 生效)。 */
56
+ pluginUpdate(): Promise<PluginUpdateResponse>;
57
+ /** 书架快照。 */
58
+ bookshelf(): Promise<import('../protocol.ts').BookshelfSnapshot>;
59
+ /** 新建书并激活(开书向导:可携带大纲文本,创建即建项目)。 */
60
+ bookCreate(bookName: string, outputDir?: string, outline?: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
61
+ /** 重置项目(清空进度;可携带新大纲)。 */
62
+ reset(outline?: string): Promise<{
63
+ ok: boolean;
64
+ bookName: string;
65
+ }>;
66
+ /** 全书一致性质检。 */
67
+ audit(): Promise<import('../protocol.ts').AuditResponse>;
68
+ /** 角色卡刷新(基于事实库聚合)。 */
69
+ charactersRefresh(): Promise<{
70
+ cards: import('../protocol.ts').RoleStatusCard[];
71
+ }>;
72
+ /** 事实库回填:对历史已生成章节批量抽取事实。 */
73
+ factsBackfill(): Promise<{
74
+ ok: boolean;
75
+ filled: number;
76
+ }>;
77
+ /** 道藏局部修补。 */
78
+ biblePatch(patch: import('../protocol.ts').BiblePatchRequest): Promise<{
79
+ bible: import('../protocol.ts').StoryBible;
80
+ }>;
81
+ /** 剧情线管理:增删改 + 关联章节。 */
82
+ plotlines(req: import('../protocol.ts').PlotlinesRequest): Promise<import('../protocol.ts').PlotlinesResponse>;
83
+ /** 敏感词检查:指定章节 / 任意文本 / 全书。 */
84
+ sensitiveCheck(req: import('../protocol.ts').SensitiveCheckRequest): Promise<import('../protocol.ts').SensitiveCheckResponse>;
85
+ /** 作者复盘补跑:单章(JSON)。 */
86
+ reviewBackfillChapter(no: number): Promise<{
87
+ no: number;
88
+ review: import('../protocol.ts').AuthorReview;
89
+ }>;
90
+ /** 作者复盘补跑:全书缺失章节(NDJSON 流)。 */
91
+ reviewBackfillAll(onFrame: (frame: JobFrame) => void): Promise<void>;
92
+ /** 章节复位:generating 卡死 → pending。 */
93
+ chapterReset(no: number): Promise<{
94
+ ok: boolean;
95
+ no: number;
96
+ }>;
97
+ /** 章节直接通过(作者行使最终决定权)。 */
98
+ chapterApprove(no: number): Promise<{
99
+ ok: boolean;
100
+ no: number;
101
+ }>;
102
+ /** 角色库:AI 提炼 / 采纳 / 更新 / 删除。 */
103
+ imageTest(req: import('../protocol.ts').ImageTestRequest): Promise<import('../protocol.ts').ImageTestResponse>;
104
+ /** 对选中的提供商/模型发一次最小真实调用,验证连通性。 */
105
+ llmTest(provider: string, model: string): Promise<LlmTestResponse>;
106
+ /** 添加模型:厂商直填 key,或自定义 OpenAI 兼容路由(写 DSH 凭据 + 注册路由)。 */
107
+ addModel(req: AddModelRequest): Promise<AddModelResponse>;
108
+ /** 运行时厂商目录(DSH pi-ai 可配置提供方 + 内置适配器)。 */
109
+ llmVendors(): Promise<LlmVendorsResponse>;
110
+ /** 查询某个 provider 当前可用的模型(添加成功后可即时刷新)。 */
111
+ llmModels(provider: string): Promise<LlmModelsResponse>;
112
+ /** 已注册的提供方路由列表(提供方管理卡片)。 */
113
+ llmProviders(): Promise<LlmProvidersResponse>;
114
+ /** 移除一个提供方(unset key + 移除 llm-pi-ai 路由)。 */
115
+ removeProvider(req: RemoveProviderRequest): Promise<RemoveProviderResponse>;
116
+ roles(req: import('../protocol.ts').RolesRequest): Promise<import('../protocol.ts').RolesResponse>;
117
+ /** 漫剧角色库:从分镜提名 / 建卡 / 更新 / 删除 / 形象锚点 / 精修提示词。 */
118
+ mangaRoles(req: import('../protocol.ts').MangaRolesRequest): Promise<import('../protocol.ts').MangaRolesResponse>;
119
+ /** 导出「即梦素材包」落盘到资产库 manga-assets/素材包/。 */
120
+ exportPackage(chapterNo: number, title: string, markdown: string): Promise<{
121
+ ok: boolean;
122
+ file: string;
123
+ }>;
124
+ /** 场景库:AI 提炼 / 采纳 / 更新 / 删除 / 图集。 */
125
+ scenes(req: import('../protocol.ts').ScenesRequest): Promise<import('../protocol.ts').ScenesResponse>;
126
+ /** 视觉世界观规则:提炼 / 保存。 */
127
+ visualRules(req: import('../protocol.ts').VisualRulesRequest): Promise<import('../protocol.ts').VisualRulesResponse>;
128
+ /** 道具库:从已写章节提炼常驻道具 / 保存清单。 */
129
+ mangaProps(req: import('../protocol.ts').MangaPropsRequest): Promise<import('../protocol.ts').MangaPropsResponse>;
130
+ /** 小说简介:AI 生成/补全(partial 留空 = 全量),或手动保存。 */
131
+ blurb(action: 'generate' | 'save', text?: string, partial?: string): Promise<{
132
+ blurb: string;
133
+ }>;
134
+ /** 封面:读取(dataUrl;dir 指定某本书的输出目录,省略为当前书)。 */
135
+ coverGet(dir?: string): Promise<import('../protocol.ts').CoverResponse>;
136
+ /** 封面:上传(base64 data URL)或移除。 */
137
+ coverPost(action: 'upload' | 'remove', dataUrl?: string): Promise<{
138
+ ok: boolean;
139
+ coverPath?: string | null;
140
+ }>;
141
+ /** 重命名当前书(同步项目与书架条目)。 */
142
+ rename(bookName: string): Promise<{
143
+ bookName: string;
144
+ }>;
145
+ /** 大世界:AI 提炼(generate)或手动保存(save)。 */
146
+ world(action: 'generate' | 'save', world?: import('../protocol.ts').WorldState): Promise<{
147
+ world: import('../protocol.ts').WorldState;
148
+ }>;
149
+ /** 切换当前书。 */
150
+ bookActivate(id: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
151
+ /** 移除书架条目。 */
152
+ bookRemove(id: string): Promise<import('../protocol.ts').BookshelfSnapshot>;
153
+ /** 导入已有项目目录(Mode A):校验 novel-project.json,登记/激活书架。 */
154
+ bookImportDir(outputDir: string): Promise<import('../protocol.ts').BookImportDirResponse>;
155
+ /** 导入 txt/md 全本(Mode B):服务器本地文件路径模式。 */
156
+ bookImportText(filePath: string, outputDir?: string): Promise<import('../protocol.ts').BookImportTextResponse>;
157
+ /** 拆章预览(浏览器上传全文,不落盘):返回识别到的章节与跳过清单。 */
158
+ bookImportTextPreview(text: string, fileName?: string): Promise<import('../protocol.ts').BookImportTextPreviewResponse>;
159
+ /** 导入 txt/md 全本(Mode B):浏览器上传全文内容模式。 */
160
+ bookImportTextContent(text: string, fileName: string, outputDir?: string): Promise<import('../protocol.ts').BookImportTextResponse>;
161
+ /** 生产单:启动批量生产(区间或新增 N 章;计划不足自动补)。 */
162
+ runStart(req: import('../protocol.ts').RunStartRequest): Promise<import('../protocol.ts').RunState>;
163
+ /** 生产单控制:pause / resume / stop。 */
164
+ runControl(action: 'pause' | 'resume' | 'stop'): Promise<import('../protocol.ts').RunState | null>;
165
+ /** 生产单状态(无生产单返回 null)。 */
166
+ runStatus(): Promise<import('../protocol.ts').RunState | null>;
167
+ /** Get project writing assets + built-in libraries. */
168
+ assets(): Promise<AssetsResponse>;
169
+ /** Patch project writing assets. */
170
+ patchAssets(patch: AssetsPatch): Promise<AssetsResponse>;
171
+ /** Extract a style asset from sample text. */
172
+ styleEngine(req: StyleEngineRequest): Promise<{
173
+ styleAsset: StyleAsset;
174
+ }>;
175
+ /**
176
+ * Consume an NDJSON job stream (generate / rewrite / polish).
177
+ * @param path - the route to POST to.
178
+ * @param payload - the JSON body.
179
+ * @param onFrame - receives every frame as it lands.
180
+ */
181
+ private streamJob;
182
+ /** Generate one chapter. */
183
+ generate(chapterNo: number, skipReview: boolean, onFrame: (frame: JobFrame) => void): Promise<void>;
184
+ /** Rewrite one chapter (whole-chapter, or local when `target` is given). */
185
+ rewrite(chapterNo: number, instructions: string, target: string, onFrame: (frame: JobFrame) => void): Promise<void>;
186
+ /** Polish (de-AI-ify) one chapter. */
187
+ polish(chapterNo: number, onFrame: (frame: JobFrame) => void): Promise<void>;
188
+ /** 采纳待确认草稿(润色/重写产物),覆盖正文文件。返回采纳后的新正文(markdown)。
189
+ * 可携带审查报告(沿用结论定状态:通过 → approved)。 */
190
+ draftApply(chapterNo: number, report?: import('../protocol.ts').ReviewReport): Promise<{
191
+ ok: boolean;
192
+ chars: number;
193
+ file: string;
194
+ markdown: string;
195
+ }>;
196
+ /** 放弃待确认草稿,保留原稿。 */
197
+ draftDiscard(chapterNo: number): Promise<{
198
+ ok: boolean;
199
+ }>;
200
+ /** Run one assistant turn (NDJSON stream). */
201
+ assistant(message: string, onFrame: (frame: import('../protocol.ts').AssistantFrame) => void): Promise<void>;
202
+ /** Load the persisted assistant conversation. */
203
+ assistantHistory(): Promise<import('../protocol.ts').AssistantMessage[]>;
204
+ /** 清空助手对话记录。 */
205
+ assistantClear(): Promise<{
206
+ ok: boolean;
207
+ }>;
208
+ /** 作者资产库/总数据:读取跨书可复用资产。 */
209
+ authorAssets(): Promise<import('../protocol.ts').AuthorAssetsResponse>;
210
+ /** 作者资产库:新增/更新一条资产(upsert by id)。 */
211
+ authorAssetsUpsert(asset: import('../protocol.ts').AuthorStyleAsset): Promise<import('../protocol.ts').AuthorAssetsResponse>;
212
+ /** 作者资产库:删除一条资产。 */
213
+ authorAssetsRemove(id: string): Promise<import('../protocol.ts').AuthorAssetsResponse>;
214
+ /** 作者资产库:导入默认(书架书的写作资产/角色 + 内置全局库)批量沉淀。 */
215
+ authorAssetsImportDefault(): Promise<import('../protocol.ts').AuthorAssetsResponse>;
216
+ /** 改编模式 P0:上传全文 → 原文设定卡片 / 可改范围矩阵。 */
217
+ adaptAnalyze(text: string, filePath?: string): Promise<import('../protocol.ts').AdaptAnalyzeResponse>;
218
+ /** 改编模式 P1:确认要改的维度 → 生成映射表/改编规则/联动影响清单。 */
219
+ adaptPropose(req: import('../protocol.ts').AdaptProposeRequest): Promise<import('../protocol.ts').AdaptProposeResponse>;
220
+ /** 改编模式 P2:执行术语替换(全局替换 + 命中统计 + 改编文本预览)。 */
221
+ adaptExecute(req: import('../protocol.ts').AdaptExecuteRequest): Promise<import('../protocol.ts').AdaptExecuteResponse>;
222
+ /** 改编模式 P3:保存改编全文为新书(原书保留,登记书架)。 */
223
+ adaptSave(req: import('../protocol.ts').AdaptSaveRequest): Promise<import('../protocol.ts').AdaptSaveResponse>;
224
+ /** 改编模式 P4:从源全文 + 编辑后方案提炼新书资料并保存为「待写新书」。 */
225
+ adaptMaterialize(req: import('../protocol.ts').AdaptMaterializeRequest): Promise<import('../protocol.ts').AdaptMaterializeResponse>;
226
+ /** 改编模式:保存预览/微调后的新书资料为新书(原书保留,登记书架)。 */
227
+ adaptMaterializeSave(req: AdaptMaterializeSaveRequest): Promise<AdaptMaterializeSaveResponse>;
228
+ /** 改编模式:rewrite 逐章重写(NDJSON 流式进度,支持分段 startNo/endNo)。 */
229
+ adaptRewriteStream(req: AdaptExecuteRequest, onFrame: (frame: AdaptRewriteFrame) => void): Promise<void>;
230
+ /** 主题自定义背景:上传图片,服务端存盘并返回可访问 URL。 */
231
+ themeBackgroundUpload(dataUrl: string): Promise<{
232
+ url: string;
233
+ }>;
234
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Browser-side docx outline extraction: a .docx is a zip whose
3
+ * word/document.xml holds the body text in <w:t> runs inside <w:p> paragraphs.
4
+ * Uses fflate (inlined into the client bundle) so the user can pick or drag a
5
+ * docx without any server upload.
6
+ *
7
+ * Import from 'fflate/browser' (not 'fflate'): the default entry resolves to
8
+ * the Node build (esm/index.mjs), which calls module.createRequire() for the
9
+ * optional worker_threads path — inlining that into the browser bundle leaves
10
+ * a bare require("module") the client-modules table cannot answer.
11
+ */
12
+ /** Extract plain text from a docx buffer: one line per <w:p> paragraph. */
13
+ export declare function extractDocxTextFromBuffer(buffer: ArrayBuffer | Uint8Array): string;
14
+ /** Read a File as ArrayBuffer. */
15
+ export declare function readFileAsArrayBuffer(file: File): Promise<ArrayBuffer>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Browser-half entry for the dsh-novel-forge plugin — runs inside the dsh web
3
+ * GUI. Registers the sidebar entry row and the workbench panel. DOM mounting
4
+ * problems are logged, never thrown — the web shell fails the whole boot when
5
+ * a plugin apply throws.
6
+ */
7
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
8
+ /** Required services (fiber inject waiting). */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Mount the novel-forge workbench.
12
+ * @param ctx - client root context.
13
+ */
14
+ export declare function apply(ctx: ClientContext): void;
@@ -0,0 +1,212 @@
1
+ /**
2
+ * dsh-novel-forge — locale dictionaries (zh / en).
3
+ */
4
+ /** zh dictionary. */
5
+ export declare const zh: {
6
+ readonly 'entry.label': "小说工坊";
7
+ readonly 'entry.tooltip': "AI 编译小说工作台:总纲 → 道藏 → 卷计划 → 章节计划 → 逐章生成+审稿";
8
+ readonly 'panel.title': "小说工坊";
9
+ readonly 'common.close': "关闭";
10
+ readonly 'common.loading': "加载中…";
11
+ readonly 'common.save': "保存";
12
+ readonly 'common.error': "错误";
13
+ readonly 'common.success': "成功";
14
+ readonly 'common.generating': "生成中…";
15
+ readonly 'common.chars': "字";
16
+ readonly 'tab.workflow': "工作台";
17
+ readonly 'tab.overview': "总纲";
18
+ readonly 'tab.plan': "章节";
19
+ readonly 'tab.bible': "道藏";
20
+ readonly 'tab.foreshadow': "暗线";
21
+ readonly 'tab.assistant': "AI 助手";
22
+ readonly 'tab.settings': "设置";
23
+ readonly 'workflow.title': "创作工作台";
24
+ readonly 'workflow.step1': "① 加载总纲";
25
+ readonly 'workflow.step2': "② 提炼道藏";
26
+ readonly 'workflow.step3': "③ 规划卷";
27
+ readonly 'workflow.step4': "④ 生成章节计划";
28
+ readonly 'workflow.step5': "⑤ 逐章写作 + AI 审稿";
29
+ readonly 'workflow.step6': "⑥ 润色 / 导出";
30
+ readonly 'workflow.loadOutline': "读取总纲";
31
+ readonly 'workflow.genBible': "提炼道藏";
32
+ readonly 'workflow.genVolumes': "生成卷计划";
33
+ readonly 'workflow.genPlan': "生成章节计划";
34
+ readonly 'workflow.done': "已完成";
35
+ readonly 'workflow.todo': "待办";
36
+ readonly 'workflow.bibleDone': "道藏已生成({n} 条规则 / {c} 个人物 / {r} 条红线)";
37
+ readonly 'workflow.volumesDone': "卷计划已生成({n} 卷)";
38
+ readonly 'workflow.planDone': "章节计划已生成({n} 章)";
39
+ readonly 'workflow.progress': "进度:总纲 ✓ · 道藏 {bible} · 卷 {volumes} · 计划 {plan} · 已完成 {done}/{total} 章";
40
+ readonly 'overview.loadDocx': "从 docx 读取总纲";
41
+ readonly 'overview.loadDocxDefault': "读取默认总纲";
42
+ readonly 'overview.loadingOutline': "正在解析 docx…";
43
+ readonly 'overview.outlineHint': "总纲文本(可编辑)";
44
+ readonly 'overview.outlineChars': "总纲字数";
45
+ readonly 'overview.saveOutline': "保存总纲";
46
+ readonly 'overview.saved': "总纲已保存";
47
+ readonly 'overview.bookName': "书名";
48
+ readonly 'overview.loadCustom': "指定 docx 路径";
49
+ readonly 'overview.loadCustomHint': "绝对路径,留空使用默认";
50
+ readonly 'plan.generate': "生成章节计划";
51
+ readonly 'plan.generateHint': "章节数量";
52
+ readonly 'plan.count': "章";
53
+ readonly 'plan.empty': "暂无章节计划,请先生成";
54
+ readonly 'plan.chapter': "章";
55
+ readonly 'plan.pending': "待生成";
56
+ readonly 'plan.generating': "生成中";
57
+ readonly 'plan.written': "待审稿";
58
+ readonly 'plan.reviewing': "审稿中";
59
+ readonly 'plan.approved': "已通过";
60
+ readonly 'plan.rejected': "待修订";
61
+ readonly 'plan.error': "失败";
62
+ readonly 'plan.write': "生成本章";
63
+ readonly 'plan.rewrite': "修订";
64
+ readonly 'plan.review': "审稿";
65
+ readonly 'plan.polish': "去AI味";
66
+ readonly 'plan.writeAll': "批量生成全部";
67
+ readonly 'plan.writeAllPending': "批量生成剩余";
68
+ readonly 'plan.generated': "已生成";
69
+ readonly 'plan.progress': "进度";
70
+ readonly 'plan.beats': "剧情要点";
71
+ readonly 'plan.reviewReport': "审稿报告";
72
+ readonly 'plan.reviewScore': "评分";
73
+ readonly 'plan.reviewVerdict': "总评";
74
+ readonly 'plan.reviewIssues': "问题清单";
75
+ readonly 'plan.reviewPass': "通过";
76
+ readonly 'plan.reviewFail': "未通过";
77
+ readonly 'plan.approve': "手动通过";
78
+ readonly 'plan.summary': "章节摘要";
79
+ readonly 'plan.volumes': "卷";
80
+ readonly 'plan.noVolume': "未分卷";
81
+ readonly 'bible.title': "道藏";
82
+ readonly 'bible.gen': "AI 提炼道藏";
83
+ readonly 'bible.genre': "题材基调";
84
+ readonly 'bible.worldRules': "世界规则";
85
+ readonly 'bible.characters': "人物志";
86
+ readonly 'bible.redLines': "写作红线";
87
+ readonly 'bible.style': "风格要求";
88
+ readonly 'bible.none': "尚未生成道藏。生成后写作会严格遵守人设与金手指规则,审稿也会按红线检查。";
89
+ readonly 'foreshadow.title': "暗线管理";
90
+ readonly 'foreshadow.suggest': "AI 建议暗线";
91
+ readonly 'foreshadow.none': "暂无暗线";
92
+ readonly 'foreshadow.status': "状态";
93
+ readonly 'foreshadow.planned': "计划中";
94
+ readonly 'foreshadow.planted': "已埋设";
95
+ readonly 'foreshadow.progressing': "推进中";
96
+ readonly 'foreshadow.resolved': "已回收";
97
+ readonly 'foreshadow.abandoned': "已放弃";
98
+ readonly 'foreshadow.target': "预计回收";
99
+ readonly 'foreshadow.plantedAt': "埋设于";
100
+ readonly 'foreshadow.setPlanted': "标记已埋设";
101
+ readonly 'foreshadow.setResolved': "标记已回收";
102
+ readonly 'tab.facts': "编年录";
103
+ readonly 'tab.plotlines': "剧情线";
104
+ readonly 'plotlines.hint': "主线/支线/人物线/悬念线的推进管理:章节生成时会注入未完结的线,要求每章至少推进一条;关联章节记录推进节点。";
105
+ readonly 'plotlines.empty': "还没有剧情线——长篇小说建议先建主线与几条支线。";
106
+ readonly 'plotlines.new': "+ 新建剧情线";
107
+ readonly 'plotlines.name': "线名";
108
+ readonly 'plotlines.kind': "类型";
109
+ readonly 'plotlines.kindMain': "主线";
110
+ readonly 'plotlines.kindBranch': "支线";
111
+ readonly 'plotlines.kindCharacter': "人物线";
112
+ readonly 'plotlines.kindMystery': "悬念线";
113
+ readonly 'plotlines.goal': "目标/终点";
114
+ readonly 'plotlines.progress': "当前进度";
115
+ readonly 'plotlines.status': "状态";
116
+ readonly 'plotlines.statusActive': "推进中";
117
+ readonly 'plotlines.statusPaused': "暂停";
118
+ readonly 'plotlines.statusResolved': "已完结";
119
+ readonly 'plotlines.statusAbandoned': "已废弃";
120
+ readonly 'plotlines.save': "保存";
121
+ readonly 'plotlines.cancel': "取消";
122
+ readonly 'plotlines.edit': "编辑";
123
+ readonly 'plotlines.remove': "删除";
124
+ readonly 'plotlines.linkChapter': "关联本章";
125
+ readonly 'plotlines.chapters': "已关联";
126
+ readonly 'plotlines.workflowTitle': "剧情线进度";
127
+ readonly 'plotlines.workflowEmpty': "未建剧情线(去「剧情线」页创建)";
128
+ readonly 'sensitive.title': "敏感词检查";
129
+ readonly 'sensitive.scanAll': "🔞 全书敏感词检查";
130
+ readonly 'sensitive.hint': "内置违禁词库硬匹配(政治/擦边/暴力/辱骂/广告/其他),发布前建议检查;只做提示,是否修改由你判断。";
131
+ readonly 'sensitive.clean': "✅ 未命中任何违禁词(扫描 {n} 章)";
132
+ readonly 'sensitive.hits': "命中 {n} 处({chapters} 章受影响)";
133
+ readonly 'sensitive.goFix': "去修订";
134
+ readonly 'sensitive.fixPrefill': "请删除或替换正文中的违禁表达「{word}」(类别:{category}),用含蓄/间接的写法替代。";
135
+ readonly 'facts.title': "编年录 / 时间线({n} 条)";
136
+ readonly 'facts.hint': "每章生成后自动抽取「已确立事实」(人物状态/境界资源/关系变化/伏笔落地),最近 20 条注入后续章节生成,保证长期一致。";
137
+ readonly 'facts.backfill': "回填历史章节事实";
138
+ readonly 'facts.backfilled': "已从历史章节回填 {n} 条事实";
139
+ readonly 'settings.title': "设置";
140
+ readonly 'settings.outlinePath': "默认大纲路径";
141
+ readonly 'settings.outputDir': "输出目录";
142
+ readonly 'settings.provider': "模型提供商";
143
+ readonly 'settings.model': "模型";
144
+ readonly 'settings.modelCustom': "自定义…";
145
+ readonly 'settings.customProvider': "自定义提供商…";
146
+ readonly 'settings.edit': "编辑";
147
+ readonly 'settings.delete': "删除";
148
+ readonly 'settings.modelCustomPlaceholder': "输入任意模型 id";
149
+ readonly 'settings.savedModels': "我的模型";
150
+ readonly 'settings.modelCards': "模型卡片(内置 + 已添加)";
151
+ readonly 'settings.savedModelName': "名称";
152
+ readonly 'settings.addModel': "添加模型";
153
+ readonly 'settings.catalogRefresh': "刷新厂商";
154
+ readonly 'settings.refreshModels': "刷新模型";
155
+ readonly 'settings.savedModelsHint': "手动添加常用模型(provider + 模型 id),点击即可切换当前模型;厂商模式会写入 DSH 凭据并注册路由。";
156
+ readonly 'settings.testConnection': "测试连通";
157
+ readonly 'settings.testRunning': "测试中";
158
+ readonly 'settings.testOk': "连通";
159
+ readonly 'settings.testFail': "失败";
160
+ readonly 'settings.testHint': "真实发送一次最小调用(约几十 token),验证 Key / 端点 / 模型可用。";
161
+ readonly 'settings.reasoningSection': "推理强度";
162
+ readonly 'settings.reasoningEffort': "写作类任务思考强度 (reasoningEffort)";
163
+ readonly 'settings.reasoningHint': "章节生成/润色/重写/审稿等写作任务使用;关掉更省更快。";
164
+ readonly 'settings.analysisReasoning': "分析类任务思考强度(提炼/拆书/反推大纲)";
165
+ readonly 'settings.analysisReasoningHint': "角色/场景/道藏提炼、拆书、反推大纲等一次性分析任务默认 low,保证质量,不受上面写作档位影响。";
166
+ readonly 'settings.reasoning.off': "off · 关闭思考(推荐日常写文)";
167
+ readonly 'settings.reasoning.low': "low · 低思考";
168
+ readonly 'settings.reasoning.high': "high · 高思考";
169
+ readonly 'settings.reasoning.max': "max · 最高思考(质检/推演)";
170
+ readonly 'settings.theme': "主题";
171
+ readonly 'settings.themeLiquid': "iOS 液态玻璃(绿)";
172
+ readonly 'settings.themeNeumorph': "新拟物(双阴影)";
173
+ readonly 'settings.themeHint': "存于浏览器本地,即时生效";
174
+ readonly 'settings.chapterChars': "每章目标字数";
175
+ readonly 'settings.maxTokens': "单章最大输出 tokens";
176
+ readonly 'settings.reviewPassScore': "审稿通过分数(0-100)";
177
+ readonly 'settings.editorFontSize': "编辑器字号(仅编辑页显示)";
178
+ readonly 'settings.editorFontSizeHint': "存于浏览器本地,不影响其他设备";
179
+ readonly 'settings.autoReview': "生成后自动审稿";
180
+ readonly 'settings.autoAuthorReview': "生成后自动作者复盘";
181
+ readonly 'settings.autoAuthorReviewHint': "复盘钩子兑现/结尾钩子/剧情线推进/连续性/节奏趋势,每章约 2000 token";
182
+ readonly 'settings.autoReviewAfterRevise': "修订后自动审查";
183
+ readonly 'settings.autoReviewAfterReviseHint': "按意见修订/润色产出草稿后自动附带一次 AI 审查,直接显示新稿评分与剩余问题(每章约 2-3k token,可关)";
184
+ readonly 'settings.save': "保存设置";
185
+ readonly 'settings.saved': "设置已保存";
186
+ readonly 'settings.openFolder': "打开输出文件夹";
187
+ readonly 'settings.export': "导出";
188
+ readonly 'settings.exportTxt': "导出 TXT";
189
+ readonly 'settings.exportMd': "导出 Markdown";
190
+ readonly 'settings.exported': "已导出:{file}({chars} 字,{chapters} 章)";
191
+ readonly 'progress.generating': "正在生成第 {no} 章《{title}》…";
192
+ readonly 'progress.done': "第 {no} 章完成({chars} 字)→ {file}";
193
+ readonly 'progress.reviewed': "第 {no} 章审稿:{score} 分 — {verdict}";
194
+ readonly 'progress.error': "第 {no} 章失败:{message}";
195
+ readonly 'progress.rewriting': "正在修订第 {no} 章…";
196
+ readonly 'progress.polishing': "正在润色第 {no} 章…";
197
+ readonly 'progress.empty': "生成/审稿进度将显示在这里";
198
+ readonly 'assistant.hint': "和 AI 编辑讨论剧情、人设、暗线;达成一致后可让它直接修改总纲、道藏、章节内容。";
199
+ readonly 'assistant.placeholder': "例如:我想让第 2 章结尾加一个悬念——墟境里传来爷爷的声音…";
200
+ readonly 'assistant.send': "发送";
201
+ readonly 'assistant.toolStart': "⚙ 执行操作:{name}…";
202
+ readonly 'assistant.toolDone': "✓ {name} 完成:{detail}";
203
+ readonly 'assistant.toolError': "✗ {name} 失败:{detail}";
204
+ readonly 'assistant.empty': "还没有对话。和 AI 编辑聊聊剧情吧。";
205
+ readonly 'status.projectNone': "输出目录中还没有项目。请先加载大纲。";
206
+ readonly 'status.files': "已生成文件";
207
+ readonly 'api.error': "请求失败";
208
+ };
209
+ /** en dictionary (fallback). */
210
+ export declare const en: Record<string, string>;
211
+ /** Keys type for the zh dictionary. */
212
+ export type NovelKey = keyof typeof zh;