@waterwx/dsh-novel-forge 2.0.1-alpha → 2.1.1-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 +112 -2
- package/lib/client.js +3300 -768
- 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 +12 -2
- 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 +50 -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 +18 -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
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
8
8
|
import type { ReactElement } from 'react'
|
|
9
9
|
import type { NovelApi } from '../api.ts'
|
|
10
|
+
import { setCurrentBook } from '../api.ts'
|
|
10
11
|
import type { PanelController } from './controller.ts'
|
|
11
12
|
import { tt } from './helpers.ts'
|
|
12
13
|
import { ModelManager } from './ModelManager.tsx'
|
|
13
14
|
import { ReasoningSection } from './ReasoningSection.tsx'
|
|
15
|
+
import LiveFeedLog from './LiveFeedLog.tsx'
|
|
14
16
|
import { BarChart3, Book, BookMarked, BookOpen, Brain, Clapperboard, Factory, FileText, Folder, GitBranch, Library, MessageSquare, Palette, PenLine, PlugZap, RotateCcw, ScrollText, Search, Settings, Sparkles, Wrench } from 'lucide-react'
|
|
15
17
|
import { AssistantTab } from './AssistantTab.tsx'
|
|
16
18
|
import { AssetsTab } from './AssetsTab.tsx'
|
|
@@ -22,6 +24,8 @@ import { CreateBookView } from './CreateBookView.tsx'
|
|
|
22
24
|
import { ImportModal } from './ImportModal.tsx'
|
|
23
25
|
import { WorldTab } from './WorldTab.tsx'
|
|
24
26
|
import { MangaWorkspace } from './MangaWorkspace.tsx'
|
|
27
|
+
import DirectorView from './DirectorView.tsx'
|
|
28
|
+
import KnowledgeBaseView from './KnowledgeBaseView.tsx'
|
|
25
29
|
import { AuditIssueRow, PlotlineCard, PlotlineHealthPanel, PlotlinePlanPanel, PlotlineSuggestionPanel, RoleCandidateRow, RoleCard, StatCell, TodoRow } from './views.tsx'
|
|
26
30
|
import { extractDocxTextFromBuffer } from '../docx.ts'
|
|
27
31
|
import type {
|
|
@@ -47,7 +51,7 @@ import css from './panel.module.css'
|
|
|
47
51
|
/** The panel's tab identifiers. */
|
|
48
52
|
export type NovelTab =
|
|
49
53
|
| 'workflow' | 'overview' | 'blurb' | 'plan' | 'bible' | 'world' | 'foreshadow' | 'assistant' | 'settings'
|
|
50
|
-
| 'characters' | 'roles' | 'facts' | 'plotlines' | 'reviews' | 'progress' | 'breakdown'
|
|
54
|
+
| 'characters' | 'roles' | 'facts' | 'plotlines' | 'reviews' | 'progress' | 'breakdown' | 'director' | 'knowledge'
|
|
51
55
|
| 'assetsGenre' | 'assetsProgression' | 'assetsTemplates' | 'assetsRules' | 'assetsStyle' | 'run' | 'manhua'
|
|
52
56
|
| 'book' | 'assets'
|
|
53
57
|
|
|
@@ -71,7 +75,7 @@ interface ProgressLine {
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
/** The navigation groups (AI-Novel-Writing-Assistant style grouping). */
|
|
74
|
-
const NAV_GROUPS: ReadonlyArray<{ id: string; label: string; items: ReadonlyArray<{ id: NovelTab; label: string; icon: ReactElement }> }> = [
|
|
78
|
+
const NAV_GROUPS: ReadonlyArray<{ id: string; label: string; collapsible?: boolean; items: ReadonlyArray<{ id: NovelTab; label: string; icon: ReactElement }> }> = [
|
|
75
79
|
{
|
|
76
80
|
id: 'create',
|
|
77
81
|
label: '创作',
|
|
@@ -85,12 +89,21 @@ const NAV_GROUPS: ReadonlyArray<{ id: string; label: string; items: ReadonlyArra
|
|
|
85
89
|
],
|
|
86
90
|
},
|
|
87
91
|
{
|
|
88
|
-
id: '
|
|
89
|
-
label: '
|
|
92
|
+
id: 'core',
|
|
93
|
+
label: '核心',
|
|
90
94
|
items: [
|
|
91
95
|
{ id: 'assistant', label: tt('tab.assistant'), icon: <MessageSquare size={18} /> },
|
|
92
96
|
{ id: 'progress', label: 'AI 进度', icon: <BarChart3 size={18} /> },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'advanced',
|
|
101
|
+
label: '进阶工具',
|
|
102
|
+
collapsible: true,
|
|
103
|
+
items: [
|
|
93
104
|
{ id: 'breakdown', label: '拆书分析', icon: <Search size={18} /> },
|
|
105
|
+
{ id: 'director', label: '自动导演', icon: <Brain size={18} /> },
|
|
106
|
+
{ id: 'knowledge', label: '知识库', icon: <BookOpen size={18} /> },
|
|
94
107
|
{ id: 'manhua', label: '漫剧工作台', icon: <Clapperboard size={18} /> },
|
|
95
108
|
{ id: 'run', label: '生产单', icon: <Factory size={18} /> },
|
|
96
109
|
],
|
|
@@ -347,6 +360,8 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
347
360
|
const [expandedVolumes, setExpandedVolumes] = useState<Record<number, boolean>>({})
|
|
348
361
|
const [chapterText, setChapterText] = useState('')
|
|
349
362
|
const progressId = useRef(0)
|
|
363
|
+
/** 面板已绑定的书(打开即锁,不随全局 active 漂移,避免串书)。 */
|
|
364
|
+
const bookBoundRef = useRef(false)
|
|
350
365
|
/** id of the single live progress row (generation counter), if any. */
|
|
351
366
|
const liveProgressId = useRef<number | null>(null)
|
|
352
367
|
/** last chars value rendered into the live row (throttle for streaming). */
|
|
@@ -586,6 +601,7 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
586
601
|
}, [])
|
|
587
602
|
/** AI 助手悬浮窗:是否打开。 */
|
|
588
603
|
const [assistantOpen, setAssistantOpen] = useState(false)
|
|
604
|
+
const [advancedOpen, setAdvancedOpen] = useState(false)
|
|
589
605
|
/** AI进度悬浮窗:是否打开。 */
|
|
590
606
|
const [progressOpen, setProgressOpen] = useState(false)
|
|
591
607
|
/** AI进度悬浮窗位置(localStorage 记忆)。 */
|
|
@@ -680,6 +696,8 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
680
696
|
})
|
|
681
697
|
/** 视图:shelf = 书架首页;create = 开书向导;workspace = 当前书工作台。 */
|
|
682
698
|
const [viewMode, setViewMode] = useState<'shelf' | 'create' | 'workspace' | 'reader'>('shelf')
|
|
699
|
+
/** 从「创意灵感」采纳后带入开书向导的预填(书名 + 一句话想法)。 */
|
|
700
|
+
const [createPrefill, setCreatePrefill] = useState<{ name: string; idea: string } | null>(null)
|
|
683
701
|
const [showImport, setShowImport] = useState(false)
|
|
684
702
|
|
|
685
703
|
/** Refresh bookshelf. */
|
|
@@ -687,6 +705,11 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
687
705
|
try {
|
|
688
706
|
const snapshot = await api.bookshelf()
|
|
689
707
|
setShelf(snapshot)
|
|
708
|
+
if (!bookBoundRef.current) {
|
|
709
|
+
bookBoundRef.current = true
|
|
710
|
+
const initialId = snapshot.activeBookId ?? snapshot.books[0]?.id ?? null
|
|
711
|
+
setCurrentBook(initialId)
|
|
712
|
+
}
|
|
690
713
|
} catch { /* shelf is best-effort */ }
|
|
691
714
|
}, [api])
|
|
692
715
|
|
|
@@ -750,6 +773,8 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
750
773
|
setError('')
|
|
751
774
|
try {
|
|
752
775
|
await api.bookActivate(id)
|
|
776
|
+
// 显式切书:重绑当前书(之后所有书级请求明确带 bookId,不再被全局 active 串书)。
|
|
777
|
+
setCurrentBook(id)
|
|
753
778
|
// 切换书后重置本地编辑状态,重新拉取目标书。
|
|
754
779
|
setOutlineText('')
|
|
755
780
|
setProject(null)
|
|
@@ -2090,6 +2115,9 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2090
2115
|
outputDir: configDraft.outputDir,
|
|
2091
2116
|
provider: configDraft.provider,
|
|
2092
2117
|
model: configDraft.model,
|
|
2118
|
+
generateModel: configDraft.generateModel,
|
|
2119
|
+
reviewModel: configDraft.reviewModel,
|
|
2120
|
+
auditModel: configDraft.auditModel,
|
|
2093
2121
|
reasoningEffort: configDraft.reasoningEffort ?? 'off',
|
|
2094
2122
|
chapterChars: configDraft.chapterChars,
|
|
2095
2123
|
maxTokens: configDraft.maxTokens,
|
|
@@ -2333,6 +2361,16 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2333
2361
|
onClick: () => { if (firstPending !== undefined) gotoChapter(firstPending.no) },
|
|
2334
2362
|
}
|
|
2335
2363
|
}
|
|
2364
|
+
if ((project?.todos ?? []).some(t => !t.done)) {
|
|
2365
|
+
const n = (project?.todos ?? []).filter(t => !t.done).length
|
|
2366
|
+
return {
|
|
2367
|
+
eyebrow: '需要你确认',
|
|
2368
|
+
title: `还有 ${n} 条导演待办未处理`,
|
|
2369
|
+
reason: '自动导演给出的风险/修复建议已加入待办,点进去逐条处理或勾掉。',
|
|
2370
|
+
actionLabel: '去处理',
|
|
2371
|
+
onClick: () => { setActiveTab('director') },
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2336
2374
|
return {
|
|
2337
2375
|
eyebrow: '全部完成 🎉',
|
|
2338
2376
|
title: '《' + project.bookName + '》已全部生成',
|
|
@@ -2378,8 +2416,21 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2378
2416
|
})
|
|
2379
2417
|
}
|
|
2380
2418
|
}
|
|
2419
|
+
// 导演采纳的待办:风险/修复清单(来自「工具 → 自动导演」)
|
|
2420
|
+
if (project !== null) {
|
|
2421
|
+
for (const td of (project.todos ?? []).filter(t => !t.done)) {
|
|
2422
|
+
if (items.length >= 6) break
|
|
2423
|
+
items.push({
|
|
2424
|
+
tone: 'warning',
|
|
2425
|
+
title: `导演待办:${td.text.length > 26 ? td.text.slice(0, 26) + '…' : td.text}`,
|
|
2426
|
+
description: '自动导演给出的风险/修复,点进去逐条处理或勾掉',
|
|
2427
|
+
actionLabel: '去处理',
|
|
2428
|
+
onClick: () => { setActiveTab('director') },
|
|
2429
|
+
})
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2381
2432
|
return items
|
|
2382
|
-
}, [chapters, openWorkspace, gotoChapter])
|
|
2433
|
+
}, [chapters, openWorkspace, gotoChapter, project])
|
|
2383
2434
|
|
|
2384
2435
|
/** 资产健康(设定/卷/写作资产/伏笔)。 */
|
|
2385
2436
|
const assetSummary = (() => {
|
|
@@ -2422,8 +2473,15 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2422
2473
|
onReadBook={async (id) => {
|
|
2423
2474
|
await activateBook(id, 'reader')
|
|
2424
2475
|
}}
|
|
2425
|
-
onAddBook={() => { setViewMode('create') }}
|
|
2476
|
+
onAddBook={() => { setCreatePrefill(null); setViewMode('create') }}
|
|
2426
2477
|
onImportBook={() => { setShowImport(true) }}
|
|
2478
|
+
onUseIdea={(idea) => {
|
|
2479
|
+
setCreatePrefill({
|
|
2480
|
+
name: idea.title,
|
|
2481
|
+
idea: `《${idea.title}》\n题材:${idea.genre}\n视角:${idea.pov}\n钩子:${idea.hook}\n长期兑现:${idea.payoff}`,
|
|
2482
|
+
})
|
|
2483
|
+
setViewMode('create')
|
|
2484
|
+
}}
|
|
2427
2485
|
onOpenSettings={() => { void openSettingsFromHome() }}
|
|
2428
2486
|
onTheme={(t, m, d) => { changePanelTheme(t); changeThemeMode(m); changeThemeDensity(d) }}
|
|
2429
2487
|
onBackground={(bg, blur) => { setThemeBg(bg); setThemeBgBlur(blur) }}
|
|
@@ -2440,6 +2498,8 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2440
2498
|
/* 开书向导:独立页面 */
|
|
2441
2499
|
<CreateBookView
|
|
2442
2500
|
api={api}
|
|
2501
|
+
initialName={createPrefill?.name}
|
|
2502
|
+
initialIdea={createPrefill?.idea}
|
|
2443
2503
|
onBack={() => { setViewMode('shelf') }}
|
|
2444
2504
|
onCreated={async (id) => {
|
|
2445
2505
|
setBusy(true)
|
|
@@ -2490,7 +2550,13 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2490
2550
|
{NAV_GROUPS.map(group => (
|
|
2491
2551
|
<div key={group.id} className={css.navGroup}>
|
|
2492
2552
|
{!navCollapsed && <div className={css.navGroupLabel}>{group.label}</div>}
|
|
2493
|
-
{group.
|
|
2553
|
+
{group.collapsible === true && (
|
|
2554
|
+
<button type="button" className={css.navTab} onClick={() => setAdvancedOpen(v => !v)} title={group.label}>
|
|
2555
|
+
<span className={css.navTabIcon}>{advancedOpen ? '▾' : '▸'}</span>
|
|
2556
|
+
{!navCollapsed && <span className={css.navTabLabel}>{advancedOpen ? '收起进阶' : '展开进阶'}</span>}
|
|
2557
|
+
</button>
|
|
2558
|
+
)}
|
|
2559
|
+
{(group.collapsible !== true || advancedOpen) && group.items.map(tab => (
|
|
2494
2560
|
<button
|
|
2495
2561
|
key={tab.id}
|
|
2496
2562
|
type="button"
|
|
@@ -2848,6 +2914,11 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
2848
2914
|
</button>
|
|
2849
2915
|
</div>
|
|
2850
2916
|
)}
|
|
2917
|
+
{/* 问编辑老师:把拆书/导演/知识库/待办交给 AI 编辑 Agent */}
|
|
2918
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 'var(--nf-space-8)', marginTop: 'var(--nf-space-8)', flexWrap: 'wrap' }}>
|
|
2919
|
+
<button type="button" className={css.button} onClick={() => { setAssistantOpen(true) }}>💬 问 AI 编辑 Agent</button>
|
|
2920
|
+
<span className={css.meta}>拆书 / 自动导演 / 知识库 / 待办,一句话交给它帮你跑。</span>
|
|
2921
|
+
</div>
|
|
2851
2922
|
{/* 创作旅程进度 */}
|
|
2852
2923
|
<div className={css.dashJourney}>
|
|
2853
2924
|
<div className={css.busyRow}>
|
|
@@ -3454,6 +3525,12 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
3454
3525
|
</span>
|
|
3455
3526
|
</div>
|
|
3456
3527
|
<div className={css.meta}><b>{tt('plan.reviewVerdict')}:</b> {review.verdict}</div>
|
|
3528
|
+
{review.riskScore !== undefined && (
|
|
3529
|
+
<div className={css.meta}><b>风险分:</b> {review.riskScore}/100</div>
|
|
3530
|
+
)}
|
|
3531
|
+
{review.aiFlavor !== undefined && (
|
|
3532
|
+
<div className={css.meta}><b>AI 味指数:</b> {review.aiFlavor}/100{(review.aiPhrases ?? []).length > 0 && ` · 套话:` + (review.aiPhrases ?? []).map(p => `${p.word}×${p.count}`).join('、')}</div>
|
|
3533
|
+
)}
|
|
3457
3534
|
{review.issues.length > 0 && (
|
|
3458
3535
|
<ul style={{ margin: 0, paddingLeft: 'var(--nf-space-18)', fontSize: 'var(--nf-fs-12)' }}>
|
|
3459
3536
|
{review.issues.map((issue, i) => (
|
|
@@ -3585,7 +3662,7 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
3585
3662
|
<div className={css.card} style={{ gap: 'var(--nf-space-12)' }}>
|
|
3586
3663
|
<div className={css.row} style={{ justifyContent: 'space-between', flexWrap: 'wrap' }}>
|
|
3587
3664
|
<span className={css.cardTitle} style={{ fontSize: 'var(--nf-fs-16)', fontWeight: 700 }}>📚 本书设定</span>
|
|
3588
|
-
<span className={css.meta}
|
|
3665
|
+
<span className={css.meta}>结构化设定/道藏(世界观·角色·境界·红线)。零散补充资料请用「工具 → 知识库」。</span>
|
|
3589
3666
|
</div>
|
|
3590
3667
|
<div className={css.row} style={{ flexWrap: 'wrap', gap: 'var(--nf-space-6)' }}>
|
|
3591
3668
|
<button
|
|
@@ -3877,6 +3954,26 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
3877
3954
|
analysisReasoning={configDraft.analysisReasoning ?? 'low'}
|
|
3878
3955
|
onChange={patch => setConfigDraft({ ...configDraft, ...patch })}
|
|
3879
3956
|
/>
|
|
3957
|
+
<div className={`${css.card} ${css.settingsCard}`} style={{ gap: 'var(--nf-space-24)' }}>
|
|
3958
|
+
<span className={css.cardTitle}><Settings size={18} style={{ verticalAlign: -3 }} /> 任务级模型路由</span>
|
|
3959
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-24)' }}>
|
|
3960
|
+
<div className={css.field}>
|
|
3961
|
+
<label className={css.fieldLabel}>正文生成模型</label>
|
|
3962
|
+
<input className={css.input} value={configDraft.generateModel ?? ''} placeholder={configDraft.model} onChange={e => setConfigDraft({ ...configDraft, generateModel: e.target.value })} />
|
|
3963
|
+
<span className={css.meta}>留空则跟随全局模型(当前 {configDraft.model})</span>
|
|
3964
|
+
</div>
|
|
3965
|
+
<div className={css.field}>
|
|
3966
|
+
<label className={css.fieldLabel}>审稿模型</label>
|
|
3967
|
+
<input className={css.input} value={configDraft.reviewModel ?? ''} placeholder={configDraft.model} onChange={e => setConfigDraft({ ...configDraft, reviewModel: e.target.value })} />
|
|
3968
|
+
<span className={css.meta}>留空则跟随全局模型</span>
|
|
3969
|
+
</div>
|
|
3970
|
+
<div className={css.field}>
|
|
3971
|
+
<label className={css.fieldLabel}>AI 复核/质检模型</label>
|
|
3972
|
+
<input className={css.input} value={configDraft.auditModel ?? ''} placeholder={configDraft.model} onChange={e => setConfigDraft({ ...configDraft, auditModel: e.target.value })} />
|
|
3973
|
+
<span className={css.meta}>留空则跟随全局模型</span>
|
|
3974
|
+
</div>
|
|
3975
|
+
</div>
|
|
3976
|
+
</div>
|
|
3880
3977
|
</>
|
|
3881
3978
|
)}
|
|
3882
3979
|
|
|
@@ -4420,6 +4517,10 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
4420
4517
|
</div>
|
|
4421
4518
|
)}
|
|
4422
4519
|
|
|
4520
|
+
{activeTab === 'director' && <DirectorView api={api} todos={project?.todos ?? []} onTodosChange={(todos) => setProject(prev => prev === null ? prev : { ...prev, todos, updatedAt: new Date().toISOString() })} />}
|
|
4521
|
+
|
|
4522
|
+
{activeTab === 'knowledge' && <KnowledgeBaseView api={api} />}
|
|
4523
|
+
|
|
4423
4524
|
{activeTab === 'run' && (
|
|
4424
4525
|
<RunPanel api={api} totalChapters={chapters.length} />
|
|
4425
4526
|
)}
|
|
@@ -4514,8 +4615,8 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
4514
4615
|
dragState.current = { type: 'move', target: 'assistant', startX: e.clientX, startY: e.clientY, origX: assistantPos.x, origY: assistantPos.y, origW: assistantSize.w, origH: assistantSize.h }
|
|
4515
4616
|
}}
|
|
4516
4617
|
>
|
|
4517
|
-
<span>💬 AI
|
|
4518
|
-
<button type="button" className={css.iconButton} title="关闭" aria-label="关闭 AI
|
|
4618
|
+
<span>💬 AI 编辑 Agent <span className={css.meta}>(拖动标题栏移动 · 右下角拉大小)</span></span>
|
|
4619
|
+
<button type="button" className={css.iconButton} title="关闭" aria-label="关闭 AI 编辑 Agent" onClick={() => { setAssistantOpen(false) }}>×</button>
|
|
4519
4620
|
</div>
|
|
4520
4621
|
<div className={css.assistantFloatBody}>
|
|
4521
4622
|
<AssistantTab api={api} />
|
|
@@ -4558,7 +4659,7 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
4558
4659
|
<button type="button" className={css.iconButton} title="关闭" aria-label="关闭AI进度" onClick={() => { setProgressOpen(false) }}>×</button>
|
|
4559
4660
|
</span>
|
|
4560
4661
|
</div>
|
|
4561
|
-
<div className={css.assistantFloatBody} style={{ padding: 'var(--nf-space-10)', display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-8)', overflow: 'hidden' }}>
|
|
4662
|
+
<div className={css.assistantFloatBody} style={{ padding: 'var(--nf-space-10)', display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-8)', overflow: 'hidden', flex: 1, minHeight: 0 }}>
|
|
4562
4663
|
{/* 当前任务大进度条:进行中显示 */}
|
|
4563
4664
|
{(busy && (busyLabel !== '' || liveBar !== null)) && (
|
|
4564
4665
|
<div style={{ border: '1px solid var(--nf-accent)', borderRadius: 'var(--nf-radius-10)', padding: 'var(--nf-space-8) var(--nf-space-12)', display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-6)', background: 'color-mix(in srgb, var(--nf-accent) 6%, transparent)' }}>
|
|
@@ -4574,12 +4675,11 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
4574
4675
|
</div>
|
|
4575
4676
|
)}
|
|
4576
4677
|
{/* 活动记录列表(标题行已并入窗口标题栏,清空按钮在右上角) */}
|
|
4577
|
-
<div className={css.progress} style={{ flex: 1, minHeight: 0, overflowY: 'auto', border: '1px solid var(--nf-border)', borderRadius: 'var(--nf-radius-10)', background: 'var(--nf-bg-inset)', padding: 'var(--nf-space-8)', display: 'flex', flexDirection: 'column' }}>
|
|
4678
|
+
<div className={css.progress} style={{ flex: '0 1 auto', maxHeight: '42%', minHeight: 0, overflowY: 'auto', border: '1px solid var(--nf-border)', borderRadius: 'var(--nf-radius-10)', background: 'var(--nf-bg-inset)', padding: 'var(--nf-space-8)', display: 'flex', flexDirection: 'column' }}>
|
|
4578
4679
|
{progress.length === 0 ? (
|
|
4579
|
-
<div style={{
|
|
4580
|
-
<span
|
|
4581
|
-
<span
|
|
4582
|
-
<span>生成、审稿等操作会显示在这里</span>
|
|
4680
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 'var(--nf-space-6)', color: 'var(--nf-text-3)', fontSize: 'var(--nf-fs-12)', padding: 'var(--nf-space-4) 2px' }}>
|
|
4681
|
+
<span>📭</span>
|
|
4682
|
+
<span>暂无活动记录,生成、审稿等操作会显示在这里</span>
|
|
4583
4683
|
</div>
|
|
4584
4684
|
) : (
|
|
4585
4685
|
progress.map(line => (
|
|
@@ -4595,6 +4695,7 @@ export function NovelPanel({ controller, api }: NovelPanelProps) {
|
|
|
4595
4695
|
)}
|
|
4596
4696
|
<div ref={progressEndRef} />
|
|
4597
4697
|
</div>
|
|
4698
|
+
<LiveFeedLog />
|
|
4598
4699
|
</div>
|
|
4599
4700
|
<div
|
|
4600
4701
|
className={css.assistantResize}
|
|
@@ -26,7 +26,7 @@ export function ProgressConsole({ progress, busy, busyLabel, liveBar, onClear }:
|
|
|
26
26
|
}, [progress]);
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-10)',
|
|
29
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--nf-space-10)', minHeight: 0 }}>
|
|
30
30
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
31
31
|
<span style={{ fontWeight: 600 }}>📊 AI 进度</span>
|
|
32
32
|
<button type="button" className={css.button + ' ' + css.buttonSmall} onClick={onClear} title="清空活动记录">清空</button>
|
|
@@ -40,12 +40,11 @@ export function ProgressConsole({ progress, busy, busyLabel, liveBar, onClear }:
|
|
|
40
40
|
{liveBar?.text !== undefined && <span className={css.liveText}>{liveBar.text}</span>}
|
|
41
41
|
</div>
|
|
42
42
|
)}
|
|
43
|
-
<div className={css.progress} style={{ flex: 1, minHeight: 0, overflowY: 'auto', border: '1px solid var(--nf-border)', borderRadius: 'var(--nf-radius-10)', background: 'var(--nf-bg-inset)', padding: 'var(--nf-space-8)', display: 'flex', flexDirection: 'column' }}>
|
|
43
|
+
<div className={css.progress} style={{ flex: '0 1 auto', maxHeight: '42%', minHeight: 0, overflowY: 'auto', border: '1px solid var(--nf-border)', borderRadius: 'var(--nf-radius-10)', background: 'var(--nf-bg-inset)', padding: 'var(--nf-space-8)', display: 'flex', flexDirection: 'column' }}>
|
|
44
44
|
{progress.length === 0 ? (
|
|
45
|
-
<div style={{
|
|
46
|
-
<span
|
|
47
|
-
<span
|
|
48
|
-
<span>生成、审稿等操作会显示在这里</span>
|
|
45
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 'var(--nf-space-6)', color: 'var(--nf-text-3)', fontSize: 'var(--nf-fs-12)', padding: 'var(--nf-space-4) 2px' }}>
|
|
46
|
+
<span>📭</span>
|
|
47
|
+
<span>暂无活动记录,生成、审稿等操作会显示在这里</span>
|
|
49
48
|
</div>
|
|
50
49
|
) : (
|
|
51
50
|
progress.map(line => (
|
|
@@ -77,6 +77,9 @@ export function SettingsView({ api, onTheme, onSettingsTab, onEditorFontSize, on
|
|
|
77
77
|
outputDir: configDraft.outputDir,
|
|
78
78
|
provider: configDraft.provider,
|
|
79
79
|
model: configDraft.model,
|
|
80
|
+
generateModel: configDraft.generateModel,
|
|
81
|
+
reviewModel: configDraft.reviewModel,
|
|
82
|
+
auditModel: configDraft.auditModel,
|
|
80
83
|
reasoningEffort: configDraft.reasoningEffort ?? 'off',
|
|
81
84
|
chapterChars: configDraft.chapterChars,
|
|
82
85
|
maxTokens: configDraft.maxTokens,
|
|
@@ -1758,8 +1758,7 @@ select.input {
|
|
|
1758
1758
|
|
|
1759
1759
|
.chatScroll {
|
|
1760
1760
|
flex: 1;
|
|
1761
|
-
min-height:
|
|
1762
|
-
max-height: 480px;
|
|
1761
|
+
min-height: 0;
|
|
1763
1762
|
overflow-y: auto;
|
|
1764
1763
|
display: flex;
|
|
1765
1764
|
flex-direction: column;
|
|
@@ -1772,7 +1771,7 @@ select.input {
|
|
|
1772
1771
|
|
|
1773
1772
|
.chatBubbleUser {
|
|
1774
1773
|
align-self: flex-end;
|
|
1775
|
-
max-width:
|
|
1774
|
+
max-width: 72%;
|
|
1776
1775
|
background: linear-gradient(180deg, var(--nf-accent), var(--nf-accent-hover));
|
|
1777
1776
|
color: var(--nf-accent-fg);
|
|
1778
1777
|
border-radius: var(--nf-radius-14, 14px) var(--nf-radius-14, 14px) var(--nf-radius-4, 4px) var(--nf-radius-14, 14px);
|