@reconcrap/boss-recommend-mcp 0.1.0
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 +127 -0
- package/bin/boss-recommend-mcp.js +2 -0
- package/config/screening-config.example.json +7 -0
- package/package.json +46 -0
- package/scripts/postinstall.cjs +42 -0
- package/skills/boss-recommend-pipeline/README.md +10 -0
- package/skills/boss-recommend-pipeline/SKILL.md +94 -0
- package/src/adapters.js +637 -0
- package/src/cli.js +550 -0
- package/src/index.js +244 -0
- package/src/parser.js +423 -0
- package/src/pipeline.js +206 -0
- package/src/test-parser.js +203 -0
- package/src/test-pipeline.js +227 -0
- package/vendor/boss-recommend-screen-cli/boss-recommend-screen-cli.cjs +1626 -0
- package/vendor/boss-recommend-screen-cli/scripts/capture-full-resume-canvas.cjs +407 -0
- package/vendor/boss-recommend-screen-cli/scripts/stitch_resume_chunks.py +141 -0
- package/vendor/boss-recommend-search-cli/src/cli.js +526 -0
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @reconcrap/boss-recommend-mcp
|
|
2
|
+
|
|
3
|
+
Boss 推荐页自动化流水线 MCP(stdio)服务。
|
|
4
|
+
|
|
5
|
+
它把 recommend 页面上的两段能力串起来:
|
|
6
|
+
|
|
7
|
+
- `boss-recommend-search-cli`: 只负责推荐页筛选项
|
|
8
|
+
- `boss-recommend-screen-cli`: 只负责滚动列表、打开详情、提取完整简历图、多模态判断,并对通过人选统一执行 `favorite` 或 `greet`
|
|
9
|
+
|
|
10
|
+
MCP 工具名:`run_recommend_pipeline`
|
|
11
|
+
|
|
12
|
+
状态机:
|
|
13
|
+
|
|
14
|
+
- `NEED_INPUT`
|
|
15
|
+
- `NEED_CONFIRMATION`
|
|
16
|
+
- `COMPLETED`
|
|
17
|
+
- `FAILED`
|
|
18
|
+
|
|
19
|
+
## 设计特点
|
|
20
|
+
|
|
21
|
+
- 页面目标固定为 `https://www.zhipin.com/web/chat/recommend`
|
|
22
|
+
- 支持推荐页原生筛选:学校标签 / 性别 / 近14天没有
|
|
23
|
+
- `post_action` 必须在每次完整运行开始时确认一次
|
|
24
|
+
- `target_count` 会在每次运行开始时询问一次(可留空,不设上限)
|
|
25
|
+
- 当 `post_action=greet` 时,必须在运行开始时确认 `max_greet_count`
|
|
26
|
+
- 一旦确认 `post_action`,本次运行内所有通过人选都统一按该动作执行
|
|
27
|
+
- 若达到 `max_greet_count` 但流程仍需继续,后续通过人选会自动改为收藏
|
|
28
|
+
- 不会对每位候选人重复确认
|
|
29
|
+
- 推荐页详情处理完成后,会强制关闭详情页并确认已关闭
|
|
30
|
+
- 简历提取采用“分段滚动截图 + 拼成长图”的方式,再交给多模态模型判断
|
|
31
|
+
|
|
32
|
+
## 安装
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
安装后可以直接运行:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
node src/cli.js start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
或使用 CLI fallback:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node src/cli.js run --instruction "推荐页筛选985男生,近14天没有,有大模型平台经验,符合标准的收藏"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 配置
|
|
51
|
+
|
|
52
|
+
用户配置文件默认路径:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
$CODEX_HOME/boss-recommend-mcp/screening-config.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
配置样例见:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
config/screening-config.example.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
必填字段:
|
|
65
|
+
|
|
66
|
+
- `baseUrl`
|
|
67
|
+
- `apiKey`
|
|
68
|
+
- `model`
|
|
69
|
+
|
|
70
|
+
可选字段:
|
|
71
|
+
|
|
72
|
+
- `openaiOrganization`
|
|
73
|
+
- `openaiProject`
|
|
74
|
+
- `debugPort`
|
|
75
|
+
- `outputDir`
|
|
76
|
+
|
|
77
|
+
## 常用命令
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
node src/cli.js install
|
|
81
|
+
node src/cli.js init-config
|
|
82
|
+
node src/cli.js set-port --port 9222
|
|
83
|
+
node src/cli.js doctor
|
|
84
|
+
node src/cli.js launch-chrome --port 9222
|
|
85
|
+
node src/cli.js run --instruction-file request.txt --confirmation-file confirmation.json --overrides-file overrides.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## MCP Tool Input
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"instruction": "推荐页筛选211女生,近14天没有,有 AI Agent 经验,符合标准的直接沟通",
|
|
93
|
+
"confirmation": {
|
|
94
|
+
"filters_confirmed": true,
|
|
95
|
+
"criteria_confirmed": true,
|
|
96
|
+
"target_count_confirmed": true,
|
|
97
|
+
"target_count_value": 20,
|
|
98
|
+
"post_action_confirmed": true,
|
|
99
|
+
"post_action_value": "greet",
|
|
100
|
+
"max_greet_count_confirmed": true,
|
|
101
|
+
"max_greet_count_value": 10
|
|
102
|
+
},
|
|
103
|
+
"overrides": {
|
|
104
|
+
"school_tag": "211",
|
|
105
|
+
"gender": "女",
|
|
106
|
+
"recent_not_view": "近14天没有",
|
|
107
|
+
"criteria": "候选人需要有 AI Agent 或 MCP 工具开发经验",
|
|
108
|
+
"target_count": 20,
|
|
109
|
+
"post_action": "greet",
|
|
110
|
+
"max_greet_count": 10
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## 测试
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run test:parser
|
|
119
|
+
npm run test:pipeline
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 当前实现边界
|
|
123
|
+
|
|
124
|
+
- 选择器已经按 recommend 页面语义切换
|
|
125
|
+
- `post_action` 的运行级单次确认已经落到 parser / pipeline / screen CLI
|
|
126
|
+
- 图片化简历筛选已经接入 recommend-screen-cli
|
|
127
|
+
- 页面按钮的真实联调验证仍然应该按你的要求,在交互前先征求确认后再做
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reconcrap/boss-recommend-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unified MCP pipeline for recommend-page filtering and screening on Boss Zhipin",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"boss",
|
|
7
|
+
"mcp",
|
|
8
|
+
"codex",
|
|
9
|
+
"recruiting",
|
|
10
|
+
"boss-zhipin",
|
|
11
|
+
"recommend"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "src/index.js",
|
|
15
|
+
"bin": {
|
|
16
|
+
"boss-recommend-mcp": "bin/boss-recommend-mcp.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"start": "node src/index.js",
|
|
20
|
+
"cli": "node src/cli.js",
|
|
21
|
+
"install:local": "node src/cli.js install",
|
|
22
|
+
"postinstall": "node scripts/postinstall.cjs",
|
|
23
|
+
"test:parser": "node src/test-parser.js",
|
|
24
|
+
"test:pipeline": "node src/test-pipeline.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin",
|
|
28
|
+
"config/screening-config.example.json",
|
|
29
|
+
"skills",
|
|
30
|
+
"scripts/postinstall.cjs",
|
|
31
|
+
"src",
|
|
32
|
+
"vendor",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"chrome-remote-interface": "^0.33.3",
|
|
37
|
+
"ws": "^8.19.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"license": "MIT"
|
|
46
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require("node:fs");
|
|
3
|
+
const path = require("node:path");
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
|
|
6
|
+
function isGlobalInstall() {
|
|
7
|
+
if (String(process.env.npm_config_global || "").toLowerCase() === "true") return true;
|
|
8
|
+
if (String(process.env.npm_config_location || "").toLowerCase() === "global") return true;
|
|
9
|
+
|
|
10
|
+
const argvRaw = String(process.env.npm_config_argv || "");
|
|
11
|
+
if (argvRaw.includes("--global") || argvRaw.includes(" -g ")) return true;
|
|
12
|
+
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function main() {
|
|
17
|
+
if (!isGlobalInstall()) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const cliPath = path.join(__dirname, "..", "src", "cli.js");
|
|
22
|
+
if (!fs.existsSync(cliPath)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const result = spawnSync(process.execPath, [cliPath, "install"], {
|
|
27
|
+
cwd: path.join(__dirname, ".."),
|
|
28
|
+
stdio: "inherit",
|
|
29
|
+
windowsHide: true,
|
|
30
|
+
shell: false
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (result.error) {
|
|
34
|
+
console.warn(`[boss-recommend-mcp] postinstall warning: ${result.error.message}`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (typeof result.status === "number" && result.status !== 0) {
|
|
38
|
+
console.warn(`[boss-recommend-mcp] postinstall warning: install exited with code ${result.status}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main();
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "boss-recommend-pipeline"
|
|
3
|
+
description: "Use when users ask to run Boss recommend-page filtering and screening via boss-recommend-mcp; confirm filters, criteria, optional target_count, and run-level post_action (plus max_greet_count when post_action=greet) before execution."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Boss Recommend Pipeline Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
当用户希望在 Boss 推荐页按条件筛选候选人时,优先调用 MCP 工具 `run_recommend_pipeline` 完成端到端任务:
|
|
11
|
+
|
|
12
|
+
1. 解析推荐页筛选指令
|
|
13
|
+
2. 结构化推荐页 filters
|
|
14
|
+
3. 确认筛选 criteria
|
|
15
|
+
4. 在运行开始时询问 `target_count`(可选,可留空)
|
|
16
|
+
5. 在运行开始时一次性确认 `post_action`
|
|
17
|
+
6. 若 `post_action=greet`,同时确认 `max_greet_count`
|
|
18
|
+
7. 执行 recommend-search-cli 与 recommend-screen-cli
|
|
19
|
+
8. 返回结果摘要
|
|
20
|
+
|
|
21
|
+
## Required Confirmation
|
|
22
|
+
|
|
23
|
+
在真正执行前,必须先确认:
|
|
24
|
+
|
|
25
|
+
- 推荐页 filters 是否正确
|
|
26
|
+
- screening criteria 是否正确
|
|
27
|
+
- `target_count`(目标筛选人数)是否需要设置(可不设上限)
|
|
28
|
+
- `post_action` 是否确定为 `favorite` 或 `greet`
|
|
29
|
+
- 当 `post_action=greet` 时,`max_greet_count`(最多打招呼人数)是否确定
|
|
30
|
+
|
|
31
|
+
`post_action` 的确认是**单次运行级别**的:
|
|
32
|
+
|
|
33
|
+
- 若用户确认 `favorite`,则本次运行中所有通过人选都统一收藏
|
|
34
|
+
- 若用户确认 `greet`,则本次运行中先按 `max_greet_count` 执行打招呼,超出上限后自动改为收藏
|
|
35
|
+
- 不要在每位候选人通过后再次逐个确认
|
|
36
|
+
|
|
37
|
+
## Tool Contract
|
|
38
|
+
|
|
39
|
+
- Tool name: `run_recommend_pipeline`
|
|
40
|
+
- Input:
|
|
41
|
+
- `instruction` (required)
|
|
42
|
+
- `confirmation`
|
|
43
|
+
- `filters_confirmed`
|
|
44
|
+
- `criteria_confirmed`
|
|
45
|
+
- `target_count_confirmed`
|
|
46
|
+
- `target_count_value` (integer, optional)
|
|
47
|
+
- `post_action_confirmed`
|
|
48
|
+
- `post_action_value` (`favorite|greet`)
|
|
49
|
+
- `max_greet_count_confirmed`
|
|
50
|
+
- `max_greet_count_value` (integer)
|
|
51
|
+
- `overrides`
|
|
52
|
+
- `school_tag`
|
|
53
|
+
- `gender`
|
|
54
|
+
- `recent_not_view`
|
|
55
|
+
- `criteria`
|
|
56
|
+
- `target_count`
|
|
57
|
+
- `post_action`
|
|
58
|
+
- `max_greet_count`
|
|
59
|
+
|
|
60
|
+
## Execution Notes
|
|
61
|
+
|
|
62
|
+
- 推荐页筛选入口在 recommend 页面,不是 search 页面。
|
|
63
|
+
- recommend-search-cli 只负责应用推荐页筛选项。
|
|
64
|
+
- recommend-screen-cli 负责滚动推荐列表、打开详情、提取完整简历图、调用多模态模型判断,并按单次确认的 `post_action` 执行收藏或打招呼。
|
|
65
|
+
- 详情页处理完成后必须关闭详情页并确认已关闭。
|
|
66
|
+
|
|
67
|
+
## Fallback
|
|
68
|
+
|
|
69
|
+
如果 MCP 不可用,改用:
|
|
70
|
+
|
|
71
|
+
`boss-recommend-mcp run --instruction "..." [--confirmation-json '{...}'] [--overrides-json '{...}']`
|
|
72
|
+
|
|
73
|
+
CLI fallback 的状态机与 MCP 保持一致:
|
|
74
|
+
|
|
75
|
+
- `NEED_INPUT`
|
|
76
|
+
- `NEED_CONFIRMATION`
|
|
77
|
+
- `COMPLETED`
|
|
78
|
+
- `FAILED`
|
|
79
|
+
|
|
80
|
+
## Setup Checklist
|
|
81
|
+
|
|
82
|
+
执行前先检查:
|
|
83
|
+
|
|
84
|
+
- `boss-recommend-mcp` 是否已安装
|
|
85
|
+
- `screening-config.json` 是否存在且包含可用模型配置
|
|
86
|
+
- Chrome 远程调试端口是否可连
|
|
87
|
+
- 当前 Chrome 是否停留在 `https://www.zhipin.com/web/chat/recommend`
|
|
88
|
+
|
|
89
|
+
## Response Style
|
|
90
|
+
|
|
91
|
+
- 用结构化中文输出
|
|
92
|
+
- 先给用户确认卡片,再正式执行
|
|
93
|
+
- 不要跳过 `post_action` 的首轮确认
|
|
94
|
+
- 不要把 recommend 流程说成 search 流程
|