@reconcrap/boss-recommend-mcp 2.0.45 → 2.0.47

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.
Files changed (56) hide show
  1. package/bin/boss-recommend-mcp.js +4 -4
  2. package/config/screening-config.example.json +27 -27
  3. package/package.json +1 -1
  4. package/scripts/postinstall.cjs +44 -44
  5. package/skills/boss-chat/README.md +39 -39
  6. package/skills/boss-chat/SKILL.md +93 -93
  7. package/skills/boss-recommend-pipeline/README.md +12 -12
  8. package/skills/boss-recommend-pipeline/SKILL.md +180 -180
  9. package/skills/boss-recruit-pipeline/README.md +17 -17
  10. package/skills/boss-recruit-pipeline/SKILL.md +58 -58
  11. package/src/chat-mcp.js +1780 -1780
  12. package/src/chat-runtime-config.js +749 -749
  13. package/src/cli.js +3054 -3054
  14. package/src/core/boss-cards/index.js +199 -199
  15. package/src/core/browser/index.js +1453 -1446
  16. package/src/core/capture/index.js +1201 -1201
  17. package/src/core/cv-acquisition/index.js +238 -238
  18. package/src/core/cv-capture-target/index.js +299 -299
  19. package/src/core/greet-quota/index.js +54 -54
  20. package/src/core/infinite-list/index.js +1326 -1326
  21. package/src/core/reporting/legacy-csv.js +341 -341
  22. package/src/core/run/timing.js +33 -33
  23. package/src/core/screening/index.js +50 -3
  24. package/src/core/self-heal/index.js +973 -973
  25. package/src/core/self-heal/viewport.js +564 -564
  26. package/src/domains/chat/cards.js +137 -137
  27. package/src/domains/chat/constants.js +221 -221
  28. package/src/domains/chat/detail.js +1668 -1661
  29. package/src/domains/chat/index.js +7 -7
  30. package/src/domains/chat/jobs.js +592 -588
  31. package/src/domains/chat/page-guard.js +98 -98
  32. package/src/domains/chat/roots.js +56 -56
  33. package/src/domains/chat/run-service.js +1977 -1955
  34. package/src/domains/recommend/actions.js +457 -457
  35. package/src/domains/recommend/cards.js +243 -243
  36. package/src/domains/recommend/constants.js +165 -165
  37. package/src/domains/recommend/detail.js +36 -28
  38. package/src/domains/recommend/filters.js +610 -581
  39. package/src/domains/recommend/index.js +10 -10
  40. package/src/domains/recommend/jobs.js +316 -263
  41. package/src/domains/recommend/refresh.js +472 -472
  42. package/src/domains/recommend/roots.js +80 -80
  43. package/src/domains/recommend/run-service.js +75 -35
  44. package/src/domains/recommend/scopes.js +246 -245
  45. package/src/domains/recruit/actions.js +277 -277
  46. package/src/domains/recruit/cards.js +74 -74
  47. package/src/domains/recruit/constants.js +167 -167
  48. package/src/domains/recruit/detail.js +461 -460
  49. package/src/domains/recruit/index.js +9 -9
  50. package/src/domains/recruit/instruction-parser.js +451 -451
  51. package/src/domains/recruit/refresh.js +44 -44
  52. package/src/domains/recruit/roots.js +68 -68
  53. package/src/domains/recruit/run-service.js +1207 -1161
  54. package/src/domains/recruit/search.js +1202 -1149
  55. package/src/recommend-mcp.js +22 -22
  56. package/src/recruit-mcp.js +1338 -1338
@@ -1,98 +1,98 @@
1
- import {
2
- getMainFrameUrl,
3
- sleep,
4
- waitForMainFrameUrl
5
- } from "../../core/browser/index.js";
6
- import { CHAT_TARGET_URL } from "./constants.js";
7
-
8
- export const CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE = "CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION";
9
-
10
- export function isChatShellUrl(url = "") {
11
- const value = String(url || "");
12
- return /https?:\/\/[^/]*zhipin\.com\/web\/chat\/index(?:[/?#]|$)/i.test(value)
13
- || /https?:\/\/[^/]*zhipin\.com\/web\/chat\/index$/i.test(value);
14
- }
15
-
16
- export function isForbiddenChatResumeTopLevelUrl(url = "") {
17
- return /https?:\/\/[^/]*zhipin\.com\/web\/frame\/c-resume\/?/i.test(String(url || ""));
18
- }
19
-
20
- export async function getChatTopLevelState(client) {
21
- let url = "";
22
- let error = null;
23
- try {
24
- url = await getMainFrameUrl(client);
25
- } catch (err) {
26
- error = err?.message || String(err);
27
- }
28
- return {
29
- url,
30
- is_chat_shell: isChatShellUrl(url),
31
- is_forbidden_resume_top_level: isForbiddenChatResumeTopLevelUrl(url),
32
- error
33
- };
34
- }
35
-
36
- export function makeForbiddenChatResumeNavigationError(pageState, message = "") {
37
- const error = new Error(message || `Chat tab navigated to forbidden top-level resume URL: ${pageState?.url || "unknown"}`);
38
- error.code = CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE;
39
- error.page_state = pageState || null;
40
- return error;
41
- }
42
-
43
- export function isForbiddenChatResumeNavigationError(error) {
44
- return error?.code === CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE
45
- || /CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION/i.test(String(error?.message || error || ""));
46
- }
47
-
48
- export async function assertChatShellNotResumeTopLevel(client, {
49
- context = "chat"
50
- } = {}) {
51
- const state = await getChatTopLevelState(client);
52
- if (state.is_forbidden_resume_top_level) {
53
- throw makeForbiddenChatResumeNavigationError(
54
- state,
55
- `CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION during ${context}: ${state.url}`
56
- );
57
- }
58
- return state;
59
- }
60
-
61
- export async function recoverChatShell(client, {
62
- targetUrl = CHAT_TARGET_URL,
63
- timeoutMs = 60000,
64
- intervalMs = 500,
65
- forceNavigate = false,
66
- settleMs = 1200
67
- } = {}) {
68
- const before = await getChatTopLevelState(client);
69
- if (before.is_chat_shell && !forceNavigate) {
70
- return {
71
- recovered: false,
72
- before,
73
- after: before,
74
- navigate_url: null,
75
- force_navigate: false
76
- };
77
- }
78
-
79
- const navigateResult = await client.Page.navigate({ url: targetUrl });
80
- if (forceNavigate && settleMs > 0) {
81
- await sleep(settleMs);
82
- }
83
- const waited = await waitForMainFrameUrl(client, isChatShellUrl, {
84
- timeoutMs,
85
- intervalMs
86
- });
87
- const after = await getChatTopLevelState(client);
88
- return {
89
- recovered: waited.ok && after.is_chat_shell,
90
- refreshed: Boolean(forceNavigate && before.is_chat_shell && after.is_chat_shell),
91
- before,
92
- after,
93
- wait: waited,
94
- navigate_result: navigateResult || null,
95
- navigate_url: targetUrl,
96
- force_navigate: Boolean(forceNavigate)
97
- };
98
- }
1
+ import {
2
+ getMainFrameUrl,
3
+ sleep,
4
+ waitForMainFrameUrl
5
+ } from "../../core/browser/index.js";
6
+ import { CHAT_TARGET_URL } from "./constants.js";
7
+
8
+ export const CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE = "CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION";
9
+
10
+ export function isChatShellUrl(url = "") {
11
+ const value = String(url || "");
12
+ return /https?:\/\/[^/]*zhipin\.com\/web\/chat\/index(?:[/?#]|$)/i.test(value)
13
+ || /https?:\/\/[^/]*zhipin\.com\/web\/chat\/index$/i.test(value);
14
+ }
15
+
16
+ export function isForbiddenChatResumeTopLevelUrl(url = "") {
17
+ return /https?:\/\/[^/]*zhipin\.com\/web\/frame\/c-resume\/?/i.test(String(url || ""));
18
+ }
19
+
20
+ export async function getChatTopLevelState(client) {
21
+ let url = "";
22
+ let error = null;
23
+ try {
24
+ url = await getMainFrameUrl(client);
25
+ } catch (err) {
26
+ error = err?.message || String(err);
27
+ }
28
+ return {
29
+ url,
30
+ is_chat_shell: isChatShellUrl(url),
31
+ is_forbidden_resume_top_level: isForbiddenChatResumeTopLevelUrl(url),
32
+ error
33
+ };
34
+ }
35
+
36
+ export function makeForbiddenChatResumeNavigationError(pageState, message = "") {
37
+ const error = new Error(message || `Chat tab navigated to forbidden top-level resume URL: ${pageState?.url || "unknown"}`);
38
+ error.code = CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE;
39
+ error.page_state = pageState || null;
40
+ return error;
41
+ }
42
+
43
+ export function isForbiddenChatResumeNavigationError(error) {
44
+ return error?.code === CHAT_FORBIDDEN_TOP_LEVEL_RESUME_CODE
45
+ || /CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION/i.test(String(error?.message || error || ""));
46
+ }
47
+
48
+ export async function assertChatShellNotResumeTopLevel(client, {
49
+ context = "chat"
50
+ } = {}) {
51
+ const state = await getChatTopLevelState(client);
52
+ if (state.is_forbidden_resume_top_level) {
53
+ throw makeForbiddenChatResumeNavigationError(
54
+ state,
55
+ `CHAT_FORBIDDEN_TOP_LEVEL_RESUME_NAVIGATION during ${context}: ${state.url}`
56
+ );
57
+ }
58
+ return state;
59
+ }
60
+
61
+ export async function recoverChatShell(client, {
62
+ targetUrl = CHAT_TARGET_URL,
63
+ timeoutMs = 60000,
64
+ intervalMs = 500,
65
+ forceNavigate = false,
66
+ settleMs = 1200
67
+ } = {}) {
68
+ const before = await getChatTopLevelState(client);
69
+ if (before.is_chat_shell && !forceNavigate) {
70
+ return {
71
+ recovered: false,
72
+ before,
73
+ after: before,
74
+ navigate_url: null,
75
+ force_navigate: false
76
+ };
77
+ }
78
+
79
+ const navigateResult = await client.Page.navigate({ url: targetUrl });
80
+ if (forceNavigate && settleMs > 0) {
81
+ await sleep(settleMs);
82
+ }
83
+ const waited = await waitForMainFrameUrl(client, isChatShellUrl, {
84
+ timeoutMs,
85
+ intervalMs
86
+ });
87
+ const after = await getChatTopLevelState(client);
88
+ return {
89
+ recovered: waited.ok && after.is_chat_shell,
90
+ refreshed: Boolean(forceNavigate && before.is_chat_shell && after.is_chat_shell),
91
+ before,
92
+ after,
93
+ wait: waited,
94
+ navigate_result: navigateResult || null,
95
+ navigate_url: targetUrl,
96
+ force_navigate: Boolean(forceNavigate)
97
+ };
98
+ }
@@ -1,56 +1,56 @@
1
- import {
2
- getDocumentRoot,
3
- querySelector,
4
- sleep
5
- } from "../../core/browser/index.js";
6
-
7
- export async function getChatRoots(client) {
8
- const topRoot = await getDocumentRoot(client);
9
- return {
10
- topRoot,
11
- roots: [
12
- { name: "top", nodeId: topRoot.nodeId }
13
- ],
14
- rootNodes: {
15
- top: topRoot.nodeId
16
- }
17
- };
18
- }
19
-
20
- export async function waitForChatRoots(client, {
21
- timeoutMs = 12000,
22
- intervalMs = 300
23
- } = {}) {
24
- const started = Date.now();
25
- let lastState = null;
26
- let lastError = null;
27
- while (Date.now() - started <= timeoutMs) {
28
- try {
29
- lastState = await getChatRoots(client);
30
- if (lastState?.rootNodes?.top) return lastState;
31
- } catch (error) {
32
- lastError = error;
33
- }
34
- await sleep(intervalMs);
35
- }
36
- if (lastError && !lastState) throw lastError;
37
- return lastState;
38
- }
39
-
40
- export async function queryFirstAcrossChatRoots(client, roots, selectors) {
41
- for (const root of roots) {
42
- if (!root?.nodeId) continue;
43
- for (const selector of selectors) {
44
- const nodeId = await querySelector(client, root.nodeId, selector);
45
- if (nodeId) {
46
- return {
47
- root: root.name,
48
- root_node_id: root.nodeId,
49
- selector,
50
- node_id: nodeId
51
- };
52
- }
53
- }
54
- }
55
- return null;
56
- }
1
+ import {
2
+ getDocumentRoot,
3
+ querySelector,
4
+ sleep
5
+ } from "../../core/browser/index.js";
6
+
7
+ export async function getChatRoots(client) {
8
+ const topRoot = await getDocumentRoot(client);
9
+ return {
10
+ topRoot,
11
+ roots: [
12
+ { name: "top", nodeId: topRoot.nodeId }
13
+ ],
14
+ rootNodes: {
15
+ top: topRoot.nodeId
16
+ }
17
+ };
18
+ }
19
+
20
+ export async function waitForChatRoots(client, {
21
+ timeoutMs = 12000,
22
+ intervalMs = 300
23
+ } = {}) {
24
+ const started = Date.now();
25
+ let lastState = null;
26
+ let lastError = null;
27
+ while (Date.now() - started <= timeoutMs) {
28
+ try {
29
+ lastState = await getChatRoots(client);
30
+ if (lastState?.rootNodes?.top) return lastState;
31
+ } catch (error) {
32
+ lastError = error;
33
+ }
34
+ await sleep(intervalMs);
35
+ }
36
+ if (lastError && !lastState) throw lastError;
37
+ return lastState;
38
+ }
39
+
40
+ export async function queryFirstAcrossChatRoots(client, roots, selectors) {
41
+ for (const root of roots) {
42
+ if (!root?.nodeId) continue;
43
+ for (const selector of selectors) {
44
+ const nodeId = await querySelector(client, root.nodeId, selector);
45
+ if (nodeId) {
46
+ return {
47
+ root: root.name,
48
+ root_node_id: root.nodeId,
49
+ selector,
50
+ node_id: nodeId
51
+ };
52
+ }
53
+ }
54
+ }
55
+ return null;
56
+ }