@reconcrap/boss-recommend-mcp 2.1.6 → 2.1.8

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 CHANGED
@@ -265,10 +265,12 @@ BOSS_RECOMMEND_MCP_CONFIG_TARGETS # JSON 数组或系统 path 分隔路径列
265
265
  BOSS_RECOMMEND_EXTERNAL_SKILL_DIRS # JSON 数组或系统 path 分隔路径列表,指定额外 skills 根目录
266
266
  ```
267
267
 
268
- 推荐运行入口是 MCP 工具 `run_recommend` / `start_recommend_pipeline_run`。在 Trae/Trae-CN 这类普通 MCP 宿主中,`prepare_recommend_pipeline_run` 返回 `READY + cron_ready=true` 后,若用户要现在运行,应继续调用 `run_recommend` 或 `start_recommend_pipeline_run`,不要改用 shell/CLI。只有宿主是 QClaw 这类 shell-only agent、没有把 MCP tools 暴露给模型时,才使用 CDP-only CLI fallback:
268
+ 推荐运行入口是 MCP 工具 `run_recommend` / `start_recommend_pipeline_run`。在 Trae/Trae-CN 这类普通 MCP 宿主中,`prepare_recommend_pipeline_run` 返回 `READY + cron_ready=true` 后,若用户要现在运行,应继续调用 `run_recommend` 或 `start_recommend_pipeline_run`,不要改用 terminal/shell/run_command/CLI/manual JSON-RPC。`prepare` 能返回结果就证明该宿主已经可以调用本 MCP server。
269
+
270
+ 只有宿主是 QClaw 这类真正 shell-only agent、没有把 MCP tools 暴露给模型、且当前会话从未成功调用过 `boss-recommend/prepare_recommend_pipeline_run` 时,才使用 CDP-only CLI fallback。CLI fallback 也必须显式传本次用户确认的 rest level:
269
271
 
270
272
  ```bash
271
- npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --slow-live --port 9222
273
+ npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
272
274
  ```
273
275
 
274
276
  `--detached` 会让父进程输出 `ACCEPTED + run_id` 后退出,子进程继续持有 Chrome DevTools 会话并执行长任务。岗位发现可以使用只读 CLI:
@@ -276,8 +278,8 @@ npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file bo
276
278
  如果是稍后启动/cron/定时任务,不要手写系统 cron;用 package-owned scheduler:
277
279
 
278
280
  ```bash
279
- npx -y @reconcrap/boss-recommend-mcp@latest prepare-run --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --slow-live --port 9222
280
- npx -y @reconcrap/boss-recommend-mcp@latest schedule-run --schedule-delay-minutes 10 --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --slow-live --port 9222
281
+ npx -y @reconcrap/boss-recommend-mcp@latest prepare-run --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
282
+ npx -y @reconcrap/boss-recommend-mcp@latest schedule-run --schedule-delay-minutes 10 --instruction-file boss-recommend-instruction.txt --overrides-file boss-recommend-overrides.json --confirmation-file boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
281
283
  npx -y @reconcrap/boss-recommend-mcp@latest schedule-status --schedule-id <schedule_id>
282
284
  ```
283
285
 
@@ -477,6 +479,7 @@ Trae-CN / 长对话防循环建议:
477
479
 
478
480
  - `run_recommend` 与 `start_recommend_pipeline_run` 是同一个异步 MCP 启动入口,但不会跳过同步确认流程。
479
481
  - `prepare_recommend_pipeline_run` / `boss-recommend-mcp prepare-run` 只做参数门禁;它不启动筛选。普通 MCP 宿主现在运行时,prepare READY 后继续调用 `run_recommend` / `start_recommend_pipeline_run`,不要改用 CLI fallback。
482
+ - `prepare_recommend_pipeline_run` 的 READY 响应会带 `prepared_only=true`、`run_started=false`、`recommended_next_tool=start_recommend_pipeline_run`、`alternate_next_tool=run_recommend` 和 `next_action.do_not_call_prepare_again=true`;agent 应直接照这个字段继续下一步。
480
483
  - `schedule_recommend_pipeline_run` / `boss-recommend-mcp schedule-run` 是推荐页定时启动的唯一推荐路径;它创建真实 package-owned detached scheduler,并返回 `schedule_id`。
481
484
  - 定时心跳默认 120 秒一次;`updated_at` 仍会在阶段或进度变化时刷新。
482
485
  - 每个 run 会持久化到 `~/.boss-recommend-mcp/runs/<run_id>.json`(可通过 `BOSS_RECOMMEND_HOME` 覆盖)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reconcrap/boss-recommend-mcp",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "Unified MCP pipeline for recommend-page filtering and screening on Boss Zhipin",
5
5
  "keywords": [
6
6
  "boss",
@@ -17,6 +17,12 @@ description: "Use when users want Boss recommend-page filtering/screening via bo
17
17
  - 只有用户**明确**说搜索页(`search/搜索页//web/chat/search`)时,才可转 `boss-recruit-pipeline`。
18
18
  - recommend 失败时(如 `JOB_TRIGGER_NOT_FOUND/NO_RECOMMEND_IFRAME/BOSS_LOGIN_REQUIRED`)禁止降级到 recruit;先修 recommend 页面就绪/登录态。
19
19
 
20
+ - **Trae-CN / 原生 MCP 启动强制规则**
21
+ - 如果当前会话里已经成功调用过 `boss-recommend/prepare_recommend_pipeline_run`,说明 Trae-CN 已经具备原生 MCP tool call 能力;下一步必须继续调用 `boss-recommend/start_recommend_pipeline_run` 或 `boss-recommend/run_recommend`。
22
+ - `prepare_recommend_pipeline_run` 返回 `READY` 只代表参数校验通过,不代表已经启动;严禁再次调用 prepare 试图启动。
23
+ - 在 Trae-CN、Trae、Codex、Cursor、Claude Code 等普通 MCP 宿主中,严禁用 `run_command`、终端、PowerShell、`npx ... run --detached`、手写 `tools/call` JSON-RPC 或任何 CLI fallback 启动 recommend run。
24
+ - 不要说“prepare 覆盖了 MCP run 调用”。正确说法是:prepare 没有启动,下一步是原生 MCP tool call。
25
+
20
26
  - **确认不可代填(强制)**
21
27
  - 禁止 agent 自行“设置合理参数”并代替用户确认。
22
28
  - 禁止在用户未明确回复前,把 `final_confirmed=true`。
@@ -95,7 +101,8 @@ description: "Use when users want Boss recommend-page filtering/screening via bo
95
101
  - 限制:只读岗位列表,不启动筛选任务;若返回 `BOSS_LOGIN_REQUIRED`,必须让用户在自动打开的 Chrome 完成登录后重试,本次 cron 不得创建。
96
102
  - 准备/门禁工具:`prepare_recommend_pipeline_run`
97
103
  - 用途:只校验参数是否完整,不启动筛选任务。
98
- - 要求:若用户要“现在启动”,返回 `status=READY` 且 `cron_ready=true` 后,下一步必须调用 MCP 工具 `run_recommend` 或 `start_recommend_pipeline_run`,禁止改用 CLI fallback。只有用户要“稍后/cron/定时启动”时,才继续创建定时任务。
104
+ - 要求:若用户要“现在启动”,返回 `status=READY` 且 `cron_ready=true` 后,下一步必须调用 MCP 工具 `run_recommend` 或 `start_recommend_pipeline_run`,禁止改用 terminal/shell/run_command/CLI/manual JSON-RPC。只有用户要“稍后/cron/定时启动”时,才继续创建定时任务。
105
+ - READY 响应会带 `prepared_only=true`、`run_started=false`、`recommended_next_tool=start_recommend_pipeline_run`、`alternate_next_tool=run_recommend`、`next_action.do_not_call_prepare_again=true`、`agent_guidance.native_mcp_required_after_prepare=true`;必须照这些字段继续,不得再次调用 prepare。
99
106
  - 若返回 `NEED_INPUT` / `NEED_CONFIRMATION` / `FAILED`:继续补齐 `pending_questions` 或修复登录/页面/config;不得先创建 cron。
100
107
  - Cron 创建工具:`schedule_recommend_pipeline_run`
101
108
  - 用途:保存已经 READY 的完整 payload,并启动 package-owned detached scheduler;到点后由包内 worker 直接调用 `start_recommend_pipeline_run`。
@@ -131,10 +138,10 @@ description: "Use when users want Boss recommend-page filtering/screening via bo
131
138
  7. 只有拿到 `SCHEDULED + schedule_id` 后才告诉用户定时任务已创建。回复必须包含 `schedule_id`,而不是只说“10 分钟后会启动”。
132
139
  8. 到点后由 package-owned detached scheduler 启动;若 Chrome/登录异常,应作为 schedule/run 失败处理,不得再向用户追问参数。
133
140
 
134
- Shell-only OpenClaw/QClaw cron 设置同样先运行 prepare
141
+ Shell-only OpenClaw/QClaw cron 设置同样先运行 prepare,并显式带上用户已确认的休息强度:
135
142
 
136
143
  ```powershell
137
- npx -y @reconcrap/boss-recommend-mcp@latest prepare-run --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --slow-live --port 9222
144
+ npx -y @reconcrap/boss-recommend-mcp@latest prepare-run --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
138
145
  ```
139
146
 
140
147
  仅当上述命令输出 `READY` 且 `cron_ready=true` 后,才允许继续创建定时任务。
@@ -142,7 +149,7 @@ npx -y @reconcrap/boss-recommend-mcp@latest prepare-run --instruction-file .\bos
142
149
  然后必须用 package-owned scheduler 创建定时任务,不要手写系统 cron:
143
150
 
144
151
  ```powershell
145
- npx -y @reconcrap/boss-recommend-mcp@latest schedule-run --schedule-delay-minutes 10 --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --slow-live --port 9222
152
+ npx -y @reconcrap/boss-recommend-mcp@latest schedule-run --schedule-delay-minutes 10 --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
146
153
  ```
147
154
 
148
155
  用户查询时:
@@ -187,18 +194,22 @@ npx -y @reconcrap/boss-recommend-mcp@latest schedule-status --schedule-id <sched
187
194
  - `featured` 且缺少校准文件:先 `boss-recommend-mcp calibrate`。
188
195
  - `latest`:流程同 `recommend`,但使用最新 tab 结构(`data-status=1`)。
189
196
 
190
- ## QClaw / Shell-Only Fallback
197
+ ## True Shell-Only Fallback (Never Trae-CN)
198
+
199
+ 本节只适用于宿主**完全没有**原生 MCP tool list、也无法调用 `boss-recommend/prepare_recommend_pipeline_run` 的 QClaw/OpenClaw 变体。
200
+
201
+ 只要当前会话里出现过 `boss-recommend/prepare_recommend_pipeline_run`、`boss-recommend/run_recommend`、`boss-recommend/start_recommend_pipeline_run` 这类原生 MCP 调用,本节立即失效。Trae-CN 永远不使用本节。
191
202
 
192
- 当 QClaw/OpenClaw 变体只暴露 shell、没有原生 MCP tool list 时,禁止停在“请使用 `run_recommend` / `start_recommend_pipeline_run` 工具”。必须用 shell 继续启动。
203
+ 当 QClaw/OpenClaw 变体只暴露 shell、没有原生 MCP tool list 时,才可以用 shell 继续启动。
193
204
 
194
205
  推荐做法:
195
206
 
196
207
  1. 将锁定的用户原文写入 instruction 文件,将已确认参数写入 `overrides` JSON;`confirmation` JSON 只需要 `{ "final_confirmed": true }`。
197
- 2. 先用 `prepare-run` 校验完整 payload 已 cron-ready;未返回 `READY + cron_ready=true` 不得创建定时任务或启动 run。
208
+ 2. 先用 `prepare-run` 校验完整 payload 已 cron-ready,并显式传 `--rest-level <low|medium|high>`;未返回 `READY + cron_ready=true` 不得创建定时任务或启动 run。
198
209
  3. 若用户要“现在启动”,用 detached CLI 启动,让父命令返回启动证据,子进程继续持有 CDP 会话:
199
210
 
200
211
  ```powershell
201
- npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --slow-live --port 9222
212
+ npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file .\boss-recommend-instruction.txt --overrides-file .\boss-recommend-overrides.json --confirmation-file .\boss-recommend-confirmation.json --rest-level <low|medium|high> --slow-live --port 9222
202
213
  ```
203
214
 
204
215
  4. 若用户要“稍后/cron/定时启动”,用 `schedule-run`,不是 `run --detached`。若 `schedule-run` 未返回 `SCHEDULED + schedule_id`,不得告诉用户定时任务已创建。
@@ -207,7 +218,7 @@ npx -y @reconcrap/boss-recommend-mcp@latest run --detached --instruction-file .\
207
218
  兼容路径:
208
219
 
209
220
  - 若 `--detached` 不可用,或返回 `RECOMMEND_CLI_RUN_UNSUPPORTED_CDP_ONLY`,说明 npm/QClaw 仍在使用旧包;先运行 `npx -y @reconcrap/boss-recommend-mcp@latest install --agent qclaw` 并重启 QClaw。
210
- - 在包更新未生效时,可以使用已验证过的直接 MCP stdio JSON-RPC 方式调用 `run_recommend` / `start_recommend_pipeline_run`;该方式等价于原生 MCP tool 调用,不能改用 recruit/search 路径。
221
+ - 禁止使用 `npx @reconcrap/boss-recommend-mcp --stdio` 或 PowerShell 手写 `tools/call` JSON-RPC;该包的 MCP server 入口是 `start`,普通 MCP 宿主必须使用原生 tool call。
211
222
 
212
223
  普通 MCP 可用时:
213
224
 
package/src/cli.js CHANGED
@@ -2716,11 +2716,11 @@ function printHelp() {
2716
2716
  console.log(" boss-recommend-mcp install --mcp-launch global-wrapper Use ~/.boss-recommend-mcp/bin wrapper so npm global upgrades affect MCP hosts");
2717
2717
  console.log("");
2718
2718
  console.log("Run command:");
2719
- console.log(" boss-recommend-mcp prepare-run --instruction \"...\" --overrides-file overrides.json --confirmation-file confirmation.json");
2720
- console.log(" boss-recommend-mcp schedule-run --schedule-delay-minutes 10 --instruction-file boss-recommend-instruction.txt --overrides-file overrides.json --confirmation-file confirmation.json");
2719
+ console.log(" boss-recommend-mcp prepare-run --instruction \"...\" --overrides-file overrides.json --confirmation-file confirmation.json --rest-level medium");
2720
+ console.log(" boss-recommend-mcp schedule-run --schedule-delay-minutes 10 --instruction-file boss-recommend-instruction.txt --overrides-file overrides.json --confirmation-file confirmation.json --rest-level medium");
2721
2721
  console.log(" boss-recommend-mcp schedule-status --schedule-id <id>");
2722
- console.log(" boss-recommend-mcp run --instruction \"推荐页上筛选211男生,近14天没有,有大模型平台经验\" --overrides-file overrides.json --confirmation-file confirmation.json");
2723
- console.log(" boss-recommend-mcp run --detached --instruction \"...\" --overrides-file overrides.json --confirmation-file confirmation.json");
2722
+ console.log(" boss-recommend-mcp run --instruction \"推荐页上筛选211男生,近14天没有,有大模型平台经验\" --overrides-file overrides.json --confirmation-file confirmation.json --rest-level medium");
2723
+ console.log(" boss-recommend-mcp run --detached --instruction \"...\" --overrides-file overrides.json --confirmation-file confirmation.json --rest-level medium");
2724
2724
  console.log(" boss-recommend-mcp list-jobs --slow-live --port 9222");
2725
2725
  console.log(" boss-recommend-mcp chat prepare-run --slow-live --port 9222 # CDP-only preflight; start runs through MCP start_boss_chat_run");
2726
2726
  console.log(" boss-recommend-mcp config set --base-url <url> --api-key <key> --model <model> [--thinking-level off|low|medium|high|current] [--greeting-message <text>] [--openai-organization <id>] [--openai-project <id>]");
package/src/index.js CHANGED
@@ -1135,7 +1135,7 @@ function createToolsSchema() {
1135
1135
  },
1136
1136
  {
1137
1137
  name: TOOL_PREPARE_RUN,
1138
- description: "只校验 Boss 推荐页流水线参数是否完整;不会启动筛选任务。若用户要现在运行,返回 READY/cron_ready=true 后必须继续调用 MCP 工具 run_recommend 或 start_recommend_pipeline_run;只有定时/稍后运行才调用 schedule_recommend_pipeline_run。不要因为 prepare READY 而改用 shell/CLI fallback。",
1138
+ description: "只校验 Boss 推荐页流水线参数是否完整;不会启动筛选任务。若用户要现在运行,返回 READY/cron_ready=true 后必须继续调用本 MCP server run_recommend 或 start_recommend_pipeline_run;只有定时/稍后运行才调用 schedule_recommend_pipeline_runprepare 能返回结果就证明原生 MCP 可用,禁止改用 terminal/shell/run_command/CLI/manual JSON-RPC。",
1139
1139
  inputSchema: createRunInputSchema()
1140
1140
  },
1141
1141
  {
@@ -1157,12 +1157,12 @@ function createToolsSchema() {
1157
1157
  },
1158
1158
  {
1159
1159
  name: TOOL_RUN_RECOMMEND,
1160
- description: "立即通过 MCP 启动 Boss 推荐页筛选。它是 start_recommend_pipeline_run 的短别名,适合 Trae/Trae-CN 等代理在 prepare_recommend_pipeline_run 返回 READY 后继续正式运行;MCP 内部会按需使用包内 detached worker,普通 MCP 可用时不要改用 CLI fallback。",
1160
+ description: "立即通过原生 MCP 启动 Boss 推荐页筛选。它是 start_recommend_pipeline_run 的短别名,适合 Trae/Trae-CN 等代理在 prepare_recommend_pipeline_run 返回 READY 后继续正式运行;必须作为 MCP tool call 调用,禁止通过 terminal/shell/run_command/CLI/manual JSON-RPC 代替。",
1161
1161
  inputSchema: createRunInputSchema()
1162
1162
  },
1163
1163
  {
1164
1164
  name: TOOL_START_RUN,
1165
- description: "立即通过 MCP 异步启动 Boss 推荐页流水线(含同步门禁预检);prepare_recommend_pipeline_run 返回 READY 后,如果用户要现在运行就调用本工具或 run_recommendMCP 内部会按需使用包内 detached worker,普通 MCP 可用时不要改用 CLI fallback。",
1165
+ description: "立即通过原生 MCP 异步启动 Boss 推荐页流水线(含同步门禁预检);prepare_recommend_pipeline_run 返回 READY 后,如果用户要现在运行就调用本工具或 run_recommend。必须作为 MCP tool call 调用,禁止通过 terminal/shell/run_command/CLI/manual JSON-RPC 代替。",
1166
1166
  inputSchema: createRunInputSchema()
1167
1167
  },
1168
1168
  {
@@ -1563,13 +1563,63 @@ export function prepareRecommendPipelineRunTool({ workspaceRoot = "", args = {}
1563
1563
  };
1564
1564
  }
1565
1565
  const { parsed, normalized } = prepared;
1566
+ const nextAction = {
1567
+ immediate_run: {
1568
+ recommended_next_tool: "start_recommend_pipeline_run",
1569
+ alternate_next_tool: "run_recommend",
1570
+ same_arguments: true,
1571
+ native_mcp_required: true
1572
+ },
1573
+ scheduled_run: {
1574
+ recommended_next_tool: "schedule_recommend_pipeline_run",
1575
+ same_arguments: true,
1576
+ requires_schedule_field: true
1577
+ },
1578
+ do_not_call_prepare_again: true,
1579
+ do_not_use_cli_fallback_when_mcp_tools_available: true,
1580
+ do_not_use_terminal_or_shell: true,
1581
+ forbidden_fallbacks: [
1582
+ "run_command",
1583
+ "terminal",
1584
+ "shell",
1585
+ "CLI detached fallback",
1586
+ "manual JSON-RPC over shell",
1587
+ "npx --stdio"
1588
+ ]
1589
+ };
1590
+ const agentGuidance = {
1591
+ host_has_native_mcp: true,
1592
+ native_mcp_required_after_prepare: true,
1593
+ proof: "This prepare_recommend_pipeline_run response was returned by the MCP server, so the host can call MCP tools from this server.",
1594
+ immediate_run: {
1595
+ tool: nextAction.immediate_run.recommended_next_tool,
1596
+ alternate_tool: nextAction.immediate_run.alternate_next_tool,
1597
+ same_arguments: true
1598
+ },
1599
+ scheduled_run: {
1600
+ tool: nextAction.scheduled_run.recommended_next_tool,
1601
+ same_arguments: true
1602
+ },
1603
+ trae_cn: {
1604
+ next_step: "Call boss-recommend/start_recommend_pipeline_run or boss-recommend/run_recommend through the native MCP tool interface.",
1605
+ never_use_terminal_fallback_after_prepare: true
1606
+ },
1607
+ forbidden_when_mcp_tools_are_available: nextAction.forbidden_fallbacks
1608
+ };
1566
1609
  return {
1567
1610
  status: "READY",
1568
1611
  cron_ready: true,
1612
+ prepared_only: true,
1613
+ run_started: false,
1614
+ recommended_next_tool: nextAction.immediate_run.recommended_next_tool,
1615
+ alternate_next_tool: nextAction.immediate_run.alternate_next_tool,
1616
+ next_action: nextAction,
1617
+ agent_guidance: agentGuidance,
1618
+ message: "READY only means the payload passed validation; prepare_recommend_pipeline_run did not start a run. This response proves the MCP server is available. To start now, call the native MCP tool start_recommend_pipeline_run or run_recommend with the same arguments. Do not call prepare_recommend_pipeline_run again, and do not use terminal, shell, CLI detached fallback, or manual JSON-RPC when MCP tools are available.",
1569
1619
  review: parsed.review,
1570
1620
  post_action: {
1571
1621
  requested: normalized.postAction,
1572
- execute_post_action: args.dry_run_post_action === true ? false : args.execute_post_action !== false,
1622
+ execute_post_action: args.dry_run_post_action === true ? false : args.execute_post_action !== false,
1573
1623
  max_greet_count: normalized.maxGreetCount
1574
1624
  },
1575
1625
  target_count_semantics: TARGET_COUNT_SEMANTICS