@reconcrap/boss-recommend-mcp 1.2.8 → 1.2.9
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 +1 -1
- package/skills/boss-recommend-pipeline/SKILL.md +101 -219
- package/src/parser.js +43 -10
- package/src/pipeline.js +5 -1
- package/src/test-parser.js +53 -2
package/package.json
CHANGED
|
@@ -1,244 +1,126 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "boss-recommend-pipeline"
|
|
3
|
-
description: "Use when users
|
|
3
|
+
description: "Use when users want Boss recommend-page filtering/screening via boss-recommend-mcp. Confirm required params first, then run in two-stage confirmation with strict recommend routing."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Boss Recommend Pipeline Skill
|
|
7
7
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
当用户希望在 Boss 推荐页按条件筛选候选人时,优先调用 MCP 工具 `start_recommend_pipeline_run` 完成端到端任务:
|
|
11
|
-
|
|
12
|
-
1. 解析推荐页筛选指令
|
|
13
|
-
2. 第一阶段仅确认非岗位参数(filters / criteria / target_count / post_action / max_greet_count)
|
|
14
|
-
3. 先执行页面就绪检查(端口、登录态、是否在 recommend 页面)
|
|
15
|
-
4. 页面就绪后再提取岗位列表,列出全部岗位并让用户确认本次岗位
|
|
16
|
-
5. 用户确认岗位后先点击该岗位,再执行 recommend-search-cli 与 recommend-screen-cli
|
|
17
|
-
6. 返回结果摘要
|
|
18
|
-
|
|
19
|
-
严格顺序约束(必须遵守):
|
|
20
|
-
|
|
21
|
-
- 在页面就绪前,禁止询问“岗位(job)要选哪个”
|
|
22
|
-
- 只有在工具返回 `job_options` 后,才允许发起岗位确认
|
|
23
|
-
- 岗位确认时必须展示 `job_options` 里的全部岗位,禁止只列一部分或让用户盲填
|
|
24
|
-
|
|
25
|
-
路由约束(必须遵守):
|
|
26
|
-
|
|
27
|
-
- 当用户请求中出现 “recommend / 推荐页 / boss recommend / recommend page / /web/chat/recommend” 语义时,只能走 `boss-recommend-pipeline`
|
|
28
|
-
- 只有当用户**明确指向搜索页面**(如 “搜索页 / boss search page / /web/chat/search / 在搜索页找人”)时,才允许转交 `boss-recruit-pipeline` 并调用 `run_recruit_pipeline`
|
|
29
|
-
- 不要调用 `boss-recruit-pipeline`,也不要调用 `run_recruit_pipeline`,除非上一条(明确 search 页面语义)命中
|
|
30
|
-
- 提到“搜索条件 / 搜索弹窗 / 搜索关键词”但上下文仍是推荐页时,仍属于 recommend 流程,禁止误切到 recruit
|
|
31
|
-
- 当 recommend 流程返回任何错误(包括 `JOB_TRIGGER_NOT_FOUND` / `NO_RECOMMEND_IFRAME` / `BOSS_LOGIN_REQUIRED`)时,禁止把 recommend 请求降级到 recruit 流程;必须先修复 recommend 的页面就绪或登录态问题
|
|
32
|
-
|
|
33
|
-
路由示例(中英文都要兼容):
|
|
34
|
-
|
|
35
|
-
- “通过 Boss 推荐页面帮我找人” -> `boss-recommend-pipeline`
|
|
36
|
-
- “Help me find candidates on Boss recommend page” -> `boss-recommend-pipeline`
|
|
37
|
-
- “在 Boss 搜索页面帮我找人” -> `boss-recruit-pipeline`
|
|
38
|
-
- “Find candidates on Boss search page” -> `boss-recruit-pipeline`
|
|
39
|
-
|
|
40
|
-
## Required Confirmation
|
|
41
|
-
|
|
42
|
-
在真正执行前,按两个阶段确认:
|
|
43
|
-
|
|
44
|
-
阶段 A(页面就绪前,禁止问岗位):
|
|
45
|
-
|
|
46
|
-
- 页面范围(`page_scope`)必须先确认:`recommend`(推荐)/ `latest`(最新)/ `featured`(精选)
|
|
47
|
-
- 即使 instruction 里已出现“推荐/精选”关键词,也必须显式二次确认 `page_confirmed=true` 与 `page_value`
|
|
48
|
-
- 学校标签(`school_tag`,支持多选)
|
|
49
|
-
- 若输入混合了有效与无效选项(如 `985,211,qs100`),必须忽略无效项并保留有效项;不要直接回退到“不限”
|
|
50
|
-
- 学历(`degree`)
|
|
51
|
-
- 性别(`gender`)
|
|
52
|
-
- 是否过滤近14天已看(`recent_not_view`)
|
|
53
|
-
- screening criteria 是否正确
|
|
54
|
-
- `criteria` 必须是用户输入的开放式自然语言描述,禁止用“严格执行/宽松执行”等预设选项代替
|
|
55
|
-
- 若之前步骤未收到 `criteria`,必须先让用户填写后再继续
|
|
56
|
-
- 即使已在之前步骤提取到 `criteria`(含 instruction / overrides),执行前也必须再次向用户复述并确认,可让用户直接改写
|
|
57
|
-
- `target_count`(目标筛选人数)是否需要设置(可不设上限)
|
|
58
|
-
- `post_action` 是否确定为 `favorite` 或 `greet`
|
|
59
|
-
- 当 `post_action=greet` 时,`max_greet_count`(最多打招呼人数)是否确定
|
|
60
|
-
- 严禁在未询问用户的情况下自动把 `max_greet_count` 设为 `target_count` 或其他默认值
|
|
61
|
-
|
|
62
|
-
阶段 B(页面就绪后,且已拿到岗位列表):
|
|
63
|
-
|
|
64
|
-
- 岗位(`job`)是否确定
|
|
65
|
-
- 必须先列出 recommend 页岗位栏里识别到的全部岗位(来自工具返回的 `job_options`),让用户明确选择
|
|
66
|
-
- 即使前序步骤已提取到 `job` 参数,执行前也必须再次展示岗位列表并让用户二次确认
|
|
67
|
-
- 用户确认后必须先点击该岗位,再开始 search 和 screen
|
|
68
|
-
- 正式开始 search/screen 前,必须做最后一轮“全参数总确认”
|
|
69
|
-
- 需要向用户复述并确认:岗位、school_tag、degree、gender、recent_not_view、criteria、target_count、post_action、max_greet_count
|
|
70
|
-
- 只有用户明确最终确认后才允许执行
|
|
71
|
-
|
|
72
|
-
禁止行为(必须避免):
|
|
73
|
-
|
|
74
|
-
- 第一轮就问“你要绑定哪个岗位”
|
|
75
|
-
- 让用户在未登录或未进入推荐页时先填岗位
|
|
76
|
-
- 在岗位确认时只展示部分岗位
|
|
77
|
-
|
|
78
|
-
`post_action` 的确认是**单次运行级别**的:
|
|
79
|
-
|
|
80
|
-
- 若用户确认 `favorite`,则本次运行中所有通过人选都统一收藏
|
|
81
|
-
- 若用户确认 `greet`,则本次运行中先按 `max_greet_count` 执行打招呼,超出上限后自动改为收藏
|
|
82
|
-
- 不要在每位候选人通过后再次逐个确认
|
|
83
|
-
|
|
84
|
-
## Instruction 原文锁定与执行前回显校验(必须遵守)
|
|
85
|
-
|
|
86
|
-
- 第一次收到用户自然语言需求时,必须把该条 `instruction` 原文锁定为 `locked_instruction_raw`。
|
|
87
|
-
- 后续所有调用(包括二轮确认、最终执行、重试)都必须复用同一条 `locked_instruction_raw`,禁止改写、扩写、摘要、同义替换、翻译。
|
|
88
|
-
- 未经用户明确要求,禁止 agent 自行生成新的 `instruction` 文案。
|
|
89
|
-
- 最终执行前(即准备提交 `job_confirmed=true` 与 `final_confirmed=true` 的那次调用),必须先向用户逐字回显本次将提交的 `instruction`,并明确提示“将按以下原文执行”。
|
|
90
|
-
- 回显校验规则:若当前待提交 `instruction` 与 `locked_instruction_raw` 不一致(按原样字符串比对),必须停止调用工具,先修正为原文后再执行。
|
|
91
|
-
- 仅当用户明确要求修改 `instruction` 时,才允许更新 `locked_instruction_raw`;更新后仍需再次逐字回显并确认。
|
|
92
|
-
|
|
93
|
-
## Tool Contract
|
|
94
|
-
|
|
95
|
-
- Tool name: `start_recommend_pipeline_run`
|
|
96
|
-
- Input:
|
|
97
|
-
- `instruction` (required)
|
|
98
|
-
- `confirmation`
|
|
99
|
-
- `page_confirmed`
|
|
100
|
-
- `page_value` (`recommend|latest|featured`)
|
|
101
|
-
- `filters_confirmed`
|
|
102
|
-
- `school_tag_confirmed`
|
|
103
|
-
- `school_tag_value`(建议回传最终确认值,避免二轮调用丢失)
|
|
104
|
-
- `degree_confirmed`
|
|
105
|
-
- `degree_value`
|
|
106
|
-
- `gender_confirmed`
|
|
107
|
-
- `gender_value`
|
|
108
|
-
- `recent_not_view_confirmed`
|
|
109
|
-
- `recent_not_view_value`
|
|
110
|
-
- `criteria_confirmed`
|
|
111
|
-
- `target_count_confirmed`
|
|
112
|
-
- `target_count_value` (integer, optional)
|
|
113
|
-
- `post_action_confirmed`
|
|
114
|
-
- `post_action_value` (`favorite|greet`)
|
|
115
|
-
- `final_confirmed`
|
|
116
|
-
- `job_confirmed`
|
|
117
|
-
- `job_value` (string)
|
|
118
|
-
- `max_greet_count_confirmed`
|
|
119
|
-
- `max_greet_count_value` (integer)
|
|
120
|
-
- `overrides`
|
|
121
|
-
- `page_scope` (`recommend|latest|featured`)
|
|
122
|
-
- `school_tag`(可传单值或数组,如 `["985","211"]`)
|
|
123
|
-
- `degree`(可传单值或数组;如“本科及以上”应展开为 `["本科","硕士","博士"]`)
|
|
124
|
-
- `gender`
|
|
125
|
-
- `recent_not_view`
|
|
126
|
-
- `criteria`
|
|
127
|
-
- `job`
|
|
128
|
-
- `target_count`
|
|
129
|
-
- `post_action`
|
|
130
|
-
- `max_greet_count`
|
|
131
|
-
|
|
132
|
-
长耗时宿主兼容(推荐):
|
|
133
|
-
|
|
134
|
-
- 默认调用 `start_recommend_pipeline_run` 启动异步流程(状态查询按“用户触发”执行,不自动轮询)。
|
|
135
|
-
- `start_recommend_pipeline_run` 会先走同步一致的前置门禁(登录/页面就绪/岗位确认/最终确认)。
|
|
136
|
-
- 只有门禁通过后才会返回 `ACCEPTED + run_id`;否则会先返回 `NEED_INPUT/NEED_CONFIRMATION/FAILED`,必须先按提示补齐。
|
|
137
|
-
- 若宿主要显式拆成三步,也可使用:
|
|
138
|
-
- `start_recommend_pipeline_run`
|
|
139
|
-
- `get_recommend_pipeline_run`
|
|
140
|
-
- `cancel_recommend_pipeline_run`
|
|
141
|
-
- `pause_recommend_pipeline_run`
|
|
142
|
-
- `resume_recommend_pipeline_run`
|
|
143
|
-
- 建议轮询间隔 5~15 秒。
|
|
144
|
-
- 已有 `run_id` 时不要重复 start,优先继续轮询同一个 run。
|
|
145
|
-
- 若宿主明确需要阻塞式返回,再传 `execution_mode=sync`。
|
|
146
|
-
- 暂停后继续必须复用同一 `run_id`:先 `pause_recommend_pipeline_run`,轮询到 `run.state=paused` 后再 `resume_recommend_pipeline_run`。
|
|
147
|
-
- `pause_recommend_pipeline_run` 返回 `PAUSE_REQUESTED` 仅表示已接收请求;真正暂停点在“当前候选人处理完成后”。
|
|
148
|
-
- `resume_recommend_pipeline_run` 会复用暂停前的 CSV 与 checkpoint,无需重新 start。
|
|
149
|
-
|
|
150
|
-
异步状态查询策略(必须遵守):
|
|
151
|
-
|
|
152
|
-
- 默认是“被动查询”模式:拿到 `ACCEPTED + run_id` 后,本轮到此结束,不要在同一轮自动 `sleep + get_recommend_pipeline_run`。
|
|
153
|
-
- 只有当用户明确要求“查询进度/继续跟进/持续监控”时,才调用 `get_recommend_pipeline_run`。
|
|
154
|
-
- 禁止在无用户指令时进行循环 `Start-Sleep` 或自动轮询并主动播报进度。
|
|
155
|
-
- 若用户明确要求持续监控,再按 5~15 秒间隔轮询,并在用户要求停止后立即停止轮询。
|
|
156
|
-
|
|
157
|
-
## Execution Notes
|
|
158
|
-
|
|
159
|
-
- 推荐页筛选入口在 recommend 页面,不是 search 页面。
|
|
160
|
-
- 页面就绪后,必须先读取岗位栏并展示全部岗位供用户确认;若未确认岗位,禁止开始 search/screen。
|
|
161
|
-
- recommend-search-cli 只负责应用推荐页筛选项。
|
|
162
|
-
- 若 `page_scope=featured`:必须严格按 `search -> 切换精选tab(data-status=3) -> screen` 顺序执行。
|
|
163
|
-
- 若 `page_scope=featured` 且校准文件缺失:必须先触发 `boss-recommend-mcp calibrate` 自动校准,成功后再继续。
|
|
164
|
-
- 若 `page_scope=latest`:执行路径与 `recommend` 一致(search + screen),但 screen 列表选择器应按最新 tab 结构读取(data-status=1)。
|
|
165
|
-
- recommend-screen-cli 负责滚动推荐列表、打开详情、提取完整简历图、调用多模态模型判断,并按单次确认的 `post_action` 执行收藏或打招呼。
|
|
166
|
-
- 精选页收藏仅允许“校准坐标 + 模拟点击”,成功判定仅看 network `add/del` 信号。
|
|
167
|
-
- 详情页处理完成后必须关闭详情页并确认已关闭。
|
|
168
|
-
|
|
169
|
-
## Fallback
|
|
170
|
-
|
|
171
|
-
如果 MCP 不可用,改用:
|
|
8
|
+
## Goal
|
|
172
9
|
|
|
173
|
-
`
|
|
10
|
+
当用户要在 Boss 推荐页筛人时,必须走 `start_recommend_pipeline_run`,并按“两阶段确认 -> 页面就绪 -> 岗位确认 -> 最终确认 -> 执行”的顺序完成。
|
|
174
11
|
|
|
175
|
-
|
|
12
|
+
## Hard Rules (Must Follow)
|
|
13
|
+
|
|
14
|
+
- **路由**
|
|
15
|
+
- 语义是推荐页(`recommend/推荐页/recommend page//web/chat/recommend`)时,只能走本 skill。
|
|
16
|
+
- 只有用户**明确**说搜索页(`search/搜索页//web/chat/search`)时,才可转 `boss-recruit-pipeline`。
|
|
17
|
+
- recommend 失败时(如 `JOB_TRIGGER_NOT_FOUND/NO_RECOMMEND_IFRAME/BOSS_LOGIN_REQUIRED`)禁止降级到 recruit;先修 recommend 页面就绪/登录态。
|
|
18
|
+
|
|
19
|
+
- **岗位确认时机**
|
|
20
|
+
- 页面未就绪前,禁止询问 `job`。
|
|
21
|
+
- 仅当工具返回 `job_options` 后,才允许问 `job`,且必须展示全部选项。
|
|
22
|
+
|
|
23
|
+
- **参数确认**
|
|
24
|
+
- `criteria` 必须是用户开放式自然语言;禁止“严格/宽松执行”等预设替代。
|
|
25
|
+
- `post_action=greet` 时,必须确认 `max_greet_count`;禁止自动默认为 `target_count`。
|
|
26
|
+
- 正式执行前必须 `final_confirmed=true`。
|
|
27
|
+
|
|
28
|
+
- **Instruction 原文锁定**
|
|
29
|
+
- 首次用户需求原文锁定为 `locked_instruction_raw`。
|
|
30
|
+
- 后续所有调用复用原文,禁止改写/翻译/摘要。
|
|
31
|
+
- 最终执行前逐字回显将提交的 `instruction`;若与锁定值不一致,先修正再执行。
|
|
32
|
+
|
|
33
|
+
## Two-Stage Confirmation
|
|
34
|
+
|
|
35
|
+
### Stage A (页面就绪前,禁止问岗位)
|
|
36
|
+
|
|
37
|
+
必须确认:
|
|
38
|
+
|
|
39
|
+
- `page_scope`:`recommend|latest|featured`
|
|
40
|
+
- `school_tag`(多选)
|
|
41
|
+
- `degree`(多选)
|
|
42
|
+
- `gender`
|
|
43
|
+
- `recent_not_view`
|
|
44
|
+
- `criteria`(开放文本)
|
|
45
|
+
- `target_count`(可空)
|
|
46
|
+
- `post_action`:`favorite|greet|none`
|
|
47
|
+
- `max_greet_count`(仅当 `post_action=greet`)
|
|
176
48
|
|
|
177
|
-
|
|
178
|
-
- 不能执行 `boss-recruit-mcp doctor` 作为 recommend 流程的环境检查
|
|
179
|
-
- 若检测到当前环境只有 recruit MCP,应先修复 recommend MCP 配置,再继续
|
|
49
|
+
### Stage B (页面就绪后)
|
|
180
50
|
|
|
181
|
-
|
|
51
|
+
必须确认:
|
|
182
52
|
|
|
183
|
-
- `
|
|
184
|
-
- `
|
|
185
|
-
- `COMPLETED`
|
|
186
|
-
- `FAILED`
|
|
53
|
+
- `job`(来自 `job_options`,必须全量展示)
|
|
54
|
+
- `final_review`(岗位 + 全参数总确认)
|
|
187
55
|
|
|
188
|
-
##
|
|
56
|
+
## Closed vs Open Questions
|
|
189
57
|
|
|
190
|
-
|
|
58
|
+
- 封闭式字段(除 `criteria/target_count/max_greet_count/job`)必须提供完整可选项,不让用户盲填。
|
|
59
|
+
- 若工具已返回 `pending_questions[].options`,优先原样使用。
|
|
60
|
+
- 若未返回,则按下列枚举展示:
|
|
61
|
+
- `page_scope`: `recommend/latest/featured`
|
|
62
|
+
- `school_tag`: `不限/985/211/双一流院校/留学/国内外名校/公办本科`
|
|
63
|
+
- `degree`: `不限/初中及以下/中专/中技/高中/大专/本科/硕士/博士`
|
|
64
|
+
- `gender`: `不限/男/女`
|
|
65
|
+
- `recent_not_view`: `不限/近14天没有`
|
|
66
|
+
- `post_action`: `favorite/greet/none`
|
|
191
67
|
|
|
192
|
-
|
|
193
|
-
- `screening-config.json` 是否存在(安装后通常会自动生成模板)
|
|
194
|
-
- `baseUrl/apiKey/model` 是否已由用户填写为可用值(不能是模板占位符)
|
|
195
|
-
- Chrome 远程调试端口是否可连
|
|
196
|
-
- 当前 Chrome 是否停留在 `https://www.zhipin.com/web/chat/recommend`
|
|
68
|
+
## Tool Usage
|
|
197
69
|
|
|
198
|
-
|
|
70
|
+
- 主工具:`start_recommend_pipeline_run`
|
|
71
|
+
- 必填:`instruction`
|
|
72
|
+
- 关键输入:
|
|
73
|
+
- `confirmation`:`page_confirmed/page_value/filters_confirmed/school_tag_confirmed.../job_confirmed/job_value/final_confirmed`
|
|
74
|
+
- `overrides`:`page_scope/school_tag/degree/gender/recent_not_view/criteria/job/target_count/post_action/max_greet_count`
|
|
199
75
|
|
|
200
|
-
|
|
201
|
-
- 检查 Boss 是否已登录
|
|
202
|
-
- 检查当前页面是否已停留在 recommend 页面
|
|
203
|
-
- 若检测到当前 URL 为 `https://www.zhipin.com/web/user/?ka=bticket`(或同类登录页 URL),立即判定为“未登录”,只提示用户登录;不要继续做页面脚本修改
|
|
204
|
-
- 若端口不可连接:先自动尝试启动 Chrome,并且必须使用 `--remote-debugging-port=<port>` + `--user-data-dir=<profile>`
|
|
205
|
-
- 若检测到 Boss 已登录但不在 recommend 页面:先自动 navigate 到 `https://www.zhipin.com/web/chat/recommend`
|
|
206
|
-
- 若检测到 Boss 未登录:提示用户先登录;用户登录后先 navigate 到 recommend 页面再继续
|
|
207
|
-
- 自动修复后仍失败时,才提示用户介入并等待“已就绪”后重试
|
|
76
|
+
最小策略:
|
|
208
77
|
|
|
209
|
-
|
|
78
|
+
- 若返回 `NEED_INPUT` 或 `NEED_CONFIRMATION`:只追问 `pending_questions`。
|
|
79
|
+
- 已确认值不重复问;仅补缺口。
|
|
80
|
+
- 拿到 `ACCEPTED + run_id` 后默认停止本轮,不自动轮询。
|
|
210
81
|
|
|
211
|
-
|
|
82
|
+
## Async Run Policy
|
|
212
83
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
- 禁止 agent 自行代填或猜测示例值(如 `test-key` / `mock-key` / `https://example.com` / `gpt-4` 占位等)
|
|
217
|
-
- 必须逐项向用户确认 `baseUrl`、`apiKey`、`model` 后再写入
|
|
218
|
-
2. 优先查看 `diagnostics.auto_repair`,若有自动修复动作则先基于其结果继续执行或给出最小化补救提示。
|
|
219
|
-
3. 若自动修复后仍失败,再读取 `diagnostics.recovery.agent_prompt`,直接把这段提示词交给 AI agent 执行环境修复。
|
|
220
|
-
4. 若 `diagnostics.recovery.agent_prompt` 不存在,使用下面的兜底提示词(严格顺序,不可跳步):
|
|
84
|
+
- 用户未明确要求“持续跟进”时,不自动 `sleep + get_recommend_pipeline_run`。
|
|
85
|
+
- 用户要求查进度时,再用 `get_recommend_pipeline_run`(建议 5-15 秒间隔)。
|
|
86
|
+
- `pause/resume/cancel` 必须复用同一 `run_id`,不要重复 `start`。
|
|
221
87
|
|
|
222
|
-
|
|
223
|
-
你是环境修复 agent。请根据 diagnostics.checks 修复依赖,必须串行执行:
|
|
224
|
-
1) 若 node_cli 失败:先安装 Node.js >=18,未成功前禁止执行 npm install。
|
|
225
|
-
2) 若任意 npm_dep_* 失败:再安装 npm 依赖(chrome-remote-interface / ws / sharp)。
|
|
226
|
-
每一步完成后重新运行 doctor,全部通过后再重试 start_recommend_pipeline_run。
|
|
227
|
-
```
|
|
88
|
+
## Preflight and Recovery
|
|
228
89
|
|
|
229
|
-
|
|
90
|
+
- 执行前必须通过:
|
|
91
|
+
- `screening-config.json` 可用且非占位值(`baseUrl/apiKey/model`)
|
|
92
|
+
- Chrome DevTools 端口可连
|
|
93
|
+
- Boss 已登录且位于 `https://www.zhipin.com/web/chat/recommend`
|
|
94
|
+
|
|
95
|
+
- `PIPELINE_PREFLIGHT_FAILED` 处理顺序:
|
|
96
|
+
1. 若 `screen_config` 失败:让用户提供真实 `baseUrl/apiKey/model`,并在 `guidance.config_path` 修改后明确回复“已修改完成”。
|
|
97
|
+
2. 若有 `diagnostics.auto_repair`:优先按其结果继续。
|
|
98
|
+
3. 否则使用 `diagnostics.recovery.agent_prompt`。
|
|
99
|
+
4. 若无 `agent_prompt`:按顺序修复 `node_cli -> npm_dep_*`,每步后重跑 doctor。
|
|
100
|
+
|
|
101
|
+
## Featured / Latest Notes
|
|
102
|
+
|
|
103
|
+
- `featured`:必须 `search -> 切换精选 tab(data-status=3) -> screen`。
|
|
104
|
+
- `featured` 且缺少校准文件:先 `boss-recommend-mcp calibrate`。
|
|
105
|
+
- `latest`:流程同 `recommend`,但使用最新 tab 结构(`data-status=1`)。
|
|
106
|
+
|
|
107
|
+
## Fallback CLI
|
|
108
|
+
|
|
109
|
+
MCP 不可用时:
|
|
110
|
+
|
|
111
|
+
`npx -y @reconcrap/boss-recommend-mcp@latest run --instruction "..." [--confirmation-json '{...}'] [--overrides-json '{...}']`
|
|
112
|
+
|
|
113
|
+
禁止错误回退:
|
|
230
114
|
|
|
231
|
-
-
|
|
115
|
+
- 不得切到 `boss-recruit-mcp` 或 `run_recruit_pipeline`。
|
|
116
|
+
- 不得用 `boss-recruit-mcp doctor` 检查 recommend 流程。
|
|
232
117
|
|
|
233
118
|
## Response Style
|
|
234
119
|
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
- 若失败原因是未登录,提示文案必须明确给出登录 URL:`https://www.zhipin.com/web/user/?ka=bticket`
|
|
243
|
-
- 不要跳过 `post_action` 的首轮确认
|
|
244
|
-
- 不要把 recommend 流程说成 search 流程
|
|
120
|
+
- 用结构化中文。
|
|
121
|
+
- 第一轮确认卡片不出现 `job`。
|
|
122
|
+
- 仅在 `job_options` 出现后给岗位确认卡片,且岗位选项必须全量。
|
|
123
|
+
- 封闭式问题必须带完整标签选项;开放式问题(如 `criteria`)保持自由输入。
|
|
124
|
+
- 页面就绪失败提示必须包含 `debug_port`、recommend URL、以及登录 URL(若未登录):
|
|
125
|
+
- `https://www.zhipin.com/web/chat/recommend`
|
|
126
|
+
- `https://www.zhipin.com/web/user/?ka=bticket`
|
package/src/parser.js
CHANGED
|
@@ -28,6 +28,10 @@ const DEGREE_ORDER = [
|
|
|
28
28
|
];
|
|
29
29
|
const GENDER_OPTIONS = ["不限", "男", "女"];
|
|
30
30
|
const RECENT_NOT_VIEW_OPTIONS = ["不限", "近14天没有"];
|
|
31
|
+
const FILTER_CONFIRM_OPTIONS = [
|
|
32
|
+
{ label: "筛选项无误,继续", value: "confirm" },
|
|
33
|
+
{ label: "筛选项需要调整", value: "revise" }
|
|
34
|
+
];
|
|
31
35
|
const POST_ACTION_OPTIONS = ["favorite", "greet", "none"];
|
|
32
36
|
const POST_ACTION_LABELS = {
|
|
33
37
|
favorite: "收藏",
|
|
@@ -52,8 +56,8 @@ const SCHOOL_TAG_PATTERNS = [
|
|
|
52
56
|
{ label: "985", pattern: /(?:学校|院校|学历|标签|筛选|要求)?[^。;;\n]{0,12}(?:985)(?!\d)/i },
|
|
53
57
|
{ label: "211", pattern: /(?:学校|院校|学历|标签|筛选|要求)?[^。;;\n]{0,12}(?:211)(?!\d)/i },
|
|
54
58
|
{ label: "双一流院校", pattern: /双一流(?:院校|学校)?/i },
|
|
55
|
-
{ label: "留学", pattern:
|
|
56
|
-
{ label: "国内外名校", pattern:
|
|
59
|
+
{ label: "留学", pattern: /留学|留学生|海归/i },
|
|
60
|
+
{ label: "国内外名校", pattern: /国内外名校|海内外名校|海外名校|qs\s*(?:top|前)?\s*\d+|名校/i },
|
|
57
61
|
{ label: "公办本科", pattern: /公办本科/i }
|
|
58
62
|
];
|
|
59
63
|
const DEGREE_PATTERNS = [
|
|
@@ -111,6 +115,10 @@ function normalizeText(input) {
|
|
|
111
115
|
return String(input || "").replace(/\s+/g, " ").trim();
|
|
112
116
|
}
|
|
113
117
|
|
|
118
|
+
function normalizeCompactText(input) {
|
|
119
|
+
return normalizeText(input).replace(/\s+/g, "").toLowerCase();
|
|
120
|
+
}
|
|
121
|
+
|
|
114
122
|
function parsePositiveIntegerValue(value) {
|
|
115
123
|
const parsed = Number.parseInt(String(value ?? ""), 10);
|
|
116
124
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
@@ -120,10 +128,25 @@ function uniqueList(items) {
|
|
|
120
128
|
return Array.from(new Set(items.filter(Boolean)));
|
|
121
129
|
}
|
|
122
130
|
|
|
131
|
+
function buildTextOptions(values = []) {
|
|
132
|
+
return values.map((value) => ({
|
|
133
|
+
label: value,
|
|
134
|
+
value
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
|
|
123
138
|
function normalizeSchoolTag(value) {
|
|
124
139
|
const normalized = normalizeText(value);
|
|
125
140
|
if (!normalized) return null;
|
|
126
|
-
|
|
141
|
+
const compact = normalizeCompactText(normalized);
|
|
142
|
+
if (normalized === "双一流" || compact === "双一流") return "双一流院校";
|
|
143
|
+
if (["留学", "留学生", "海归", "海外留学"].includes(compact)) return "留学";
|
|
144
|
+
if (
|
|
145
|
+
["国内外名校", "海内外名校", "国内外高校", "海内外高校", "海外名校"].includes(compact)
|
|
146
|
+
|| /^qs(?:前|top)?\d+$/.test(compact)
|
|
147
|
+
) {
|
|
148
|
+
return "国内外名校";
|
|
149
|
+
}
|
|
127
150
|
if (SCHOOL_TAG_OPTIONS.includes(normalized)) return normalized;
|
|
128
151
|
return null;
|
|
129
152
|
}
|
|
@@ -257,10 +280,19 @@ function normalizeGender(value) {
|
|
|
257
280
|
function normalizeRecentNotView(value) {
|
|
258
281
|
const normalized = normalizeText(value);
|
|
259
282
|
if (!normalized) return null;
|
|
260
|
-
|
|
283
|
+
const compact = normalizeCompactText(normalized).replace(/天内/g, "天");
|
|
284
|
+
if (
|
|
285
|
+
/^(?:近)?14天(?:没有|未看|没看过|没看|未查看|未查看过)$/.test(compact)
|
|
286
|
+
|| /^(?:过滤|排除)(?:近)?14天(?:已看|看过)?$/.test(compact)
|
|
287
|
+
) {
|
|
261
288
|
return "近14天没有";
|
|
262
289
|
}
|
|
263
|
-
if (
|
|
290
|
+
if (
|
|
291
|
+
/^(?:不限|不限制|无要求|无|全部|都可以)$/.test(compact)
|
|
292
|
+
|| /^(?:不过滤|保留)(?:近)?14天(?:已看|看过)?$/.test(compact)
|
|
293
|
+
) {
|
|
294
|
+
return "不限";
|
|
295
|
+
}
|
|
264
296
|
return RECENT_NOT_VIEW_OPTIONS.includes(normalized) ? normalized : null;
|
|
265
297
|
}
|
|
266
298
|
|
|
@@ -634,7 +666,7 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
|
|
|
634
666
|
field: "school_tag",
|
|
635
667
|
question: schoolTagQuestion,
|
|
636
668
|
value: searchParams.school_tag,
|
|
637
|
-
options: SCHOOL_TAG_OPTIONS
|
|
669
|
+
options: buildTextOptions(SCHOOL_TAG_OPTIONS)
|
|
638
670
|
});
|
|
639
671
|
}
|
|
640
672
|
|
|
@@ -643,7 +675,7 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
|
|
|
643
675
|
field: "degree",
|
|
644
676
|
question: "请确认学历筛选(可多选)。",
|
|
645
677
|
value: searchParams.degree,
|
|
646
|
-
options: DEGREE_OPTIONS
|
|
678
|
+
options: buildTextOptions(DEGREE_OPTIONS)
|
|
647
679
|
});
|
|
648
680
|
}
|
|
649
681
|
|
|
@@ -652,7 +684,7 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
|
|
|
652
684
|
field: "gender",
|
|
653
685
|
question: "请确认性别筛选。",
|
|
654
686
|
value: searchParams.gender,
|
|
655
|
-
options: GENDER_OPTIONS
|
|
687
|
+
options: buildTextOptions(GENDER_OPTIONS)
|
|
656
688
|
});
|
|
657
689
|
}
|
|
658
690
|
|
|
@@ -661,7 +693,7 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
|
|
|
661
693
|
field: "recent_not_view",
|
|
662
694
|
question: "请确认是否过滤近14天内已看过的人选。",
|
|
663
695
|
value: searchParams.recent_not_view,
|
|
664
|
-
options: RECENT_NOT_VIEW_OPTIONS
|
|
696
|
+
options: buildTextOptions(RECENT_NOT_VIEW_OPTIONS)
|
|
665
697
|
});
|
|
666
698
|
}
|
|
667
699
|
|
|
@@ -669,7 +701,8 @@ export function parseRecommendInstruction({ instruction, confirmation, overrides
|
|
|
669
701
|
pending_questions.push({
|
|
670
702
|
field: "filters",
|
|
671
703
|
question: "请确认以上推荐页筛选项整体无误。",
|
|
672
|
-
value: searchParams
|
|
704
|
+
value: searchParams,
|
|
705
|
+
options: FILTER_CONFIRM_OPTIONS
|
|
673
706
|
});
|
|
674
707
|
}
|
|
675
708
|
|
package/src/pipeline.js
CHANGED
|
@@ -367,7 +367,11 @@ function buildFinalReviewQuestion({ searchParams, screenParams, selectedJob, sel
|
|
|
367
367
|
page_scope: selectedPage || "recommend",
|
|
368
368
|
search_params: searchParams,
|
|
369
369
|
screen_params: screenParams
|
|
370
|
-
}
|
|
370
|
+
},
|
|
371
|
+
options: [
|
|
372
|
+
{ label: "参数无误,开始执行", value: "confirm" },
|
|
373
|
+
{ label: "参数需要调整", value: "revise" }
|
|
374
|
+
]
|
|
371
375
|
};
|
|
372
376
|
}
|
|
373
377
|
|
package/src/test-parser.js
CHANGED
|
@@ -250,7 +250,7 @@ function testSchoolTagOverrideMixedValidAndInvalidShouldKeepValidOnes() {
|
|
|
250
250
|
instruction: "推荐页筛选候选人,有算法经验",
|
|
251
251
|
confirmation: null,
|
|
252
252
|
overrides: {
|
|
253
|
-
school_tag: ["985", "211", "
|
|
253
|
+
school_tag: ["985", "211", "foo_tag"]
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
|
|
@@ -263,13 +263,37 @@ function testSchoolTagOverrideAllInvalidShouldFallbackToUnlimited() {
|
|
|
263
263
|
instruction: "推荐页筛选候选人,有算法经验",
|
|
264
264
|
confirmation: null,
|
|
265
265
|
overrides: {
|
|
266
|
-
school_tag: ["
|
|
266
|
+
school_tag: ["abc", "foo"]
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
assert.deepEqual(result.searchParams.school_tag, ["不限"]);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
function testSchoolTagQsAliasShouldNormalizeToDomesticAndOverseasTop() {
|
|
274
|
+
const result = parseRecommendInstruction({
|
|
275
|
+
instruction: "推荐页筛选候选人,有算法经验",
|
|
276
|
+
confirmation: null,
|
|
277
|
+
overrides: {
|
|
278
|
+
school_tag: ["985", "QS前200"]
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
assert.deepEqual(result.searchParams.school_tag, ["985", "国内外名校"]);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function testRecentNotViewSpacedOverrideShouldNormalize() {
|
|
286
|
+
const result = parseRecommendInstruction({
|
|
287
|
+
instruction: "推荐页筛选985男生,有算法经验",
|
|
288
|
+
confirmation: null,
|
|
289
|
+
overrides: {
|
|
290
|
+
recent_not_view: "近 14 天没有"
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
assert.equal(result.searchParams.recent_not_view, "近14天没有");
|
|
295
|
+
}
|
|
296
|
+
|
|
273
297
|
function testCriteriaCanBeProvidedViaOverrides() {
|
|
274
298
|
const result = parseRecommendInstruction({
|
|
275
299
|
instruction: "推荐页筛选211女生",
|
|
@@ -488,6 +512,30 @@ function testFeaturedKeywordShouldProposeFeaturedPageScope() {
|
|
|
488
512
|
assert.equal(result.pending_questions.some((item) => item.field === "page_scope"), true);
|
|
489
513
|
}
|
|
490
514
|
|
|
515
|
+
function testClosedQuestionsShouldExposeStructuredOptions() {
|
|
516
|
+
const result = parseRecommendInstruction({
|
|
517
|
+
instruction: "推荐页筛选候选人,有 Agent 经验,符合标准收藏",
|
|
518
|
+
confirmation: null,
|
|
519
|
+
overrides: null
|
|
520
|
+
});
|
|
521
|
+
const schoolTagQuestion = result.pending_questions.find((item) => item.field === "school_tag");
|
|
522
|
+
const recentNotViewQuestion = result.pending_questions.find((item) => item.field === "recent_not_view");
|
|
523
|
+
const filtersQuestion = result.pending_questions.find((item) => item.field === "filters");
|
|
524
|
+
|
|
525
|
+
assert.equal(Boolean(schoolTagQuestion), true);
|
|
526
|
+
assert.equal(Array.isArray(schoolTagQuestion.options), true);
|
|
527
|
+
assert.equal(schoolTagQuestion.options.some((item) => item.value === "国内外名校"), true);
|
|
528
|
+
assert.equal(schoolTagQuestion.options.every((item) => typeof item.label === "string" && typeof item.value === "string"), true);
|
|
529
|
+
|
|
530
|
+
assert.equal(Boolean(recentNotViewQuestion), true);
|
|
531
|
+
assert.equal(Array.isArray(recentNotViewQuestion.options), true);
|
|
532
|
+
assert.equal(recentNotViewQuestion.options.some((item) => item.value === "近14天没有"), true);
|
|
533
|
+
|
|
534
|
+
assert.equal(Boolean(filtersQuestion), true);
|
|
535
|
+
assert.equal(Array.isArray(filtersQuestion.options), true);
|
|
536
|
+
assert.equal(filtersQuestion.options.some((item) => item.value === "confirm"), true);
|
|
537
|
+
}
|
|
538
|
+
|
|
491
539
|
function testLatestKeywordShouldProposeLatestPageScope() {
|
|
492
540
|
const result = parseRecommendInstruction({
|
|
493
541
|
instruction: "在推荐页最新里筛选候选人,有 Agent 经验,符合标准收藏",
|
|
@@ -547,6 +595,8 @@ function main() {
|
|
|
547
595
|
testSchoolTagOverrideCanBeArray();
|
|
548
596
|
testSchoolTagOverrideMixedValidAndInvalidShouldKeepValidOnes();
|
|
549
597
|
testSchoolTagOverrideAllInvalidShouldFallbackToUnlimited();
|
|
598
|
+
testSchoolTagQsAliasShouldNormalizeToDomesticAndOverseasTop();
|
|
599
|
+
testRecentNotViewSpacedOverrideShouldNormalize();
|
|
550
600
|
testCriteriaCanBeProvidedViaOverrides();
|
|
551
601
|
testMissingCriteriaTriggersNeedInput();
|
|
552
602
|
testMcpMentionShouldStayInCriteria();
|
|
@@ -558,6 +608,7 @@ function main() {
|
|
|
558
608
|
testPostActionNoneCanBeConfirmed();
|
|
559
609
|
testJobSelectionHintCanComeFromOverrides();
|
|
560
610
|
testFeaturedKeywordShouldProposeFeaturedPageScope();
|
|
611
|
+
testClosedQuestionsShouldExposeStructuredOptions();
|
|
561
612
|
testLatestKeywordShouldProposeLatestPageScope();
|
|
562
613
|
testConfirmedPageScopeShouldBeResolved();
|
|
563
614
|
testPageScopeOverrideShouldNotBypassConfirmation();
|