@cloud411716/fancy-webnovel 4.30.33 → 4.30.35
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/docs/material-library/manual/00-core.md +12 -79
- package/docs/material-library/manual/01-carrier.md +8 -38
- package/docs/material-library/manual/03-hidden-world.md +2 -2
- package/docs/material-library/manual/04-naming.md +11 -44
- package/docs/material-library/manual/06-revision.md +2 -2
- package/docs/material-library/manual/07-surprise.md +10 -84
- package/docs/material-library/manual/cases/boundary.md +2 -2
- package/docs/material-library/manual/cases/credential.md +1 -1
- package/docs/material-library/manual/cases/document.md +4 -4
- package/docs/material-library/manual/cases/record.md +4 -4
- package/docs/material-library/manual/cases/ritual.md +4 -4
- package/docs/material-library/manual/cases/transaction.md +2 -2
- package/docs/material-library/manual/failures/event-summary.md +2 -2
- package/docs/material-library/manual/failures/formulaic.md +1 -1
- package/docs/material-library/manual/failures/naked-process.md +2 -2
- package/docs/material-library/manual/failures/name-only.md +5 -5
- package/docs/material-library/manual/palettes/suspense.md +1 -1
- package/docs/material-library/manual/palettes/xianxia.md +1 -1
- package/docs/material-library/manual/patterns/boundary.md +1 -1
- package/docs/material-library/manual/patterns/credential.md +1 -1
- package/docs/material-library/manual/patterns/document.md +5 -5
- package/docs/material-library/manual/patterns/record.md +2 -2
- package/docs/material-library/manual/patterns/ritual.md +4 -4
- package/docs/material-library/manual/patterns/transaction.md +2 -2
- package/docs/material-library/prompt.md +58 -144
- package/docs/material-library/quality-spec.md +2 -2
- package/package.json +1 -1
- package/plugins/fancy-material/builtin-styles.js +9 -9
- package/plugins/fancy-material/genre-playbooks.js +3 -3
- package/plugins/fancy-material/index.js +22 -22
- package/plugins/fancy-material/kinds.js +1 -1
- package/plugins/fancy-material/manual.js +2 -20
- package/plugins/fancy-material/prompts/world-mother.md +5 -5
- package/plugins/fancy-material/styles.js +16 -28
- package/plugins/fancy-material/team.js +2 -2
- package/plugins/fancy-material/templates.js +14 -14
- package/plugins/fancy-material/world.js +24 -26
|
@@ -126,35 +126,17 @@ export function renderManualBlock({ kind = '', subkind = '', genres = [], seed =
|
|
|
126
126
|
const carrier = compact ? '' : readFile(path.join(MANUAL_DIR, '01-carrier.md'));
|
|
127
127
|
const naming = compact ? '' : readFile(path.join(MANUAL_DIR, '04-naming.md'));
|
|
128
128
|
const surprise = compact ? '' : readFile(path.join(MANUAL_DIR, '07-surprise.md'));
|
|
129
|
-
|
|
130
|
-
const palettes = selectPalettes({ genres, limit: compact ? 1 : 2 });
|
|
131
|
-
const patterns = compact ? [] : selectPatterns({ caseId: selectedCase?.id || '', limit: 3 });
|
|
132
|
-
const failures = selectFailures({ kind, limit: compact ? 1 : 2 });
|
|
133
|
-
if (!core && !selectedCase && !palettes.length) return '';
|
|
129
|
+
if (!core && !carrier && !naming && !surprise) return '';
|
|
134
130
|
|
|
135
131
|
const lines = [
|
|
136
132
|
'# 创作手册(本批必读)',
|
|
137
133
|
'',
|
|
138
|
-
'本手册优先于旧的创作段。字段、schema、kind
|
|
134
|
+
'本手册优先于旧的创作段。字段、schema、kind 硬规则、世界设定仍然优先。',
|
|
139
135
|
'',
|
|
140
136
|
];
|
|
141
137
|
if (core) lines.push(core, '');
|
|
142
138
|
if (carrier) lines.push(carrier, '');
|
|
143
139
|
if (naming) lines.push(naming, '');
|
|
144
140
|
if (surprise) lines.push(surprise, '');
|
|
145
|
-
if (selectedCase?.content) {
|
|
146
|
-
lines.push('## 本批结构案例:' + selectedCase.id, '', selectedCase.content, '');
|
|
147
|
-
}
|
|
148
|
-
for (const palette of palettes) {
|
|
149
|
-
lines.push('## 题材调色板:' + palette.id, '', palette.content, '');
|
|
150
|
-
}
|
|
151
|
-
if (patterns.length) {
|
|
152
|
-
lines.push('## 参考模式(只学结构,不抄名字)', '');
|
|
153
|
-
for (const pattern of patterns) lines.push(pattern, '');
|
|
154
|
-
}
|
|
155
|
-
if (failures.length) {
|
|
156
|
-
lines.push('## 失败诊断(写之前先对照)', '');
|
|
157
|
-
for (const failure of failures) lines.push(failure, '');
|
|
158
|
-
}
|
|
159
141
|
return lines.join('\n').trim();
|
|
160
142
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 世界设定候选生成
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
你是一位网文世界的总设定师。你现在的任务不是写素材,而是先造一个能长出素材的世界设定。
|
|
4
4
|
|
|
5
5
|
工作区:`{{WORKSPACE}}`
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
{{STYLE_BLOCK}}
|
|
18
18
|
|
|
19
|
-
## 四、生成 3
|
|
19
|
+
## 四、生成 3 个世界设定候选
|
|
20
20
|
|
|
21
21
|
必须生成**恰好 3 个**候选,三个候选的差异要落在世界运转方式上,而不是只换名字:
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
### 命名质量红线
|
|
31
31
|
|
|
32
|
-
-
|
|
32
|
+
- 世界设定不是现实公司的换皮。不要用“夜班、值班、保安、物业、工单、培训手册”直接当世界观核心。
|
|
33
33
|
- 不要生成“试岗、替班、带班、值守”这种现实职级名。
|
|
34
34
|
- 不要生成“包月令、静音条”这种“日常词 + 后缀”的字面功能名。
|
|
35
35
|
- `positioning` 是读者承诺,不是词表;先把它翻译成世界公理、代价、禁忌,再让名字从公理里长出来。
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
{
|
|
50
50
|
"candidate_type": "suggestion_anchor",
|
|
51
51
|
"world_id": "stable_ascii_slug",
|
|
52
|
-
"title": "
|
|
52
|
+
"title": "世界设定名",
|
|
53
53
|
"logline": "一句话世界",
|
|
54
54
|
"core_conflict": "这个世界最核心、无法调和的矛盾",
|
|
55
55
|
"reader_promise": "读者会得到的核心体验",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 风格注册表:内置风格 + 数据库 douyin_style。
|
|
3
3
|
*
|
|
4
|
-
* 风格是跨 kind
|
|
4
|
+
* 风格是跨 kind 的写法倾向;世界设定和 kind 的硬规则优先。
|
|
5
5
|
* 这里不处理具体生成,只负责加载、合并、按题材选择、渲染成提示词。
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -493,20 +493,20 @@ export function stylePromptBlock(styles, selected, { genres = [] } = {}) {
|
|
|
493
493
|
: picked;
|
|
494
494
|
|
|
495
495
|
const lines = [
|
|
496
|
-
'##
|
|
496
|
+
'## 风格锁定(写法层,不覆盖世界设定)',
|
|
497
497
|
'',
|
|
498
|
-
'
|
|
498
|
+
'世界设定的命名逻辑、公理、代价、禁忌优先;kind 的硬规则优先。',
|
|
499
499
|
'风格只决定:句式、长度、语气、意象密度、命名模式。',
|
|
500
|
-
'
|
|
500
|
+
'风格不能把世界设定的核心词替换成现实职业词/流程词;日常物件/场所只能做底层逻辑,不能直接当名字。',
|
|
501
501
|
'',
|
|
502
502
|
];
|
|
503
503
|
if (!picked.length) {
|
|
504
|
-
lines.push('
|
|
504
|
+
lines.push('本次未选择账号风格。按世界设定和 kind 规则命名;命名模式默认 image,但世界设定优先。');
|
|
505
505
|
return lines.join('\n');
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
lines.push('### 本次风格分工');
|
|
509
|
-
lines.push('- 主命名风格:' + (primary ? `\`${primary.style_key}\`(${primary.style_name})` : '
|
|
509
|
+
lines.push('- 主命名风格:' + (primary ? `\`${primary.style_key}\`(${primary.style_name})` : '无(按世界设定和 kind 规则命名)'));
|
|
510
510
|
if (structure.length) {
|
|
511
511
|
lines.push('- 结构参考(不参与命名):' + structure.map((style) => `\`${style.style_key}\``).join('、'));
|
|
512
512
|
}
|
|
@@ -533,19 +533,15 @@ export function stylePromptBlock(styles, selected, { genres = [] } = {}) {
|
|
|
533
533
|
for (const step of style.generation_chain) lines.push(' - ' + step);
|
|
534
534
|
}
|
|
535
535
|
if (isNaming) {
|
|
536
|
-
lines.push('-
|
|
536
|
+
lines.push('- 物件/场所来源:从当前世界设定 + 十一个来源库的映射里找;日常物件只做底层逻辑,不直接当名字。');
|
|
537
537
|
}
|
|
538
538
|
if (isNaming && style.hook_rule) lines.push('- 钩子要求:' + style.hook_rule);
|
|
539
539
|
const rules = style.naming_rules || {};
|
|
540
540
|
if (rules.length) lines.push('- 长度:' + (Array.isArray(rules.length) ? rules.length.join('–') + ' 字' : rules.length));
|
|
541
|
-
if (rules.syntax) lines.push('- 句式:' + asArray(rules.syntax).join(';'));
|
|
542
|
-
if (rules.suffixes) lines.push('- 可用后缀:' + (asArray(rules.suffixes).join('、') || '无固定后缀'));
|
|
543
|
-
if (rules.forbidden) lines.push('- 禁用写法(不是禁用载体):' + asArray(rules.forbidden).join('、'));
|
|
544
541
|
if (isNaming) {
|
|
545
|
-
lines.push('-
|
|
546
|
-
lines.push('- note
|
|
542
|
+
lines.push('- 名字:先写 note;再从 note 里已经发生的规则、代价、物件反推名字,不要先选后缀。');
|
|
543
|
+
lines.push('- note 结构:不要固定“表层→规则→代价→漏洞”的同一顺序;同批至少 3 条从不同入口写(代价现场/受害者视角/失败交易/规则漏洞/物件残留)。');
|
|
547
544
|
}
|
|
548
|
-
if (rules.trace_forbidden) lines.push('- 禁用引导词(出现在 name 里即重写):' + asArray(rules.trace_forbidden).join('、'));
|
|
549
545
|
if (rules.trace_diversity) {
|
|
550
546
|
lines.push('- 痕迹多样性(硬要求):');
|
|
551
547
|
for (const item of asArray(rules.trace_diversity)) lines.push(' - ' + item);
|
|
@@ -559,7 +555,7 @@ export function stylePromptBlock(styles, selected, { genres = [] } = {}) {
|
|
|
559
555
|
for (const item of asArray(rules.trace_high_concept)) lines.push(' - ' + item);
|
|
560
556
|
}
|
|
561
557
|
if (rules.trace_hidden_world) {
|
|
562
|
-
lines.push('-
|
|
558
|
+
lines.push('- 设定(硬要求):');
|
|
563
559
|
for (const item of asArray(rules.trace_hidden_world)) lines.push(' - ' + item);
|
|
564
560
|
}
|
|
565
561
|
if (rules.trace_surprise) {
|
|
@@ -567,28 +563,21 @@ export function stylePromptBlock(styles, selected, { genres = [] } = {}) {
|
|
|
567
563
|
for (const item of asArray(rules.trace_surprise)) lines.push(' - ' + item);
|
|
568
564
|
}
|
|
569
565
|
if (rules.tone) lines.push('- 语气:' + rules.tone);
|
|
570
|
-
const forbidden = asArray(style.lexicon && style.lexicon.forbidden);
|
|
571
|
-
if (forbidden.length) lines.push('- 禁用词/意象:' + forbidden.join('、'));
|
|
572
|
-
|
|
573
566
|
const anchors = [];
|
|
574
567
|
for (const [kind, values] of Object.entries(styleAnchorExamples(style))) {
|
|
575
568
|
const list = asArray(values).slice(0, 4);
|
|
576
569
|
if (list.length) anchors.push(` - \`${kind}\`:${list.join('、')}`);
|
|
577
570
|
}
|
|
578
|
-
if (anchors.length) {
|
|
579
|
-
lines.push('-
|
|
571
|
+
if (anchors.length && !isNaming) {
|
|
572
|
+
lines.push('- 结构锚点(不参与命名):');
|
|
580
573
|
lines.push(...anchors);
|
|
581
|
-
lines.push(' -
|
|
574
|
+
lines.push(' - 只校准结构;与世界设定冲突时以世界设定为准,不要复用锚点里的名词。');
|
|
582
575
|
}
|
|
583
576
|
const concepts = styleConceptExamples(style);
|
|
584
577
|
if (concepts.length) {
|
|
585
578
|
lines.push('- ' + (isNaming ? '概念示例(只校准张力,不抄设定):' : '结构示例(不参与命名):'));
|
|
586
579
|
for (const example of concepts.slice(0, 4)) lines.push(' - ' + example);
|
|
587
580
|
}
|
|
588
|
-
const anti = dedupeAntiExamples(style.anti_examples);
|
|
589
|
-
if (anti.length) {
|
|
590
|
-
lines.push('- 反例(失败形态,不是禁用词):' + anti.slice(0, 10).join('、'));
|
|
591
|
-
}
|
|
592
581
|
lines.push('');
|
|
593
582
|
}
|
|
594
583
|
|
|
@@ -596,10 +585,10 @@ export function stylePromptBlock(styles, selected, { genres = [] } = {}) {
|
|
|
596
585
|
if (primary) {
|
|
597
586
|
lines.push('本批以 `' + primary.style_key + '` 为主命名风格;其他 naming 风格只提供辅助意象;structure 风格不参与命名。');
|
|
598
587
|
} else {
|
|
599
|
-
lines.push('
|
|
588
|
+
lines.push('本批没有命名风格;按世界设定和 kind 规则命名,结构风格只做结构参考。');
|
|
600
589
|
}
|
|
601
|
-
lines.push('
|
|
602
|
-
lines.push('
|
|
590
|
+
lines.push('世界设定和 kind 的硬规则优先;风格不能豁免。');
|
|
591
|
+
lines.push('示例只校准强度;如果示例与世界设定/kind 冲突,以世界设定/kind 为准。示例中的名字和设定不得原样出现;写出同名/近义就重写。');
|
|
603
592
|
return lines.join('\n');
|
|
604
593
|
}
|
|
605
594
|
|
|
@@ -627,7 +616,6 @@ export function styleBatchSummary(styles) {
|
|
|
627
616
|
];
|
|
628
617
|
if (style.style_type === 'naming') bits.push('命名模式 `' + (style.naming_mode || 'image') + '`');
|
|
629
618
|
if (rules.length) bits.push(`长度 ${Array.isArray(rules.length) ? rules.length.join('–') + ' 字' : rules.length}`);
|
|
630
|
-
if (rules.forbidden && rules.forbidden.length) bits.push('禁用 ' + rules.forbidden.join('、'));
|
|
631
619
|
return bits.join(';');
|
|
632
620
|
}).join('\n');
|
|
633
621
|
}
|
|
@@ -228,9 +228,9 @@ PASS 仅当没有 blocker/major。minor 可以记录但不阻塞。
|
|
|
228
228
|
2. 规则能不能一句话复述?有没有具体画面/数字/颜色/动作?
|
|
229
229
|
3. 是否先有规则、再有舞台,而不是先选物件再贴后缀?
|
|
230
230
|
4. 代价是否是这条能力内生的,而不是只复用愿孔/金漆?
|
|
231
|
-
5. note
|
|
231
|
+
5. note 是否写清了这个设定本身:它是什么、哪里反常、代价/限制/漏洞?
|
|
232
232
|
6. 把舞台换掉,名字还成立吗?成立则说明名字没有咬住规则。
|
|
233
|
-
7.
|
|
233
|
+
7. 同批是否有明显重复的物件/关系模板/命名形态?
|
|
234
234
|
8. 同批 note 是否大量复用同一结构/同一句式?超过一半要求重写。
|
|
235
235
|
|
|
236
236
|
返回 JSON:
|
|
@@ -21,15 +21,15 @@ export function helpText() {
|
|
|
21
21
|
}).join('\n');
|
|
22
22
|
return `🧩 素材库 用法
|
|
23
23
|
|
|
24
|
-
/fancy-material 交互式:逐步选择 6 层 facet → 3
|
|
25
|
-
/fancy-material continue
|
|
24
|
+
/fancy-material 交互式:逐步选择 6 层 facet → 3 个世界设定候选 → 生成范围/数量 → 生成素材
|
|
25
|
+
/fancy-material continue 沿用上次的世界设定、facet、风格和范围,继续追加素材
|
|
26
26
|
/fancy-material team show 查看双生成 + 交叉审查 + 裁判的配置
|
|
27
27
|
/fancy-material team models [provider] 查看当前可用模型(默认 opencode-go)
|
|
28
28
|
/fancy-material team set a|b|judge <provider> <model> [thinking] 设置模型和 thinking 等级(三者必须不同)
|
|
29
29
|
/fancy-material team set rounds <1-10> 设置最多交叉审查轮次(默认 5)
|
|
30
30
|
/fancy-material team set max-calls <6-40> 设置整个 workflow 最多 agent 调用
|
|
31
31
|
/fancy-material team on|off 开/关 Team 模式
|
|
32
|
-
/fancy-material --fresh
|
|
32
|
+
/fancy-material --fresh 重新构建世界设定(旧素材保留,不删除)
|
|
33
33
|
/fancy-material --style <key> ... 手动指定账号风格;多个用逗号分隔,例如 --style suci,crazy-fish
|
|
34
34
|
不指定时在交互流程里选择:自动 / 不使用 / 具体 key
|
|
35
35
|
/fancy-material load <文件.jsonl> 导入 JSONL;导入前先校验格式
|
|
@@ -53,7 +53,7 @@ export function helpText() {
|
|
|
53
53
|
- facet 多选是**交集**:同一层选中的每一项都必须同时满足,不是任选其一。例如题材选 都市+异能+脑洞,素材必须同时满足三种。
|
|
54
54
|
- 选「都市异能」会同时按「都市」和「异能」处理;选「悬疑脑洞」会同时按「悬疑」和「脑洞」处理,两个条件都必须满足。
|
|
55
55
|
- 题材/方向/定位来自 _novel_topic_suggestion.json 时只做推荐值;用户本次选择优先,fancy-material 不修改该文件。
|
|
56
|
-
-
|
|
56
|
+
- 世界设定保存在 <工作区>/.fancy/material/flow.json;continue 会沿用它,不删除旧素材。
|
|
57
57
|
- 风格来源:内置风格库 + 数据库 douyin_style;交互流程里可选自动、不使用或具体 key,也可用 --style 预填。
|
|
58
58
|
- 用 /fancy-douyin list 查看账号的 style_key、风格名和示例。
|
|
59
59
|
- 不设库内上限:运行两次就是每个 kind 累计追加;已有素材只用于去重。
|
|
@@ -101,7 +101,7 @@ function compactRules(genres, queryScript, workspace, sourceFixed = 'builtin') {
|
|
|
101
101
|
'- 好素材 = 熟悉锚点 × 一处不对劲 × 未解问题 × 会咬人的后果;只停在“规则必须遵守”视为废稿。',
|
|
102
102
|
'- 单条素材最多 1–2 个来源库;不要多源大杂烩,不要直接照搬名句/神名/塔罗/七宗罪标签。',
|
|
103
103
|
'- 成套体系(七宗罪/塔罗/四体液/十二宫)整组使用;不要零散单抽。',
|
|
104
|
-
'-
|
|
104
|
+
'- 名字是设定留下的痕迹/边界,不是流程说明书;现实流程词只能做底层逻辑。',
|
|
105
105
|
'- 名词性 kind 的名字必须能放进“我看见了___”;动作+时长、条件+结果、状态+动作不算名字。',
|
|
106
106
|
'- charging-bar 主风格:名字只能是痕迹/印记/边界/债契;事件、时长、效果全部进 note。',
|
|
107
107
|
'- 字段只能是 id / kind / name / tags / genres / world_id / group_id / subkind / rank_order / note / source;'
|
|
@@ -166,7 +166,7 @@ export function generationPrompt({
|
|
|
166
166
|
lines.push('## 继续生成(同一素材库)', '');
|
|
167
167
|
lines.push('继续遵守最初提示词中的角色、写作原则、质量红线、命名标准、描写标准、查询与追加规则。不要重新解释规则,直接写本批素材。', '');
|
|
168
168
|
lines.push(...compactRules(genres, queryScript, workspace, sourceFixed), '');
|
|
169
|
-
if (worldSummary) lines.push('##
|
|
169
|
+
if (worldSummary) lines.push('## 本批世界设定锁定(必须保持)', '', worldSummary, '');
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
if (styleSummary && !includeBase) {
|
|
@@ -184,7 +184,7 @@ export function generationPrompt({
|
|
|
184
184
|
: mode === 'suggestion'
|
|
185
185
|
? 'suggestion(_novel_topic_suggestion.json)'
|
|
186
186
|
: mode === 'world'
|
|
187
|
-
? 'world
|
|
187
|
+
? 'world(世界设定 + facet 交集)'
|
|
188
188
|
: mode === 'builtin'
|
|
189
189
|
? 'builtin(内置全题材)'
|
|
190
190
|
: mode === 'other'
|
|
@@ -192,14 +192,14 @@ export function generationPrompt({
|
|
|
192
192
|
: String(mode || '未指定');
|
|
193
193
|
lines.push('- 题材模式:' + modeLabel);
|
|
194
194
|
if (worldBlock && includeBase) {
|
|
195
|
-
//
|
|
196
|
-
lines.push('-
|
|
195
|
+
// 世界设定已经包含在 base 里;这里只提醒本批仍受它约束。
|
|
196
|
+
lines.push('- 世界设定:见上方「世界设定(最高优先级)」;本批所有素材都必须从该世界设定推导。');
|
|
197
197
|
}
|
|
198
198
|
if (Array.isArray(genres) && genres.length) {
|
|
199
199
|
lines.push('- 本次题材(全部同时满足):' + genres.join('、'));
|
|
200
200
|
lines.push('- 题材交集规则:以上每一项都必须出现在素材的 genres 里;不是任选其一。');
|
|
201
201
|
} else {
|
|
202
|
-
lines.push('-
|
|
202
|
+
lines.push('- 本次题材:无限制;按世界设定推导,但每条素材仍要写 1–10 个 genres。');
|
|
203
203
|
}
|
|
204
204
|
if (custom) {
|
|
205
205
|
lines.push('- 用户素材类型:' + (custom.allKinds ? 'all(全部 ' + MATERIAL_KINDS.length + ' 个素材类型)' : custom.materialType));
|
|
@@ -284,7 +284,7 @@ function groupHeader({ base, includeBase, worldSummary, styleSummary, modes = ''
|
|
|
284
284
|
} else {
|
|
285
285
|
lines.push('## 继续生成(同一素材库)', '');
|
|
286
286
|
lines.push('继续遵守最初提示词中的角色、写作原则、质量红线、命名标准、描写标准、查询与追加规则。不要重新解释规则,直接写本批素材。', '');
|
|
287
|
-
if (worldSummary) lines.push('##
|
|
287
|
+
if (worldSummary) lines.push('## 本批世界设定锁定(必须保持)', '', worldSummary, '');
|
|
288
288
|
}
|
|
289
289
|
if (styleSummary && !includeBase) lines.push('## 本批风格锁定(写法层,必须保持)', '', styleSummary, '');
|
|
290
290
|
if (modes) lines.push(modes, '');
|
|
@@ -487,7 +487,7 @@ export function generationRunText({
|
|
|
487
487
|
lines.push('本次新增:' + importedTotal + ' 条');
|
|
488
488
|
if (Number.isFinite(total)) lines.push('库中素材:' + total + ' 条');
|
|
489
489
|
if (batches) lines.push('已导入批次:' + batches + ' 批');
|
|
490
|
-
if (worldTitle) lines.push('
|
|
490
|
+
if (worldTitle) lines.push('本次世界设定:' + worldTitle);
|
|
491
491
|
if (Array.isArray(styles) && styles.length) {
|
|
492
492
|
lines.push('本次风格:' + styles.map((style) => `${style.style_key}(${style.style_name})`).join('、'));
|
|
493
493
|
}
|
|
@@ -496,9 +496,9 @@ export function generationRunText({
|
|
|
496
496
|
if (progressFile) lines.push('进度文件:' + progressFile);
|
|
497
497
|
if (flowFile) lines.push('世界状态:' + flowFile);
|
|
498
498
|
if (aborted || incomplete.length || notStarted.length || stopReason) {
|
|
499
|
-
lines.push('继续追加:/fancy-material continue
|
|
499
|
+
lines.push('继续追加:/fancy-material continue(沿用本次世界设定);已导入素材不会撤销。');
|
|
500
500
|
} else {
|
|
501
|
-
lines.push('素材不够?运行 /fancy-material continue
|
|
501
|
+
lines.push('素材不够?运行 /fancy-material continue 沿用本次世界设定继续生成。');
|
|
502
502
|
}
|
|
503
503
|
return lines.join('\n');
|
|
504
504
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 世界设定与 facet 选择状态。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 这一层只负责“用户选了什么、世界设定是什么、怎么把交集约束写进提示词”,
|
|
5
5
|
* 不负责素材生成、不碰 material 表。
|
|
6
6
|
*
|
|
7
7
|
* 关键语义:
|
|
@@ -247,7 +247,7 @@ export function scopeQuestion({ currentKinds = [] } = {}) {
|
|
|
247
247
|
}
|
|
248
248
|
options.push({
|
|
249
249
|
label: '推荐:命名 + 世界 + 能力 + 等级 + 剧情',
|
|
250
|
-
description:
|
|
250
|
+
description: `世界设定最相关的 ${recommendedScopeKinds().length} 个 kind`,
|
|
251
251
|
});
|
|
252
252
|
options.push({
|
|
253
253
|
label: `全部 ${MATERIAL_KINDS.length} 个 kind`,
|
|
@@ -322,7 +322,7 @@ export function worldCandidateQuestion(candidates, { allowReroll = true } = {})
|
|
|
322
322
|
if (candidate.difference) bits.push('差异:' + candidate.difference);
|
|
323
323
|
options.push({
|
|
324
324
|
label,
|
|
325
|
-
description: bits.join(';').slice(0, 300) || '
|
|
325
|
+
description: bits.join(';').slice(0, 300) || '世界设定候选',
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
if (allowReroll) {
|
|
@@ -331,8 +331,8 @@ export function worldCandidateQuestion(candidates, { allowReroll = true } = {})
|
|
|
331
331
|
options.push({ label: '取消', description: '不生成素材' });
|
|
332
332
|
return {
|
|
333
333
|
id: 'material-world',
|
|
334
|
-
header: '素材 ·
|
|
335
|
-
question: '
|
|
334
|
+
header: '素材 · 世界设定',
|
|
335
|
+
question: '请选择一个世界设定;后续素材都从这个世界设定里长出来',
|
|
336
336
|
detail: '推荐第一个:它优先兑现 _novel_topic_suggestion.json 的方向和定位。选定后可用 /fancy-material continue 沿用同一世界追加素材。',
|
|
337
337
|
options,
|
|
338
338
|
};
|
|
@@ -357,7 +357,7 @@ function normalizeStringArray(value) {
|
|
|
357
357
|
|
|
358
358
|
function normalizeWorldCandidate(raw, index, { constraintGenres = [] } = {}) {
|
|
359
359
|
const source = raw && typeof raw === 'object' ? raw : {};
|
|
360
|
-
const title = clean(source.title || source.name) ||
|
|
360
|
+
const title = clean(source.title || source.name) || `世界设定 ${index + 1}`;
|
|
361
361
|
const coreGenres = normalizeStringArray(source.core_genres || source.genres);
|
|
362
362
|
return {
|
|
363
363
|
world_id: clean(source.world_id || source.id) || `world_${slugFromTitle(title)}`,
|
|
@@ -385,7 +385,7 @@ function normalizeWorldCandidate(raw, index, { constraintGenres = [] } = {}) {
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
/**
|
|
388
|
-
* 解析 LLM
|
|
388
|
+
* 解析 LLM 写出的世界设定 JSON。允许纯 JSON、```json 围栏和前后解释。
|
|
389
389
|
*/
|
|
390
390
|
export function parseWorldCandidates(text, { constraintGenres = [] } = {}) {
|
|
391
391
|
const source = stripJsonFence(text);
|
|
@@ -395,11 +395,11 @@ export function parseWorldCandidates(text, { constraintGenres = [] } = {}) {
|
|
|
395
395
|
} catch {
|
|
396
396
|
const start = source.indexOf('{');
|
|
397
397
|
const end = source.lastIndexOf('}');
|
|
398
|
-
if (start < 0 || end <= start) throw new Error('
|
|
398
|
+
if (start < 0 || end <= start) throw new Error('世界设定结果不是 JSON 对象');
|
|
399
399
|
data = JSON.parse(source.slice(start, end + 1));
|
|
400
400
|
}
|
|
401
401
|
const list = Array.isArray(data) ? data : data.candidates;
|
|
402
|
-
if (!Array.isArray(list) || !list.length) throw new Error('
|
|
402
|
+
if (!Array.isArray(list) || !list.length) throw new Error('世界设定结果缺少 candidates 数组');
|
|
403
403
|
return list.slice(0, 3).map((item, index) => normalizeWorldCandidate(item, index, { constraintGenres }));
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -440,10 +440,10 @@ export function suggestionFingerprint(suggestion) {
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
export function flowSummaryText(flow) {
|
|
443
|
-
if (!flow || !flow.world) return '
|
|
443
|
+
if (!flow || !flow.world) return '(没有可沿用的世界设定)';
|
|
444
444
|
const facets = flow.facet_labels || flow.facets || {};
|
|
445
445
|
const lines = [
|
|
446
|
-
'
|
|
446
|
+
'世界设定:' + (flow.world.title || '未命名'),
|
|
447
447
|
flow.world.core_conflict ? '核心矛盾:' + flow.world.core_conflict : '',
|
|
448
448
|
'题材:' + ((facets.genres || []).join('、') || '无(不限)'),
|
|
449
449
|
'场景:' + ((facets.settings || []).join('、') || '无(不限)'),
|
|
@@ -478,7 +478,7 @@ function renderSuggestionBlock(suggestion) {
|
|
|
478
478
|
return [
|
|
479
479
|
'## 选题建议锚点',
|
|
480
480
|
'',
|
|
481
|
-
'当前没有 _novel_topic_suggestion.json。按用户 facet
|
|
481
|
+
'当前没有 _novel_topic_suggestion.json。按用户 facet 自由构建世界设定,但不要伪造选题建议。',
|
|
482
482
|
].join('\n');
|
|
483
483
|
}
|
|
484
484
|
return [
|
|
@@ -489,18 +489,17 @@ function renderSuggestionBlock(suggestion) {
|
|
|
489
489
|
'- 定位:' + (suggestion.positioning || '(无)'),
|
|
490
490
|
'',
|
|
491
491
|
'使用规则:',
|
|
492
|
-
'-
|
|
492
|
+
'- 方向是候选世界设定的锚点,不是最终世界名。',
|
|
493
493
|
'- 定位是读者承诺和核心矛盾,不是命名词表。',
|
|
494
494
|
'- 必须先把定位翻译成 3–5 条世界公理/代价/禁忌,再让名字从公理里长出来。',
|
|
495
|
-
'-
|
|
495
|
+
'- 名字不能停在现实职业词/流程词的裸词状态;日常物件/场所必须加一层世界公理/代价/禁忌的异常边界。',
|
|
496
496
|
'- 禁止把定位里的职业、机构、流程名词裸写成 power_rank / faction_rank / skill_name / faction_name。',
|
|
497
|
-
'- 反例(L1 裸词):试岗、替班、带班、值守、包月令、静音条。',
|
|
498
497
|
].join('\n');
|
|
499
498
|
}
|
|
500
499
|
|
|
501
500
|
function renderStyleBlock(styleSummary = '') {
|
|
502
501
|
if (!styleSummary) {
|
|
503
|
-
return '## 风格锚点\n\n
|
|
502
|
+
return '## 风格锚点\n\n本次未选择账号风格;按通用创作标准,但世界设定仍要成立。';
|
|
504
503
|
}
|
|
505
504
|
return '## 风格锚点\n\n' + styleSummary;
|
|
506
505
|
}
|
|
@@ -519,7 +518,7 @@ export function buildWorldPrompt({
|
|
|
519
518
|
try {
|
|
520
519
|
template = fs.readFileSync(WORLD_PROMPT_FILE, 'utf8');
|
|
521
520
|
} catch (err) {
|
|
522
|
-
throw new Error('
|
|
521
|
+
throw new Error('缺少世界设定提示词文件:' + WORLD_PROMPT_FILE + '(' + (err && err.message ? err.message : String(err)) + ')');
|
|
523
522
|
}
|
|
524
523
|
const previous = previousTitles.length
|
|
525
524
|
? '## 上一批候选(不要重复)\n\n' + previousTitles.map((title) => '- ' + title).join('\n')
|
|
@@ -542,11 +541,11 @@ export function renderWorldBlock({
|
|
|
542
541
|
constraintGenres = [],
|
|
543
542
|
topicGenre = '',
|
|
544
543
|
}) {
|
|
545
|
-
if (!world) return '##
|
|
544
|
+
if (!world) return '## 世界设定\n\n本次没有世界设定,按通用规则生成。';
|
|
546
545
|
const lines = [
|
|
547
|
-
'##
|
|
546
|
+
'## 世界设定(最高优先级)',
|
|
548
547
|
'',
|
|
549
|
-
'-
|
|
548
|
+
'- 世界设定:' + (world.title || '未命名'),
|
|
550
549
|
world.logline ? '- 一句话:' + world.logline : '',
|
|
551
550
|
world.core_conflict ? '- 核心矛盾:' + world.core_conflict : '',
|
|
552
551
|
world.reader_promise ? '- 读者承诺:' + world.reader_promise : '',
|
|
@@ -572,11 +571,10 @@ export function renderWorldBlock({
|
|
|
572
571
|
'- 不同层之间也是交集;不能为了好写而丢掉题材、情绪、场景、情节、身份或关系。',
|
|
573
572
|
'- 素材的 genres 必须原样包含全部核心题材;缺任何一个都算废稿。',
|
|
574
573
|
'- 对应 facet 数组(tropes / moods / settings / roles / relations)必须包含本次选中的全部值;不能只写其中一个。',
|
|
575
|
-
'-
|
|
576
|
-
'-
|
|
577
|
-
'-
|
|
574
|
+
'- 名字必须从世界设定的公理、代价、禁忌里长出来;不能停在现实职业词/流程词的裸词状态。',
|
|
575
|
+
'- 日常物件/场所可以来自现实,但必须加一层世界设定的异常边界、代价或残留;裸写“取号/窗口/回执/试岗/替班”不算名字。',
|
|
576
|
+
'- 世界设定的命名逻辑优先于账号风格的词汇;风格只改变写法,不改变命名逻辑。',
|
|
578
577
|
'- 禁止把 positioning 里的职业/机构/流程名词裸写成 power_rank / faction_rank / skill_name / faction_name。',
|
|
579
|
-
'- 反例(L1 裸词):试岗、替班、带班、值守、包月令、静音条。',
|
|
580
578
|
].filter(Boolean);
|
|
581
579
|
if (world.ability_categories?.length) {
|
|
582
580
|
lines.push('', '### 能力类别', ...world.ability_categories.map((item) => '- ' + (item.name || item)));
|
|
@@ -611,7 +609,7 @@ export function renderWorldBatchSummary({
|
|
|
611
609
|
.filter(Boolean)
|
|
612
610
|
.join(';');
|
|
613
611
|
return [
|
|
614
|
-
'-
|
|
612
|
+
'- 世界设定:' + (world.title || '未命名'),
|
|
615
613
|
world.core_conflict ? '- 核心矛盾:' + world.core_conflict : '',
|
|
616
614
|
world.cost ? '- 核心代价:' + world.cost : '',
|
|
617
615
|
world.naming_logic ? '- 命名逻辑:' + world.naming_logic : '',
|