@reconcrap/boss-recommend-mcp 1.1.2 → 1.1.4

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/src/parser.js CHANGED
@@ -28,10 +28,11 @@ const DEGREE_ORDER = [
28
28
  ];
29
29
  const GENDER_OPTIONS = ["不限", "男", "女"];
30
30
  const RECENT_NOT_VIEW_OPTIONS = ["不限", "近14天没有"];
31
- const POST_ACTION_OPTIONS = ["favorite", "greet"];
31
+ const POST_ACTION_OPTIONS = ["favorite", "greet", "none"];
32
32
  const POST_ACTION_LABELS = {
33
33
  favorite: "收藏",
34
- greet: "直接沟通"
34
+ greet: "直接沟通",
35
+ none: "什么也不做"
35
36
  };
36
37
  const LEADING_NOISE_PATTERNS = [
37
38
  /^使用boss-recommend-pipeline skills/i,
@@ -90,7 +91,7 @@ const FILTER_CLAUSE_PATTERNS = [
90
91
  /近?14天(?:内)?没有|近?14天(?:内)?没看过|近?14天(?:内)?未查看|过滤[^。;;\n]{0,12}14天|排除[^。;;\n]{0,12}14天/i,
91
92
  /目标(?:处理|筛选)?(?:人数|数量)?|至少(?:处理|筛选)|(?:处理|筛选)\s*\d+\s*(?:位|人)/i,
92
93
  /最多(?:打招呼|沟通|联系)|(?:打招呼|沟通|联系)(?:上限|最多|不超过|至多)/i,
93
- /收藏|打招呼|直接沟通/i
94
+ /收藏|打招呼|直接沟通|什么也不做|不做任何操作|不操作|仅筛选|只筛选/i
94
95
  ];
95
96
  const META_CLAUSE_PATTERNS = [
96
97
  /推荐页|推荐页面|boss推荐/i,
@@ -259,6 +260,9 @@ function normalizePostAction(value) {
259
260
  if (!normalized) return null;
260
261
  if (["favorite", "fav", "收藏"].includes(normalized)) return "favorite";
261
262
  if (["greet", "chat", "打招呼", "直接沟通", "沟通"].includes(normalized)) return "greet";
263
+ if (["none", "noop", "no-op", "什么也不做", "不做任何操作", "不操作", "仅筛选", "只筛选"].includes(normalized)) {
264
+ return "none";
265
+ }
262
266
  return null;
263
267
  }
264
268
 
@@ -377,6 +381,8 @@ function resolvePostAction({ instruction, confirmation, overrides }) {
377
381
  ? "favorite"
378
382
  : /打招呼|直接沟通|沟通/.test(instruction)
379
383
  ? "greet"
384
+ : /什么也不做|不做任何操作|不操作|仅筛选|只筛选/.test(instruction)
385
+ ? "none"
380
386
  : null;
381
387
  const proposed = overrideValue || confirmationValue || instructionValue || null;
382
388
 
@@ -534,41 +540,25 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
534
540
  invalidOverrideSchoolTags: schoolTagAudit.invalid,
535
541
  maxGreetCountResolution
536
542
  });
537
- const hasSchoolTagSignal = Boolean(
538
- (Array.isArray(overrideSchoolTag) && overrideSchoolTag.length > 0)
539
- || (Array.isArray(confirmationSchoolTag) && confirmationSchoolTag.length > 0)
540
- || (Array.isArray(detectedSchoolTags) && detectedSchoolTags.length > 0)
541
- );
542
- const hasDegreeSignal = Boolean(
543
- (Array.isArray(overrideDegrees) && overrideDegrees.length > 0)
544
- || (Array.isArray(confirmationDegrees) && confirmationDegrees.length > 0)
545
- || (Array.isArray(detectedDegrees) && detectedDegrees.length > 0)
546
- );
547
- const hasGenderSignal = Boolean(
548
- overrideGender
549
- || confirmationGender
550
- || extractGender(text)
551
- );
552
- const hasRecentNotViewSignal = Boolean(
553
- overrideRecentNotView
554
- || confirmationRecentNotView
555
- || extractRecentNotView(text)
556
- );
543
+ const hasConfirmedSchoolTagValue = Array.isArray(confirmationSchoolTag) && confirmationSchoolTag.length > 0;
544
+ const hasConfirmedDegreeValue = Array.isArray(confirmationDegrees) && confirmationDegrees.length > 0;
545
+ const hasConfirmedGenderValue = Boolean(confirmationGender);
546
+ const hasConfirmedRecentNotViewValue = Boolean(confirmationRecentNotView);
557
547
  const needs_school_tag_confirmation = (
558
548
  confirmation?.school_tag_confirmed !== true
559
- || !hasSchoolTagSignal
549
+ || !hasConfirmedSchoolTagValue
560
550
  );
561
551
  const needs_degree_confirmation = (
562
552
  confirmation?.degree_confirmed !== true
563
- || !hasDegreeSignal
553
+ || !hasConfirmedDegreeValue
564
554
  );
565
555
  const needs_gender_confirmation = (
566
556
  confirmation?.gender_confirmed !== true
567
- || !hasGenderSignal
557
+ || !hasConfirmedGenderValue
568
558
  );
569
559
  const needs_recent_not_view_confirmation = (
570
560
  confirmation?.recent_not_view_confirmed !== true
571
- || !hasRecentNotViewSignal
561
+ || !hasConfirmedRecentNotViewValue
572
562
  );
573
563
  const needs_filters_confirmation = (
574
564
  confirmation?.filters_confirmed !== true
@@ -659,7 +649,8 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
659
649
  value: postActionResolution.proposed_post_action,
660
650
  options: [
661
651
  { label: POST_ACTION_LABELS.favorite, value: "favorite" },
662
- { label: POST_ACTION_LABELS.greet, value: "greet" }
652
+ { label: POST_ACTION_LABELS.greet, value: "greet" },
653
+ { label: POST_ACTION_LABELS.none, value: "none" }
663
654
  ]
664
655
  });
665
656
  }