@cloud411716/fancy-webnovel 4.30.45 → 4.30.46

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.45",
3
+ "version": "4.30.46",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -2286,7 +2286,7 @@ function teamText(root, config) {
2286
2286
  `最多 agent 调用:${config.maxTotalCalls}`,
2287
2287
  `5 轮未通过交裁判:${config.judgeOnMaxRounds ? '是' : '否'}`,
2288
2288
  `入库前人工确认:${config.reviewBeforeImport ? '开启' : '关闭'}`,
2289
- `ability_name 名字阶段:${config.nameStage?.enabled ? '开启' : '关闭'}(池 ${config.nameStage?.poolSize || 80} / 留 ${config.nameStage?.keep || 20} / 裁判 ${config.nameStage?.judges || 3} / 达标 ${config.nameStage?.minScore || 4.5})`,
2289
+ `ability_name 名字阶段:${config.nameStage?.enabled ? '开启' : '关闭'}(池 ${config.nameStage?.poolSize || 80} / 留 ${config.nameStage?.keep || 20} / 裁判 ${config.nameStage?.judges || 3} / 核心 ${config.nameStage?.minScore || 4.5} / 支撑 ${config.nameStage?.supportScore || 4.3})`,
2290
2290
  `强制锚点:${(config.nameStage?.anchorNames || []).join('、') || '(无)'}`,
2291
2291
  `风格锚点:${(config.nameStage?.styleAnchors || []).join('、') || '(无)'}`,
2292
2292
  '',
@@ -2346,7 +2346,7 @@ async function handleTeamCommand(ctx, session, tokens) {
2346
2346
  const key = String(tokens[1] || '').toLowerCase();
2347
2347
  const value = tokens.slice(2);
2348
2348
  if (!key) {
2349
- return notify(session, 'error', '用法:/fancy-material team set a|b|judge <provider> <model> [thinking] | rounds <n> | max-calls <n> | mode <cross|oneway> | judge-on-max <true|false> | review-before-import on|off | name-stage on|off | anchors <名字...> | style-anchors <名字...> | rejected <名字...> | name-pool <n> | name-keep <n> | name-judges <n>');
2349
+ return notify(session, 'error', '用法:/fancy-material team set a|b|judge <provider> <model> [thinking] | rounds <n> | max-calls <n> | mode <cross|oneway> | judge-on-max <true|false> | review-before-import on|off | name-stage on|off | anchors <名字...> | style-anchors <名字...> | rejected <名字...> | name-pool <n> | name-keep <n> | name-judges <n> | name-support <n>');
2350
2350
  }
2351
2351
  if (key === 'a' || key === 'b' || key === 'judge') {
2352
2352
  if (value.length < 2) {
@@ -2452,6 +2452,13 @@ async function handleTeamCommand(ctx, session, tokens) {
2452
2452
  writeTeamConfig(root, config);
2453
2453
  return notify(session, 'success', `✅ ${key} 已设为 ${n}。`);
2454
2454
  }
2455
+ if (key === 'name-support') {
2456
+ const n = Number(value[0]);
2457
+ if (!Number.isFinite(n) || n < 1 || n > 5) return notify(session, 'error', 'name-support 必须是 1–5。');
2458
+ config.nameStage.supportScore = n;
2459
+ writeTeamConfig(root, config);
2460
+ return notify(session, 'success', `✅ name-support 已设为 ${n}。`);
2461
+ }
2455
2462
  return notify(session, 'error', `未知 team 设置:${key}`);
2456
2463
  }
2457
2464
  return notify(session, 'error', '用法:/fancy-material team show|models [provider]|on|off|reset|set ...');
@@ -450,6 +450,7 @@ export async function runNameStage({
450
450
 
451
451
  const screeningRank = new Map(screeningOrder.map((name, index) => [name, index]));
452
452
  const minScore = Math.max(1, Math.min(5, Number(config.minScore) || 4.5));
453
+ const supportScore = Math.max(1, Math.min(5, Number(config.supportScore) || 4.3));
453
454
  const ranked = panelNames
454
455
  .map((name) => {
455
456
  const scores = scoreMap.get(name) || { hook: [], distinct: [], image: [], clarity: [], natural: [], coldRead: [] };
@@ -459,6 +460,8 @@ export async function runNameStage({
459
460
  const clarity = average(scores.clarity);
460
461
  const natural = average(scores.natural);
461
462
  const coldRead = average(scores.coldRead);
463
+ const coreMin = Math.min(clarity, natural, coldRead);
464
+ const supportMin = Math.min(hook, distinct);
462
465
  return {
463
466
  name,
464
467
  hook,
@@ -467,17 +470,23 @@ export async function runNameStage({
467
470
  clarity,
468
471
  natural,
469
472
  coldRead,
473
+ coreMin,
474
+ supportMin,
475
+ qualified: coreMin >= minScore && supportMin >= supportScore,
470
476
  min: Math.min(hook, distinct, clarity, natural, coldRead),
471
477
  total: hook + distinct + image + clarity + natural + coldRead,
472
478
  rank: screeningRank.get(name) ?? 999,
473
479
  interpretation: interpretations.get(name) || '',
474
480
  };
475
481
  })
476
- .sort((a, b) => (b.min - a.min) || (b.total - a.total) || (a.rank - b.rank));
482
+ .sort((a, b) => (Number(b.qualified) - Number(a.qualified))
483
+ || (b.coreMin - a.coreMin)
484
+ || (b.total - a.total)
485
+ || (a.rank - b.rank));
477
486
 
478
487
  const needed = Math.max(0, keep - anchors.length);
479
488
  const selectedNew = [];
480
- const strictlyQualified = ranked.filter((row) => row.min >= minScore);
489
+ const strictlyQualified = ranked.filter((row) => row.qualified);
481
490
  for (const row of strictlyQualified) {
482
491
  if (selectedNew.length >= needed) break;
483
492
  if (anchorSet.has(row.name)) continue;
@@ -525,13 +534,11 @@ export async function runNameStage({
525
534
  const finishedAt = new Date().toISOString();
526
535
  const belowThreshold = selected
527
536
  .filter((row) => row.score)
528
- .filter((row) => Math.min(
529
- row.score.hook,
530
- row.score.distinct,
531
- row.score.clarity,
532
- row.score.natural,
533
- row.score.coldRead,
534
- ) < minScore)
537
+ .filter((row) => {
538
+ const coreMin = Math.min(row.score.clarity, row.score.natural, row.score.coldRead);
539
+ const supportMin = Math.min(row.score.hook, row.score.distinct);
540
+ return coreMin < minScore || supportMin < supportScore;
541
+ })
535
542
  .map((row) => row.name);
536
543
  const meta = {
537
544
  batchId,
@@ -547,6 +554,7 @@ export async function runNameStage({
547
554
  screeningTop: targetTop,
548
555
  judges: judgeCount,
549
556
  minScore,
557
+ supportScore,
550
558
  belowThreshold,
551
559
  calls,
552
560
  selected: selected.map((row) => row.name),
@@ -30,6 +30,7 @@ const DEFAULT_TEAM = Object.freeze({
30
30
  screeningTop: 30,
31
31
  judges: 3,
32
32
  minScore: 4.5,
33
+ supportScore: 4.3,
33
34
  anchorNames: [],
34
35
  styleAnchors: [],
35
36
  rejectedNames: [],
@@ -68,6 +69,7 @@ export function readTeamConfig(root) {
68
69
  screeningTop: clampInt(ns.screeningTop, 10, 200, 30),
69
70
  judges: clampInt(ns.judges, 1, 5, 3),
70
71
  minScore: Math.max(1, Math.min(5, Number(ns.minScore) || 4.5)),
72
+ supportScore: Math.max(1, Math.min(5, Number(ns.supportScore) || 4.3)),
71
73
  anchorNames: stringArray(ns.anchorNames, []),
72
74
  styleAnchors: stringArray(ns.styleAnchors, []),
73
75
  rejectedNames: stringArray(ns.rejectedNames, []),