@reconcrap/boss-recommend-mcp 2.0.1 → 2.0.2

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": "@reconcrap/boss-recommend-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Unified MCP pipeline for recommend-page filtering and screening on Boss Zhipin",
5
5
  "keywords": [
6
6
  "boss",
@@ -31,6 +31,7 @@ description: "Use when users want Boss recommend-page filtering/screening via bo
31
31
  - `criteria` 必须是用户开放式自然语言;禁止“严格/宽松执行”等预设替代。
32
32
  - `post_action=greet` 时,必须确认 `max_greet_count`;禁止自动默认为 `target_count`。
33
33
  - 正式执行前必须 `final_confirmed=true`。
34
+ - 真实筛选禁止传 `detail_limit: 0`;recommend 默认必须打开候选人详情/CV。只有用户明确要求“卡片-only 调试”时,才允许同时传 `detail_limit: 0` 和 `allow_card_only_screening: true`。
34
35
 
35
36
  - **Instruction 原文锁定**
36
37
  - 首次用户需求原文锁定为 `locked_instruction_raw`。
@@ -332,7 +332,7 @@ export async function runRecommendWorkflow({
332
332
  fallbackPageScope = "recommend",
333
333
  filter = {},
334
334
  maxCandidates = 5,
335
- detailLimit = 0,
335
+ detailLimit,
336
336
  closeDetail = true,
337
337
  delayMs = 0,
338
338
  cardTimeoutMs = 10000,
@@ -362,7 +362,7 @@ export async function runRecommendWorkflow({
362
362
  const normalizedFallbackPageScope = normalizeRecommendPageScope(fallbackPageScope) || "recommend";
363
363
  const postActionEnabled = normalizedPostAction !== "none";
364
364
  const limit = Math.max(1, Number(maxCandidates) || 1);
365
- const detailCountLimit = Math.max(0, Number(detailLimit) || 0);
365
+ const detailCountLimit = detailLimit == null ? limit : Math.max(0, Number(detailLimit) || 0);
366
366
  const effectiveDetailLimit = postActionEnabled ? limit : detailCountLimit;
367
367
  const networkRecorder = effectiveDetailLimit > 0
368
368
  ? createRecommendDetailNetworkRecorder(client)
@@ -785,7 +785,7 @@ export function createRecommendRunService({
785
785
  fallbackPageScope = "recommend",
786
786
  filter = {},
787
787
  maxCandidates = 5,
788
- detailLimit = 0,
788
+ detailLimit,
789
789
  closeDetail = true,
790
790
  delayMs = 0,
791
791
  cardTimeoutMs = 10000,
@@ -814,6 +814,8 @@ export function createRecommendRunService({
814
814
  const normalizedPostAction = normalizeRecommendPostAction(postAction) || "none";
815
815
  const requestedPageScope = normalizeRecommendPageScope(pageScope) || "recommend";
816
816
  const normalizedFallbackPageScope = normalizeRecommendPageScope(fallbackPageScope) || "recommend";
817
+ const candidateLimit = Math.max(1, Number(maxCandidates) || 1);
818
+ const normalizedDetailLimit = detailLimit == null ? candidateLimit : Math.max(0, Number(detailLimit) || 0);
817
819
  return manager.startRun({
818
820
  name,
819
821
  context: {
@@ -825,7 +827,7 @@ export function createRecommendRunService({
825
827
  fallback_page_scope: normalizedFallbackPageScope,
826
828
  filter: normalizedFilter,
827
829
  max_candidates: maxCandidates,
828
- detail_limit: detailLimit,
830
+ detail_limit: normalizedDetailLimit,
829
831
  close_detail: closeDetail,
830
832
  cv_acquisition_mode: cvAcquisitionMode,
831
833
  max_image_pages: maxImagePages,
@@ -846,7 +848,7 @@ export function createRecommendRunService({
846
848
  },
847
849
  progress: {
848
850
  card_count: 0,
849
- target_count: Math.max(1, Number(maxCandidates) || 1),
851
+ target_count: candidateLimit,
850
852
  processed: 0,
851
853
  screened: 0,
852
854
  detail_opened: 0,
@@ -864,7 +866,7 @@ export function createRecommendRunService({
864
866
  fallbackPageScope: normalizedFallbackPageScope,
865
867
  filter: normalizedFilter,
866
868
  maxCandidates,
867
- detailLimit,
869
+ detailLimit: normalizedDetailLimit,
868
870
  closeDetail,
869
871
  delayMs,
870
872
  cardTimeoutMs,
package/src/index.js CHANGED
@@ -540,7 +540,11 @@ function createRunInputSchema() {
540
540
  detail_limit: {
541
541
  type: "integer",
542
542
  minimum: 0,
543
- description: "打开详情的人数上限;默认 00 表示只用卡片信息"
543
+ description: "打开详情/CV 的人数上限;默认跟随 target_count/max_candidates。生产筛选不应传 0;只有 allow_card_only_screening=true 时才会接受 0 作为调试卡片-only 模式"
544
+ },
545
+ allow_card_only_screening: {
546
+ type: "boolean",
547
+ description: "高级调试开关;默认 false。只有显式为 true 时,recommend 才会尊重 detail_limit=0 并只用卡片信息筛选"
544
548
  },
545
549
  delay_ms: {
546
550
  type: "integer",
@@ -75,6 +75,15 @@ function parseNonNegativeInteger(raw, fallback) {
75
75
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback;
76
76
  }
77
77
 
78
+ function resolveRecommendDetailLimit(args = {}, normalized = {}) {
79
+ const fallback = parsePositiveInteger(normalized.targetCount, 5);
80
+ const requested = parseNonNegativeInteger(args.detail_limit, fallback);
81
+ if (requested === 0 && args.allow_card_only_screening !== true) {
82
+ return fallback;
83
+ }
84
+ return requested;
85
+ }
86
+
78
87
  function methodSummary(methodLog = []) {
79
88
  const summary = {};
80
89
  for (const entry of methodLog || []) {
@@ -867,7 +876,7 @@ function getRunOptions(args, parsed, normalized, session) {
867
876
  fallbackPageScope: "recommend",
868
877
  filter: normalized.filter,
869
878
  maxCandidates: normalized.targetCount,
870
- detailLimit: parseNonNegativeInteger(args.detail_limit, 0),
879
+ detailLimit: resolveRecommendDetailLimit(args, normalized),
871
880
  closeDetail: true,
872
881
  delayMs: parseNonNegativeInteger(args.delay_ms, 0),
873
882
  cardTimeoutMs: slowLive ? 180000 : 90000,