@cloud411716/fancy-webnovel 4.29.0 → 4.29.1
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.
|
@@ -135,7 +135,7 @@ plugins/fancy-material/
|
|
|
135
135
|
|
|
136
136
|
facet 多选是**交集**:同一层选中的每一项都必须同时满足,不是任选其一。
|
|
137
137
|
例如题材同时选 `都市 + 异能 + 脑洞`,每条素材的 `genres` 必须同时包含这三种。
|
|
138
|
-
|
|
138
|
+
选 `都市异能` 会同时按 `都市` 和 `异能` 两个条件处理,例如 `都市异能 → 都市 + 异能`。
|
|
139
139
|
|
|
140
140
|
世界母体和本次选择保存在 `<工作区>/.fancy/material/flow.json`。
|
|
141
141
|
素材不够时运行 `/fancy-material continue` 沿用同一世界母体追加;想重新构建世界用 `/fancy-material --fresh`。
|
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ export function helpText() {
|
|
|
45
45
|
- tags 和 genres 都是数组:tags 3–8 个,genres 1–10 个;一个素材可以同时适配多个题材/标签。
|
|
46
46
|
- 每次运行默认每个 kind 新增 20 条;每批最多 10 条,插件自动分批直到完成。
|
|
47
47
|
- facet 多选是**交集**:同一层选中的每一项都必须同时满足,不是任选其一。例如题材选 都市+异能+脑洞,素材必须同时满足三种。
|
|
48
|
-
-
|
|
48
|
+
- 选「都市异能」会同时按「都市」和「异能」处理;选「悬疑脑洞」会同时按「悬疑」和「脑洞」处理,两个条件都必须满足。
|
|
49
49
|
- 题材/方向/定位来自 _novel_topic_suggestion.json 时只做推荐值;用户本次选择优先,fancy-material 不修改该文件。
|
|
50
50
|
- 世界母体保存在 <工作区>/.fancy/material/flow.json;continue 会沿用它,不删除旧素材。
|
|
51
51
|
- 风格来源:内置风格库 + 数据库 douyin_style;交互流程里可选自动、不使用或具体 key,也可用 --style 预填。
|
|
@@ -18,6 +18,7 @@ import path from 'node:path';
|
|
|
18
18
|
import { fileURLToPath } from 'node:url';
|
|
19
19
|
|
|
20
20
|
import { atomicWriteJson } from '#workspace';
|
|
21
|
+
import { BUILTIN_GENRES } from '#material-topic';
|
|
21
22
|
import { MATERIAL_FACET_CANDIDATES } from './facets.js';
|
|
22
23
|
import { KIND_GROUPS, KIND_LABELS, MATERIAL_KINDS } from './kinds.js';
|
|
23
24
|
|
|
@@ -35,7 +36,7 @@ export const DEFAULT_SCOPE_TITLES = ['命名', '世界与势力', '能力', '剧
|
|
|
35
36
|
* 每一层都是多选,第一项统一是“无(不限)”。
|
|
36
37
|
*/
|
|
37
38
|
export const FACET_STEPS = [
|
|
38
|
-
{ id: 'genres', label: '题材 / 世界类型', header: '题材', limit:
|
|
39
|
+
{ id: 'genres', label: '题材 / 世界类型', header: '题材', limit: Infinity },
|
|
39
40
|
{ id: 'settings', label: '时代 / 场景 / 背景', header: '场景', limit: 15 },
|
|
40
41
|
{ id: 'moods', label: '情绪 / 调性', header: '情绪', limit: 14 },
|
|
41
42
|
{ id: 'tropes', label: '情节 / 流派 / 梗', header: '情节', limit: 16 },
|
|
@@ -137,6 +138,16 @@ function recommendationLabels(field, suggestion) {
|
|
|
137
138
|
return unique([raw, ...expandGenre(raw)]);
|
|
138
139
|
}
|
|
139
140
|
|
|
141
|
+
function allGenreLabels() {
|
|
142
|
+
// 第一层题材必须完整:平台题材 + 常用基础/细分题材都列出来。
|
|
143
|
+
// 这里不做截断;用户想选冷门题材时不用自己手打。
|
|
144
|
+
return unique([
|
|
145
|
+
...BUILTIN_GENRES,
|
|
146
|
+
...Object.keys(GENRE_ALIASES),
|
|
147
|
+
...asArray(MATERIAL_FACET_CANDIDATES.genres),
|
|
148
|
+
]);
|
|
149
|
+
}
|
|
150
|
+
|
|
140
151
|
/**
|
|
141
152
|
* 为一层 facet 生成 DSH 合法的问题对象。
|
|
142
153
|
* 选项第一项固定是“无(不限)”。
|
|
@@ -146,13 +157,13 @@ export function facetQuestion(step, { suggestion = null, selected = [] } = {}) {
|
|
|
146
157
|
const recommended = recommendationLabels(step.id, suggestion);
|
|
147
158
|
const candidates = unique([
|
|
148
159
|
...recommended,
|
|
149
|
-
...asArray(MATERIAL_FACET_CANDIDATES[step.id]),
|
|
160
|
+
...(step.id === 'genres' ? allGenreLabels() : asArray(MATERIAL_FACET_CANDIDATES[step.id])),
|
|
150
161
|
...asArray(selected),
|
|
151
162
|
]);
|
|
152
|
-
const limit = Math.max(1, Number(step.limit)
|
|
163
|
+
const limit = Number.isFinite(Number(step.limit)) ? Math.max(1, Number(step.limit)) : Infinity;
|
|
153
164
|
const options = [{
|
|
154
165
|
label: EMPTY_FACET_LABEL,
|
|
155
|
-
description: '
|
|
166
|
+
description: '这一组不限制;选中会清空同组的其它选项',
|
|
156
167
|
}];
|
|
157
168
|
const used = new Set([EMPTY_FACET_LABEL]);
|
|
158
169
|
for (const value of candidates) {
|
|
@@ -163,13 +174,13 @@ export function facetQuestion(step, { suggestion = null, selected = [] } = {}) {
|
|
|
163
174
|
label: value,
|
|
164
175
|
description: isRecommended
|
|
165
176
|
? '推荐:来自 _novel_topic_suggestion.json(可改)'
|
|
166
|
-
: (step.id === 'genres' ? '
|
|
177
|
+
: (step.id === 'genres' ? '题材条件;多选时每一项都要同时满足' : '选中后必须同时满足'),
|
|
167
178
|
});
|
|
168
|
-
if (options.length >= limit + 1) break;
|
|
179
|
+
if (Number.isFinite(limit) && options.length >= limit + 1) break;
|
|
169
180
|
}
|
|
170
181
|
const hint = step.id === 'genres'
|
|
171
|
-
? '
|
|
172
|
-
: '
|
|
182
|
+
? '多选规则(交集):例如同时选 都市 + 异能 + 脑洞,生成素材必须同时满足这三种,不是任选其一。选「都市异能」时,会同时按「都市」和「异能」两个条件处理。'
|
|
183
|
+
: '多选规则:同一个问题里选中的每一项都必须同时成立,不是任选其一。';
|
|
173
184
|
return {
|
|
174
185
|
id: 'material-facet-' + step.id,
|
|
175
186
|
header: '素材 · ' + step.header,
|
|
@@ -198,7 +209,7 @@ export function styleQuestion(styles = []) {
|
|
|
198
209
|
id: 'material-style',
|
|
199
210
|
header: '素材 · 风格',
|
|
200
211
|
question: '请选择对标风格(可多选;第一项「无」表示自动)',
|
|
201
|
-
detail: '
|
|
212
|
+
detail: '同一个问题里多选=同时使用这些风格核心;无=按题材自动选;不使用账号风格=关闭风格锁定。',
|
|
202
213
|
options,
|
|
203
214
|
multiSelect: true,
|
|
204
215
|
};
|