@cloud411716/fancy-webnovel 4.30.47 → 4.30.48

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "4.30.47",
3
+ "version": "4.30.48",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -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 materialPreviewText(records) {
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) + (previewFile ? `\n\n预览文件:${previewFile}` : '');
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: `${preview}\n\n---\n以上 ${records.length} 条素材要写入数据库吗?`,
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, materialPreviewText(recordsForReview) + '\n', 'utf8');
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('- 身份/制度 + 边界:身份/机构 + 凭证/边界');
@@ -176,9 +177,16 @@ function buildNamePrompt({
176
177
  lines.push('- 棺材是对象;空棺是物象。');
177
178
  lines.push('- 面具是对象;傩面是物象。');
178
179
  lines.push('- 下水道是对象;暗渠是物象。');
180
+ lines.push('- 钟摆、门缝、铁皮、鞋印、门槛、灯杆、车窗、水管、砖缝、锁孔:这些是**裸器物/部位/材料**,不是物象。');
181
+ lines.push('- 停摆、焦缝、锈铁、残印、凹槛、歪杆、裂窗、漏水、缺砖、锈孔:这些才是物象。');
182
+ lines.push('');
183
+ lines.push('# 裸名测试');
184
+ lines.push('前两字如果只是器物/部位/材料名,没有状态、痕迹、限定或仪式感,直接判为“对象”,不是“物象”,重写。');
185
+ lines.push('不要用:钟摆、门缝、铁皮、鞋印、门槛、灯杆、车窗、水管、砖缝、柜台、抽屉、锁孔、钥匙。');
186
+ lines.push('要写成带状态/痕迹/限定的物象:停摆、焦缝、锈铁、残印、凹槛、歪杆、裂窗、漏水、缺砖、空屉、锈孔、断钥。');
179
187
  lines.push('');
180
188
  lines.push('名字结构优先:');
181
- lines.push('1. **物象 + 结果/状态**:`灯烬名灭`、`门槛吃岁`');
189
+ lines.push('1. **物象 + 结果/状态**:`灯烬名灭`、`凹槛吃岁`');
182
190
  lines.push('2. **主体 + 动作**:`工牌借脸`、`檐灰点眼`');
183
191
  lines.push('3. **条件 + 后果**:`灯灭名断`');
184
192
  lines.push('');
@@ -202,7 +210,8 @@ function buildNamePrompt({
202
210
  lines.push('后半不要写缺宾语的动词(锁喉、扫名、收影、换姓、借脸、断罪);要写明确对象或结果(声断、名散、影替、姓消、脸换、罪落)。');
203
211
  lines.push('');
204
212
  lines.push('# 物象分布');
205
- lines.push('至少一半名字来自公共设施/身体/城市日常(灯、路、水、电、门、梯、车、桥、骨、血、脸、影、声),不要整批都是神殿器物(香篆、香帚、供桌、匾额、神像)。');
213
+ lines.push('不要整批神殿器物,也不要整批裸日常设施;名字前半必须是带痕迹/状态的物象,不是设施/部位/材料名。');
214
+ lines.push('同批至少覆盖 4 类物象:身体痕迹、仪式残迹、城市设施上的异常、器物缺损、空间边界、文书/身份残留;同一类最多 3 条。');
206
215
  lines.push('');
207
216
  if (anchors.length) {
208
217
  lines.push('# 用户认可的名字(只学结构,不要直接复用)');
@@ -254,16 +263,17 @@ function buildScorePrompt(names) {
254
263
  '对每个名字按 1–5 分评分(允许 0.5):',
255
264
  '- hook:第一眼吸引力。5 = 一眼记住;4.5 = 很强;4 = 好但眼熟;3 = 普通。',
256
265
  '- distinct:独特性。5 = 不常见且不可替换;4.5 = 有明显辨识度;4 = 同类里常见。',
257
- '- image:物象感。5 = 有一个带质感/痕迹/仪式/禁忌的具体物象;4 = 有画面但偏普通;3 = 功能对象或流程词。',
266
+ '- image:物象感。5 = 物象带质感/痕迹/仪式/禁忌;4 = 有画面但偏普通;3 = 功能对象或流程词;**如果前两字只是裸器物/部位/材料名(钟摆、门缝、铁皮、鞋印、门槛、灯杆、车窗、水管、砖缝、锁孔),最高 3.5。**',
258
267
  '- clarity:第一读能不能说出能力方向。5 = 一遍就懂;4.5 = 稍一停顿就懂;4 = 需要补一步;3 = 要读 note 才懂。',
259
268
  '- natural:像不像自然中文。5 = 顺口自然;4.5 = 略压缩但顺;4 = 像代号/标题;3 = 生硬、需要硬脑补。',
260
269
  '- coldRead:只看名字,能不能用一句话说出“这能力干什么”。5 = 能;4.5 = 接近;4 = 只能说个大概;3 = 只能感到气氛。',
270
+ '- bare:前两字是否只是裸器物/部位/材料名,没有状态/痕迹/限定?是 = true,否 = false。',
261
271
  '',
262
272
  '同时给每个名字写一句 `interpretation`:你只看名字时,第一反应它是什么能力。不要补设定。',
263
273
  '',
264
274
  list,
265
275
  '',
266
- '只返回 JSON:{"scores":[{"name":"名字","hook":0,"distinct":0,"image":0,"clarity":0,"natural":0,"coldRead":0,"interpretation":"一句话"}]}。不要解释,不要改写名字。',
276
+ '只返回 JSON:{"scores":[{"name":"名字","hook":0,"distinct":0,"image":0,"clarity":0,"natural":0,"coldRead":0,"bare":false,"interpretation":"一句话"}]}。不要解释,不要改写名字。',
267
277
  ].join('\n');
268
278
  }
269
279
 
@@ -464,13 +474,14 @@ export async function runNameStage({
464
474
  const name = normalizeName(row.name);
465
475
  if (!panelNames.includes(name)) continue;
466
476
  if (!scoreMap.has(name)) {
467
- scoreMap.set(name, { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [] });
477
+ scoreMap.set(name, { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [], bare: [] });
468
478
  }
469
479
  const scores = scoreMap.get(name);
470
480
  for (const key of ['hook', 'distinct', 'image', 'clarity', 'natural', 'coldRead']) {
471
481
  const value = Number(row[key]);
472
482
  if (Number.isFinite(value)) scores[key].push(value);
473
483
  }
484
+ scores.bare.push(row.bare === true);
474
485
  if (typeof row.interpretation === 'string' && row.interpretation.trim() && !interpretations.has(name)) {
475
486
  interpretations.set(name, row.interpretation.trim());
476
487
  }
@@ -482,13 +493,14 @@ export async function runNameStage({
482
493
  const supportScore = Math.max(1, Math.min(5, Number(config.supportScore) || 4.3));
483
494
  const ranked = panelNames
484
495
  .map((name) => {
485
- const scores = scoreMap.get(name) || { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [] };
496
+ const scores = scoreMap.get(name) || { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [], bare: [] };
486
497
  const hook = average(scores.hook);
487
498
  const distinct = average(scores.distinct);
488
499
  const image = average(scores.image);
489
500
  const clarity = average(scores.clarity);
490
501
  const natural = average(scores.natural);
491
502
  const coldRead = average(scores.coldRead);
503
+ const bare = scores.bare.some(Boolean);
492
504
  const coreMin = Math.min(clarity, natural, coldRead);
493
505
  const supportMin = Math.min(hook, distinct);
494
506
  return {
@@ -499,9 +511,10 @@ export async function runNameStage({
499
511
  clarity,
500
512
  natural,
501
513
  coldRead,
514
+ bare,
502
515
  coreMin,
503
516
  supportMin,
504
- qualified: coreMin >= minScore && supportMin >= supportScore,
517
+ qualified: !bare && coreMin >= minScore && supportMin >= supportScore,
505
518
  min: Math.min(hook, distinct, clarity, natural, coldRead),
506
519
  total: hook + distinct + image + clarity + natural + coldRead,
507
520
  rank: screeningRank.get(name) ?? 999,
@@ -554,6 +567,7 @@ export async function runNameStage({
554
567
  clarity: score.clarity,
555
568
  natural: score.natural,
556
569
  coldRead: score.coldRead,
570
+ bare: score.bare,
557
571
  },
558
572
  ...(score.interpretation ? { interpretation: score.interpretation } : {}),
559
573
  } : {}),
@@ -566,7 +580,7 @@ export async function runNameStage({
566
580
  .filter((row) => {
567
581
  const coreMin = Math.min(row.score.clarity, row.score.natural, row.score.coldRead);
568
582
  const supportMin = Math.min(row.score.hook, row.score.distinct);
569
- return coreMin < minScore || supportMin < supportScore;
583
+ return row.score.bare === true || coreMin < minScore || supportMin < supportScore;
570
584
  })
571
585
  .map((row) => row.name);
572
586
  const meta = {