@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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NovelApi } from './api.ts';
|
|
2
|
+
import type { PanelController } from './panel/controller.ts';
|
|
3
|
+
/** The injected panel container. */
|
|
4
|
+
export declare const PANEL_VIEW_SELECTOR = "[data-dsh-novelforge-view]";
|
|
5
|
+
/**
|
|
6
|
+
* Mount the panel React tree into the center column and bind visibility to
|
|
7
|
+
* the controller.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mountPanel(controller: PanelController, api: NovelApi): () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
/** Props. */
|
|
3
|
+
export interface AssetsTabProps {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
/** 初始子页(左侧导航直达对应资产分类)。 */
|
|
6
|
+
initialTab?: AssetSubTab;
|
|
7
|
+
}
|
|
8
|
+
/** 写作资产子页签。 */
|
|
9
|
+
type AssetSubTab = 'genre' | 'progression' | 'templates' | 'rules' | 'style';
|
|
10
|
+
/** 写作资产页签。 */
|
|
11
|
+
export declare function AssetsTab({ api, initialTab }: AssetsTabProps): any;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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, onEndfieldAccent, 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' | 'endfield', 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
|
+
/** 终末地强调色变化回调。 */
|
|
20
|
+
onEndfieldAccent?: (accent: 'valley' | 'wuling') => void;
|
|
21
|
+
/** 是否启用改编模式(默认 false=隐藏入口)。 */
|
|
22
|
+
adaptEnabled?: boolean;
|
|
23
|
+
/** AI 进度实时状态(与书内共享同一份)。 */
|
|
24
|
+
progress?: ProgressLine[];
|
|
25
|
+
busy?: boolean;
|
|
26
|
+
busyLabel?: string;
|
|
27
|
+
liveBar?: {
|
|
28
|
+
text: string;
|
|
29
|
+
ratio?: number;
|
|
30
|
+
} | null;
|
|
31
|
+
onClearProgress?: () => void;
|
|
32
|
+
}): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { BookshelfSnapshot } from '../../protocol.ts';
|
|
3
|
+
/** Props. */
|
|
4
|
+
export interface BookshelfBarProps {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
shelf: BookshelfSnapshot;
|
|
7
|
+
/** 刷新整个面板(切换书后重新拉状态)。 */
|
|
8
|
+
onSwitch: () => void;
|
|
9
|
+
}
|
|
10
|
+
/** 书架条。 */
|
|
11
|
+
export declare function BookshelfBar({ api, shelf, onSwitch }: BookshelfBarProps): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 漫剧工作台·全流程步骤条(唯一导航,方案X):
|
|
3
|
+
* ①创建方案 → ②一键生成 → ③分镜 → ④角色定妆 → ⑤场景底图 → ⑥导出使用。
|
|
4
|
+
* 每个步骤对应一个独立页面主体;完成度自动判定(读 project 现有字段)。
|
|
5
|
+
*/
|
|
6
|
+
import type { ProjectState } from '../../protocol.ts';
|
|
7
|
+
/** 步骤 → 页面主体的一一对应目标。 */
|
|
8
|
+
export type FlowTarget = 'plan' | 'rules' | 'skeleton' | 'table' | 'import' | 'makeup' | 'prompts' | 'scenes' | 'props' | 'export';
|
|
9
|
+
export interface FlowStep {
|
|
10
|
+
no: number;
|
|
11
|
+
label: string;
|
|
12
|
+
hint: string;
|
|
13
|
+
done: boolean;
|
|
14
|
+
target: FlowTarget;
|
|
15
|
+
}
|
|
16
|
+
/** 依据 project 数据计算 6 步完成度(与存储顺序无关,按生产顺序排列)。 */
|
|
17
|
+
export declare function computeFlowSteps(project: ProjectState | null, exported?: boolean): FlowStep[];
|
|
18
|
+
export declare function FlowGuide({ project, onNavigate, exported, }: {
|
|
19
|
+
project: ProjectState | null;
|
|
20
|
+
onNavigate: (target: FlowTarget) => void;
|
|
21
|
+
exported?: boolean;
|
|
22
|
+
}): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ImageModelConfig, ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function MangaRoleLibrary({ api, project, refresh, styleId, filterId, focus, showCards, chapterNo: externalChapter, onProgress, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState | null;
|
|
6
|
+
refresh: () => void | Promise<void>;
|
|
7
|
+
styleId?: string;
|
|
8
|
+
filterId?: string;
|
|
9
|
+
/** 是否启用生图(豆包等出定妆图)。 */
|
|
10
|
+
imageApiEnabled?: boolean;
|
|
11
|
+
/** 生图模型库(出定妆图时可选择用哪条)。 */
|
|
12
|
+
imageModels?: ImageModelConfig[];
|
|
13
|
+
/** 步骤页聚焦:import=展开并滚动到导入区;cards=滚动到已建漫剧卡列表。 */
|
|
14
|
+
focus?: 'import' | 'cards';
|
|
15
|
+
/** 是否显示「已建漫剧卡」列表(第⑤步导入页可隐藏,只留导入区)。 */
|
|
16
|
+
showCards?: boolean;
|
|
17
|
+
/** 全局当前章节(从工作台顶部导航条传入)。 */
|
|
18
|
+
chapterNo?: number | null;
|
|
19
|
+
onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
|
|
20
|
+
}): any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ChapterPlan, ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function MangaWorkspace({ api, project, chapters, onProjectChanged, onProgress, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState | null;
|
|
6
|
+
chapters: ChapterPlan[];
|
|
7
|
+
/** 方案/资产变更已持久化后触发(刷新项目)。 */
|
|
8
|
+
onProjectChanged?: () => void | Promise<void>;
|
|
9
|
+
/** 是否启用生图(漫剧卡出定妆图)。 */
|
|
10
|
+
/** 上报到「AI进度」控制台(漫剧工作台内所有 LLM/方案操作)。 */
|
|
11
|
+
onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
|
|
12
|
+
}): any;
|
|
@@ -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,13 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { PanelController } from './controller.ts';
|
|
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';
|
|
5
|
+
/** Panel shell props. */
|
|
6
|
+
export interface NovelPanelProps {
|
|
7
|
+
/** The panel state owner (open/close/toggle). */
|
|
8
|
+
controller: PanelController;
|
|
9
|
+
/** The API client every tab operates through. */
|
|
10
|
+
api: NovelApi;
|
|
11
|
+
}
|
|
12
|
+
/** The novel-forge panel. */
|
|
13
|
+
export declare function NovelPanel({ controller, api }: NovelPanelProps): any;
|
|
@@ -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
|
+
}): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function PropLibrary({ api, project, refresh, onProgress, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState | null;
|
|
6
|
+
refresh: () => void | Promise<void>;
|
|
7
|
+
onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
|
|
8
|
+
}): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function ReaderView({ api, project, onBack, onOpenWorkspace, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState;
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
onOpenWorkspace: () => void;
|
|
8
|
+
}): any;
|
|
@@ -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,16 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function SceneLibrary({ api, project, refresh, styleId, filterId, chapterNo: externalChapter, onProgress, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState | null;
|
|
6
|
+
/** 场景库变更已持久化后触发(刷新项目)。 */
|
|
7
|
+
refresh: () => void | Promise<void>;
|
|
8
|
+
/** 提炼场景时的漫剧基底风格 id(提示词按方案风格措辞)。 */
|
|
9
|
+
styleId?: string;
|
|
10
|
+
/** 可选滤镜风格 id。 */
|
|
11
|
+
filterId?: string;
|
|
12
|
+
/** 全局当前章节(从工作台顶部导航条传入)。 */
|
|
13
|
+
chapterNo?: number | null;
|
|
14
|
+
/** 上报到「AI进度」控制台。 */
|
|
15
|
+
onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
|
|
16
|
+
}): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
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' | 'endfield';
|
|
5
|
+
type EndfieldAccent = 'valley' | 'wuling';
|
|
6
|
+
type ThemeDensity = 'comfort' | 'compact' | 'spacious';
|
|
7
|
+
export declare function SettingsView({ api, onTheme, onSettingsTab, onEditorFontSize, onBackground, onOpacity, onEndfieldAccent }: {
|
|
8
|
+
api: NovelApi;
|
|
9
|
+
onTheme?: (theme: ThemeName, mode: ThemeMode, density: ThemeDensity) => void;
|
|
10
|
+
onSettingsTab?: (tab: SettingsTab) => void;
|
|
11
|
+
onEditorFontSize?: (n: number) => void;
|
|
12
|
+
onBackground?: (bg: string | undefined, blur: number) => void;
|
|
13
|
+
onOpacity?: (n: number) => void;
|
|
14
|
+
onEndfieldAccent?: (accent: EndfieldAccent) => void;
|
|
15
|
+
}): any;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { BookshelfSnapshot } from '../../protocol.ts';
|
|
3
|
+
/** 书架首页。 */
|
|
4
|
+
export declare function ShelfView({ api, shelf, onOpenBook, onReadBook, onAddBook, onImportBook, }: {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
shelf: BookshelfSnapshot;
|
|
7
|
+
/** 点击书卡:激活该书并进入工作台。 */
|
|
8
|
+
onOpenBook: (id: string) => void;
|
|
9
|
+
/** 点击「阅读」:激活该书并进入沉浸式阅读页。 */
|
|
10
|
+
onReadBook: (id: string) => void;
|
|
11
|
+
/** 点击+:进入开书向导页。 */
|
|
12
|
+
onAddBook: () => void;
|
|
13
|
+
/** 点击「导入」:打开导入弹窗(已有项目目录 / txt/md 全本)。 */
|
|
14
|
+
onImportBook: () => void;
|
|
15
|
+
}): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { ChapterPlan, ProjectState } from '../../protocol.ts';
|
|
3
|
+
export declare function StoryboardTab({ api, project, chapters, onProjectChanged, styleId, filterId, mode, onGoStep, onProgress, }: {
|
|
4
|
+
api: NovelApi;
|
|
5
|
+
project: ProjectState | null;
|
|
6
|
+
chapters: ChapterPlan[];
|
|
7
|
+
/** 生成成功且已持久化后触发(刷新项目,切章/重进可恢复)。 */
|
|
8
|
+
onProjectChanged?: () => void | Promise<void>;
|
|
9
|
+
/** 漫剧基底风格 id(画面措辞随风格)。 */
|
|
10
|
+
styleId?: string;
|
|
11
|
+
/** 可选滤镜风格 id。 */
|
|
12
|
+
filterId?: string;
|
|
13
|
+
/** 页面模式:auto=按本章实际进度显示;skeleton/table/prompts=固定显示该步骤(前置不足显示提示,不降级)。 */
|
|
14
|
+
mode?: 'auto' | 'skeleton' | 'table' | 'prompts';
|
|
15
|
+
/** 「下一步」按钮回调(1=骨架→2=分镜表→3=提示词),供外层切步骤页。 */
|
|
16
|
+
onGoStep?: (n: 1 | 2 | 3) => void;
|
|
17
|
+
/** 上报到「AI进度」控制台(分镜三步生成)。 */
|
|
18
|
+
onProgress?: (text: string, kind?: 'info' | 'done' | 'error') => void;
|
|
19
|
+
}): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function StyleGallery(): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NovelApi } from '../api.ts';
|
|
2
|
+
import type { WorldState } from '../../protocol.ts';
|
|
3
|
+
/** 大世界页签。 */
|
|
4
|
+
export declare function WorldTab({ api, world, onChanged, }: {
|
|
5
|
+
api: NovelApi;
|
|
6
|
+
/** 当前项目的大世界数据(可能为空)。 */
|
|
7
|
+
world: WorldState | undefined;
|
|
8
|
+
/** 保存/提炼成功后由父组件刷新项目状态。 */
|
|
9
|
+
onChanged: (world: WorldState) => void;
|
|
10
|
+
}): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Novel-forge panel controller: the single owner of the panel's open/closed
|
|
3
|
+
* state (framework-free, mirroring the family plugins' controllers).
|
|
4
|
+
*/
|
|
5
|
+
/** Immutable controller snapshot for UI subscriptions. */
|
|
6
|
+
export interface PanelControllerSnapshot {
|
|
7
|
+
panelOpen: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** The panel state owner the sidebar entry toggles and the view renders from. */
|
|
10
|
+
export declare class PanelController {
|
|
11
|
+
private panelOpen;
|
|
12
|
+
private listeners;
|
|
13
|
+
getSnapshot(): PanelControllerSnapshot;
|
|
14
|
+
subscribe(fn: () => void): () => void;
|
|
15
|
+
open(): void;
|
|
16
|
+
close(): void;
|
|
17
|
+
toggle(): void;
|
|
18
|
+
private notify;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny translation helper for the panel: reads the zh dict with the en dict
|
|
3
|
+
* as fallback (the family plugins use a full locale registry; the panel keeps
|
|
4
|
+
* a dependency-free helper so the client bundle stays self-contained).
|
|
5
|
+
*/
|
|
6
|
+
import { type NovelKey } from '../locales.ts';
|
|
7
|
+
/** Translate one key with optional {placeholder} substitution. */
|
|
8
|
+
export declare function tt(key: NovelKey, params?: Record<string, string | number>): string;
|
|
9
|
+
/** 角色定位中文名(角色库/提炼候选共用,收敛自多份复制)。 */
|
|
10
|
+
export declare const ROLE_LABELS: Record<string, string>;
|
|
11
|
+
/** 角色定位徽章颜色。 */
|
|
12
|
+
export declare function roleColor(label: string): string;
|
|
13
|
+
/** 剧情线类型中文名(与 locale 对齐)。 */
|
|
14
|
+
export declare function kindLabel(kind: string): string;
|
|
15
|
+
/** 剧情线状态中文名。 */
|
|
16
|
+
export declare function plotlineStatusLabel(status: string): string;
|
|
17
|
+
/** 剧情线状态颜色。 */
|
|
18
|
+
export declare function plotlineStatusColor(status: string): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 纯展示组件(views):所有状态与事件处理器都留在 NovelPanel,
|
|
3
|
+
* 这里只接收 props 渲染。便于单独维护与复用。
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactElement } from 'react';
|
|
6
|
+
import type { AuditIssue, Plotline, PlotlineHealthReport, PlotlinePlan, RoleRecord, RoleStatusCard } from '../../protocol.ts';
|
|
7
|
+
/** 统计格:状态摘要条 / 资产健康通用。 */
|
|
8
|
+
export declare function StatCell(props: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
detail: string;
|
|
12
|
+
/** 值颜色(可选)。 */
|
|
13
|
+
valueColor?: string;
|
|
14
|
+
/** 值字号覆盖(如长文本用 13)。 */
|
|
15
|
+
valueFontSize?: number;
|
|
16
|
+
/** detail 悬浮提示(可选)。 */
|
|
17
|
+
detailTitle?: string;
|
|
18
|
+
}): ReactElement;
|
|
19
|
+
/** 待办队列行。 */
|
|
20
|
+
export declare function TodoRow(props: {
|
|
21
|
+
tone: 'danger' | 'warning' | 'info' | 'success';
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
actionLabel: string;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
onAction: () => void;
|
|
27
|
+
}): ReactElement;
|
|
28
|
+
/** 全书质检问题行。 */
|
|
29
|
+
export declare function AuditIssueRow(props: {
|
|
30
|
+
issue: AuditIssue;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
onFix: () => void;
|
|
33
|
+
}): ReactElement;
|
|
34
|
+
/** 剧情线卡片(列表主体)。 */
|
|
35
|
+
export declare function PlotlineCard(props: {
|
|
36
|
+
line: Plotline;
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
onRefresh: () => void;
|
|
39
|
+
onEdit: () => void;
|
|
40
|
+
onRemove: () => void;
|
|
41
|
+
}): ReactElement;
|
|
42
|
+
/** AI 候选角色行(提炼结果,可采纳/修改后采纳)。 */
|
|
43
|
+
export declare function RoleCandidateRow(props: {
|
|
44
|
+
candidate: RoleRecord;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
onAdopt: () => void;
|
|
47
|
+
onEdit: () => void;
|
|
48
|
+
}): ReactElement;
|
|
49
|
+
/** 已收录角色卡(含从编年录刷新的当前状态行)。 */
|
|
50
|
+
export declare function RoleCard(props: {
|
|
51
|
+
role: RoleRecord;
|
|
52
|
+
status?: RoleStatusCard;
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
onEdit: () => void;
|
|
55
|
+
onRemove: () => void;
|
|
56
|
+
}): ReactElement;
|
|
57
|
+
/** 🩺 剧情健康检查报告面板。 */
|
|
58
|
+
export declare function PlotlineHealthPanel(props: {
|
|
59
|
+
report: PlotlineHealthReport;
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
onPlan: () => void;
|
|
62
|
+
onClose: () => void;
|
|
63
|
+
}): ReactElement;
|
|
64
|
+
/** ✨ AI 剧情方案面板。 */
|
|
65
|
+
export declare function PlotlinePlanPanel(props: {
|
|
66
|
+
plan: PlotlinePlan;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
onAdopt: (suggestion: Plotline) => void;
|
|
69
|
+
onClose: () => void;
|
|
70
|
+
}): ReactElement;
|
|
71
|
+
/** ✨ AI 建议剧情线面板。 */
|
|
72
|
+
export declare function PlotlineSuggestionPanel(props: {
|
|
73
|
+
suggestions: Plotline[];
|
|
74
|
+
disabled: boolean;
|
|
75
|
+
onAdopt: (suggestion: Plotline) => void;
|
|
76
|
+
onClose: () => void;
|
|
77
|
+
}): ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sidebar entry injection — mirrors the family plugins' DOM-level pattern:
|
|
3
|
+
* the shell exposes no external slot, so the entry row is injected after the
|
|
4
|
+
* sibling plugin entries and self-heals via MutationObserver.
|
|
5
|
+
*/
|
|
6
|
+
import type { PanelController } from './panel/controller.ts';
|
|
7
|
+
/** Stable data attribute identifying the injected entry row. */
|
|
8
|
+
export declare const ENTRY_SELECTOR = "[data-dsh-novelforge-entry]";
|
|
9
|
+
/**
|
|
10
|
+
* Mount the sidebar entry, waiting for the shell and self-healing on
|
|
11
|
+
* re-renders.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mountSidebarEntry(controller: PanelController): () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 漫画风格预设:每个预设对应一组出图提示词与排版偏好。 */
|
|
2
|
+
export interface ComicStylePreset {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** 注入 imagePrompt 的风格描述词。 */
|
|
6
|
+
prompt: string;
|
|
7
|
+
/** 可选:排版偏好说明。 */
|
|
8
|
+
layoutHint?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const COMIC_STYLE_PRESETS: ComicStylePreset[];
|
|
11
|
+
export declare function getComicStylePrompt(styleId?: string): string;
|
|
12
|
+
export declare function getComicStyleLabel(styleId?: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* docx outline extraction: a .docx is a zip whose word/document.xml holds the
|
|
3
|
+
* body text in <w:t> runs inside <w:p> paragraphs. We unzip with fflate and
|
|
4
|
+
* walk the XML with a tiny tokenizer — no heavyweight XML/DOM dependency.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Extract plain text from a docx buffer: one line per <w:p> paragraph, with
|
|
8
|
+
* <w:tab>/<w:br> preserved as whitespace. Tables and nested structures are
|
|
9
|
+
* flattened in document order (their paragraphs are just <w:p> too).
|
|
10
|
+
* @param buffer - the raw .docx bytes.
|
|
11
|
+
* @returns the body text.
|
|
12
|
+
*/
|
|
13
|
+
export declare function extractDocxText(buffer: Uint8Array): string;
|
|
14
|
+
/**
|
|
15
|
+
* Read and extract a docx outline from disk.
|
|
16
|
+
* @param path - absolute path to the .docx file.
|
|
17
|
+
* @returns the extracted outline text.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readOutlineFromDocx(path: string): string;
|