@reconcrap/boss-recommend-mcp 2.1.16 → 2.1.17

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.1.16",
3
+ "version": "2.1.17",
4
4
  "description": "Unified MCP pipeline for recommend-page filtering and screening on Boss Zhipin",
5
5
  "keywords": [
6
6
  "boss",
@@ -80,11 +80,11 @@
80
80
  "benchmark:screening": "node scripts/benchmark-screening-strategies.js"
81
81
  },
82
82
  "files": [
83
- "bin",
84
- "config/screening-config.example.json",
85
- "skills",
86
- "scripts/install-macos.sh",
87
- "scripts/postinstall.cjs",
83
+ "bin",
84
+ "config/screening-config.example.json",
85
+ "skills",
86
+ "scripts/install-macos.sh",
87
+ "scripts/postinstall.cjs",
88
88
  "src/core",
89
89
  "src/domains",
90
90
  "src/chat-mcp.js",
@@ -5,6 +5,7 @@ import {
5
5
  getNodeBox,
6
6
  getOuterHTML,
7
7
  querySelectorAll,
8
+ scrollNodeIntoView,
8
9
  sleep
9
10
  } from "../../core/browser/index.js";
10
11
  import {
@@ -433,7 +434,21 @@ export async function waitForRecommendDetailActionControls(client, {
433
434
  export async function clickRecommendActionControl(client, control, {
434
435
  allowDisabled = false
435
436
  } = {}) {
436
- if (!control?.center) {
437
+ let clickCenter = control?.center || null;
438
+ let clickRect = control?.rect || null;
439
+ if (control?.node_id) {
440
+ try {
441
+ await scrollNodeIntoView(client, control.node_id);
442
+ await sleep(150);
443
+ const box = await getNodeBox(client, control.node_id);
444
+ clickCenter = box.center;
445
+ clickRect = box.rect;
446
+ } catch {
447
+ // Fall back to the discovered center below; callers still get a clear
448
+ // error if no usable click point exists.
449
+ }
450
+ }
451
+ if (!clickCenter) {
437
452
  throw new Error("Action control has no clickable center");
438
453
  }
439
454
  const greetQuota = control.kind === "greet"
@@ -442,7 +457,7 @@ export async function clickRecommendActionControl(client, control, {
442
457
  if (control.disabled && !allowDisabled) {
443
458
  throw new Error(`Action control is disabled: ${control.kind}`);
444
459
  }
445
- await clickPoint(client, control.center.x, control.center.y);
460
+ await clickPoint(client, clickCenter.x, clickCenter.y);
446
461
  return {
447
462
  clicked: true,
448
463
  kind: control.kind,
@@ -451,6 +466,7 @@ export async function clickRecommendActionControl(client, control, {
451
466
  selector: control.selector,
452
467
  root: control.root,
453
468
  node_id: control.node_id,
454
- center: control.center
469
+ center: clickCenter,
470
+ rect: clickRect
455
471
  };
456
472
  }