@reconcrap/boss-recommend-mcp 1.3.9 → 1.3.11
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/README.md +24 -4
- package/package.json +1 -1
- package/skills/boss-chat/README.md +5 -2
- package/skills/boss-chat/SKILL.md +2 -2
- package/src/boss-chat.js +89 -12
- package/src/index.js +62 -35
- package/src/pipeline.js +15 -6
- package/src/test-boss-chat.js +328 -1
- package/src/test-pipeline.js +90 -0
- package/vendor/boss-chat-cli/src/app.js +61 -4
- package/vendor/boss-chat-cli/src/browser/chat-page.js +75 -0
- package/vendor/boss-chat-cli/src/cli.js +1 -1
- package/vendor/boss-chat-cli/src/services/llm.js +393 -52
- package/vendor/boss-chat-cli/src/services/state-store.js +4 -131
- package/vendor/boss-recommend-screen-cli/boss-recommend-screen-cli.cjs +45 -6
- package/vendor/boss-recommend-screen-cli/test-recoverable-resume-failures.cjs +25 -0
|
@@ -630,6 +630,16 @@ function browserActivateCandidate(options = {}) {
|
|
|
630
630
|
function browserScrollCustomerList(options = {}) {
|
|
631
631
|
const ratio = Number(options.ratio || 0.72);
|
|
632
632
|
const clamp = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
633
|
+
const normalize = (value) => String(value || '').replace(/\s+/g, ' ').trim();
|
|
634
|
+
const isVisible = (el) => {
|
|
635
|
+
if (!(el instanceof HTMLElement)) return false;
|
|
636
|
+
const style = getComputedStyle(el);
|
|
637
|
+
if (style.display === 'none' || style.visibility === 'hidden' || Number(style.opacity || '1') < 0.01) {
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
const rect = el.getBoundingClientRect();
|
|
641
|
+
return rect.width > 2 && rect.height > 2;
|
|
642
|
+
};
|
|
633
643
|
const isOverflowScrollable = (el) => {
|
|
634
644
|
if (!(el instanceof HTMLElement)) return false;
|
|
635
645
|
const style = getComputedStyle(el);
|
|
@@ -706,6 +716,20 @@ function browserScrollCustomerList(options = {}) {
|
|
|
706
716
|
return { ok: false, error: 'CHAT_LIST_CONTAINER_NOT_FOUND' };
|
|
707
717
|
}
|
|
708
718
|
|
|
719
|
+
const findNoMoreTips = () => {
|
|
720
|
+
const host =
|
|
721
|
+
listContainer.closest('.chat-user, .user-container, .chat-container, .chat-main') || document;
|
|
722
|
+
const tips = Array.from(host.querySelectorAll('div[role="tfoot"] .load-tips, p.load-tips')).find((node) => {
|
|
723
|
+
if (!(node instanceof HTMLElement)) return false;
|
|
724
|
+
const text = normalize(node.textContent || '');
|
|
725
|
+
return text.includes('没有更多了') && isVisible(node);
|
|
726
|
+
});
|
|
727
|
+
return {
|
|
728
|
+
detected: Boolean(tips),
|
|
729
|
+
text: normalize(tips?.textContent || ''),
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
|
|
709
733
|
const firstCard = listContainer.querySelector('div[role="listitem"]') || document.querySelector('div[role="listitem"]');
|
|
710
734
|
if (firstCard instanceof HTMLElement) {
|
|
711
735
|
const best = findBestScrollableContainer(firstCard);
|
|
@@ -714,6 +738,7 @@ function browserScrollCustomerList(options = {}) {
|
|
|
714
738
|
}
|
|
715
739
|
}
|
|
716
740
|
|
|
741
|
+
const noMoreBefore = findNoMoreTips();
|
|
717
742
|
const before = {
|
|
718
743
|
top: Number(listContainer.scrollTop || 0),
|
|
719
744
|
height: Number(listContainer.scrollHeight || 0),
|
|
@@ -750,11 +775,18 @@ function browserScrollCustomerList(options = {}) {
|
|
|
750
775
|
clientHeight: Number(listContainer.clientHeight || 0),
|
|
751
776
|
cardCount: Number(listContainer.querySelectorAll('div[role="listitem"]').length || 0),
|
|
752
777
|
};
|
|
778
|
+
const noMoreAfter = findNoMoreTips();
|
|
779
|
+
const atBottom = after.height <= after.clientHeight + 2 || after.top >= Math.max(0, after.height - after.clientHeight - 2);
|
|
753
780
|
|
|
754
781
|
return {
|
|
755
782
|
ok: true,
|
|
756
783
|
before,
|
|
757
784
|
after,
|
|
785
|
+
atBottom,
|
|
786
|
+
noMoreDetectedBefore: noMoreBefore.detected,
|
|
787
|
+
noMoreDetectedAfter: noMoreAfter.detected,
|
|
788
|
+
noMoreTextBefore: noMoreBefore.text,
|
|
789
|
+
noMoreTextAfter: noMoreAfter.text,
|
|
758
790
|
didScroll:
|
|
759
791
|
before.top !== after.top ||
|
|
760
792
|
before.height !== after.height ||
|
|
@@ -1992,6 +2024,18 @@ function browserExtractResumeProfileFromModal() {
|
|
|
1992
2024
|
normalized.includes('匿名牛人')
|
|
1993
2025
|
);
|
|
1994
2026
|
};
|
|
2027
|
+
const stripNoiseText = (text) => {
|
|
2028
|
+
let cleaned = normalize(text);
|
|
2029
|
+
const noisePhrases = ['其他名企大厂经历牛人', '相似牛人', '推荐牛人', '匿名牛人'];
|
|
2030
|
+
for (const phrase of noisePhrases) {
|
|
2031
|
+
cleaned = cleaned.split(phrase).join(' ');
|
|
2032
|
+
}
|
|
2033
|
+
return normalize(cleaned);
|
|
2034
|
+
};
|
|
2035
|
+
const pickSectionText = (section) => {
|
|
2036
|
+
if (!section) return '';
|
|
2037
|
+
return stripNoiseText(section.innerText || section.textContent || '');
|
|
2038
|
+
};
|
|
1995
2039
|
const pickFirstText = (scope, selectors) => {
|
|
1996
2040
|
for (const selector of selectors) {
|
|
1997
2041
|
let nodes = [];
|
|
@@ -2057,6 +2101,8 @@ function browserExtractResumeProfileFromModal() {
|
|
|
2057
2101
|
position: '',
|
|
2058
2102
|
schools: [],
|
|
2059
2103
|
majors: [],
|
|
2104
|
+
resumeText: '',
|
|
2105
|
+
evidenceCorpus: '',
|
|
2060
2106
|
};
|
|
2061
2107
|
}
|
|
2062
2108
|
|
|
@@ -2070,6 +2116,16 @@ function browserExtractResumeProfileFromModal() {
|
|
|
2070
2116
|
root.querySelector('.geek-work-experience-wrap') ||
|
|
2071
2117
|
root.querySelector('.resume-section[class*="work"]') ||
|
|
2072
2118
|
root;
|
|
2119
|
+
const projectSection =
|
|
2120
|
+
root.querySelector('.resume-section.geek-project-experience-wrap') ||
|
|
2121
|
+
root.querySelector('.geek-project-experience-wrap') ||
|
|
2122
|
+
root.querySelector('.resume-section[class*="project"]') ||
|
|
2123
|
+
null;
|
|
2124
|
+
const skillSection =
|
|
2125
|
+
root.querySelector('.resume-section.geek-skill-wrap') ||
|
|
2126
|
+
root.querySelector('.geek-skill-wrap') ||
|
|
2127
|
+
root.querySelector('.resume-section[class*="skill"]') ||
|
|
2128
|
+
null;
|
|
2073
2129
|
const baseSection =
|
|
2074
2130
|
root.querySelector('.resume-section.geek-base-info-wrap') ||
|
|
2075
2131
|
root.querySelector('.geek-base-info-wrap') ||
|
|
@@ -2102,6 +2158,21 @@ function browserExtractResumeProfileFromModal() {
|
|
|
2102
2158
|
'.position span',
|
|
2103
2159
|
'.position',
|
|
2104
2160
|
]);
|
|
2161
|
+
const baseText = pickSectionText(baseSection);
|
|
2162
|
+
const educationText = pickSectionText(educationSection);
|
|
2163
|
+
const workText = pickSectionText(workSection);
|
|
2164
|
+
const projectText = pickSectionText(projectSection);
|
|
2165
|
+
const skillText = pickSectionText(skillSection);
|
|
2166
|
+
const evidenceCorpus = stripNoiseText(root.innerText || root.textContent || '');
|
|
2167
|
+
const resumeText = [
|
|
2168
|
+
baseText ? `基础信息: ${baseText}` : '',
|
|
2169
|
+
educationText ? `教育经历: ${educationText}` : '',
|
|
2170
|
+
workText ? `工作经历: ${workText}` : '',
|
|
2171
|
+
projectText ? `项目经历: ${projectText}` : '',
|
|
2172
|
+
skillText ? `技能信息: ${skillText}` : '',
|
|
2173
|
+
]
|
|
2174
|
+
.filter(Boolean)
|
|
2175
|
+
.join('\n');
|
|
2105
2176
|
|
|
2106
2177
|
return {
|
|
2107
2178
|
ok: true,
|
|
@@ -2112,11 +2183,15 @@ function browserExtractResumeProfileFromModal() {
|
|
|
2112
2183
|
position,
|
|
2113
2184
|
schools,
|
|
2114
2185
|
majors,
|
|
2186
|
+
resumeText: resumeText || evidenceCorpus || '',
|
|
2187
|
+
evidenceCorpus: evidenceCorpus || resumeText || '',
|
|
2115
2188
|
debug: {
|
|
2116
2189
|
rootClass: String(root.className || ''),
|
|
2117
2190
|
educationClass: String(educationSection?.className || ''),
|
|
2118
2191
|
workClass: String(workSection?.className || ''),
|
|
2119
2192
|
wrapperClass: String(scope?.className || ''),
|
|
2193
|
+
resumeTextLength: Number((resumeText || '').length),
|
|
2194
|
+
evidenceCorpusLength: Number((evidenceCorpus || '').length),
|
|
2120
2195
|
},
|
|
2121
2196
|
};
|
|
2122
2197
|
}
|
|
@@ -291,7 +291,7 @@ function printUsage() {
|
|
|
291
291
|
console.log('');
|
|
292
292
|
console.log('Run options:');
|
|
293
293
|
console.log(' --dry-run Evaluate and click, but do not request resume');
|
|
294
|
-
console.log(' --no-state
|
|
294
|
+
console.log(' --no-state Disable in-run candidate deduplication');
|
|
295
295
|
console.log(' --job <text|value|index> Select job by label/value/index');
|
|
296
296
|
console.log(' --criteria <text> Screening criteria for resume evaluation');
|
|
297
297
|
console.log(' --start-from <unread|all> Start from unread or all list');
|