@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.
- package/README.md +97 -2
- package/lib/client.js +3291 -752
- package/lib/index.js +3557 -237
- package/lib/types/assets.d.ts +16 -3
- package/lib/types/assistant.d.ts +4 -0
- package/lib/types/client/api.d.ts +89 -0
- package/lib/types/client/llmLive.d.ts +33 -0
- package/lib/types/client/locales.d.ts +3 -3
- package/lib/types/client/panel/AdaptModeView.d.ts +1 -1
- package/lib/types/client/panel/AssetsTab.d.ts +1 -1
- package/lib/types/client/panel/AssistantTab.d.ts +1 -1
- package/lib/types/client/panel/AuthorAssetsView.d.ts +1 -1
- package/lib/types/client/panel/AuthorHome.d.ts +4 -2
- package/lib/types/client/panel/BookAnalysisView.d.ts +4 -0
- package/lib/types/client/panel/BookshelfBar.d.ts +1 -1
- package/lib/types/client/panel/CreateBookView.d.ts +6 -2
- package/lib/types/client/panel/DirectorView.d.ts +7 -0
- package/lib/types/client/panel/FlowGuide.d.ts +1 -1
- package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +1 -1
- package/lib/types/client/panel/IdeaInspirationView.d.ts +6 -0
- package/lib/types/client/panel/ImportModal.d.ts +1 -1
- package/lib/types/client/panel/KnowledgeBaseView.d.ts +4 -0
- package/lib/types/client/panel/LiveFeedLog.d.ts +5 -0
- package/lib/types/client/panel/MangaRoleLibrary.d.ts +1 -1
- package/lib/types/client/panel/MangaWorkspace.d.ts +1 -1
- package/lib/types/client/panel/MarketRadarView.d.ts +5 -0
- package/lib/types/client/panel/NovelPanel.d.ts +2 -2
- package/lib/types/client/panel/ProgressConsole.d.ts +1 -1
- package/lib/types/client/panel/ProgressHomeView.d.ts +1 -1
- package/lib/types/client/panel/PropLibrary.d.ts +1 -1
- 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/SceneLibrary.d.ts +1 -1
- package/lib/types/client/panel/SettingsView.d.ts +1 -1
- package/lib/types/client/panel/ShelfView.d.ts +1 -1
- package/lib/types/client/panel/StoryboardTab.d.ts +1 -1
- package/lib/types/client/panel/StyleCard.d.ts +1 -1
- package/lib/types/client/panel/StyleGallery.d.ts +1 -1
- package/lib/types/client/panel/WorldTab.d.ts +1 -1
- package/lib/types/engine.d.ts +29 -1
- package/lib/types/global-assets.d.ts +6 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/llm-live.d.ts +44 -0
- package/lib/types/market-radar-scan.d.ts +19 -0
- package/lib/types/market-radar-sources.d.ts +31 -0
- package/lib/types/prompting.d.ts +35 -0
- package/lib/types/protocol.d.ts +364 -8
- package/lib/types/run.d.ts +1 -1
- package/lib/types/src/ai-scan.d.ts +36 -0
- package/lib/types/src/assets.d.ts +37 -0
- package/lib/types/src/assistant.d.ts +45 -0
- package/lib/types/src/author-assets.d.ts +25 -0
- package/lib/types/src/bookshelf.d.ts +42 -0
- package/lib/types/src/client/api.d.ts +234 -0
- package/lib/types/src/client/docx.d.ts +15 -0
- package/lib/types/src/client/index.d.ts +14 -0
- package/lib/types/src/client/locales.d.ts +212 -0
- package/lib/types/src/client/mount.d.ts +9 -0
- package/lib/types/src/client/panel/AdaptModeView.d.ts +5 -0
- package/lib/types/src/client/panel/AssetsTab.d.ts +12 -0
- package/lib/types/src/client/panel/AssistantTab.d.ts +7 -0
- package/lib/types/src/client/panel/AuthorAssetsView.d.ts +4 -0
- package/lib/types/src/client/panel/AuthorHome.d.ts +32 -0
- package/lib/types/src/client/panel/BookshelfBar.d.ts +11 -0
- package/lib/types/src/client/panel/CreateBookView.d.ts +9 -0
- package/lib/types/src/client/panel/FlowGuide.d.ts +22 -0
- package/lib/types/src/client/panel/GlobalAssetLibraryView.d.ts +4 -0
- package/lib/types/src/client/panel/ImportModal.d.ts +7 -0
- package/lib/types/src/client/panel/MangaRoleLibrary.d.ts +20 -0
- package/lib/types/src/client/panel/MangaWorkspace.d.ts +12 -0
- package/lib/types/src/client/panel/ModelManager.d.ts +14 -0
- package/lib/types/src/client/panel/NovelPanel.d.ts +13 -0
- package/lib/types/src/client/panel/ProgressConsole.d.ts +17 -0
- package/lib/types/src/client/panel/ProgressHomeView.d.ts +5 -0
- package/lib/types/src/client/panel/PropLibrary.d.ts +8 -0
- package/lib/types/src/client/panel/ReaderView.d.ts +8 -0
- package/lib/types/src/client/panel/ReasoningSection.d.ts +10 -0
- package/lib/types/src/client/panel/RunPanel.d.ts +5 -0
- package/lib/types/src/client/panel/SceneLibrary.d.ts +16 -0
- package/lib/types/src/client/panel/SettingsView.d.ts +16 -0
- package/lib/types/src/client/panel/ShelfView.d.ts +15 -0
- package/lib/types/src/client/panel/StoryboardTab.d.ts +19 -0
- package/lib/types/src/client/panel/StyleCard.d.ts +8 -0
- package/lib/types/src/client/panel/StyleGallery.d.ts +1 -0
- package/lib/types/src/client/panel/WorldTab.d.ts +10 -0
- package/lib/types/src/client/panel/controller.d.ts +19 -0
- package/lib/types/src/client/panel/helpers.d.ts +18 -0
- package/lib/types/src/client/panel/views.d.ts +77 -0
- package/lib/types/src/client/sidebar-entry.d.ts +13 -0
- package/lib/types/src/client/text.d.ts +9 -0
- package/lib/types/src/comic-presets.d.ts +12 -0
- package/lib/types/src/docx.d.ts +19 -0
- package/lib/types/src/engine.d.ts +402 -0
- package/lib/types/src/index.d.ts +79 -0
- package/lib/types/src/manga-genre-rules.d.ts +22 -0
- package/lib/types/src/novel-context.d.ts +80 -0
- package/lib/types/src/prompt-utils.d.ts +35 -0
- package/lib/types/src/protocol.d.ts +2176 -0
- package/lib/types/src/review-policy.d.ts +97 -0
- package/lib/types/src/routes.d.ts +29 -0
- package/lib/types/src/run.d.ts +32 -0
- package/lib/types/src/shot-language.d.ts +46 -0
- package/lib/types/src/story-beat-language.d.ts +35 -0
- package/lib/types/src/style-library.d.ts +33 -0
- package/package.json +1 -1
- package/src/assets.ts +1774 -879
- package/src/assistant.ts +154 -9
- package/src/client/api.ts +105 -6
- package/src/client/llmLive.ts +101 -0
- package/src/client/locales.ts +4 -4
- package/src/client/panel/AdaptModeView.tsx +18 -3
- package/src/client/panel/AssistantTab.tsx +41 -3
- package/src/client/panel/AuthorHome.tsx +51 -20
- package/src/client/panel/BookAnalysisView.tsx +60 -0
- package/src/client/panel/CreateBookView.tsx +22 -3
- package/src/client/panel/DirectorView.tsx +200 -0
- package/src/client/panel/IdeaInspirationView.tsx +71 -0
- package/src/client/panel/KnowledgeBaseView.tsx +73 -0
- package/src/client/panel/LiveFeedLog.tsx +76 -0
- package/src/client/panel/MarketRadarView.tsx +374 -0
- package/src/client/panel/NovelPanel.tsx +117 -16
- package/src/client/panel/ProgressConsole.tsx +5 -6
- package/src/client/panel/SettingsView.tsx +3 -0
- package/src/client/panel/panel.module.css +2 -3
- package/src/engine.ts +459 -23
- package/src/global-assets.ts +59 -0
- package/src/index.ts +17 -1
- package/src/llm-live.ts +68 -0
- package/src/market-radar-scan.ts +41 -0
- package/src/market-radar-sources.ts +173 -0
- package/src/prompting.ts +159 -0
- package/src/protocol.ts +340 -8
- package/src/routes.ts +579 -59
- package/src/run.ts +15 -8
- package/skills/chapter-batch/SKILL.md +0 -81
package/lib/types/assets.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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;
|
package/lib/types/assistant.d.ts
CHANGED
|
@@ -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': "请求失败";
|
|
@@ -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):
|
|
11
|
+
export declare function AssetsTab({ api, initialTab }: AssetsTabProps): any;
|
|
12
12
|
export {};
|
|
@@ -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
|
-
}):
|
|
34
|
+
}): any;
|
|
@@ -8,4 +8,4 @@ export interface BookshelfBarProps {
|
|
|
8
8
|
onSwitch: () => void;
|
|
9
9
|
}
|
|
10
10
|
/** 书架条。 */
|
|
11
|
-
export declare function BookshelfBar({ api, shelf, onSwitch }: BookshelfBarProps):
|
|
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
|
-
|
|
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;
|
|
@@ -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;
|
|
@@ -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):
|
|
13
|
+
export declare function NovelPanel({ controller, api }: NovelPanelProps): 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
|
-
}):
|
|
15
|
+
}): any;
|
|
16
16
|
export {};
|
|
@@ -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
|
-
}):
|
|
19
|
+
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function StyleGallery():
|
|
1
|
+
export declare function StyleGallery(): any;
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -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;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -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>;
|