@reconcrap/boss-recommend-mcp 1.1.2 → 1.1.4
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 +3 -2
- package/scripts/postinstall.cjs +44 -44
- package/skills/boss-recommend-pipeline/README.md +12 -12
- package/skills/boss-recommend-pipeline/SKILL.md +195 -195
- package/src/adapters.js +1876 -1806
- package/src/index.js +1254 -1254
- package/src/parser.js +19 -28
- package/src/pipeline.js +919 -792
- package/src/run-state.js +351 -351
- package/src/test-adapters-runtime.js +163 -163
- package/src/test-index-async.js +236 -236
- package/src/test-parser.js +55 -0
- package/src/test-pipeline.js +103 -0
- package/src/test-run-state.js +152 -152
- package/vendor/boss-recommend-screen-cli/boss-recommend-screen-cli.cjs +111 -18
- package/vendor/boss-recommend-screen-cli/scripts/capture-full-resume-canvas.cjs +508 -452
- package/vendor/boss-recommend-screen-cli/test-recoverable-resume-failures.cjs +245 -0
- package/vendor/boss-recommend-search-cli/src/cli.js +811 -811
- package/vendor/boss-recommend-search-cli/src/test-job-selection.js +201 -201
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reconcrap/boss-recommend-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Unified MCP pipeline for recommend-page filtering and screening on Boss Zhipin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boss",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"test:run-state": "node src/test-run-state.js",
|
|
26
26
|
"test:runtime": "node src/test-adapters-runtime.js",
|
|
27
27
|
"test:async": "node src/test-index-async.js",
|
|
28
|
-
"test:search-job": "node vendor/boss-recommend-search-cli/src/test-job-selection.js"
|
|
28
|
+
"test:search-job": "node vendor/boss-recommend-search-cli/src/test-job-selection.js",
|
|
29
|
+
"test:screen-runtime": "node vendor/boss-recommend-screen-cli/test-recoverable-resume-failures.cjs"
|
|
29
30
|
},
|
|
30
31
|
"files": [
|
|
31
32
|
"bin",
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
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
|
-
const cliPath = path.join(__dirname, "..", "src", "cli.js");
|
|
18
|
-
if (!fs.existsSync(cliPath)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const initCwd = String(process.env.INIT_CWD || "").trim();
|
|
23
|
-
const workspaceArgs = initCwd ? ["--workspace-root", path.resolve(initCwd)] : [];
|
|
24
|
-
const cliArgs = isGlobalInstall()
|
|
25
|
-
? [cliPath, "install", ...workspaceArgs]
|
|
26
|
-
: [cliPath, "init-config", ...workspaceArgs];
|
|
27
|
-
|
|
28
|
-
const result = spawnSync(process.execPath, cliArgs, {
|
|
29
|
-
cwd: path.join(__dirname, ".."),
|
|
30
|
-
stdio: "inherit",
|
|
31
|
-
windowsHide: true,
|
|
32
|
-
shell: false
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (result.error) {
|
|
36
|
-
console.warn(`[boss-recommend-mcp] postinstall warning: ${result.error.message}`);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (typeof result.status === "number" && result.status !== 0) {
|
|
40
|
-
console.warn(`[boss-recommend-mcp] postinstall warning: install exited with code ${result.status}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
main();
|
|
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
|
+
const cliPath = path.join(__dirname, "..", "src", "cli.js");
|
|
18
|
+
if (!fs.existsSync(cliPath)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const initCwd = String(process.env.INIT_CWD || "").trim();
|
|
23
|
+
const workspaceArgs = initCwd ? ["--workspace-root", path.resolve(initCwd)] : [];
|
|
24
|
+
const cliArgs = isGlobalInstall()
|
|
25
|
+
? [cliPath, "install", ...workspaceArgs]
|
|
26
|
+
: [cliPath, "init-config", ...workspaceArgs];
|
|
27
|
+
|
|
28
|
+
const result = spawnSync(process.execPath, cliArgs, {
|
|
29
|
+
cwd: path.join(__dirname, ".."),
|
|
30
|
+
stdio: "inherit",
|
|
31
|
+
windowsHide: true,
|
|
32
|
+
shell: false
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (result.error) {
|
|
36
|
+
console.warn(`[boss-recommend-mcp] postinstall warning: ${result.error.message}`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (typeof result.status === "number" && result.status !== 0) {
|
|
40
|
+
console.warn(`[boss-recommend-mcp] postinstall warning: install exited with code ${result.status}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
main();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Boss Recommend Pipeline Skill
|
|
2
|
-
|
|
3
|
-
用于 Boss 推荐页的人选筛选流水线。
|
|
4
|
-
|
|
5
|
-
核心规则:
|
|
6
|
-
|
|
7
|
-
- 先确认推荐页 filters
|
|
8
|
-
- 再确认筛选 criteria
|
|
9
|
-
- 再确认本次运行统一动作 `favorite` 或 `greet`
|
|
10
|
-
- 只确认一次 `post_action`,不要逐个候选人反复确认
|
|
11
|
-
- 运行中临时中断请使用 `pause_recommend_pipeline_run`(按 run_id),不要靠自然语言“暂停/继续”指令
|
|
12
|
-
- 继续执行请使用 `resume_recommend_pipeline_run`;状态查询默认按用户指令触发,不自动轮询
|
|
1
|
+
# Boss Recommend Pipeline Skill
|
|
2
|
+
|
|
3
|
+
用于 Boss 推荐页的人选筛选流水线。
|
|
4
|
+
|
|
5
|
+
核心规则:
|
|
6
|
+
|
|
7
|
+
- 先确认推荐页 filters
|
|
8
|
+
- 再确认筛选 criteria
|
|
9
|
+
- 再确认本次运行统一动作 `favorite` 或 `greet`
|
|
10
|
+
- 只确认一次 `post_action`,不要逐个候选人反复确认
|
|
11
|
+
- 运行中临时中断请使用 `pause_recommend_pipeline_run`(按 run_id),不要靠自然语言“暂停/继续”指令
|
|
12
|
+
- 继续执行请使用 `resume_recommend_pipeline_run`;状态查询默认按用户指令触发,不自动轮询
|
|
@@ -5,169 +5,169 @@ description: "Use when users ask to run Boss recommend-page filtering and screen
|
|
|
5
5
|
|
|
6
6
|
# Boss Recommend Pipeline Skill
|
|
7
7
|
|
|
8
|
-
## Purpose
|
|
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
|
-
- 学校标签(`school_tag`,支持多选)
|
|
47
|
-
- 若输入混合了有效与无效选项(如 `985,211,qs100`),必须忽略无效项并保留有效项;不要直接回退到“不限”
|
|
48
|
-
- 学历(`degree`)
|
|
8
|
+
## Purpose
|
|
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
|
+
- 学校标签(`school_tag`,支持多选)
|
|
47
|
+
- 若输入混合了有效与无效选项(如 `985,211,qs100`),必须忽略无效项并保留有效项;不要直接回退到“不限”
|
|
48
|
+
- 学历(`degree`)
|
|
49
49
|
- 性别(`gender`)
|
|
50
|
-
- 是否过滤近14天已看(`recent_not_view`)
|
|
51
|
-
- screening criteria 是否正确
|
|
52
|
-
- `criteria` 必须是用户输入的开放式自然语言描述,禁止用“严格执行/宽松执行”等预设选项代替
|
|
53
|
-
- 若之前步骤未收到 `criteria`,必须先让用户填写后再继续
|
|
54
|
-
- 即使已在之前步骤提取到 `criteria`(含 instruction / overrides),执行前也必须再次向用户复述并确认,可让用户直接改写
|
|
55
|
-
- `target_count`(目标筛选人数)是否需要设置(可不设上限)
|
|
56
|
-
- `post_action` 是否确定为 `favorite` 或 `greet`
|
|
57
|
-
- 当 `post_action=greet` 时,`max_greet_count`(最多打招呼人数)是否确定
|
|
58
|
-
- 严禁在未询问用户的情况下自动把 `max_greet_count` 设为 `target_count` 或其他默认值
|
|
59
|
-
|
|
60
|
-
阶段 B(页面就绪后,且已拿到岗位列表):
|
|
61
|
-
|
|
62
|
-
- 岗位(`job`)是否确定
|
|
63
|
-
- 必须先列出 recommend 页岗位栏里识别到的全部岗位(来自工具返回的 `job_options`),让用户明确选择
|
|
64
|
-
- 即使前序步骤已提取到 `job` 参数,执行前也必须再次展示岗位列表并让用户二次确认
|
|
65
|
-
- 用户确认后必须先点击该岗位,再开始 search 和 screen
|
|
66
|
-
- 正式开始 search/screen 前,必须做最后一轮“全参数总确认”
|
|
67
|
-
- 需要向用户复述并确认:岗位、school_tag、degree、gender、recent_not_view、criteria、target_count、post_action、max_greet_count
|
|
68
|
-
- 只有用户明确最终确认后才允许执行
|
|
69
|
-
|
|
70
|
-
禁止行为(必须避免):
|
|
71
|
-
|
|
72
|
-
- 第一轮就问“你要绑定哪个岗位”
|
|
73
|
-
- 让用户在未登录或未进入推荐页时先填岗位
|
|
74
|
-
- 在岗位确认时只展示部分岗位
|
|
50
|
+
- 是否过滤近14天已看(`recent_not_view`)
|
|
51
|
+
- screening criteria 是否正确
|
|
52
|
+
- `criteria` 必须是用户输入的开放式自然语言描述,禁止用“严格执行/宽松执行”等预设选项代替
|
|
53
|
+
- 若之前步骤未收到 `criteria`,必须先让用户填写后再继续
|
|
54
|
+
- 即使已在之前步骤提取到 `criteria`(含 instruction / overrides),执行前也必须再次向用户复述并确认,可让用户直接改写
|
|
55
|
+
- `target_count`(目标筛选人数)是否需要设置(可不设上限)
|
|
56
|
+
- `post_action` 是否确定为 `favorite` 或 `greet`
|
|
57
|
+
- 当 `post_action=greet` 时,`max_greet_count`(最多打招呼人数)是否确定
|
|
58
|
+
- 严禁在未询问用户的情况下自动把 `max_greet_count` 设为 `target_count` 或其他默认值
|
|
59
|
+
|
|
60
|
+
阶段 B(页面就绪后,且已拿到岗位列表):
|
|
61
|
+
|
|
62
|
+
- 岗位(`job`)是否确定
|
|
63
|
+
- 必须先列出 recommend 页岗位栏里识别到的全部岗位(来自工具返回的 `job_options`),让用户明确选择
|
|
64
|
+
- 即使前序步骤已提取到 `job` 参数,执行前也必须再次展示岗位列表并让用户二次确认
|
|
65
|
+
- 用户确认后必须先点击该岗位,再开始 search 和 screen
|
|
66
|
+
- 正式开始 search/screen 前,必须做最后一轮“全参数总确认”
|
|
67
|
+
- 需要向用户复述并确认:岗位、school_tag、degree、gender、recent_not_view、criteria、target_count、post_action、max_greet_count
|
|
68
|
+
- 只有用户明确最终确认后才允许执行
|
|
69
|
+
|
|
70
|
+
禁止行为(必须避免):
|
|
71
|
+
|
|
72
|
+
- 第一轮就问“你要绑定哪个岗位”
|
|
73
|
+
- 让用户在未登录或未进入推荐页时先填岗位
|
|
74
|
+
- 在岗位确认时只展示部分岗位
|
|
75
75
|
|
|
76
76
|
`post_action` 的确认是**单次运行级别**的:
|
|
77
77
|
|
|
78
78
|
- 若用户确认 `favorite`,则本次运行中所有通过人选都统一收藏
|
|
79
|
-
- 若用户确认 `greet`,则本次运行中先按 `max_greet_count` 执行打招呼,超出上限后自动改为收藏
|
|
80
|
-
- 不要在每位候选人通过后再次逐个确认
|
|
81
|
-
|
|
82
|
-
## Instruction 原文锁定与执行前回显校验(必须遵守)
|
|
83
|
-
|
|
84
|
-
- 第一次收到用户自然语言需求时,必须把该条 `instruction` 原文锁定为 `locked_instruction_raw`。
|
|
85
|
-
- 后续所有调用(包括二轮确认、最终执行、重试)都必须复用同一条 `locked_instruction_raw`,禁止改写、扩写、摘要、同义替换、翻译。
|
|
86
|
-
- 未经用户明确要求,禁止 agent 自行生成新的 `instruction` 文案。
|
|
87
|
-
- 最终执行前(即准备提交 `job_confirmed=true` 与 `final_confirmed=true` 的那次调用),必须先向用户逐字回显本次将提交的 `instruction`,并明确提示“将按以下原文执行”。
|
|
88
|
-
- 回显校验规则:若当前待提交 `instruction` 与 `locked_instruction_raw` 不一致(按原样字符串比对),必须停止调用工具,先修正为原文后再执行。
|
|
89
|
-
- 仅当用户明确要求修改 `instruction` 时,才允许更新 `locked_instruction_raw`;更新后仍需再次逐字回显并确认。
|
|
90
|
-
|
|
91
|
-
## Tool Contract
|
|
92
|
-
|
|
93
|
-
- Tool name: `start_recommend_pipeline_run`
|
|
94
|
-
- Input:
|
|
95
|
-
- `instruction` (required)
|
|
96
|
-
- `confirmation`
|
|
97
|
-
- `filters_confirmed`
|
|
98
|
-
- `school_tag_confirmed`
|
|
99
|
-
- `school_tag_value`(建议回传最终确认值,避免二轮调用丢失)
|
|
100
|
-
- `degree_confirmed`
|
|
101
|
-
- `degree_value`
|
|
102
|
-
- `gender_confirmed`
|
|
103
|
-
- `gender_value`
|
|
104
|
-
- `recent_not_view_confirmed`
|
|
105
|
-
- `recent_not_view_value`
|
|
106
|
-
- `criteria_confirmed`
|
|
79
|
+
- 若用户确认 `greet`,则本次运行中先按 `max_greet_count` 执行打招呼,超出上限后自动改为收藏
|
|
80
|
+
- 不要在每位候选人通过后再次逐个确认
|
|
81
|
+
|
|
82
|
+
## Instruction 原文锁定与执行前回显校验(必须遵守)
|
|
83
|
+
|
|
84
|
+
- 第一次收到用户自然语言需求时,必须把该条 `instruction` 原文锁定为 `locked_instruction_raw`。
|
|
85
|
+
- 后续所有调用(包括二轮确认、最终执行、重试)都必须复用同一条 `locked_instruction_raw`,禁止改写、扩写、摘要、同义替换、翻译。
|
|
86
|
+
- 未经用户明确要求,禁止 agent 自行生成新的 `instruction` 文案。
|
|
87
|
+
- 最终执行前(即准备提交 `job_confirmed=true` 与 `final_confirmed=true` 的那次调用),必须先向用户逐字回显本次将提交的 `instruction`,并明确提示“将按以下原文执行”。
|
|
88
|
+
- 回显校验规则:若当前待提交 `instruction` 与 `locked_instruction_raw` 不一致(按原样字符串比对),必须停止调用工具,先修正为原文后再执行。
|
|
89
|
+
- 仅当用户明确要求修改 `instruction` 时,才允许更新 `locked_instruction_raw`;更新后仍需再次逐字回显并确认。
|
|
90
|
+
|
|
91
|
+
## Tool Contract
|
|
92
|
+
|
|
93
|
+
- Tool name: `start_recommend_pipeline_run`
|
|
94
|
+
- Input:
|
|
95
|
+
- `instruction` (required)
|
|
96
|
+
- `confirmation`
|
|
97
|
+
- `filters_confirmed`
|
|
98
|
+
- `school_tag_confirmed`
|
|
99
|
+
- `school_tag_value`(建议回传最终确认值,避免二轮调用丢失)
|
|
100
|
+
- `degree_confirmed`
|
|
101
|
+
- `degree_value`
|
|
102
|
+
- `gender_confirmed`
|
|
103
|
+
- `gender_value`
|
|
104
|
+
- `recent_not_view_confirmed`
|
|
105
|
+
- `recent_not_view_value`
|
|
106
|
+
- `criteria_confirmed`
|
|
107
107
|
- `target_count_confirmed`
|
|
108
108
|
- `target_count_value` (integer, optional)
|
|
109
|
-
- `post_action_confirmed`
|
|
110
|
-
- `post_action_value` (`favorite|greet`)
|
|
111
|
-
- `final_confirmed`
|
|
112
|
-
- `job_confirmed`
|
|
113
|
-
- `job_value` (string)
|
|
114
|
-
- `max_greet_count_confirmed`
|
|
115
|
-
- `max_greet_count_value` (integer)
|
|
109
|
+
- `post_action_confirmed`
|
|
110
|
+
- `post_action_value` (`favorite|greet`)
|
|
111
|
+
- `final_confirmed`
|
|
112
|
+
- `job_confirmed`
|
|
113
|
+
- `job_value` (string)
|
|
114
|
+
- `max_greet_count_confirmed`
|
|
115
|
+
- `max_greet_count_value` (integer)
|
|
116
116
|
- `overrides`
|
|
117
|
-
- `school_tag`(可传单值或数组,如 `["985","211"]`)
|
|
117
|
+
- `school_tag`(可传单值或数组,如 `["985","211"]`)
|
|
118
118
|
- `degree`(可传单值或数组;如“本科及以上”应展开为 `["本科","硕士","博士"]`)
|
|
119
119
|
- `gender`
|
|
120
120
|
- `recent_not_view`
|
|
121
|
-
- `criteria`
|
|
122
|
-
- `job`
|
|
123
|
-
- `target_count`
|
|
124
|
-
- `post_action`
|
|
125
|
-
- `max_greet_count`
|
|
126
|
-
|
|
127
|
-
长耗时宿主兼容(推荐):
|
|
128
|
-
|
|
129
|
-
- 默认调用 `start_recommend_pipeline_run` 启动异步流程(状态查询按“用户触发”执行,不自动轮询)。
|
|
130
|
-
- `start_recommend_pipeline_run` 会先走同步一致的前置门禁(登录/页面就绪/岗位确认/最终确认)。
|
|
131
|
-
- 只有门禁通过后才会返回 `ACCEPTED + run_id`;否则会先返回 `NEED_INPUT/NEED_CONFIRMATION/FAILED`,必须先按提示补齐。
|
|
132
|
-
- 若宿主要显式拆成三步,也可使用:
|
|
133
|
-
- `start_recommend_pipeline_run`
|
|
134
|
-
- `get_recommend_pipeline_run`
|
|
135
|
-
- `cancel_recommend_pipeline_run`
|
|
136
|
-
- `pause_recommend_pipeline_run`
|
|
137
|
-
- `resume_recommend_pipeline_run`
|
|
138
|
-
- 建议轮询间隔 5~15 秒。
|
|
139
|
-
- 已有 `run_id` 时不要重复 start,优先继续轮询同一个 run。
|
|
140
|
-
- 若宿主明确需要阻塞式返回,再传 `execution_mode=sync`。
|
|
141
|
-
- 暂停后继续必须复用同一 `run_id`:先 `pause_recommend_pipeline_run`,轮询到 `run.state=paused` 后再 `resume_recommend_pipeline_run`。
|
|
142
|
-
- `pause_recommend_pipeline_run` 返回 `PAUSE_REQUESTED` 仅表示已接收请求;真正暂停点在“当前候选人处理完成后”。
|
|
143
|
-
- `resume_recommend_pipeline_run` 会复用暂停前的 CSV 与 checkpoint,无需重新 start。
|
|
144
|
-
|
|
145
|
-
异步状态查询策略(必须遵守):
|
|
146
|
-
|
|
147
|
-
- 默认是“被动查询”模式:拿到 `ACCEPTED + run_id` 后,本轮到此结束,不要在同一轮自动 `sleep + get_recommend_pipeline_run`。
|
|
148
|
-
- 只有当用户明确要求“查询进度/继续跟进/持续监控”时,才调用 `get_recommend_pipeline_run`。
|
|
149
|
-
- 禁止在无用户指令时进行循环 `Start-Sleep` 或自动轮询并主动播报进度。
|
|
150
|
-
- 若用户明确要求持续监控,再按 5~15 秒间隔轮询,并在用户要求停止后立即停止轮询。
|
|
121
|
+
- `criteria`
|
|
122
|
+
- `job`
|
|
123
|
+
- `target_count`
|
|
124
|
+
- `post_action`
|
|
125
|
+
- `max_greet_count`
|
|
126
|
+
|
|
127
|
+
长耗时宿主兼容(推荐):
|
|
128
|
+
|
|
129
|
+
- 默认调用 `start_recommend_pipeline_run` 启动异步流程(状态查询按“用户触发”执行,不自动轮询)。
|
|
130
|
+
- `start_recommend_pipeline_run` 会先走同步一致的前置门禁(登录/页面就绪/岗位确认/最终确认)。
|
|
131
|
+
- 只有门禁通过后才会返回 `ACCEPTED + run_id`;否则会先返回 `NEED_INPUT/NEED_CONFIRMATION/FAILED`,必须先按提示补齐。
|
|
132
|
+
- 若宿主要显式拆成三步,也可使用:
|
|
133
|
+
- `start_recommend_pipeline_run`
|
|
134
|
+
- `get_recommend_pipeline_run`
|
|
135
|
+
- `cancel_recommend_pipeline_run`
|
|
136
|
+
- `pause_recommend_pipeline_run`
|
|
137
|
+
- `resume_recommend_pipeline_run`
|
|
138
|
+
- 建议轮询间隔 5~15 秒。
|
|
139
|
+
- 已有 `run_id` 时不要重复 start,优先继续轮询同一个 run。
|
|
140
|
+
- 若宿主明确需要阻塞式返回,再传 `execution_mode=sync`。
|
|
141
|
+
- 暂停后继续必须复用同一 `run_id`:先 `pause_recommend_pipeline_run`,轮询到 `run.state=paused` 后再 `resume_recommend_pipeline_run`。
|
|
142
|
+
- `pause_recommend_pipeline_run` 返回 `PAUSE_REQUESTED` 仅表示已接收请求;真正暂停点在“当前候选人处理完成后”。
|
|
143
|
+
- `resume_recommend_pipeline_run` 会复用暂停前的 CSV 与 checkpoint,无需重新 start。
|
|
144
|
+
|
|
145
|
+
异步状态查询策略(必须遵守):
|
|
146
|
+
|
|
147
|
+
- 默认是“被动查询”模式:拿到 `ACCEPTED + run_id` 后,本轮到此结束,不要在同一轮自动 `sleep + get_recommend_pipeline_run`。
|
|
148
|
+
- 只有当用户明确要求“查询进度/继续跟进/持续监控”时,才调用 `get_recommend_pipeline_run`。
|
|
149
|
+
- 禁止在无用户指令时进行循环 `Start-Sleep` 或自动轮询并主动播报进度。
|
|
150
|
+
- 若用户明确要求持续监控,再按 5~15 秒间隔轮询,并在用户要求停止后立即停止轮询。
|
|
151
151
|
|
|
152
152
|
## Execution Notes
|
|
153
153
|
|
|
154
|
-
- 推荐页筛选入口在 recommend 页面,不是 search 页面。
|
|
155
|
-
- 页面就绪后,必须先读取岗位栏并展示全部岗位供用户确认;若未确认岗位,禁止开始 search/screen。
|
|
156
|
-
- recommend-search-cli 只负责应用推荐页筛选项。
|
|
157
|
-
- recommend-screen-cli 负责滚动推荐列表、打开详情、提取完整简历图、调用多模态模型判断,并按单次确认的 `post_action` 执行收藏或打招呼。
|
|
158
|
-
- 详情页处理完成后必须关闭详情页并确认已关闭。
|
|
159
|
-
|
|
160
|
-
## Fallback
|
|
161
|
-
|
|
162
|
-
如果 MCP 不可用,改用:
|
|
163
|
-
|
|
164
|
-
`npx -y @reconcrap/boss-recommend-mcp@latest run --instruction "..." [--confirmation-json '{...}'] [--overrides-json '{...}']`
|
|
165
|
-
|
|
166
|
-
禁止错误回退:
|
|
167
|
-
|
|
168
|
-
- 不能把 recommend 请求回退到 `boss-recruit-mcp` / `run_recruit_pipeline`
|
|
169
|
-
- 不能执行 `boss-recruit-mcp doctor` 作为 recommend 流程的环境检查
|
|
170
|
-
- 若检测到当前环境只有 recruit MCP,应先修复 recommend MCP 配置,再继续
|
|
154
|
+
- 推荐页筛选入口在 recommend 页面,不是 search 页面。
|
|
155
|
+
- 页面就绪后,必须先读取岗位栏并展示全部岗位供用户确认;若未确认岗位,禁止开始 search/screen。
|
|
156
|
+
- recommend-search-cli 只负责应用推荐页筛选项。
|
|
157
|
+
- recommend-screen-cli 负责滚动推荐列表、打开详情、提取完整简历图、调用多模态模型判断,并按单次确认的 `post_action` 执行收藏或打招呼。
|
|
158
|
+
- 详情页处理完成后必须关闭详情页并确认已关闭。
|
|
159
|
+
|
|
160
|
+
## Fallback
|
|
161
|
+
|
|
162
|
+
如果 MCP 不可用,改用:
|
|
163
|
+
|
|
164
|
+
`npx -y @reconcrap/boss-recommend-mcp@latest run --instruction "..." [--confirmation-json '{...}'] [--overrides-json '{...}']`
|
|
165
|
+
|
|
166
|
+
禁止错误回退:
|
|
167
|
+
|
|
168
|
+
- 不能把 recommend 请求回退到 `boss-recruit-mcp` / `run_recruit_pipeline`
|
|
169
|
+
- 不能执行 `boss-recruit-mcp doctor` 作为 recommend 流程的环境检查
|
|
170
|
+
- 若检测到当前环境只有 recruit MCP,应先修复 recommend MCP 配置,再继续
|
|
171
171
|
|
|
172
172
|
CLI fallback 的状态机与 MCP 保持一致:
|
|
173
173
|
|
|
@@ -176,39 +176,39 @@ CLI fallback 的状态机与 MCP 保持一致:
|
|
|
176
176
|
- `COMPLETED`
|
|
177
177
|
- `FAILED`
|
|
178
178
|
|
|
179
|
-
## Setup Checklist
|
|
180
|
-
|
|
181
|
-
执行前先检查:
|
|
182
|
-
|
|
183
|
-
- `boss-recommend-mcp` 是否已安装
|
|
184
|
-
- `screening-config.json` 是否存在(安装后通常会自动生成模板)
|
|
185
|
-
- `baseUrl/apiKey/model` 是否已由用户填写为可用值(不能是模板占位符)
|
|
186
|
-
- Chrome 远程调试端口是否可连
|
|
187
|
-
- 当前 Chrome 是否停留在 `https://www.zhipin.com/web/chat/recommend`
|
|
188
|
-
|
|
189
|
-
在开始执行 recommend-search-cli / recommend-screen-cli 前,必须做页面就绪门禁:
|
|
190
|
-
|
|
191
|
-
- 检查 Chrome DevTools 端口是否可连接
|
|
192
|
-
- 检查 Boss 是否已登录
|
|
193
|
-
- 检查当前页面是否已停留在 recommend 页面
|
|
194
|
-
- 若检测到当前 URL 为 `https://www.zhipin.com/web/user/?ka=bticket`(或同类登录页 URL),立即判定为“未登录”,只提示用户登录;不要继续做页面脚本修改
|
|
195
|
-
- 若端口不可连接:先自动尝试启动 Chrome,并且必须使用 `--remote-debugging-port=<port>` + `--user-data-dir=<profile>`
|
|
196
|
-
- 若检测到 Boss 已登录但不在 recommend 页面:先自动 navigate 到 `https://www.zhipin.com/web/chat/recommend`
|
|
197
|
-
- 若检测到 Boss 未登录:提示用户先登录;用户登录后先 navigate 到 recommend 页面再继续
|
|
198
|
-
- 自动修复后仍失败时,才提示用户介入并等待“已就绪”后重试
|
|
199
|
-
|
|
200
|
-
## Preflight 失败自动修复
|
|
201
|
-
|
|
202
|
-
当工具返回 `status=FAILED` 且 `error.code=PIPELINE_PREFLIGHT_FAILED` 时:
|
|
203
|
-
|
|
204
|
-
1. 若 `diagnostics.checks` 中 `screen_config` 失败,优先引导用户填写 `screening-config.json` 的 `baseUrl/apiKey/model`(必须让用户提供真实值,不可保留模板值)。
|
|
205
|
-
- 若 `required_user_action=confirm_screening_config_updated`,表示检测到默认占位词未替换。
|
|
206
|
-
- 这时必须先把 `guidance.config_dir` / `guidance.config_path` 告诉用户,让用户去该目录修改后明确回复“已修改完成”,再继续下一步。
|
|
207
|
-
- 禁止 agent 自行代填或猜测示例值(如 `test-key` / `mock-key` / `https://example.com` / `gpt-4` 占位等)
|
|
208
|
-
- 必须逐项向用户确认 `baseUrl`、`apiKey`、`model` 后再写入
|
|
209
|
-
2. 优先查看 `diagnostics.auto_repair`,若有自动修复动作则先基于其结果继续执行或给出最小化补救提示。
|
|
210
|
-
3. 若自动修复后仍失败,再读取 `diagnostics.recovery.agent_prompt`,直接把这段提示词交给 AI agent 执行环境修复。
|
|
211
|
-
4. 若 `diagnostics.recovery.agent_prompt` 不存在,使用下面的兜底提示词(严格顺序,不可跳步):
|
|
179
|
+
## Setup Checklist
|
|
180
|
+
|
|
181
|
+
执行前先检查:
|
|
182
|
+
|
|
183
|
+
- `boss-recommend-mcp` 是否已安装
|
|
184
|
+
- `screening-config.json` 是否存在(安装后通常会自动生成模板)
|
|
185
|
+
- `baseUrl/apiKey/model` 是否已由用户填写为可用值(不能是模板占位符)
|
|
186
|
+
- Chrome 远程调试端口是否可连
|
|
187
|
+
- 当前 Chrome 是否停留在 `https://www.zhipin.com/web/chat/recommend`
|
|
188
|
+
|
|
189
|
+
在开始执行 recommend-search-cli / recommend-screen-cli 前,必须做页面就绪门禁:
|
|
190
|
+
|
|
191
|
+
- 检查 Chrome DevTools 端口是否可连接
|
|
192
|
+
- 检查 Boss 是否已登录
|
|
193
|
+
- 检查当前页面是否已停留在 recommend 页面
|
|
194
|
+
- 若检测到当前 URL 为 `https://www.zhipin.com/web/user/?ka=bticket`(或同类登录页 URL),立即判定为“未登录”,只提示用户登录;不要继续做页面脚本修改
|
|
195
|
+
- 若端口不可连接:先自动尝试启动 Chrome,并且必须使用 `--remote-debugging-port=<port>` + `--user-data-dir=<profile>`
|
|
196
|
+
- 若检测到 Boss 已登录但不在 recommend 页面:先自动 navigate 到 `https://www.zhipin.com/web/chat/recommend`
|
|
197
|
+
- 若检测到 Boss 未登录:提示用户先登录;用户登录后先 navigate 到 recommend 页面再继续
|
|
198
|
+
- 自动修复后仍失败时,才提示用户介入并等待“已就绪”后重试
|
|
199
|
+
|
|
200
|
+
## Preflight 失败自动修复
|
|
201
|
+
|
|
202
|
+
当工具返回 `status=FAILED` 且 `error.code=PIPELINE_PREFLIGHT_FAILED` 时:
|
|
203
|
+
|
|
204
|
+
1. 若 `diagnostics.checks` 中 `screen_config` 失败,优先引导用户填写 `screening-config.json` 的 `baseUrl/apiKey/model`(必须让用户提供真实值,不可保留模板值)。
|
|
205
|
+
- 若 `required_user_action=confirm_screening_config_updated`,表示检测到默认占位词未替换。
|
|
206
|
+
- 这时必须先把 `guidance.config_dir` / `guidance.config_path` 告诉用户,让用户去该目录修改后明确回复“已修改完成”,再继续下一步。
|
|
207
|
+
- 禁止 agent 自行代填或猜测示例值(如 `test-key` / `mock-key` / `https://example.com` / `gpt-4` 占位等)
|
|
208
|
+
- 必须逐项向用户确认 `baseUrl`、`apiKey`、`model` 后再写入
|
|
209
|
+
2. 优先查看 `diagnostics.auto_repair`,若有自动修复动作则先基于其结果继续执行或给出最小化补救提示。
|
|
210
|
+
3. 若自动修复后仍失败,再读取 `diagnostics.recovery.agent_prompt`,直接把这段提示词交给 AI agent 执行环境修复。
|
|
211
|
+
4. 若 `diagnostics.recovery.agent_prompt` 不存在,使用下面的兜底提示词(严格顺序,不可跳步):
|
|
212
212
|
|
|
213
213
|
```text
|
|
214
214
|
你是环境修复 agent。请根据 diagnostics.checks 修复依赖,必须串行执行:
|
|
@@ -216,7 +216,7 @@ CLI fallback 的状态机与 MCP 保持一致:
|
|
|
216
216
|
2) 若任意 npm_dep_* 失败:再安装 npm 依赖(chrome-remote-interface / ws)。
|
|
217
217
|
3) 若 python_cli 失败:安装 Python,并确保 python 命令可用。
|
|
218
218
|
4) 若 python_pillow 失败:最后执行 python -m pip install pillow。
|
|
219
|
-
每一步完成后重新运行 doctor,全部通过后再重试 start_recommend_pipeline_run。
|
|
219
|
+
每一步完成后重新运行 doctor,全部通过后再重试 start_recommend_pipeline_run。
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
安装顺序约束(必须遵守):
|
|
@@ -224,15 +224,15 @@ CLI fallback 的状态机与 MCP 保持一致:
|
|
|
224
224
|
- 没有 Node.js 时,不能先装 npm 包
|
|
225
225
|
- 没有 Python 时,不能先装 Pillow
|
|
226
226
|
|
|
227
|
-
## Response Style
|
|
228
|
-
|
|
229
|
-
- 用结构化中文输出
|
|
230
|
-
- 先给用户确认卡片,再正式执行
|
|
231
|
-
- 第一轮确认卡片不得包含 `job` 字段
|
|
232
|
-
- 只有当工具返回 `job_options` 后,岗位确认卡片才允许出现 `job` 字段,且必须完整列出 `job_options`
|
|
233
|
-
- 对 `school_tag/degree/gender/recent_not_view` 必须逐项提问并逐项确认,不可合并成一句“filters已确认”
|
|
234
|
-
- 询问 `criteria` 时必须使用开放式文本输入,不要提供“严格执行/宽松执行”等枚举选项
|
|
235
|
-
- 当页面就绪检查失败时,提示文案里必须包含 `debug_port` 和 recommend 页面 URL
|
|
236
|
-
- 若失败原因是未登录,提示文案必须明确给出登录 URL:`https://www.zhipin.com/web/user/?ka=bticket`
|
|
237
|
-
- 不要跳过 `post_action` 的首轮确认
|
|
238
|
-
- 不要把 recommend 流程说成 search 流程
|
|
227
|
+
## Response Style
|
|
228
|
+
|
|
229
|
+
- 用结构化中文输出
|
|
230
|
+
- 先给用户确认卡片,再正式执行
|
|
231
|
+
- 第一轮确认卡片不得包含 `job` 字段
|
|
232
|
+
- 只有当工具返回 `job_options` 后,岗位确认卡片才允许出现 `job` 字段,且必须完整列出 `job_options`
|
|
233
|
+
- 对 `school_tag/degree/gender/recent_not_view` 必须逐项提问并逐项确认,不可合并成一句“filters已确认”
|
|
234
|
+
- 询问 `criteria` 时必须使用开放式文本输入,不要提供“严格执行/宽松执行”等枚举选项
|
|
235
|
+
- 当页面就绪检查失败时,提示文案里必须包含 `debug_port` 和 recommend 页面 URL
|
|
236
|
+
- 若失败原因是未登录,提示文案必须明确给出登录 URL:`https://www.zhipin.com/web/user/?ka=bticket`
|
|
237
|
+
- 不要跳过 `post_action` 的首轮确认
|
|
238
|
+
- 不要把 recommend 流程说成 search 流程
|