@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
@@ -8,7 +8,7 @@
8
8
  * Assets persist with the project (novel-project.json) and are injected into
9
9
  * generation / planning / review prompts, and available to the AI assistant.
10
10
  */
11
- import type { AntiAiRule, GenreNode, PlotBeatTemplate, ProgressionMode, ProjectAssets, StyleAsset, StyleTemplate } from './protocol.ts';
11
+ import type { AntiAiRule, GenreNode, PlotBeatTemplate, ProgressionMode, ProjectAssets, StarterStyleProfile, StyleAsset, StyleTemplate } from './protocol.ts';
12
12
  /** 预置写法模板(来自 AI-Novel-Writing-Assistant 内置 DEFAULT_STYLE_TEMPLATES)。 */
13
13
  export declare const BUILTIN_STYLE_TEMPLATES: StyleTemplate[];
14
14
  /** 内置全局反 AI 规则(来自 AI-Novel-Writing-Assistant 内置 DEFAULT_ANTI_AI_RULES)。 */
@@ -23,7 +23,12 @@ export declare const BUILTIN_PLOT_BEATS: PlotBeatTemplate[];
23
23
  export declare function emptyProjectAssets(): ProjectAssets;
24
24
  /** 合并项目资产与内置库:返回「生效的反 AI 规则」(内置全局 + 项目自定义)。 */
25
25
  export declare function effectiveAntiAiRules(assets: ProjectAssets | undefined): AntiAiRule[];
26
- /** 把生效规则渲染成提示词块(禁止/鼓励分列,压缩省 token)。 */
26
+ /** 安定 key:内置规则全局基线(globalBaselineEnabled)在新书/旧书一律生效。 */
27
+ export declare function ensureGlobalBaseline(assets: ProjectAssets | undefined): ProjectAssets;
28
+ /** 内置库种子化 upsert(对齐上游 SystemResourceBootstrapService 精神)。
29
+ * missing_only 仅补齐缺失的全局基线规则;sync_existing 还会按 key 刷新已内置规则的结构化字段。 */
30
+ export declare function ensureBuiltinAssets(assets: ProjectAssets | undefined, mode?: 'missing_only' | 'sync_existing'): ProjectAssets;
31
+ /** 把生效规则渲染成提示词块(禁止/风险/鼓励三档分列,压缩省 token)。 */
27
32
  export declare function renderAntiAiRules(assets: ProjectAssets | undefined): string;
28
33
  /** 渲染题材与推进模式提示词块。 */
29
34
  export declare function renderGenreAndProgression(assets: ProjectAssets | undefined): string;
@@ -33,5 +38,13 @@ export declare function renderStyleAssets(assets: ProjectAssets | undefined): st
33
38
  export declare function renderAllAssets(assets: ProjectAssets | undefined): string;
34
39
  /** 预置写法模板 → 可直接绑定的 StyleAsset。 */
35
40
  export declare function styleTemplateToAsset(template: StyleTemplate): StyleAsset;
36
- /** 写法引擎:从样本文本提取风格资产的系统提示词。 */
41
+ /** 起始风格画像库:无样本文本也能快速绑定一套写法(对齐上游 DEFAULT_STARTER_STYLE_PROFILES)。 */
42
+ export declare const BUILTIN_STARTER_STYLE_PROFILES: StarterStyleProfile[];
43
+ /** 起始风格画像 → 可直接绑定的 StyleAsset(绑定对应模板,名称用画像名)。 */
44
+ export declare function starterProfileToAsset(profile: StarterStyleProfile): StyleAsset | null;
45
+ /** 根据指纹风险推荐仿写预设:low→imitate / medium→balanced / high→transfer。 */
46
+ export declare function recommendStylePreset(fingerprintRisk?: 'low' | 'medium' | 'high'): 'imitate' | 'balanced' | 'transfer';
47
+ /** 写法引擎:从样本文本提取风格资产的系统提示词(含 preset / 指纹 / 净化管线)。 */
37
48
  export declare function styleEngineSystemPrompt(): string;
49
+ /** 写作公式提取系统提示词(分层:basic 骨架 / standard 完整 / deep 逐句细化)。 */
50
+ export declare function styleFormulaSystemPrompt(depth: 'basic' | 'standard' | 'deep'): string;
@@ -41,5 +41,9 @@ export declare function runAssistantTurn(ctx: Context, config: NovelConfig, proj
41
41
  frame: 'toolDelta';
42
42
  name: string;
43
43
  text: string;
44
+ } | {
45
+ frame: 'toolResult';
46
+ name: string;
47
+ text: string;
44
48
  }, void, unknown>;
45
49
  export { chapterFileName };
@@ -8,6 +8,7 @@ import { type AssetsPatch, type AssetsResponse, type AddModelRequest, type AddMo
8
8
  export declare class NovelApiError extends Error {
9
9
  constructor(message: string);
10
10
  }
11
+ export declare function setCurrentBook(id: string | null): void;
11
12
  /** The browser half's only data entry point. */
12
13
  export declare class NovelApi {
13
14
  status(): Promise<StatusResponse>;
@@ -65,6 +66,94 @@ export declare class NovelApi {
65
66
  }>;
66
67
  /** 全书一致性质检。 */
67
68
  audit(): Promise<import('../protocol.ts').AuditResponse>;
69
+ /** 热门题材雷达:信号 + 生产底座。 */
70
+ marketRadar(req: import('../protocol.ts').MarketRadarRequest): Promise<{
71
+ result: import('../protocol.ts').MarketRadarResult;
72
+ }>;
73
+ /** 真实榜单扫榜:抓取公开榜单,返回分组候选。 */
74
+ marketRadarScan(req: {
75
+ platforms?: string[];
76
+ }): Promise<{
77
+ result: {
78
+ scannedAt: string;
79
+ groups: any[];
80
+ };
81
+ }>;
82
+ /** 把雷达生产底座里的新资产同步进全局资源库(跨书复用;已有名字跳过)。 */
83
+ marketRadarSync(req: {
84
+ foundation: import('../protocol.ts').ProductionFoundation;
85
+ }): Promise<{
86
+ ok: boolean;
87
+ synced: {
88
+ genre: boolean;
89
+ primaryMode: boolean;
90
+ secondaryMode: boolean;
91
+ };
92
+ }>;
93
+ /** 书内知识库:读取。 */
94
+ knowledgeList(): Promise<{
95
+ docs: import('../protocol.ts').KnowledgeDoc[];
96
+ }>;
97
+ /** 书内知识库:新增。 */
98
+ knowledgeAdd(doc: {
99
+ title: string;
100
+ content: string;
101
+ }): Promise<{
102
+ docs: import('../protocol.ts').KnowledgeDoc[];
103
+ }>;
104
+ /** 书内知识库:删除。 */
105
+ knowledgeRemove(id: string): Promise<{
106
+ docs: import('../protocol.ts').KnowledgeDoc[];
107
+ }>;
108
+ /** 书分析/拆书。 */
109
+ bookAnalysis(text: string): Promise<{
110
+ result: import('../protocol.ts').BookAnalysisResult;
111
+ }>;
112
+ /** 创意灵感。 */
113
+ ideaInspiration(idea: string, count?: number): Promise<{
114
+ result: import('../protocol.ts').IdeaInspirationResult;
115
+ }>;
116
+ /** 雷达→灵感:基于市场信号/生产底座/创意简报生成开书灵感。 */
117
+ marketIdeaInspiration(req: {
118
+ signals?: import('../protocol.ts').MarketRadarSignal[];
119
+ foundation?: import('../protocol.ts').ProductionFoundation;
120
+ brief?: import('../protocol.ts').MarketCreativeBrief;
121
+ count?: number;
122
+ }): Promise<{
123
+ result: import('../protocol.ts').IdeaInspirationResult;
124
+ }>;
125
+ /** 自动导演编排建议:基于全书上下文。 */
126
+ director(focus?: string): Promise<{
127
+ result: import('../protocol.ts').DirectorAdvice;
128
+ }>;
129
+ /** 自动导演「采纳」出的书内待办:读取。 */
130
+ directorTodosList(): Promise<{
131
+ todos: import('../protocol.ts').DirectorTodo[];
132
+ }>;
133
+ /** 待办:新增(来源 risk/fix)。 */
134
+ directorTodosAdd(text: string, source: 'risk' | 'fix'): Promise<{
135
+ todos: import('../protocol.ts').DirectorTodo[];
136
+ }>;
137
+ /** 待办:勾选/取消。 */
138
+ directorTodosToggle(id: string): Promise<{
139
+ todos: import('../protocol.ts').DirectorTodo[];
140
+ }>;
141
+ /** 待办:删除。 */
142
+ directorTodosRemove(id: string): Promise<{
143
+ todos: import('../protocol.ts').DirectorTodo[];
144
+ }>;
145
+ /** 用选中的市场信号 + 影响模式生成开书创意简报。 */
146
+ marketRadarBrief(req: import('../protocol.ts').MarketRadarBriefRequest): Promise<{
147
+ creativeBrief: import('../protocol.ts').MarketCreativeBrief;
148
+ }>;
149
+ /** 把雷达生产底座一键应用到某本书(写入项目资产/开书定盘)。 */
150
+ marketRadarApply(req: {
151
+ bookId?: string;
152
+ foundation: import('../protocol.ts').ProductionFoundation;
153
+ }): Promise<{
154
+ ok: boolean;
155
+ bookName: string;
156
+ }>;
68
157
  /** 角色卡刷新(基于事实库聚合)。 */
69
158
  charactersRefresh(): Promise<{
70
159
  cards: import('../protocol.ts').RoleStatusCard[];
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 浏览器端「AI 创作实况」钩子:连接 /llm-live/stream (SSE),按 LLM 调用分组会话。
3
+ * 轻量实现,不持久化缓存(对齐上游 useLlmLiveFeed 的核心行为)。
4
+ */
5
+ export interface LlmLiveFrame {
6
+ type: 'session_started' | 'output_delta' | 'reasoning_delta' | 'phase_changed' | 'session_completed';
7
+ sessionId: string;
8
+ label?: string;
9
+ model?: string;
10
+ at: string;
11
+ content?: string;
12
+ totalChars?: number;
13
+ totalReasoningChars?: number;
14
+ phase?: 'requesting' | 'streaming' | 'completed' | 'failed';
15
+ phaseMessage?: string;
16
+ preview?: string;
17
+ error?: string;
18
+ }
19
+ export interface LlmLiveSession {
20
+ sessionId: string;
21
+ label: string;
22
+ model?: string;
23
+ phase: 'requesting' | 'streaming' | 'completed' | 'failed';
24
+ phaseMessage: string;
25
+ preview: string;
26
+ totalChars: number;
27
+ startedAt: string;
28
+ updatedAt: string;
29
+ }
30
+ export declare function useLlmLiveFeed(enabled?: boolean): {
31
+ connected: boolean;
32
+ sessions: LlmLiveSession[];
33
+ };
@@ -18,7 +18,7 @@ export declare const zh: {
18
18
  readonly 'tab.plan': "章节";
19
19
  readonly 'tab.bible': "道藏";
20
20
  readonly 'tab.foreshadow': "暗线";
21
- readonly 'tab.assistant': "AI 助手";
21
+ readonly 'tab.assistant': "AI 编辑 Agent";
22
22
  readonly 'tab.settings': "设置";
23
23
  readonly 'workflow.title': "创作工作台";
24
24
  readonly 'workflow.step1': "① 加载总纲";
@@ -195,13 +195,13 @@ export declare const zh: {
195
195
  readonly 'progress.rewriting': "正在修订第 {no} 章…";
196
196
  readonly 'progress.polishing': "正在润色第 {no} 章…";
197
197
  readonly 'progress.empty': "生成/审稿进度将显示在这里";
198
- readonly 'assistant.hint': "和 AI 编辑讨论剧情、人设、暗线;达成一致后可让它直接修改总纲、道藏、章节内容。";
198
+ readonly 'assistant.hint': "和 AI 编辑 Agent 讨论剧情、人设、暗线;达成一致后可让它直接修改总纲、道藏、章节内容。";
199
199
  readonly 'assistant.placeholder': "例如:我想让第 2 章结尾加一个悬念——墟境里传来爷爷的声音…";
200
200
  readonly 'assistant.send': "发送";
201
201
  readonly 'assistant.toolStart': "⚙ 执行操作:{name}…";
202
202
  readonly 'assistant.toolDone': "✓ {name} 完成:{detail}";
203
203
  readonly 'assistant.toolError': "✗ {name} 失败:{detail}";
204
- readonly 'assistant.empty': "还没有对话。和 AI 编辑聊聊剧情吧。";
204
+ readonly 'assistant.empty': "还没有对话。和 AI 编辑 Agent 聊聊剧情吧。";
205
205
  readonly 'status.projectNone': "输出目录中还没有项目。请先加载大纲。";
206
206
  readonly 'status.files': "已生成文件";
207
207
  readonly 'api.error': "请求失败";
@@ -2,4 +2,4 @@ import type { NovelApi } from '../api.ts';
2
2
  export declare function AdaptModeView({ api, onOpenBook }: {
3
3
  api: NovelApi;
4
4
  onOpenBook?: (id: string) => void;
5
- }): import("react").JSX.Element;
5
+ }): any;
@@ -8,5 +8,5 @@ export interface AssetsTabProps {
8
8
  /** 写作资产子页签。 */
9
9
  type AssetSubTab = 'genre' | 'progression' | 'templates' | 'rules' | 'style';
10
10
  /** 写作资产页签。 */
11
- export declare function AssetsTab({ api, initialTab }: AssetsTabProps): import("react").JSX.Element;
11
+ export declare function AssetsTab({ api, initialTab }: AssetsTabProps): any;
12
12
  export {};
@@ -4,4 +4,4 @@ export interface AssistantTabProps {
4
4
  api: NovelApi;
5
5
  }
6
6
  /** The assistant conversation tab. */
7
- export declare function AssistantTab({ api }: AssistantTabProps): import("react").JSX.Element;
7
+ export declare function AssistantTab({ api }: AssistantTabProps): any;
@@ -1,4 +1,4 @@
1
1
  import type { NovelApi } from '../api.ts';
2
2
  export declare function AuthorAssetsView({ api }: {
3
3
  api: NovelApi;
4
- }): import("react").JSX.Element;
4
+ }): any;
@@ -1,13 +1,15 @@
1
1
  import type { NovelApi } from '../api.ts';
2
2
  import type { BookshelfSnapshot } from '../../protocol.ts';
3
3
  import { type ProgressLine } from './ProgressConsole.tsx';
4
- export declare function AuthorHome({ api, shelf, onOpenBook, onReadBook, onAddBook, onImportBook, onOpenSettings, onTheme, onBackground, onOpacity, onEndfieldAccent, adaptEnabled, progress, busy, busyLabel, liveBar, onClearProgress }: {
4
+ export declare function AuthorHome({ api, shelf, onOpenBook, onReadBook, onAddBook, onImportBook, onOpenSettings, onTheme, onBackground, onOpacity, onEndfieldAccent, adaptEnabled, progress, busy, busyLabel, liveBar, onClearProgress, onUseIdea }: {
5
5
  api: NovelApi;
6
6
  shelf: BookshelfSnapshot;
7
7
  onOpenBook: (id: string) => void;
8
8
  onReadBook: (id: string) => void;
9
9
  onAddBook: () => void;
10
10
  onImportBook: () => void;
11
+ /** 创意灵感 → 采纳某个灵感带入开书向导。 */
12
+ onUseIdea?: (idea: import('../../protocol.ts').IdeaInspirationResult['ideas'][number]) => void;
11
13
  /** 兼容旧入口:首页设置现为独立设置页,此回调保留但不再使用。 */
12
14
  onOpenSettings?: () => void;
13
15
  /** 主题/模式/密度变化回调(供面板根容器实时生效)。 */
@@ -29,4 +31,4 @@ export declare function AuthorHome({ api, shelf, onOpenBook, onReadBook, onAddBo
29
31
  ratio?: number;
30
32
  } | null;
31
33
  onClearProgress?: () => void;
32
- }): import("react").JSX.Element;
34
+ }): any;
@@ -0,0 +1,4 @@
1
+ import type { NovelApi } from '../api.ts';
2
+ export default function BookAnalysisView({ api }: {
3
+ api: NovelApi;
4
+ }): JSX.Element;
@@ -8,4 +8,4 @@ export interface BookshelfBarProps {
8
8
  onSwitch: () => void;
9
9
  }
10
10
  /** 书架条。 */
11
- export declare function BookshelfBar({ api, shelf, onSwitch }: BookshelfBarProps): import("react").JSX.Element;
11
+ export declare function BookshelfBar({ api, shelf, onSwitch }: BookshelfBarProps): any;
@@ -1,9 +1,13 @@
1
1
  import type { NovelApi } from '../api.ts';
2
2
  /** 开书向导页。 */
3
- export declare function CreateBookView({ api, onBack, onCreated, }: {
3
+ export declare function CreateBookView({ api, onBack, onCreated, initialIdea, initialName, }: {
4
4
  api: NovelApi;
5
5
  /** 返回书架。 */
6
6
  onBack: () => void;
7
7
  /** 开书成功:进入新书工作台。 */
8
8
  onCreated: (id: string) => void;
9
- }): import("react").JSX.Element;
9
+ /** 从「创意灵感」带过来的起步想法(预填到「一句话想法」输入框)。 */
10
+ initialIdea?: string;
11
+ /** 从「创意灵感」带过来的初始书名。 */
12
+ initialName?: string;
13
+ }): any;
@@ -0,0 +1,7 @@
1
+ import type { NovelApi } from '../api.ts';
2
+ import type { DirectorTodo } from '../../protocol.ts';
3
+ export default function DirectorView({ api, todos, onTodosChange }: {
4
+ api: NovelApi;
5
+ todos: DirectorTodo[];
6
+ onTodosChange?: (todos: DirectorTodo[]) => void;
7
+ }): JSX.Element;
@@ -19,4 +19,4 @@ export declare function FlowGuide({ project, onNavigate, exported, }: {
19
19
  project: ProjectState | null;
20
20
  onNavigate: (target: FlowTarget) => void;
21
21
  exported?: boolean;
22
- }): import("react").JSX.Element;
22
+ }): any;
@@ -1,4 +1,4 @@
1
1
  import type { NovelApi } from '../api.ts';
2
2
  export declare function GlobalAssetLibraryView({ api }: {
3
3
  api: NovelApi;
4
- }): import("react").JSX.Element;
4
+ }): any;
@@ -0,0 +1,6 @@
1
+ import type { NovelApi } from '../api.ts';
2
+ import type { IdeaInspirationResult } from '../../protocol.ts';
3
+ export default function IdeaInspirationView({ api, onUseIdea }: {
4
+ api: NovelApi;
5
+ onUseIdea?: (idea: IdeaInspirationResult['ideas'][number]) => void;
6
+ }): JSX.Element;
@@ -4,4 +4,4 @@ export declare function ImportModal({ api, onClose, onImported, }: {
4
4
  onClose: () => void;
5
5
  /** 导入成功并已激活该书后回调(刷新书架)。 */
6
6
  onImported: () => void | Promise<void>;
7
- }): import("react").JSX.Element;
7
+ }): any;
@@ -0,0 +1,4 @@
1
+ import type { NovelApi } from '../api.ts';
2
+ export default function KnowledgeBaseView({ api }: {
3
+ api: NovelApi;
4
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 「实时调用 / LIVE」—— 内嵌到 AI 进度窗的下半区(详情层),不再独立浮窗。
3
+ * 连接 /llm-live/stream,按 LLM 调用分组展示模型实时输出。
4
+ */
5
+ export default function LiveFeedLog(): JSX.Element;
@@ -17,4 +17,4 @@ export declare function MangaRoleLibrary({ api, project, refresh, styleId, filte
17
17
  /** 全局当前章节(从工作台顶部导航条传入)。 */
18
18
  chapterNo?: number | null;
19
19
  onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
20
- }): import("react").JSX.Element;
20
+ }): any;
@@ -9,4 +9,4 @@ export declare function MangaWorkspace({ api, project, chapters, onProjectChange
9
9
  /** 是否启用生图(漫剧卡出定妆图)。 */
10
10
  /** 上报到「AI进度」控制台(漫剧工作台内所有 LLM/方案操作)。 */
11
11
  onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
12
- }): import("react").JSX.Element;
12
+ }): any;
@@ -0,0 +1,5 @@
1
+ import type { NovelApi } from '../api.ts';
2
+ export default function MarketRadarView({ api, bookId }: {
3
+ api: NovelApi;
4
+ bookId?: string;
5
+ }): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import type { NovelApi } from '../api.ts';
2
2
  import type { PanelController } from './controller.ts';
3
3
  /** The panel's tab identifiers. */
4
- export type NovelTab = 'workflow' | 'overview' | 'blurb' | 'plan' | 'bible' | 'world' | 'foreshadow' | 'assistant' | 'settings' | 'characters' | 'roles' | 'facts' | 'plotlines' | 'reviews' | 'progress' | 'breakdown' | 'assetsGenre' | 'assetsProgression' | 'assetsTemplates' | 'assetsRules' | 'assetsStyle' | 'run' | 'manhua' | 'book' | 'assets';
4
+ export type NovelTab = 'workflow' | 'overview' | 'blurb' | 'plan' | 'bible' | 'world' | 'foreshadow' | 'assistant' | 'settings' | 'characters' | 'roles' | 'facts' | 'plotlines' | 'reviews' | 'progress' | 'breakdown' | 'director' | 'knowledge' | 'assetsGenre' | 'assetsProgression' | 'assetsTemplates' | 'assetsRules' | 'assetsStyle' | 'run' | 'manhua' | 'book' | 'assets';
5
5
  /** Panel shell props. */
6
6
  export interface NovelPanelProps {
7
7
  /** The panel state owner (open/close/toggle). */
@@ -10,4 +10,4 @@ export interface NovelPanelProps {
10
10
  api: NovelApi;
11
11
  }
12
12
  /** The novel-forge panel. */
13
- export declare function NovelPanel({ controller, api }: NovelPanelProps): import("react").JSX.Element;
13
+ export declare function NovelPanel({ controller, api }: NovelPanelProps): any;
@@ -14,4 +14,4 @@ export declare function ProgressConsole({ progress, busy, busyLabel, liveBar, on
14
14
  ratio?: number;
15
15
  } | null;
16
16
  onClear: () => void;
17
- }): import("react").JSX.Element;
17
+ }): any;
@@ -2,4 +2,4 @@ import type { BookshelfSnapshot } from '../../protocol.ts';
2
2
  export declare function ProgressHomeView({ shelf, onOpenBook }: {
3
3
  shelf: BookshelfSnapshot;
4
4
  onOpenBook: (id: string) => void;
5
- }): import("react").JSX.Element;
5
+ }): any;
@@ -5,4 +5,4 @@ export declare function PropLibrary({ api, project, refresh, onProgress, }: {
5
5
  project: ProjectState | null;
6
6
  refresh: () => void | Promise<void>;
7
7
  onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
8
- }): import("react").JSX.Element;
8
+ }): any;
@@ -5,4 +5,4 @@ export declare function ReaderView({ api, project, onBack, onOpenWorkspace, }: {
5
5
  project: ProjectState;
6
6
  onBack: () => void;
7
7
  onOpenWorkspace: () => void;
8
- }): import("react").JSX.Element;
8
+ }): any;
@@ -2,4 +2,4 @@ import type { NovelApi } from '../api.ts';
2
2
  export declare function RunPanel({ api, totalChapters }: {
3
3
  api: NovelApi;
4
4
  totalChapters: number;
5
- }): import("react").JSX.Element;
5
+ }): any;
@@ -13,4 +13,4 @@ export declare function SceneLibrary({ api, project, refresh, styleId, filterId,
13
13
  chapterNo?: number | null;
14
14
  /** 上报到「AI进度」控制台。 */
15
15
  onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
16
- }): import("react").JSX.Element;
16
+ }): any;
@@ -12,5 +12,5 @@ export declare function SettingsView({ api, onTheme, onSettingsTab, onEditorFont
12
12
  onBackground?: (bg: string | undefined, blur: number) => void;
13
13
  onOpacity?: (n: number) => void;
14
14
  onEndfieldAccent?: (accent: EndfieldAccent) => void;
15
- }): import("react").JSX.Element;
15
+ }): any;
16
16
  export {};
@@ -12,4 +12,4 @@ export declare function ShelfView({ api, shelf, onOpenBook, onReadBook, onAddBoo
12
12
  onAddBook: () => void;
13
13
  /** 点击「导入」:打开导入弹窗(已有项目目录 / txt/md 全本)。 */
14
14
  onImportBook: () => void;
15
- }): import("react").JSX.Element;
15
+ }): any;
@@ -16,4 +16,4 @@ export declare function StoryboardTab({ api, project, chapters, onProjectChanged
16
16
  onGoStep?: (n: 1 | 2 | 3) => void;
17
17
  /** 上报到「AI进度」控制台(分镜三步生成)。 */
18
18
  onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
19
- }): import("react").JSX.Element;
19
+ }): any;
@@ -5,4 +5,4 @@ export declare function StyleCard({ style, selected, onClick, }: {
5
5
  selected?: boolean;
6
6
  /** 点击卡片(选风格)。 */
7
7
  onClick?: () => void;
8
- }): import("react").JSX.Element;
8
+ }): any;
@@ -1 +1 @@
1
- export declare function StyleGallery(): import("react").JSX.Element;
1
+ export declare function StyleGallery(): any;
@@ -7,4 +7,4 @@ export declare function WorldTab({ api, world, onChanged, }: {
7
7
  world: WorldState | undefined;
8
8
  /** 保存/提炼成功后由父组件刷新项目状态。 */
9
9
  onChanged: (world: WorldState) => void;
10
- }): import("react").JSX.Element;
10
+ }): any;
@@ -12,7 +12,7 @@
12
12
  */
13
13
  export declare const COMPLIANCE_REDLINES: ReadonlyArray<string>;
14
14
  import type { Context } from '@deepseek-ai/cordis';
15
- import type { AdaptationDimension, AdaptAnalyzeResponse, AdaptationMapping, AdaptationRules, AdaptProposeResponse, AuditIssue, AuthorReview, BreakdownResponse, ChapterPlan, Foreshadow, NovelConfig, OutlineCandidate, Plotline, PlotlineHealthReport, PlotlinePlan, ProjectState, ReviewReport, RoleRecord, RoleStatusCard, SceneCard, StoryBible, StoryboardSkeleton, StoryboardTable, StoryboardPrompt, AddModelRequest, AddModelResponse, LlmModelsResponse, LlmVendorsResponse, LlmProvidersResponse, RemoveProviderRequest, RemoveProviderResponse, LlmTestResponse, MangaRoleCandidate, Prop, Volume, WorldState, AdaptMaterializeRequest, AdaptMaterializeResponse, AdaptMaterializeSaveRequest, AdaptMaterializeSaveResponse } from './protocol.ts';
15
+ import type { AdaptationDimension, AdaptAnalyzeResponse, AdaptationMapping, AdaptationRules, AdaptProposeResponse, AuditIssue, AuthorReview, BreakdownResponse, ChapterPlan, Foreshadow, NovelConfig, OutlineCandidate, Plotline, PlotlineHealthReport, PlotlinePlan, ProjectState, ReviewReport, RoleRecord, RoleStatusCard, SceneCard, StoryBible, StoryboardSkeleton, StoryboardTable, StoryboardPrompt, AddModelRequest, AddModelResponse, LlmModelsResponse, LlmVendorsResponse, LlmProvidersResponse, RemoveProviderRequest, RemoveProviderResponse, LlmTestResponse, MangaRoleCandidate, Prop, Volume, WorldState, AdaptMaterializeRequest, AdaptMaterializeResponse, AdaptMaterializeSaveRequest, AdaptMaterializeSaveResponse, MarketRadarRequest, MarketRadarResult, MarketRadarSignal, MarketRadarBriefRequest, ProductionFoundation, MarketCreativeBrief, BookAnalysisRequest, BookAnalysisResult, IdeaInspirationRequest, IdeaInspirationResult, DirectorRequest, DirectorAdvice } from './protocol.ts';
16
16
  /** Project state file name inside the output dir. */
17
17
  export declare const PROJECT_FILE = "novel-project.json";
18
18
  /** Chapter output file name, e.g. 第001章_开篇.md */
@@ -361,7 +361,35 @@ export declare function extractStyleAsset(ctx: Context, config: NovelConfig, sam
361
361
  dialogueRules: string[];
362
362
  descriptionRules: string[];
363
363
  boundaries: string[];
364
+ preset?: 'imitate' | 'balanced' | 'transfer';
365
+ fingerprintRisk?: 'low' | 'medium' | 'high';
366
+ writingGuidance?: string[];
367
+ forbiddenEntities?: string[];
364
368
  }>;
369
+ /** 分层提取写作公式(basic/standard/deep)。 */
370
+ export declare function extractStyleFormula(ctx: Context, config: NovelConfig, sampleText: string, depth: 'basic' | 'standard' | 'deep'): Promise<{
371
+ name: string;
372
+ focusAreas: string[];
373
+ formula: string;
374
+ applyGuidance: string;
375
+ }>;
376
+ /** 题材雷达:输入平台/题材/榜单文本 → 信号 + 生产底座 + 开书创意。 */
377
+ export declare function runMarketRadar(ctx: Context, config: NovelConfig, req: MarketRadarRequest): Promise<MarketRadarResult>;
378
+ /** 开书创意简报:用选中的市场信号 + 影响模式生成可执行 constraint / creative seed。 */
379
+ export declare function runMarketCreativeBrief(ctx: Context, config: NovelConfig, req: MarketRadarBriefRequest): Promise<MarketCreativeBrief>;
380
+ /** 书分析/拆书:输入一本书/章节文本 → 卖点/结构/可借鉴点/风险。 */
381
+ export declare function runBookAnalysis(ctx: Context, config: NovelConfig, req: BookAnalysisRequest): Promise<BookAnalysisResult>;
382
+ /** 创意灵感:一句话/题材 → 多方向开书灵感。 */
383
+ export declare function runIdeaInspiration(ctx: Context, config: NovelConfig, req: IdeaInspirationRequest): Promise<IdeaInspirationResult>;
384
+ /** 雷达→灵感:基于市场信号/生产底座/创意简报,生成贴合市场的开书灵感。 */
385
+ export declare function runMarketIdeaInspiration(ctx: Context, config: NovelConfig, req: {
386
+ signals?: MarketRadarSignal[];
387
+ foundation?: ProductionFoundation;
388
+ brief?: MarketCreativeBrief;
389
+ count?: number;
390
+ }): Promise<IdeaInspirationResult>;
391
+ /** 自动导演编排建议:基于全书上下文,给出下一卷/阶段编排 + 修复再平衡。 */
392
+ export declare function runDirectorAdvice(ctx: Context, config: NovelConfig, project: ProjectState, req: DirectorRequest): Promise<DirectorAdvice>;
365
393
  /** Export the whole book as one txt/md file. */
366
394
  export declare function exportBook(outputDir: string, project: ProjectState, format: 'txt' | 'md'): {
367
395
  file: string;
@@ -0,0 +1,6 @@
1
+ import type { GenreNode, ProgressionMode } from './protocol.ts';
2
+ export declare function globalGenreLibrary(): GenreNode[];
3
+ export declare function globalProgressionLibrary(): ProgressionMode[];
4
+ /** 新增/已有则跳过;返回 true=新增。 */
5
+ export declare function addGlobalGenre(g: GenreNode): boolean;
6
+ export declare function addGlobalMode(m: ProgressionMode): boolean;
@@ -33,6 +33,12 @@ export interface Config {
33
33
  provider?: string;
34
34
  /** LLM model id. */
35
35
  model?: string;
36
+ /** 任务级模型路由:正文生成模型(留空则跟随 model)。 */
37
+ generateModel?: string;
38
+ /** 任务级模型路由:审稿模型(留空则跟随 model)。 */
39
+ reviewModel?: string;
40
+ /** 任务级模型路由:AI 复核/质检模型(留空则跟随 model)。 */
41
+ auditModel?: string;
36
42
  /** LLM reasoning effort (off/low/high/max). */
37
43
  reasoningEffort?: 'off' | 'low' | 'high' | 'max';
38
44
  /** 分析类任务(提炼/拆书/反推大纲等)的推理档位;默认 low。 */
@@ -0,0 +1,44 @@
1
+ /**
2
+ * LLM 实况 feed(对齐上游「AI 创作实况 / LIVE LOG」的轻量实现)。
3
+ *
4
+ * 以「每次 LLM 调用」为粒度,把生命周期事件(开始/流式正文/阶段变化/完成)推给订阅者,
5
+ * 并提供环形缓冲供新连上的客户端重放。不持久化(与上游缓存不同,如需成 cache 再扩展)。
6
+ */
7
+ export type LlmLivePhase = 'requesting' | 'streaming' | 'completed' | 'failed';
8
+ export interface LlmLiveFrame {
9
+ type: 'session_started' | 'output_delta' | 'reasoning_delta' | 'phase_changed' | 'session_completed';
10
+ /** 由服务端生成,形如 ll-<n>。 */
11
+ sessionId: string;
12
+ /** 本次调用用途(如 正文生成/审稿/章节规划)。 */
13
+ label?: string;
14
+ /** 使用模型(用于展示)。 */
15
+ model?: string;
16
+ /** 事件时间(ISO)。 */
17
+ at: string;
18
+ /** session_started / 部分帧:交互上下文。 */
19
+ context?: {
20
+ taskId?: string;
21
+ interactionId: string;
22
+ };
23
+ /** output_delta / reasoning_delta:本次增量文本。 */
24
+ content?: string;
25
+ /** session 累计字符数。 */
26
+ totalChars?: number;
27
+ /** reasoning 累计字符数。 */
28
+ totalReasoningChars?: number;
29
+ /** phase_changed:新阶段。 */
30
+ phase?: LlmLivePhase;
31
+ /** phase_changed:阶段描述。 */
32
+ phaseMessage?: string;
33
+ /** session_completed:最终预览(截断)。 */
34
+ preview?: string;
35
+ /** session_completed:失败信息。 */
36
+ error?: string;
37
+ }
38
+ type Listener = (frame: LlmLiveFrame) => void;
39
+ export declare function nextSessionId(): string;
40
+ export declare function subscribeLiveFeed(listener: Listener): () => void;
41
+ export declare function emitLive(frame: LlmLiveFrame): void;
42
+ export declare function liveLatest(): LlmLiveFrame[];
43
+ export declare function clearLiveFeed(): void;
44
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 热门题材雷达:真实榜单扫榜(聚合各平台榜单源,容错)。
3
+ */
4
+ import { type CollectedRankingItem, type MarketRadarPlatform } from './market-radar-sources.ts';
5
+ export interface MarketRadarGroup {
6
+ platform: MarketRadarPlatform;
7
+ platformLabel: string;
8
+ listKey: string;
9
+ listLabel: string;
10
+ status: 'ok' | 'error';
11
+ error?: string;
12
+ items: CollectedRankingItem[];
13
+ }
14
+ export interface MarketScanResult {
15
+ scannedAt: string;
16
+ groups: MarketRadarGroup[];
17
+ }
18
+ export declare function getLastMarketScan(): MarketScanResult | null;
19
+ export declare function scanMarketRanking(platforms?: string[]): Promise<MarketScanResult>;