@reconcrap/boss-recommend-mcp 2.0.49 → 2.0.51

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.
@@ -129,6 +129,14 @@ function compactRefreshAttempt(refreshAttempt) {
129
129
  forced_recent_viewed: Boolean(refreshAttempt.forced_recent_viewed),
130
130
  card_count: refreshAttempt.card_count || 0,
131
131
  search_params: refreshAttempt.search_params || null,
132
+ recovery_settle: refreshAttempt.recovery_settle
133
+ ? {
134
+ ok: Boolean(refreshAttempt.recovery_settle.ok),
135
+ status: refreshAttempt.recovery_settle.status || "",
136
+ reason: refreshAttempt.recovery_settle.reason || "",
137
+ elapsed_ms: refreshAttempt.recovery_settle.elapsed_ms || 0
138
+ }
139
+ : null,
132
140
  application: refreshAttempt.application
133
141
  ? {
134
142
  applied: Boolean(refreshAttempt.application.applied),
@@ -17,6 +17,10 @@ import {
17
17
  htmlToText,
18
18
  normalizeText
19
19
  } from "../../core/screening/index.js";
20
+ import {
21
+ createRecoverySettleError,
22
+ waitForMiniFreshStartSettle
23
+ } from "../common/recovery-settle.js";
20
24
  import {
21
25
  RECRUIT_CARD_SELECTOR,
22
26
  RECRUIT_TARGET_URL,
@@ -402,12 +406,30 @@ export async function waitForRecruitSearchControls(client, {
402
406
  };
403
407
  }
404
408
 
409
+ async function settleRecruitSearchAfterReset(client, {
410
+ timeoutMs = DEFAULT_RECRUIT_RESET_TIMEOUT_MS,
411
+ settleMs = 5000
412
+ } = {}) {
413
+ return waitForMiniFreshStartSettle(client, {
414
+ domain: "search",
415
+ timeoutMs,
416
+ intervalMs: 500,
417
+ settleMs: Math.max(0, Math.min(settleMs || 0, 5000)),
418
+ readinessLabel: "search_controls_ready",
419
+ checkReady: ({ remainingMs }) => waitForRecruitSearchControls(client, {
420
+ timeoutMs: Math.min(Math.max(1, remainingMs), 1500),
421
+ intervalMs: 300
422
+ })
423
+ });
424
+ }
425
+
405
426
  export async function resetRecruitSearchPage(client, {
406
427
  url = RECRUIT_TARGET_URL,
407
428
  settleMs = 5000,
408
429
  timeoutMs = DEFAULT_RECRUIT_RESET_TIMEOUT_MS
409
430
  } = {}) {
410
431
  const actions = [];
432
+ let miniFreshStart = null;
411
433
  const rootTimeoutMs = Math.min(timeoutMs, 90000);
412
434
  async function waitForRootsAfterSettle() {
413
435
  await sleep(settleMs);
@@ -432,6 +454,21 @@ export async function resetRecruitSearchPage(client, {
432
454
  actions.push({ method: "Page.navigate", url });
433
455
  }
434
456
 
457
+ miniFreshStart = await settleRecruitSearchAfterReset(client, {
458
+ timeoutMs: Math.min(timeoutMs, 90000),
459
+ settleMs
460
+ });
461
+ actions.push({
462
+ method: "mini_fresh_start_settle",
463
+ ok: Boolean(miniFreshStart.ok),
464
+ status: miniFreshStart.status || "",
465
+ reason: miniFreshStart.reason || "",
466
+ elapsed_ms: miniFreshStart.elapsed_ms || 0
467
+ });
468
+ if (!miniFreshStart.ok) {
469
+ throw createRecoverySettleError("search", miniFreshStart);
470
+ }
471
+
435
472
  let roots = await waitForRootsAfterSettle();
436
473
  const frameReset = await navigateRecruitSearchFrame(client, roots?.iframe?.nodeId, {
437
474
  pageUrl: url,
@@ -459,6 +496,20 @@ export async function resetRecruitSearchPage(client, {
459
496
  actions.push(fallbackFrameReset);
460
497
  await sleep(settleMs);
461
498
  }
499
+ miniFreshStart = await settleRecruitSearchAfterReset(client, {
500
+ timeoutMs: Math.min(timeoutMs, 90000),
501
+ settleMs: Math.min(settleMs, 1500)
502
+ });
503
+ actions.push({
504
+ method: "mini_fresh_start_settle_after_navigate",
505
+ ok: Boolean(miniFreshStart.ok),
506
+ status: miniFreshStart.status || "",
507
+ reason: miniFreshStart.reason || "",
508
+ elapsed_ms: miniFreshStart.elapsed_ms || 0
509
+ });
510
+ if (!miniFreshStart.ok) {
511
+ throw createRecoverySettleError("search", miniFreshStart);
512
+ }
462
513
  controls = await waitForControls();
463
514
  }
464
515
  roots = await getRecruitRoots(client, { requireFrame: false });
@@ -473,6 +524,7 @@ export async function resetRecruitSearchPage(client, {
473
524
  target_url: url,
474
525
  iframe_selector: controls.iframe_selector || roots.iframe.selector,
475
526
  iframe_document_node_id: controls.iframe_document_node_id || roots.iframe.documentNodeId,
527
+ mini_fresh_start: miniFreshStart,
476
528
  controls
477
529
  };
478
530
  }