@waterwx/dsh-novel-forge 0.1.0 → 1.0.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 +162 -111
- package/cordis.patch.yml +1 -1
- package/lib/client.js +54165 -2666
- package/lib/index.js +11895 -2211
- package/lib/types/ai-scan.d.ts +36 -0
- package/lib/types/assets.d.ts +19 -4
- package/lib/types/assistant.d.ts +6 -0
- package/lib/types/author-assets.d.ts +25 -0
- package/lib/types/bookshelf.d.ts +8 -1
- package/lib/types/client/api.d.ts +235 -3
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/llmLive.d.ts +33 -0
- package/lib/types/client/locales.d.ts +101 -28
- package/lib/types/client/panel/AdaptModeView.d.ts +5 -0
- package/lib/types/client/panel/AssetsTab.d.ts +6 -1
- package/lib/types/client/panel/AuthorAssetsView.d.ts +4 -0
- package/lib/types/client/panel/AuthorHome.d.ts +34 -0
- package/lib/types/client/panel/BookAnalysisView.d.ts +4 -0
- package/lib/types/client/panel/CreateBookView.d.ts +13 -0
- package/lib/types/client/panel/DirectorView.d.ts +7 -0
- package/lib/types/client/panel/FlowGuide.d.ts +22 -0
- package/lib/types/client/panel/GlobalAssetLibraryView.d.ts +4 -0
- package/lib/types/client/panel/IdeaInspirationView.d.ts +6 -0
- package/lib/types/client/panel/ImportModal.d.ts +7 -0
- 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 +20 -0
- package/lib/types/client/panel/MangaWorkspace.d.ts +12 -0
- package/lib/types/client/panel/MarketRadarView.d.ts +5 -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/NovelPanel.d.ts +1 -1
- 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/PropLibrary.d.ts +8 -0
- package/lib/types/client/panel/ReaderView.d.ts +8 -0
- package/lib/types/client/panel/ReasoningSection.d.ts +10 -0
- package/lib/types/client/panel/RunPanel.d.ts +5 -0
- package/lib/types/client/panel/SceneLibrary.d.ts +16 -0
- package/lib/types/client/panel/SettingsView.d.ts +16 -0
- package/lib/types/client/panel/ShelfView.d.ts +15 -0
- package/lib/types/client/panel/StoryboardTab.d.ts +19 -0
- package/lib/types/client/panel/StyleCard.d.ts +8 -0
- package/lib/types/client/panel/StyleGallery.d.ts +1 -0
- package/lib/types/client/panel/WorldTab.d.ts +10 -0
- package/lib/types/client/panel/helpers.d.ts +10 -0
- package/lib/types/client/panel/views.d.ts +77 -0
- package/lib/types/client/run-status.d.ts +19 -0
- package/lib/types/client/text.d.ts +9 -0
- package/lib/types/comic-presets.d.ts +12 -0
- package/lib/types/engine.d.ts +250 -8
- package/lib/types/global-assets.d.ts +6 -0
- package/lib/types/index.d.ts +24 -2
- package/lib/types/llm-live.d.ts +44 -0
- package/lib/types/manga-genre-rules.d.ts +22 -0
- package/lib/types/market-radar-scan.d.ts +19 -0
- package/lib/types/market-radar-sources.d.ts +31 -0
- package/lib/types/novel-context.d.ts +80 -0
- package/lib/types/prompt-utils.d.ts +35 -0
- package/lib/types/prompting.d.ts +35 -0
- package/lib/types/protocol.d.ts +1453 -5
- package/lib/types/review-policy.d.ts +97 -0
- package/lib/types/run.d.ts +32 -0
- package/lib/types/shot-language.d.ts +46 -0
- 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/lib/types/story-beat-language.d.ts +35 -0
- package/lib/types/style-library.d.ts +33 -0
- package/package.json +57 -42
- package/scripts/patch-schemastery.mjs +47 -0
- package/src/ai-scan.ts +179 -0
- package/src/assets.ts +1774 -518
- package/src/assistant.ts +915 -547
- package/src/author-assets.ts +147 -0
- package/src/bookshelf.ts +32 -2
- package/src/client/api.ts +666 -254
- package/src/client/index.ts +3 -1
- package/src/client/llmLive.ts +101 -0
- package/src/client/locales.ts +178 -31
- package/src/client/mount.tsx +1 -1
- package/src/client/panel/AdaptModeView.tsx +535 -0
- package/src/client/panel/AssetsTab.tsx +168 -51
- package/src/client/panel/AssistantTab.tsx +339 -188
- package/src/client/panel/AuthorAssetsView.tsx +208 -0
- package/src/client/panel/AuthorHome.tsx +234 -0
- package/src/client/panel/BookAnalysisView.tsx +60 -0
- package/src/client/panel/BookshelfBar.tsx +63 -9
- package/src/client/panel/CreateBookView.tsx +371 -0
- package/src/client/panel/DirectorView.tsx +200 -0
- package/src/client/panel/GlobalAssetLibraryView.tsx +172 -0
- package/src/client/panel/IdeaInspirationView.tsx +71 -0
- package/src/client/panel/ImportModal.tsx +303 -0
- package/src/client/panel/KnowledgeBaseView.tsx +73 -0
- package/src/client/panel/LiveFeedLog.tsx +67 -0
- package/src/client/panel/MarketRadarView.tsx +374 -0
- package/src/client/panel/ModelManager.tsx +205 -0
- package/src/client/panel/NovelPanel.tsx +4713 -990
- package/src/client/panel/ProgressConsole.tsx +63 -0
- package/src/client/panel/ProgressHomeView.tsx +87 -0
- package/src/client/panel/ReaderView.tsx +306 -0
- package/src/client/panel/ReasoningSection.tsx +31 -0
- package/src/client/panel/RunPanel.tsx +204 -0
- package/src/client/panel/SettingsView.tsx +265 -0
- package/src/client/panel/ShelfView.tsx +242 -0
- package/src/client/panel/WorldTab.tsx +202 -0
- package/src/client/panel/helpers.ts +50 -0
- package/src/client/panel/panel.module.css +4325 -526
- package/src/client/panel/views.tsx +346 -0
- package/src/client/run-status.ts +100 -0
- package/src/client/sidebar-entry.ts +1 -1
- package/src/client/text.ts +28 -0
- package/src/engine.ts +4230 -1019
- package/src/global-assets.ts +59 -0
- package/src/index.ts +123 -9
- 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/novel-context.ts +287 -0
- package/src/prompt-utils.ts +73 -0
- package/src/prompting.ts +159 -0
- package/src/protocol.ts +1998 -539
- package/src/review-policy.ts +161 -0
- package/src/routes.ts +3277 -955
- package/src/run.ts +338 -0
- package/lib/client.js.map +0 -1
- package/lib/index.js.map +0 -1
package/src/client/index.ts
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* problems are logged, never thrown — the web shell fails the whole boot when
|
|
5
5
|
* a plugin apply throws.
|
|
6
6
|
*/
|
|
7
|
-
import type { ClientContext } from '@deepseek-ai/
|
|
7
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis'
|
|
8
8
|
import { NovelApi } from './api.ts'
|
|
9
9
|
import { mountPanel } from './mount.tsx'
|
|
10
10
|
import { PanelController } from './panel/controller.ts'
|
|
11
11
|
import { mountSidebarEntry } from './sidebar-entry.ts'
|
|
12
|
+
import { mountRunStatus } from './run-status.ts'
|
|
12
13
|
|
|
13
14
|
/** Required services (fiber inject waiting). */
|
|
14
15
|
export const inject = ['slots', 'locale']
|
|
@@ -24,6 +25,7 @@ export function apply(ctx: ClientContext): void {
|
|
|
24
25
|
try {
|
|
25
26
|
disposers.push(mountSidebarEntry(controller))
|
|
26
27
|
disposers.push(mountPanel(controller, api))
|
|
28
|
+
disposers.push(mountRunStatus(controller, api))
|
|
27
29
|
} catch (error) {
|
|
28
30
|
// DOM failures degrade the panel, never the GUI.
|
|
29
31
|
console.warn('[dsh-novel-forge] mount failed:', error)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浏览器端「AI 创作实况」钩子:连接 /llm-live/stream (SSE),按 LLM 调用分组会话。
|
|
3
|
+
* 轻量实现,不持久化缓存(对齐上游 useLlmLiveFeed 的核心行为)。
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
7
|
+
import { NOVEL_API } from '../protocol.ts'
|
|
8
|
+
|
|
9
|
+
export interface LlmLiveFrame {
|
|
10
|
+
type: 'session_started' | 'output_delta' | 'reasoning_delta' | 'phase_changed' | 'session_completed'
|
|
11
|
+
sessionId: string
|
|
12
|
+
label?: string
|
|
13
|
+
model?: string
|
|
14
|
+
at: string
|
|
15
|
+
content?: string
|
|
16
|
+
totalChars?: number
|
|
17
|
+
totalReasoningChars?: number
|
|
18
|
+
phase?: 'requesting' | 'streaming' | 'completed' | 'failed'
|
|
19
|
+
phaseMessage?: string
|
|
20
|
+
preview?: string
|
|
21
|
+
error?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface LlmLiveSession {
|
|
25
|
+
sessionId: string
|
|
26
|
+
label: string
|
|
27
|
+
model?: string
|
|
28
|
+
phase: 'requesting' | 'streaming' | 'completed' | 'failed'
|
|
29
|
+
phaseMessage: string
|
|
30
|
+
preview: string
|
|
31
|
+
totalChars: number
|
|
32
|
+
startedAt: string
|
|
33
|
+
updatedAt: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const MAX_PREVIEW_CHARS = 20_000
|
|
37
|
+
|
|
38
|
+
function applyFrame(current: Record<string, LlmLiveSession>, frame: LlmLiveFrame): Record<string, LlmLiveSession> {
|
|
39
|
+
const next = { ...current }
|
|
40
|
+
const id = frame.sessionId
|
|
41
|
+
let session = next[id]
|
|
42
|
+
if (frame.type === 'session_started') {
|
|
43
|
+
session = {
|
|
44
|
+
sessionId: id,
|
|
45
|
+
label: frame.label ?? 'LLM 调用',
|
|
46
|
+
model: frame.model,
|
|
47
|
+
phase: 'requesting',
|
|
48
|
+
phaseMessage: '正在连接模型',
|
|
49
|
+
preview: '',
|
|
50
|
+
totalChars: 0,
|
|
51
|
+
startedAt: frame.at,
|
|
52
|
+
updatedAt: frame.at,
|
|
53
|
+
}
|
|
54
|
+
next[id] = session
|
|
55
|
+
return next
|
|
56
|
+
}
|
|
57
|
+
if (session === undefined) return next
|
|
58
|
+
if (frame.type === 'output_delta') {
|
|
59
|
+
const preview = (session.preview + (frame.content ?? '')).slice(-MAX_PREVIEW_CHARS)
|
|
60
|
+
session = { ...session, phase: session.phase === 'requesting' ? 'streaming' : session.phase, phaseMessage: session.phase === 'requesting' ? '模型正在返回内容' : session.phaseMessage, preview, totalChars: frame.totalChars ?? session.totalChars + (frame.content?.length ?? 0), updatedAt: frame.at }
|
|
61
|
+
next[id] = session
|
|
62
|
+
} else if (frame.type === 'reasoning_delta') {
|
|
63
|
+
session = { ...session, phase: session.phase === 'requesting' ? 'streaming' : session.phase, updatedAt: frame.at }
|
|
64
|
+
next[id] = session
|
|
65
|
+
} else if (frame.type === 'phase_changed') {
|
|
66
|
+
session = { ...session, phase: frame.phase ?? session.phase, phaseMessage: frame.phaseMessage ?? session.phaseMessage, updatedAt: frame.at }
|
|
67
|
+
next[id] = session
|
|
68
|
+
} else if (frame.type === 'session_completed') {
|
|
69
|
+
session = { ...session, phase: frame.phase ?? 'completed', phaseMessage: frame.phase === 'failed' ? (frame.error ?? '调用失败') : '模型结果已准备完成', totalChars: frame.totalChars ?? session.totalChars, preview: session.preview || (frame.preview ?? ''), updatedAt: frame.at }
|
|
70
|
+
next[id] = session
|
|
71
|
+
}
|
|
72
|
+
return next
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function useLlmLiveFeed(enabled = true): { connected: boolean; sessions: LlmLiveSession[] } {
|
|
76
|
+
const [sessions, setSessions] = useState<Record<string, LlmLiveSession>>({})
|
|
77
|
+
const [connected, setConnected] = useState(false)
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (!enabled) {
|
|
80
|
+
setSessions({})
|
|
81
|
+
setConnected(false)
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
const es = new EventSource(NOVEL_API.llmLive)
|
|
85
|
+
es.onopen = () => setConnected(true)
|
|
86
|
+
es.onmessage = (ev) => {
|
|
87
|
+
try {
|
|
88
|
+
const frame = JSON.parse(ev.data as string) as LlmLiveFrame
|
|
89
|
+
setSessions(prev => applyFrame(prev, frame))
|
|
90
|
+
} catch { /* ignore malformed frame */ }
|
|
91
|
+
}
|
|
92
|
+
// EventSource 断线会自动重连;这里只在断线瞬间标记未连接,重连成功后会再次 onopen。
|
|
93
|
+
es.onerror = () => setConnected(false)
|
|
94
|
+
return () => {
|
|
95
|
+
es.close()
|
|
96
|
+
setConnected(false)
|
|
97
|
+
}
|
|
98
|
+
}, [enabled])
|
|
99
|
+
const list = useMemo(() => Object.values(sessions).sort((a, b) => a.startedAt.localeCompare(b.startedAt)), [sessions])
|
|
100
|
+
return { connected, sessions: list }
|
|
101
|
+
}
|
package/src/client/locales.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** zh dictionary. */
|
|
6
6
|
export const zh = {
|
|
7
7
|
'entry.label': '小说工坊',
|
|
8
|
-
'entry.tooltip': 'AI
|
|
8
|
+
'entry.tooltip': 'AI 编译小说工作台:总纲 → 道藏 → 卷计划 → 章节计划 → 逐章生成+审稿',
|
|
9
9
|
'panel.title': '小说工坊',
|
|
10
10
|
'common.close': '关闭',
|
|
11
11
|
'common.loading': '加载中…',
|
|
@@ -14,37 +14,37 @@ export const zh = {
|
|
|
14
14
|
'common.success': '成功',
|
|
15
15
|
'common.generating': '生成中…',
|
|
16
16
|
'common.chars': '字',
|
|
17
|
-
'tab.workflow': '
|
|
18
|
-
'tab.overview': '
|
|
17
|
+
'tab.workflow': '工作台',
|
|
18
|
+
'tab.overview': '总纲',
|
|
19
19
|
'tab.plan': '章节',
|
|
20
|
-
'tab.bible': '
|
|
21
|
-
'tab.foreshadow': '
|
|
22
|
-
'tab.assistant': 'AI
|
|
20
|
+
'tab.bible': '道藏',
|
|
21
|
+
'tab.foreshadow': '暗线',
|
|
22
|
+
'tab.assistant': 'AI 编辑 Agent',
|
|
23
23
|
'tab.settings': '设置',
|
|
24
|
-
'workflow.title': '
|
|
25
|
-
'workflow.step1': '①
|
|
26
|
-
'workflow.step2': '②
|
|
24
|
+
'workflow.title': '创作工作台',
|
|
25
|
+
'workflow.step1': '① 加载总纲',
|
|
26
|
+
'workflow.step2': '② 提炼道藏',
|
|
27
27
|
'workflow.step3': '③ 规划卷',
|
|
28
28
|
'workflow.step4': '④ 生成章节计划',
|
|
29
29
|
'workflow.step5': '⑤ 逐章写作 + AI 审稿',
|
|
30
30
|
'workflow.step6': '⑥ 润色 / 导出',
|
|
31
|
-
'workflow.loadOutline': '
|
|
32
|
-
'workflow.genBible': '
|
|
31
|
+
'workflow.loadOutline': '读取总纲',
|
|
32
|
+
'workflow.genBible': '提炼道藏',
|
|
33
33
|
'workflow.genVolumes': '生成卷计划',
|
|
34
34
|
'workflow.genPlan': '生成章节计划',
|
|
35
35
|
'workflow.done': '已完成',
|
|
36
36
|
'workflow.todo': '待办',
|
|
37
|
-
'workflow.bibleDone': '
|
|
37
|
+
'workflow.bibleDone': '道藏已生成({n} 条规则 / {c} 个人物 / {r} 条红线)',
|
|
38
38
|
'workflow.volumesDone': '卷计划已生成({n} 卷)',
|
|
39
39
|
'workflow.planDone': '章节计划已生成({n} 章)',
|
|
40
|
-
'workflow.progress': '
|
|
41
|
-
'overview.loadDocx': '从 docx
|
|
42
|
-
'overview.loadDocxDefault': '
|
|
40
|
+
'workflow.progress': '进度:总纲 ✓ · 道藏 {bible} · 卷 {volumes} · 计划 {plan} · 已完成 {done}/{total} 章',
|
|
41
|
+
'overview.loadDocx': '从 docx 读取总纲',
|
|
42
|
+
'overview.loadDocxDefault': '读取默认总纲',
|
|
43
43
|
'overview.loadingOutline': '正在解析 docx…',
|
|
44
|
-
'overview.outlineHint': '
|
|
45
|
-
'overview.outlineChars': '
|
|
46
|
-
'overview.saveOutline': '
|
|
47
|
-
'overview.saved': '
|
|
44
|
+
'overview.outlineHint': '总纲文本(可编辑)',
|
|
45
|
+
'overview.outlineChars': '总纲字数',
|
|
46
|
+
'overview.saveOutline': '保存总纲',
|
|
47
|
+
'overview.saved': '总纲已保存',
|
|
48
48
|
'overview.bookName': '书名',
|
|
49
49
|
'overview.loadCustom': '指定 docx 路径',
|
|
50
50
|
'overview.loadCustomHint': '绝对路径,留空使用默认',
|
|
@@ -79,17 +79,17 @@ export const zh = {
|
|
|
79
79
|
'plan.summary': '章节摘要',
|
|
80
80
|
'plan.volumes': '卷',
|
|
81
81
|
'plan.noVolume': '未分卷',
|
|
82
|
-
'bible.title': '
|
|
83
|
-
'bible.gen': 'AI
|
|
82
|
+
'bible.title': '道藏',
|
|
83
|
+
'bible.gen': 'AI 提炼道藏',
|
|
84
84
|
'bible.genre': '题材基调',
|
|
85
85
|
'bible.worldRules': '世界规则',
|
|
86
|
-
'bible.characters': '
|
|
86
|
+
'bible.characters': '人物志',
|
|
87
87
|
'bible.redLines': '写作红线',
|
|
88
88
|
'bible.style': '风格要求',
|
|
89
|
-
'bible.none': '
|
|
90
|
-
'foreshadow.title': '
|
|
91
|
-
'foreshadow.suggest': 'AI
|
|
92
|
-
'foreshadow.none': '
|
|
89
|
+
'bible.none': '尚未生成道藏。生成后写作会严格遵守人设与金手指规则,审稿也会按红线检查。',
|
|
90
|
+
'foreshadow.title': '暗线管理',
|
|
91
|
+
'foreshadow.suggest': 'AI 建议暗线',
|
|
92
|
+
'foreshadow.none': '暂无暗线',
|
|
93
93
|
'foreshadow.status': '状态',
|
|
94
94
|
'foreshadow.planned': '计划中',
|
|
95
95
|
'foreshadow.planted': '已埋设',
|
|
@@ -100,15 +100,88 @@ export const zh = {
|
|
|
100
100
|
'foreshadow.plantedAt': '埋设于',
|
|
101
101
|
'foreshadow.setPlanted': '标记已埋设',
|
|
102
102
|
'foreshadow.setResolved': '标记已回收',
|
|
103
|
+
'tab.facts': '编年录',
|
|
104
|
+
'tab.plotlines': '剧情线',
|
|
105
|
+
'plotlines.hint': '主线/支线/人物线/悬念线的推进管理:章节生成时会注入未完结的线,要求每章至少推进一条;关联章节记录推进节点。',
|
|
106
|
+
'plotlines.empty': '还没有剧情线——长篇小说建议先建主线与几条支线。',
|
|
107
|
+
'plotlines.new': '+ 新建剧情线',
|
|
108
|
+
'plotlines.name': '线名',
|
|
109
|
+
'plotlines.kind': '类型',
|
|
110
|
+
'plotlines.kindMain': '主线',
|
|
111
|
+
'plotlines.kindBranch': '支线',
|
|
112
|
+
'plotlines.kindCharacter': '人物线',
|
|
113
|
+
'plotlines.kindMystery': '悬念线',
|
|
114
|
+
'plotlines.goal': '目标/终点',
|
|
115
|
+
'plotlines.progress': '当前进度',
|
|
116
|
+
'plotlines.status': '状态',
|
|
117
|
+
'plotlines.statusActive': '推进中',
|
|
118
|
+
'plotlines.statusPaused': '暂停',
|
|
119
|
+
'plotlines.statusResolved': '已完结',
|
|
120
|
+
'plotlines.statusAbandoned': '已废弃',
|
|
121
|
+
'plotlines.save': '保存',
|
|
122
|
+
'plotlines.cancel': '取消',
|
|
123
|
+
'plotlines.edit': '编辑',
|
|
124
|
+
'plotlines.remove': '删除',
|
|
125
|
+
'plotlines.linkChapter': '关联本章',
|
|
126
|
+
'plotlines.chapters': '已关联',
|
|
127
|
+
'plotlines.workflowTitle': '剧情线进度',
|
|
128
|
+
'plotlines.workflowEmpty': '未建剧情线(去「剧情线」页创建)',
|
|
129
|
+
'sensitive.title': '敏感词检查',
|
|
130
|
+
'sensitive.scanAll': '🔞 全书敏感词检查',
|
|
131
|
+
'sensitive.hint': '内置违禁词库硬匹配(政治/擦边/暴力/辱骂/广告/其他),发布前建议检查;只做提示,是否修改由你判断。',
|
|
132
|
+
'sensitive.clean': '✅ 未命中任何违禁词(扫描 {n} 章)',
|
|
133
|
+
'sensitive.hits': '命中 {n} 处({chapters} 章受影响)',
|
|
134
|
+
'sensitive.goFix': '去修订',
|
|
135
|
+
'sensitive.fixPrefill': '请删除或替换正文中的违禁表达「{word}」(类别:{category}),用含蓄/间接的写法替代。',
|
|
136
|
+
'facts.title': '编年录 / 时间线({n} 条)',
|
|
137
|
+
'facts.hint': '每章生成后自动抽取「已确立事实」(人物状态/境界资源/关系变化/伏笔落地),最近 20 条注入后续章节生成,保证长期一致。',
|
|
138
|
+
'facts.backfill': '回填历史章节事实',
|
|
139
|
+
'facts.backfilled': '已从历史章节回填 {n} 条事实',
|
|
103
140
|
'settings.title': '设置',
|
|
104
141
|
'settings.outlinePath': '默认大纲路径',
|
|
105
142
|
'settings.outputDir': '输出目录',
|
|
106
143
|
'settings.provider': '模型提供商',
|
|
107
144
|
'settings.model': '模型',
|
|
145
|
+
'settings.modelCustom': '自定义…',
|
|
146
|
+
'settings.customProvider': '自定义提供商…',
|
|
147
|
+
'settings.edit': '编辑',
|
|
148
|
+
'settings.delete': '删除',
|
|
149
|
+
'settings.modelCustomPlaceholder': '输入任意模型 id',
|
|
150
|
+
'settings.savedModels': '我的模型',
|
|
151
|
+
'settings.modelCards': '模型卡片(内置 + 已添加)',
|
|
152
|
+
'settings.savedModelName': '名称',
|
|
153
|
+
'settings.addModel': '添加模型',
|
|
154
|
+
'settings.catalogRefresh': '刷新厂商',
|
|
155
|
+
'settings.refreshModels': '刷新模型',
|
|
156
|
+
'settings.savedModelsHint': '手动添加常用模型(provider + 模型 id),点击即可切换当前模型;厂商模式会写入 DSH 凭据并注册路由。',
|
|
157
|
+
'settings.testConnection': '测试连通',
|
|
158
|
+
'settings.testRunning': '测试中',
|
|
159
|
+
'settings.testOk': '连通',
|
|
160
|
+
'settings.testFail': '失败',
|
|
161
|
+
'settings.testHint': '真实发送一次最小调用(约几十 token),验证 Key / 端点 / 模型可用。',
|
|
162
|
+
'settings.reasoningSection': '推理强度',
|
|
163
|
+
'settings.reasoningEffort': '写作类任务思考强度 (reasoningEffort)',
|
|
164
|
+
'settings.reasoningHint': '章节生成/润色/重写/审稿等写作任务使用;关掉更省更快。',
|
|
165
|
+
'settings.analysisReasoning': '分析类任务思考强度(提炼/拆书/反推大纲)',
|
|
166
|
+
'settings.analysisReasoningHint': '角色/场景/道藏提炼、拆书、反推大纲等一次性分析任务默认 low,保证质量,不受上面写作档位影响。',
|
|
167
|
+
'settings.reasoning.off': 'off · 关闭思考(推荐日常写文)',
|
|
168
|
+
'settings.reasoning.low': 'low · 低思考',
|
|
169
|
+
'settings.reasoning.high': 'high · 高思考',
|
|
170
|
+
'settings.reasoning.max': 'max · 最高思考(质检/推演)',
|
|
171
|
+
'settings.theme': '主题',
|
|
172
|
+
'settings.themeLiquid': 'iOS 液态玻璃(绿)',
|
|
173
|
+
'settings.themeNeumorph': '新拟物(双阴影)',
|
|
174
|
+
'settings.themeHint': '存于浏览器本地,即时生效',
|
|
108
175
|
'settings.chapterChars': '每章目标字数',
|
|
109
176
|
'settings.maxTokens': '单章最大输出 tokens',
|
|
110
177
|
'settings.reviewPassScore': '审稿通过分数(0-100)',
|
|
178
|
+
'settings.editorFontSize': '编辑器字号(仅编辑页显示)',
|
|
179
|
+
'settings.editorFontSizeHint': '存于浏览器本地,不影响其他设备',
|
|
111
180
|
'settings.autoReview': '生成后自动审稿',
|
|
181
|
+
'settings.autoAuthorReview': '生成后自动作者复盘',
|
|
182
|
+
'settings.autoAuthorReviewHint': '复盘钩子兑现/结尾钩子/剧情线推进/连续性/节奏趋势,每章约 2000 token',
|
|
183
|
+
'settings.autoReviewAfterRevise': '修订后自动审查',
|
|
184
|
+
'settings.autoReviewAfterReviseHint': '按意见修订/润色产出草稿后自动附带一次 AI 审查,直接显示新稿评分与剩余问题(每章约 2-3k token,可关)',
|
|
112
185
|
'settings.save': '保存设置',
|
|
113
186
|
'settings.saved': '设置已保存',
|
|
114
187
|
'settings.openFolder': '打开输出文件夹',
|
|
@@ -123,13 +196,13 @@ export const zh = {
|
|
|
123
196
|
'progress.rewriting': '正在修订第 {no} 章…',
|
|
124
197
|
'progress.polishing': '正在润色第 {no} 章…',
|
|
125
198
|
'progress.empty': '生成/审稿进度将显示在这里',
|
|
126
|
-
'assistant.hint': '和 AI
|
|
199
|
+
'assistant.hint': '和 AI 编辑 Agent 讨论剧情、人设、暗线;达成一致后可让它直接修改总纲、道藏、章节内容。',
|
|
127
200
|
'assistant.placeholder': '例如:我想让第 2 章结尾加一个悬念——墟境里传来爷爷的声音…',
|
|
128
201
|
'assistant.send': '发送',
|
|
129
202
|
'assistant.toolStart': '⚙ 执行操作:{name}…',
|
|
130
203
|
'assistant.toolDone': '✓ {name} 完成:{detail}',
|
|
131
204
|
'assistant.toolError': '✗ {name} 失败:{detail}',
|
|
132
|
-
'assistant.empty': '还没有对话。和 AI
|
|
205
|
+
'assistant.empty': '还没有对话。和 AI 编辑 Agent 聊聊剧情吧。',
|
|
133
206
|
'status.projectNone': '输出目录中还没有项目。请先加载大纲。',
|
|
134
207
|
'status.files': '已生成文件',
|
|
135
208
|
'api.error': '请求失败',
|
|
@@ -147,13 +220,13 @@ export const en: Record<string, string> = {
|
|
|
147
220
|
'common.success': 'Success',
|
|
148
221
|
'common.generating': 'Generating…',
|
|
149
222
|
'common.chars': ' chars',
|
|
150
|
-
'tab.workflow': '
|
|
223
|
+
'tab.workflow': 'Workbench',
|
|
151
224
|
'tab.overview': 'Outline',
|
|
152
225
|
'tab.plan': 'Chapters',
|
|
153
226
|
'tab.bible': 'Bible',
|
|
154
227
|
'tab.foreshadow': 'Foreshadow',
|
|
155
228
|
'tab.settings': 'Settings',
|
|
156
|
-
'workflow.title': 'Writing
|
|
229
|
+
'workflow.title': 'Writing workbench',
|
|
157
230
|
'workflow.step1': '① Load outline',
|
|
158
231
|
'workflow.step2': '② Extract story bible',
|
|
159
232
|
'workflow.step3': '③ Plan volumes',
|
|
@@ -237,10 +310,47 @@ export const en: Record<string, string> = {
|
|
|
237
310
|
'settings.outputDir': 'Output directory',
|
|
238
311
|
'settings.provider': 'Provider',
|
|
239
312
|
'settings.model': 'Model',
|
|
313
|
+
'settings.modelCustom': 'Custom…',
|
|
314
|
+
'settings.customProvider': 'Custom provider…',
|
|
315
|
+
'settings.edit': 'Edit',
|
|
316
|
+
'settings.delete': 'Delete',
|
|
317
|
+
'settings.modelCustomPlaceholder': 'Type any model id',
|
|
318
|
+
'settings.savedModels': 'My Models',
|
|
319
|
+
'settings.modelCards': 'Model cards (built-in + added)',
|
|
320
|
+
'settings.savedModelName': 'Name',
|
|
321
|
+
'settings.addModel': 'Add model',
|
|
322
|
+
'settings.catalogRefresh': 'Refresh vendors',
|
|
323
|
+
'settings.refreshModels': 'Refresh models',
|
|
324
|
+
'settings.savedModelsHint': 'Manually add a model (provider + model id); click to switch. Vendor mode writes the key into DSH credentials and registers the route.',
|
|
325
|
+
'settings.testConnection': 'Test',
|
|
326
|
+
'settings.testRunning': 'Testing',
|
|
327
|
+
'settings.testOk': 'OK',
|
|
328
|
+
'settings.testFail': 'Failed',
|
|
329
|
+
'settings.testHint': 'Sends one minimal real call (~dozens of tokens) to verify key / endpoint / model.',
|
|
330
|
+
'settings.reasoningSection': 'Reasoning',
|
|
331
|
+
'settings.reasoningEffort': 'Writing-task reasoning effort',
|
|
332
|
+
'settings.analysisReasoning': 'Analysis-task reasoning (extract / breakdown / reverse outline)',
|
|
333
|
+
'settings.analysisReasoningHint': 'One-off analysis tasks (roles/scenes/bible extract, breakdown, reverse outline) default to low; not affected by the writing-level switch.',
|
|
334
|
+
'settings.reasoning.off': 'off · no thinking (recommended)',
|
|
335
|
+
'settings.reasoning.low': 'low',
|
|
336
|
+
'settings.reasoning.high': 'high',
|
|
337
|
+
'settings.reasoning.max': 'max (audit/reasoning)',
|
|
338
|
+
'settings.reasoningHint': 'off is fastest/cheapest; high/max are slower and stronger',
|
|
339
|
+
'settings.theme': 'Theme',
|
|
340
|
+
'settings.themeLiquid': 'iOS Liquid Glass (green)',
|
|
341
|
+
'settings.themeClassic': 'Classic frosted (blue)',
|
|
342
|
+
'settings.themeNeumorph': 'Neumorphism (dual-shadow)',
|
|
343
|
+
'settings.themeHint': 'Stored in browser localStorage; applies instantly',
|
|
240
344
|
'settings.chapterChars': 'Chars per chapter',
|
|
241
345
|
'settings.maxTokens': 'Max output tokens',
|
|
242
346
|
'settings.reviewPassScore': 'Review pass score (0-100)',
|
|
347
|
+
'settings.editorFontSize': 'Editor font size (workspace only)',
|
|
348
|
+
'settings.editorFontSizeHint': 'Stored in browser localStorage; display-only',
|
|
243
349
|
'settings.autoReview': 'Auto-review after writing',
|
|
350
|
+
'settings.autoAuthorReview': 'Auto author review after writing',
|
|
351
|
+
'settings.autoAuthorReviewHint': 'Reviews hook payoff / ending hook / plotline progress / continuity / pacing trend (~2000 tokens per chapter)',
|
|
352
|
+
'settings.autoReviewAfterRevise': 'Auto review after revise',
|
|
353
|
+
'settings.autoReviewAfterReviseHint': 'Automatically runs one AI review on the produced draft after revise/polish, showing the new score and remaining issues (~2-3k tokens, can be disabled)',
|
|
244
354
|
'settings.save': 'Save settings',
|
|
245
355
|
'settings.saved': 'Settings saved',
|
|
246
356
|
'settings.openFolder': 'Open output folder',
|
|
@@ -248,6 +358,43 @@ export const en: Record<string, string> = {
|
|
|
248
358
|
'settings.exportTxt': 'Export TXT',
|
|
249
359
|
'settings.exportMd': 'Export Markdown',
|
|
250
360
|
'settings.exported': 'Exported: {file} ({chars} chars, {chapters} chapters)',
|
|
361
|
+
'tab.facts': 'Chronicle',
|
|
362
|
+
'tab.plotlines': 'Plotlines',
|
|
363
|
+
'plotlines.hint': 'Track main/branch/character/mystery arcs: unfinished arcs are injected into chapter writing so each chapter advances at least one; linked chapters record progress nodes.',
|
|
364
|
+
'plotlines.empty': 'No plotlines yet — consider creating the main arc and a few branches.',
|
|
365
|
+
'plotlines.new': '+ New plotline',
|
|
366
|
+
'plotlines.name': 'Name',
|
|
367
|
+
'plotlines.kind': 'Type',
|
|
368
|
+
'plotlines.kindMain': 'Main',
|
|
369
|
+
'plotlines.kindBranch': 'Branch',
|
|
370
|
+
'plotlines.kindCharacter': 'Character',
|
|
371
|
+
'plotlines.kindMystery': 'Mystery',
|
|
372
|
+
'plotlines.goal': 'Goal',
|
|
373
|
+
'plotlines.progress': 'Current progress',
|
|
374
|
+
'plotlines.status': 'Status',
|
|
375
|
+
'plotlines.statusActive': 'Active',
|
|
376
|
+
'plotlines.statusPaused': 'Paused',
|
|
377
|
+
'plotlines.statusResolved': 'Resolved',
|
|
378
|
+
'plotlines.statusAbandoned': 'Abandoned',
|
|
379
|
+
'plotlines.save': 'Save',
|
|
380
|
+
'plotlines.cancel': 'Cancel',
|
|
381
|
+
'plotlines.edit': 'Edit',
|
|
382
|
+
'plotlines.remove': 'Remove',
|
|
383
|
+
'plotlines.linkChapter': 'Link chapter',
|
|
384
|
+
'plotlines.chapters': 'Linked',
|
|
385
|
+
'plotlines.workflowTitle': 'Plotline progress',
|
|
386
|
+
'plotlines.workflowEmpty': 'No plotlines yet (create them in the Plotlines tab)',
|
|
387
|
+
'sensitive.title': 'Sensitive-word check',
|
|
388
|
+
'sensitive.scanAll': '🔞 Scan all chapters',
|
|
389
|
+
'sensitive.hint': 'Built-in banned-word library (politics/erotica/violence/abuse/ads/other). Run before publishing; suggestions only.',
|
|
390
|
+
'sensitive.clean': '✅ No banned words found ({n} chapters scanned)',
|
|
391
|
+
'sensitive.hits': '{n} hits across {chapters} chapters',
|
|
392
|
+
'sensitive.goFix': 'Fix',
|
|
393
|
+
'sensitive.fixPrefill': 'Remove or rephrase the banned expression "{word}" (category: {category}) with an indirect alternative.',
|
|
394
|
+
'facts.title': 'Chronicle / timeline ({n} facts)',
|
|
395
|
+
'facts.hint': 'Auto-extracted established facts per chapter (state/resources/relations/foreshadow landings); the latest 20 are injected into later chapters for consistency.',
|
|
396
|
+
'facts.backfill': 'Backfill facts from historical chapters',
|
|
397
|
+
'facts.backfilled': 'Backfilled {n} facts from historical chapters',
|
|
251
398
|
'progress.generating': 'Writing chapter {no} “{title}”…',
|
|
252
399
|
'progress.done': 'Chapter {no} done ({chars} chars) → {file}',
|
|
253
400
|
'progress.reviewed': 'Chapter {no} review: {score} — {verdict}',
|
|
@@ -255,7 +402,7 @@ export const en: Record<string, string> = {
|
|
|
255
402
|
'progress.rewriting': 'Revising chapter {no}…',
|
|
256
403
|
'progress.polishing': 'Polishing chapter {no}…',
|
|
257
404
|
'progress.empty': 'Generation/review progress appears here',
|
|
258
|
-
'assistant.hint': 'Discuss plot, characters, foreshadowing with the AI
|
|
405
|
+
'assistant.hint': 'Discuss plot, characters, foreshadowing with the AI Editor Agent; once agreed, let it edit the outline, bible, or chapters directly.',
|
|
259
406
|
'assistant.placeholder': 'e.g. Add a hook at the end of chapter 2…',
|
|
260
407
|
'assistant.send': 'Send',
|
|
261
408
|
'assistant.toolStart': '⚙ Running {name}…',
|
package/src/client/mount.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import css from './panel/panel.module.css'
|
|
|
12
12
|
/** The injected panel container. */
|
|
13
13
|
export const PANEL_VIEW_SELECTOR = '[data-dsh-novelforge-view]'
|
|
14
14
|
|
|
15
|
-
const CONVERSATION_COLUMN_SELECTOR = '[data-pane="conversation"]'
|
|
15
|
+
const CONVERSATION_COLUMN_SELECTOR = '[data-pane="conversation"], [class*="centerCol"]'
|
|
16
16
|
const ACTIVE_ATTR = 'data-dsh-novelforge-active'
|
|
17
17
|
/** Sibling panels' activation attributes (evicted when this panel opens). */
|
|
18
18
|
const OTHER_ACTIVE_ATTRS = ['data-dsh-taskboard-active', 'data-dsh-ssh-active']
|