@waterwx/dsh-novel-forge 1.7.3 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +3627 -447
- package/lib/client.js.map +1 -1
- package/lib/index.js +1127 -141
- package/lib/index.js.map +1 -1
- package/lib/types/author-assets.d.ts +25 -0
- package/lib/types/client/api.d.ts +31 -1
- package/lib/types/client/locales.d.ts +16 -0
- package/lib/types/client/panel/AdaptModeView.d.ts +4 -0
- package/lib/types/client/panel/AuthorAssetsView.d.ts +4 -0
- package/lib/types/client/panel/AuthorHome.d.ts +30 -0
- package/lib/types/client/panel/ModelManager.d.ts +14 -0
- package/lib/types/client/panel/ModelPicker.d.ts +11 -0
- package/lib/types/client/panel/ProgressConsole.d.ts +17 -0
- package/lib/types/client/panel/ProgressHomeView.d.ts +5 -0
- package/lib/types/client/panel/ReasoningSection.d.ts +10 -0
- package/lib/types/client/panel/SettingsView.d.ts +14 -0
- package/lib/types/client/text.d.ts +9 -0
- package/lib/types/engine.d.ts +39 -1
- package/lib/types/index.d.ts +8 -0
- package/lib/types/protocol.d.ts +339 -0
- package/package.json +1 -1
- package/src/author-assets.ts +166 -0
- package/src/client/api.ts +82 -0
- package/src/client/locales.ts +32 -0
- package/src/client/mount.tsx._new +97 -0
- package/src/client/mount.tsx._nf +97 -0
- package/src/client/mount.tsx._tmp +97 -0
- package/src/client/panel/AdaptModeView.tsx +202 -0
- package/src/client/panel/AuthorAssetsView.tsx +206 -0
- package/src/client/panel/AuthorHome.tsx +107 -0
- package/src/client/panel/ImportModal.tsx +2 -1
- package/src/client/panel/ModelManager.tsx +205 -0
- package/src/client/panel/NovelPanel.tsx +73 -79
- package/src/client/panel/ProgressConsole.tsx +64 -0
- package/src/client/panel/ProgressHomeView.tsx +87 -0
- package/src/client/panel/ReasoningSection.tsx +31 -0
- package/src/client/panel/SettingsView.tsx +292 -0
- package/src/client/panel/panel.module.css +325 -0
- package/src/client/sidebar-entry.ts +1 -1
- package/src/client/text.ts +28 -0
- package/src/engine.ts +442 -0
- package/src/index.ts +20 -0
- package/src/protocol.ts +356 -0
- package/src/routes.ts +323 -0
|
@@ -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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* fetch, same origin; generation/rewrite/polish ride NDJSON streams read
|
|
4
4
|
* incrementally.
|
|
5
5
|
*/
|
|
6
|
-
import { type AssetsPatch, type AssetsResponse, type BibleResponse, type ChapterResponse, type ConfigPatch, type ExportResponse, type ForeshadowRequest, type ForeshadowResponse, type JobFrame, type LoadOutlineResponse, type NovelConfig, type PlanResponse, type ReviewReport, type StatusResponse, type StyleEngineRequest, type StyleAsset, type VolumesResponse } from '../protocol.ts';
|
|
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 LlmTestResponse, type NovelConfig, type PlanResponse, type ReviewReport, type StatusResponse, type StyleEngineRequest, type StyleAsset, type VolumesResponse } from '../protocol.ts';
|
|
7
7
|
/** Error carrying the route's JSON error message. */
|
|
8
8
|
export declare class NovelApiError extends Error {
|
|
9
9
|
constructor(message: string);
|
|
@@ -99,6 +99,18 @@ export declare class NovelApi {
|
|
|
99
99
|
}>;
|
|
100
100
|
/** 角色库:AI 提炼 / 采纳 / 更新 / 删除。 */
|
|
101
101
|
imageTest(req: import('../protocol.ts').ImageTestRequest): Promise<import('../protocol.ts').ImageTestResponse>;
|
|
102
|
+
/** 对选中的提供商/模型发一次最小真实调用,验证连通性。 */
|
|
103
|
+
llmTest(provider: string, model: string): Promise<LlmTestResponse>;
|
|
104
|
+
/** 添加模型:厂商直填 key,或自定义 OpenAI 兼容路由(写 DSH 凭据 + 注册路由)。 */
|
|
105
|
+
addModel(req: AddModelRequest): Promise<AddModelResponse>;
|
|
106
|
+
/** 运行时厂商目录(DSH pi-ai 可配置提供方 + 内置适配器)。 */
|
|
107
|
+
llmVendors(): Promise<LlmVendorsResponse>;
|
|
108
|
+
/** 查询某个 provider 当前可用的模型(添加成功后可即时刷新)。 */
|
|
109
|
+
llmModels(provider: string): Promise<LlmModelsResponse>;
|
|
110
|
+
/** 已注册的提供方路由列表(提供方管理卡片)。 */
|
|
111
|
+
llmProviders(): Promise<LlmProvidersResponse>;
|
|
112
|
+
/** 移除一个提供方(unset key + 移除 llm-pi-ai 路由)。 */
|
|
113
|
+
removeProvider(req: RemoveProviderRequest): Promise<RemoveProviderResponse>;
|
|
102
114
|
roles(req: import('../protocol.ts').RolesRequest): Promise<import('../protocol.ts').RolesResponse>;
|
|
103
115
|
/** 漫剧角色库:从分镜提名 / 建卡 / 更新 / 删除 / 形象锚点 / 精修提示词。 */
|
|
104
116
|
mangaRoles(req: import('../protocol.ts').MangaRolesRequest): Promise<import('../protocol.ts').MangaRolesResponse>;
|
|
@@ -184,4 +196,22 @@ export declare class NovelApi {
|
|
|
184
196
|
assistantClear(): Promise<{
|
|
185
197
|
ok: boolean;
|
|
186
198
|
}>;
|
|
199
|
+
/** 作者资产库/总数据:读取跨书可复用资产。 */
|
|
200
|
+
authorAssets(): Promise<import('../protocol.ts').AuthorAssetsResponse>;
|
|
201
|
+
/** 作者资产库:新增/更新一条资产(upsert by id)。 */
|
|
202
|
+
authorAssetsUpsert(asset: import('../protocol.ts').AuthorStyleAsset): Promise<import('../protocol.ts').AuthorAssetsResponse>;
|
|
203
|
+
/** 作者资产库:删除一条资产。 */
|
|
204
|
+
authorAssetsRemove(id: string): Promise<import('../protocol.ts').AuthorAssetsResponse>;
|
|
205
|
+
/** 作者资产库:导入默认(书架书的写作资产/角色 + 内置全局库)批量沉淀。 */
|
|
206
|
+
authorAssetsImportDefault(): Promise<import('../protocol.ts').AuthorAssetsResponse>;
|
|
207
|
+
/** 改编模式 P0:上传全文 → 原文设定卡片 / 可改范围矩阵。 */
|
|
208
|
+
adaptAnalyze(text: string, filePath?: string): Promise<import('../protocol.ts').AdaptAnalyzeResponse>;
|
|
209
|
+
/** 改编模式 P1:确认要改的维度 → 生成映射表/改编规则/联动影响清单。 */
|
|
210
|
+
adaptPropose(req: import('../protocol.ts').AdaptProposeRequest): Promise<import('../protocol.ts').AdaptProposeResponse>;
|
|
211
|
+
/** 改编模式 P2:执行术语替换(全局替换 + 命中统计 + 改编文本预览)。 */
|
|
212
|
+
adaptExecute(req: import('../protocol.ts').AdaptExecuteRequest): Promise<import('../protocol.ts').AdaptExecuteResponse>;
|
|
213
|
+
/** 主题自定义背景:上传图片,服务端存盘并返回可访问 URL。 */
|
|
214
|
+
themeBackgroundUpload(dataUrl: string): Promise<{
|
|
215
|
+
url: string;
|
|
216
|
+
}>;
|
|
187
217
|
}
|
|
@@ -142,7 +142,23 @@ export declare const zh: {
|
|
|
142
142
|
readonly 'settings.provider': "模型提供商";
|
|
143
143
|
readonly 'settings.model': "模型";
|
|
144
144
|
readonly 'settings.modelCustom': "自定义…";
|
|
145
|
+
readonly 'settings.customProvider': "自定义提供商…";
|
|
146
|
+
readonly 'settings.edit': "编辑";
|
|
147
|
+
readonly 'settings.delete': "删除";
|
|
145
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': "推理强度";
|
|
146
162
|
readonly 'settings.reasoningEffort': "写作类任务思考强度 (reasoningEffort)";
|
|
147
163
|
readonly 'settings.reasoningHint': "章节生成/润色/重写/审稿等写作任务使用;关掉更省更快。";
|
|
148
164
|
readonly 'settings.analysisReasoning': "分析类任务思考强度(提炼/拆书/反推大纲)";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { BookshelfSnapshot } from '../../protocol.ts';
|
|
3
|
+
import { type ProgressLine } from './ProgressConsole.tsx';
|
|
4
|
+
export declare function AuthorHome({ api, shelf, onOpenBook, onReadBook, onAddBook, onImportBook, onOpenSettings, onTheme, onBackground, onOpacity, adaptEnabled, progress, busy, busyLabel, liveBar, onClearProgress }: {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
shelf: BookshelfSnapshot;
|
|
7
|
+
onOpenBook: (id: string) => void;
|
|
8
|
+
onReadBook: (id: string) => void;
|
|
9
|
+
onAddBook: () => void;
|
|
10
|
+
onImportBook: () => void;
|
|
11
|
+
/** 兼容旧入口:首页设置现为独立设置页,此回调保留但不再使用。 */
|
|
12
|
+
onOpenSettings?: () => void;
|
|
13
|
+
/** 主题/模式/密度变化回调(供面板根容器实时生效)。 */
|
|
14
|
+
onTheme?: (theme: 'liquid' | 'neumorph' | 'macos' | 'clay', mode: 'system' | 'light' | 'dark', density: 'comfort' | 'compact' | 'spacious') => void;
|
|
15
|
+
/** 自定义背景变化回调。 */
|
|
16
|
+
onBackground?: (bg: string | undefined, blur: number) => void;
|
|
17
|
+
/** 玻璃透明度变化回调。 */
|
|
18
|
+
onOpacity?: (n: number) => void;
|
|
19
|
+
/** 是否启用改编模式(默认 false=隐藏入口)。 */
|
|
20
|
+
adaptEnabled?: boolean;
|
|
21
|
+
/** AI 进度实时状态(与书内共享同一份)。 */
|
|
22
|
+
progress?: ProgressLine[];
|
|
23
|
+
busy?: boolean;
|
|
24
|
+
busyLabel?: string;
|
|
25
|
+
liveBar?: {
|
|
26
|
+
text: string;
|
|
27
|
+
ratio?: number;
|
|
28
|
+
} | null;
|
|
29
|
+
onClearProgress?: () => void;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { SavedModel } from '../../protocol.ts';
|
|
3
|
+
/** 目录不可用时回退的内置预设(历史行为)。 */
|
|
4
|
+
export declare const FALLBACK_MODEL_PRESETS: readonly ["deepseek-v4-flash", "deepseek-v4-pro", "deepseek-chat", "deepseek-reasoner"];
|
|
5
|
+
export interface ModelManagerProps {
|
|
6
|
+
api: NovelApi;
|
|
7
|
+
provider: string;
|
|
8
|
+
model: string;
|
|
9
|
+
savedModels: SavedModel[];
|
|
10
|
+
onProvider: (provider: string) => void;
|
|
11
|
+
onModel: (model: string) => void;
|
|
12
|
+
onSavedModels: (models: SavedModel[]) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function ModelManager({ api, provider, model, onProvider, onModel }: ModelManagerProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
/** 目录不可用时回退的内置预设(历史行为)。 */
|
|
3
|
+
export declare const FALLBACK_MODEL_PRESETS: readonly ["deepseek-v4-flash", "deepseek-v4-pro", "deepseek-chat", "deepseek-reasoner"];
|
|
4
|
+
export interface ModelPickerProps {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
provider: string;
|
|
7
|
+
model: string;
|
|
8
|
+
onProvider: (provider: string) => void;
|
|
9
|
+
onModel: (model: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ModelPicker({ api, provider, model, onProvider, onModel }: ModelPickerProps): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ProgressLine {
|
|
2
|
+
id: number;
|
|
3
|
+
text: string;
|
|
4
|
+
kind: 'info' | 'done' | 'error';
|
|
5
|
+
live?: boolean;
|
|
6
|
+
ratio?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProgressConsole({ progress, busy, busyLabel, liveBar, onClear }: {
|
|
9
|
+
progress: ProgressLine[];
|
|
10
|
+
busy: boolean;
|
|
11
|
+
busyLabel: string;
|
|
12
|
+
liveBar: {
|
|
13
|
+
text: string;
|
|
14
|
+
ratio?: number;
|
|
15
|
+
} | null;
|
|
16
|
+
onClear: () => void;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NovelConfig } from '../../protocol.ts';
|
|
2
|
+
export interface ReasoningSectionProps {
|
|
3
|
+
reasoningEffort: NovelConfig['reasoningEffort'];
|
|
4
|
+
analysisReasoning: NovelConfig['analysisReasoning'];
|
|
5
|
+
onChange: (patch: {
|
|
6
|
+
reasoningEffort?: NovelConfig['reasoningEffort'];
|
|
7
|
+
analysisReasoning?: NovelConfig['analysisReasoning'];
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function ReasoningSection({ reasoningEffort, analysisReasoning, onChange }: ReasoningSectionProps): JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
type SettingsTab = 'model' | 'writing' | 'image' | 'files' | 'appearance';
|
|
3
|
+
type ThemeMode = 'system' | 'light' | 'dark';
|
|
4
|
+
type ThemeName = 'liquid' | 'neumorph' | 'macos' | 'clay';
|
|
5
|
+
type ThemeDensity = 'comfort' | 'compact' | 'spacious';
|
|
6
|
+
export declare function SettingsView({ api, onTheme, onSettingsTab, onEditorFontSize, onBackground, onOpacity }: {
|
|
7
|
+
api: NovelApi;
|
|
8
|
+
onTheme?: (theme: ThemeName, mode: ThemeMode, density: ThemeDensity) => void;
|
|
9
|
+
onSettingsTab?: (tab: SettingsTab) => void;
|
|
10
|
+
onEditorFontSize?: (n: number) => void;
|
|
11
|
+
onBackground?: (bg: string | undefined, blur: number) => void;
|
|
12
|
+
onOpacity?: (n: number) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export {};
|
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 { AuditIssue, AuthorReview, BreakdownResponse, ChapterPlan, Foreshadow, NovelConfig, OutlineCandidate, Plotline, PlotlineHealthReport, PlotlinePlan, ProjectState, ReviewReport, RoleRecord, RoleStatusCard, SceneCard, StoryBible, StoryboardSkeleton, StoryboardTable, StoryboardPrompt, MangaRoleCandidate, Volume, WorldState } from './protocol.ts';
|
|
15
|
+
import type { AdaptationDimension, AdaptAnalyzeResponse, AdaptationMapping, 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, Volume, WorldState } 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 */
|
|
@@ -147,6 +147,21 @@ export declare function testImageEndpoint(baseURL: string, apiKey: string, model
|
|
|
147
147
|
message?: string;
|
|
148
148
|
modelFound?: boolean;
|
|
149
149
|
}>;
|
|
150
|
+
/** 对选中的提供商/模型发一次最小真实调用(maxTokens=16),验证 Key / 端点 / 模型可用。 */
|
|
151
|
+
export declare function testLlmModel(ctx: Context, provider: string, model: string): Promise<LlmTestResponse>;
|
|
152
|
+
/** 运行时厂商目录:DSH pi-ai 可配置提供方 + 内置适配器,作为「添加模型」下拉。 */
|
|
153
|
+
export declare function listLlmVendors(ctx: Context): Promise<LlmVendorsResponse>;
|
|
154
|
+
/** 查询某个 provider 当前可用模型(添加成功后可即时刷新下拉)。 */
|
|
155
|
+
export declare function listLlmModels(ctx: Context, provider: string): Promise<LlmModelsResponse>;
|
|
156
|
+
/** 当前已注册的提供方路由列表(提供方管理卡片)。 */
|
|
157
|
+
export declare function listLlmProviders(ctx: Context): Promise<LlmProvidersResponse>;
|
|
158
|
+
/** 移除一个提供方:unset 凭据 ref + 移除 llm-pi-ai providers 路由。 */
|
|
159
|
+
export declare function removeLlmProvider(ctx: Context, req: RemoveProviderRequest): Promise<RemoveProviderResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* 添加模型(DSH 同款体验):厂商直填 API Key,或自定义 OpenAI 兼容路由。
|
|
162
|
+
* 写入 DSH 凭据 refs,并(必要时)注册/更新 llm-pi-ai provider 路由。
|
|
163
|
+
*/
|
|
164
|
+
export declare function registerLlmModel(ctx: Context, req: AddModelRequest): Promise<AddModelResponse>;
|
|
150
165
|
/** 小说角色库:生成角色定妆图并写回角色卡(imageUrl)。 */
|
|
151
166
|
export declare function generateRoleReferenceImage(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, name: string, style?: string, modelId?: string): Promise<string>;
|
|
152
167
|
/** 漫剧角色卡:生成定妆图并写回漫剧卡(imageUrl)。 */
|
|
@@ -217,6 +232,29 @@ export declare function generateStoryboardSkeleton(ctx: Context, config: NovelCo
|
|
|
217
232
|
* 两阶段:分批提取章节事件摘要 → 汇总生成大纲。不修改章节/设定,只返回大纲文本。
|
|
218
233
|
*/
|
|
219
234
|
export declare function reverseOutlineFromChapters(ctx: Context, config: NovelConfig, project: ProjectState, outputDir: string, onProgress?: (done: number, total: number, phase: string) => void): Promise<string>;
|
|
235
|
+
/**
|
|
236
|
+
* 改编模式 P0:全文分析 → 原文设定卡片 / 可改范围矩阵。
|
|
237
|
+
* 拆章统计 + 取样正文,让 LLM 一次输出结构化 JSON:
|
|
238
|
+
* { bookName, outline, dimensions: [{key,title,mutability,current,evidence,candidates,impact,risk}] }。
|
|
239
|
+
*/
|
|
240
|
+
export declare function analyzeAdaptation(ctx: Context, config: NovelConfig, text: string): Promise<AdaptAnalyzeResponse>;
|
|
241
|
+
/** 改编方案:由用户勾选的维度与新值,生成 LLM 映射表/规则/影响清单。 */
|
|
242
|
+
export declare function proposeAdaptation(ctx: Context, config: NovelConfig, text: string, selections: Array<{
|
|
243
|
+
key: string;
|
|
244
|
+
title: string;
|
|
245
|
+
current: string;
|
|
246
|
+
target: string;
|
|
247
|
+
mutability: string;
|
|
248
|
+
}>, dimensions?: AdaptationDimension[]): Promise<AdaptProposeResponse>;
|
|
249
|
+
/** 剧本术语替换执行:按映射表做精确替换并统计命中。 */
|
|
250
|
+
export declare function applyAdaptationReplacements(text: string, mappings: AdaptationMapping[]): {
|
|
251
|
+
adaptedText: string;
|
|
252
|
+
hits: Array<{
|
|
253
|
+
source: string;
|
|
254
|
+
target: string;
|
|
255
|
+
count: number;
|
|
256
|
+
}>;
|
|
257
|
+
};
|
|
220
258
|
/**
|
|
221
259
|
* 摘要 + 事实抽取合并为一次 LLM 调用(省一次调用与一次正文输入,
|
|
222
260
|
* 批量生成时整体开销约省 25%)。
|
package/lib/types/index.d.ts
CHANGED
|
@@ -57,6 +57,14 @@ export interface Config {
|
|
|
57
57
|
imageApiModel?: string;
|
|
58
58
|
/** 是否启用豆包生图(旧字段,兼容迁移用)。 */
|
|
59
59
|
imageApiEnabled?: boolean;
|
|
60
|
+
/** 自定义背景图(URL / dataURL / 服务端路径引用)。 */
|
|
61
|
+
themeBackground?: string;
|
|
62
|
+
/** 自定义背景遮罩/模糊强度 0-80。 */
|
|
63
|
+
themeBackgroundBlur?: number;
|
|
64
|
+
/** 玻璃透明度 0-100(100=当前原样)。 */
|
|
65
|
+
themeOpacity?: number;
|
|
66
|
+
/** 是否启用改编模式(默认关闭)。 */
|
|
67
|
+
enableAdaptMode?: boolean;
|
|
60
68
|
}
|
|
61
69
|
export declare const Config: z<Config>;
|
|
62
70
|
/** Model-facing announcement: plugin presence, capabilities, and limits. */
|