@cloud411716/fancy-webnovel 4.30.47 → 4.30.49
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/package.json
CHANGED
|
@@ -938,7 +938,15 @@ function answerSingle(answer) {
|
|
|
938
938
|
return Array.isArray(answer.selected) ? String(answer.selected[0] || '').trim() : '';
|
|
939
939
|
}
|
|
940
940
|
|
|
941
|
-
function
|
|
941
|
+
function clipPreviewText(value, limit = 90) {
|
|
942
|
+
return String(value || '')
|
|
943
|
+
.replace(/\|/g, '\\|')
|
|
944
|
+
.replace(/\s+/g, ' ')
|
|
945
|
+
.trim()
|
|
946
|
+
.slice(0, limit);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function materialFullPreviewText(records) {
|
|
942
950
|
const lines = [
|
|
943
951
|
`## 待确认入库(${records.length} 条)`,
|
|
944
952
|
'',
|
|
@@ -954,13 +962,30 @@ function materialPreviewText(records) {
|
|
|
954
962
|
return lines.join('\n');
|
|
955
963
|
}
|
|
956
964
|
|
|
965
|
+
function materialPreviewText(records, previewFile = '') {
|
|
966
|
+
const lines = [
|
|
967
|
+
`## 待确认入库(${records.length} 条)`,
|
|
968
|
+
'',
|
|
969
|
+
'以下素材已经通过 Team 交叉审查和裁判,但**还没有写入数据库**。',
|
|
970
|
+
'',
|
|
971
|
+
'| # | 名字 | note 摘要 | derivation 摘要 |',
|
|
972
|
+
'|---:|---|---|---|',
|
|
973
|
+
];
|
|
974
|
+
records.forEach((record, index) => {
|
|
975
|
+
lines.push(`| ${index + 1} | ${record.name || '未命名'} | ${clipPreviewText(record.note)} | ${clipPreviewText(record.derivation)} |`);
|
|
976
|
+
});
|
|
977
|
+
lines.push('');
|
|
978
|
+
if (previewFile) lines.push(`完整预览:${previewFile}`);
|
|
979
|
+
return lines.join('\n');
|
|
980
|
+
}
|
|
981
|
+
|
|
957
982
|
async function confirmMaterialImport(ctx, invocation, session, records, previewFile = '') {
|
|
958
|
-
const preview = materialPreviewText(records
|
|
983
|
+
const preview = materialPreviewText(records, previewFile);
|
|
959
984
|
await notify(session, 'success', preview);
|
|
960
985
|
const first = await askOne(ctx, invocation, {
|
|
961
986
|
id: 'material_import_confirm',
|
|
962
987
|
header: '素材入库',
|
|
963
|
-
question:
|
|
988
|
+
question: `以上 ${records.length} 条素材要写入数据库吗?`,
|
|
964
989
|
options: [
|
|
965
990
|
{ label: '全部写入', description: '把全部素材写入数据库' },
|
|
966
991
|
{ label: '选择部分', description: '逐条选择要写入的素材' },
|
|
@@ -2085,7 +2110,7 @@ export async function runGenerationWithPlan(ctx, invocation, session, taskList,
|
|
|
2085
2110
|
const recordsForReview = readJsonlRecords(file);
|
|
2086
2111
|
if (recordsForReview.length) {
|
|
2087
2112
|
const previewFile = file.replace(/\.jsonl$/, '.review.md');
|
|
2088
|
-
fs.writeFileSync(previewFile,
|
|
2113
|
+
fs.writeFileSync(previewFile, materialFullPreviewText(recordsForReview) + '\n', 'utf8');
|
|
2089
2114
|
reviewResult = await confirmMaterialImport(ctx, invocation, session, recordsForReview, previewFile);
|
|
2090
2115
|
if (!reviewResult.ok) {
|
|
2091
2116
|
fatal = true;
|
|
@@ -32,9 +32,10 @@ const NAME_SCORE_SCHEMA = {
|
|
|
32
32
|
clarity: { type: 'number' },
|
|
33
33
|
natural: { type: 'number' },
|
|
34
34
|
coldRead: { type: 'number' },
|
|
35
|
+
bare: { type: 'boolean' },
|
|
35
36
|
interpretation: { type: 'string' },
|
|
36
37
|
},
|
|
37
|
-
required: ['name', 'hook', 'distinct', 'image', 'clarity', 'natural', 'coldRead'],
|
|
38
|
+
required: ['name', 'hook', 'distinct', 'image', 'clarity', 'natural', 'coldRead', 'bare'],
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
},
|
|
@@ -150,7 +151,7 @@ function buildNamePrompt({
|
|
|
150
151
|
lines.push('- 5 历史/制度/律法/经济:制度漏洞、债务、身份、层层成本、博弈');
|
|
151
152
|
lines.push('- 6 科学/技术/医学/认知:硬约束、代偿、反馈、损耗、信号失真');
|
|
152
153
|
lines.push('- 7 艺术/感官/器物/工艺/媒介:材质、工艺、媒介局限、留白');
|
|
153
|
-
lines.push('- 8
|
|
154
|
+
lines.push('- 8 日常/职业/城市/网络:只取流程死角、隐性规矩、设施上的异常痕迹;不要把设施名直接当物象');
|
|
154
155
|
lines.push('- 9 心理/哲学/梦境:认知陷阱、身份分裂、执念、记忆虚构');
|
|
155
156
|
lines.push('- 10 叙事母题/戏剧/游戏:闭环、替身、归还、循环、观测者');
|
|
156
157
|
lines.push('- 11 成套符号/序列:对立权柄、等级、同源、序列枷锁');
|
|
@@ -161,7 +162,7 @@ function buildNamePrompt({
|
|
|
161
162
|
lines.push('- 状态 + 具象:悬置/将尽/失联/冻结 + 物件/空间');
|
|
162
163
|
lines.push('- 对冲双意象:柔/锐、生/朽、轻/重、明/幽、瞬/恒、微/宏');
|
|
163
164
|
lines.push('- 空间 + 回响:废弃/边界空间 + 留痕/回响动作');
|
|
164
|
-
lines.push('-
|
|
165
|
+
lines.push('- 残迹 + 宏大:残迹/余烬/缺口 + 单向动作 + 宏大背景(不是“小物件 + 大词”)');
|
|
165
166
|
lines.push('- 时间 + 终局:时间标记 + 终局意象');
|
|
166
167
|
lines.push('- 动作 + 对象:强动词 + 明确物象(必须把宾语写出来)');
|
|
167
168
|
lines.push('- 身份/制度 + 边界:身份/机构 + 凭证/边界');
|
|
@@ -172,13 +173,26 @@ function buildNamePrompt({
|
|
|
172
173
|
lines.push('# 物象标准');
|
|
173
174
|
lines.push('不是功能对象,而是被选中的细节:带质感、痕迹、仪式、禁忌、记忆或反常的具体形象。');
|
|
174
175
|
lines.push('- 日历是对象;忌日那页、撕不掉的旧历是物象。');
|
|
175
|
-
lines.push('- 邮戳是对象;退信戳、盖糊名字的戳是物象。');
|
|
176
|
-
lines.push('- 棺材是对象;空棺是物象。');
|
|
177
|
-
lines.push('- 面具是对象;傩面是物象。');
|
|
178
176
|
lines.push('- 下水道是对象;暗渠是物象。');
|
|
177
|
+
lines.push('示例只说明“对象→物象”的区别,不是选词表。');
|
|
178
|
+
lines.push('');
|
|
179
|
+
lines.push('# 如何选择物象(方法论,不是清单)');
|
|
180
|
+
lines.push('不要从词表里挑。按顺序做:');
|
|
181
|
+
lines.push('1. **定来源**:从当前世界设定/本次来源里选 1–2 条公理、代价、禁忌、机构流程、视觉母题。');
|
|
182
|
+
lines.push('2. **定关系**:这条规则和谁冲突?谁得利、谁付代价、谁被排除?写出一句具体关系。');
|
|
183
|
+
lines.push('3. **找载体**:这个关系落在什么公共设施/仪式器物/身体部位/文书/空间边界/职业流程上?');
|
|
184
|
+
lines.push('4. **选细节**:不要用载体本身;选它被使用过的痕迹、状态、缺口、残留、异常。');
|
|
185
|
+
lines.push('5. **压名字**:物象细节 + 结果/状态,或主体 + 强动作 + 明确对象。');
|
|
186
|
+
lines.push('6. **四问**:');
|
|
187
|
+
lines.push(' - 和题材/来源/世界设定相关吗?');
|
|
188
|
+
lines.push(' - 换一个题材/世界还成立吗?成立 = 太通用,换一个;');
|
|
189
|
+
lines.push(' - 有没有状态/痕迹/限定?');
|
|
190
|
+
lines.push(' - 能不能一句话说清:谁/什么 + 对谁/什么 + 做了什么/发生了什么?');
|
|
191
|
+
lines.push('');
|
|
192
|
+
lines.push('不要从通用日常物品清单里挑;不要写与题材/来源/世界设定无关的裸器物/部位/材料。');
|
|
179
193
|
lines.push('');
|
|
180
194
|
lines.push('名字结构优先:');
|
|
181
|
-
lines.push('1. **物象 +
|
|
195
|
+
lines.push('1. **物象 + 结果/状态**:`灯烬名灭`、`凹槛吃岁`');
|
|
182
196
|
lines.push('2. **主体 + 动作**:`工牌借脸`、`檐灰点眼`');
|
|
183
197
|
lines.push('3. **条件 + 后果**:`灯灭名断`');
|
|
184
198
|
lines.push('');
|
|
@@ -198,11 +212,11 @@ function buildNamePrompt({
|
|
|
198
212
|
lines.push('- 坏:`锁眼借脸`(谁借谁的脸?)');
|
|
199
213
|
lines.push('改成“物象细节 + 明确对象/结果”:');
|
|
200
214
|
lines.push('- `篆灰声断`、`断帚名散`、`桌下影替`、`凿匾姓消`、`锁孔换脸`');
|
|
201
|
-
lines.push('
|
|
202
|
-
lines.push('
|
|
215
|
+
lines.push('前半不要写工具类别;要写被选中的细节。后半不要写缺宾语的动词;要写明确对象或结果。');
|
|
216
|
+
lines.push('示例只说明结构问题,不是禁用词表。');
|
|
203
217
|
lines.push('');
|
|
204
218
|
lines.push('# 物象分布');
|
|
205
|
-
lines.push('
|
|
219
|
+
lines.push('同批物象要覆盖不同的来源/机制,不要都从同一类通用设施或同一类仪式器物里挑;至少覆盖 4 类来源/机制。');
|
|
206
220
|
lines.push('');
|
|
207
221
|
if (anchors.length) {
|
|
208
222
|
lines.push('# 用户认可的名字(只学结构,不要直接复用)');
|
|
@@ -254,16 +268,17 @@ function buildScorePrompt(names) {
|
|
|
254
268
|
'对每个名字按 1–5 分评分(允许 0.5):',
|
|
255
269
|
'- hook:第一眼吸引力。5 = 一眼记住;4.5 = 很强;4 = 好但眼熟;3 = 普通。',
|
|
256
270
|
'- distinct:独特性。5 = 不常见且不可替换;4.5 = 有明显辨识度;4 = 同类里常见。',
|
|
257
|
-
'- image:物象感。5 =
|
|
271
|
+
'- image:物象感。5 = 物象与题材/来源/世界设定强相关,且带质感/痕迹/仪式/禁忌;4 = 有画面但偏普通;3 = 功能对象或流程词;**如果前两字只是与题材/来源/世界设定无关的裸器物/部位/材料名,最高 3.5。**',
|
|
258
272
|
'- clarity:第一读能不能说出能力方向。5 = 一遍就懂;4.5 = 稍一停顿就懂;4 = 需要补一步;3 = 要读 note 才懂。',
|
|
259
273
|
'- natural:像不像自然中文。5 = 顺口自然;4.5 = 略压缩但顺;4 = 像代号/标题;3 = 生硬、需要硬脑补。',
|
|
260
274
|
'- coldRead:只看名字,能不能用一句话说出“这能力干什么”。5 = 能;4.5 = 接近;4 = 只能说个大概;3 = 只能感到气氛。',
|
|
275
|
+
'- bare:前两字是否只是与题材/来源/世界设定无关的裸器物/部位/材料名,没有状态/痕迹/限定?是 = true,否 = false。',
|
|
261
276
|
'',
|
|
262
277
|
'同时给每个名字写一句 `interpretation`:你只看名字时,第一反应它是什么能力。不要补设定。',
|
|
263
278
|
'',
|
|
264
279
|
list,
|
|
265
280
|
'',
|
|
266
|
-
'只返回 JSON:{"scores":[{"name":"名字","hook":0,"distinct":0,"image":0,"clarity":0,"natural":0,"coldRead":0,"interpretation":"一句话"}]}。不要解释,不要改写名字。',
|
|
281
|
+
'只返回 JSON:{"scores":[{"name":"名字","hook":0,"distinct":0,"image":0,"clarity":0,"natural":0,"coldRead":0,"bare":false,"interpretation":"一句话"}]}。不要解释,不要改写名字。',
|
|
267
282
|
].join('\n');
|
|
268
283
|
}
|
|
269
284
|
|
|
@@ -464,13 +479,14 @@ export async function runNameStage({
|
|
|
464
479
|
const name = normalizeName(row.name);
|
|
465
480
|
if (!panelNames.includes(name)) continue;
|
|
466
481
|
if (!scoreMap.has(name)) {
|
|
467
|
-
scoreMap.set(name, { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [] });
|
|
482
|
+
scoreMap.set(name, { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [], bare: [] });
|
|
468
483
|
}
|
|
469
484
|
const scores = scoreMap.get(name);
|
|
470
485
|
for (const key of ['hook', 'distinct', 'image', 'clarity', 'natural', 'coldRead']) {
|
|
471
486
|
const value = Number(row[key]);
|
|
472
487
|
if (Number.isFinite(value)) scores[key].push(value);
|
|
473
488
|
}
|
|
489
|
+
scores.bare.push(row.bare === true);
|
|
474
490
|
if (typeof row.interpretation === 'string' && row.interpretation.trim() && !interpretations.has(name)) {
|
|
475
491
|
interpretations.set(name, row.interpretation.trim());
|
|
476
492
|
}
|
|
@@ -482,13 +498,14 @@ export async function runNameStage({
|
|
|
482
498
|
const supportScore = Math.max(1, Math.min(5, Number(config.supportScore) || 4.3));
|
|
483
499
|
const ranked = panelNames
|
|
484
500
|
.map((name) => {
|
|
485
|
-
const scores = scoreMap.get(name) || { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [] };
|
|
501
|
+
const scores = scoreMap.get(name) || { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [], bare: [] };
|
|
486
502
|
const hook = average(scores.hook);
|
|
487
503
|
const distinct = average(scores.distinct);
|
|
488
504
|
const image = average(scores.image);
|
|
489
505
|
const clarity = average(scores.clarity);
|
|
490
506
|
const natural = average(scores.natural);
|
|
491
507
|
const coldRead = average(scores.coldRead);
|
|
508
|
+
const bare = scores.bare.some(Boolean);
|
|
492
509
|
const coreMin = Math.min(clarity, natural, coldRead);
|
|
493
510
|
const supportMin = Math.min(hook, distinct);
|
|
494
511
|
return {
|
|
@@ -499,9 +516,10 @@ export async function runNameStage({
|
|
|
499
516
|
clarity,
|
|
500
517
|
natural,
|
|
501
518
|
coldRead,
|
|
519
|
+
bare,
|
|
502
520
|
coreMin,
|
|
503
521
|
supportMin,
|
|
504
|
-
qualified: coreMin >= minScore && supportMin >= supportScore,
|
|
522
|
+
qualified: !bare && coreMin >= minScore && supportMin >= supportScore,
|
|
505
523
|
min: Math.min(hook, distinct, clarity, natural, coldRead),
|
|
506
524
|
total: hook + distinct + image + clarity + natural + coldRead,
|
|
507
525
|
rank: screeningRank.get(name) ?? 999,
|
|
@@ -554,6 +572,7 @@ export async function runNameStage({
|
|
|
554
572
|
clarity: score.clarity,
|
|
555
573
|
natural: score.natural,
|
|
556
574
|
coldRead: score.coldRead,
|
|
575
|
+
bare: score.bare,
|
|
557
576
|
},
|
|
558
577
|
...(score.interpretation ? { interpretation: score.interpretation } : {}),
|
|
559
578
|
} : {}),
|
|
@@ -566,7 +585,7 @@ export async function runNameStage({
|
|
|
566
585
|
.filter((row) => {
|
|
567
586
|
const coreMin = Math.min(row.score.clarity, row.score.natural, row.score.coldRead);
|
|
568
587
|
const supportMin = Math.min(row.score.hook, row.score.distinct);
|
|
569
|
-
return coreMin < minScore || supportMin < supportScore;
|
|
588
|
+
return row.score.bare === true || coreMin < minScore || supportMin < supportScore;
|
|
570
589
|
})
|
|
571
590
|
.map((row) => row.name);
|
|
572
591
|
const meta = {
|