@reconcrap/boss-recommend-mcp 2.1.21 → 2.1.22
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 +5 -2
- package/bin/boss-recommend-mcp.js +4 -4
- package/config/screening-config.example.json +33 -33
- package/package.json +8 -8
- package/scripts/install-macos.sh +280 -280
- package/scripts/postinstall.cjs +44 -44
- package/skills/boss-chat/README.md +42 -42
- package/skills/boss-chat/SKILL.md +106 -106
- package/skills/boss-recommend-pipeline/README.md +13 -13
- package/skills/boss-recommend-pipeline/SKILL.md +219 -214
- package/skills/boss-recruit-pipeline/README.md +19 -19
- package/skills/boss-recruit-pipeline/SKILL.md +89 -89
- package/src/chat-mcp.js +127 -127
- package/src/chat-runtime-config.js +775 -775
- package/src/cli.js +573 -573
- package/src/core/boss-cards/index.js +199 -199
- package/src/core/browser/index.js +2419 -2415
- package/src/core/capture/index.js +1201 -1201
- package/src/core/cv-acquisition/index.js +238 -238
- package/src/core/cv-capture-target/index.js +299 -299
- package/src/core/greet-quota/index.js +71 -71
- package/src/core/infinite-list/index.js +1326 -1326
- package/src/core/reporting/legacy-csv.js +334 -332
- package/src/core/run/index.js +32 -32
- package/src/core/run/timing.js +33 -33
- package/src/core/screening/index.js +2135 -2135
- package/src/core/self-heal/index.js +973 -973
- package/src/core/self-heal/viewport.js +564 -564
- package/src/detached-worker.js +99 -99
- package/src/domains/chat/cards.js +137 -137
- package/src/domains/chat/constants.js +9 -9
- package/src/domains/chat/detail.js +113 -113
- package/src/domains/chat/index.js +7 -7
- package/src/domains/chat/jobs.js +620 -620
- package/src/domains/chat/page-guard.js +122 -122
- package/src/domains/chat/roots.js +56 -56
- package/src/domains/chat/run-service.js +571 -571
- package/src/domains/common/account-rights-panel.js +314 -314
- package/src/domains/common/recovery-settle.js +159 -159
- package/src/domains/recommend/actions.js +472 -472
- package/src/domains/recommend/cards.js +243 -243
- package/src/domains/recommend/colleague-contact.js +333 -333
- package/src/domains/recommend/constants.js +228 -159
- package/src/domains/recommend/detail.js +650 -650
- package/src/domains/recommend/filters.js +748 -377
- package/src/domains/recommend/index.js +4 -3
- package/src/domains/recommend/jobs.js +542 -542
- package/src/domains/recommend/location.js +736 -0
- package/src/domains/recommend/refresh.js +504 -361
- package/src/domains/recommend/roots.js +80 -80
- package/src/domains/recommend/run-service.js +987 -854
- package/src/domains/recommend/scopes.js +246 -246
- package/src/domains/recruit/actions.js +277 -277
- package/src/domains/recruit/cards.js +74 -74
- package/src/domains/recruit/constants.js +236 -236
- package/src/domains/recruit/detail.js +588 -588
- package/src/domains/recruit/index.js +9 -9
- package/src/domains/recruit/instruction-parser.js +866 -866
- package/src/domains/recruit/refresh.js +45 -45
- package/src/domains/recruit/roots.js +68 -68
- package/src/domains/recruit/run-service.js +1620 -1620
- package/src/domains/recruit/search.js +3229 -3229
- package/src/index.js +13 -0
- package/src/parser.js +376 -8
- package/src/recommend-mcp.js +929 -915
- package/src/recommend-scheduler.js +496 -496
- package/src/recruit-mcp.js +2121 -2121
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bringPageToFront,
|
|
3
|
-
detectBossLoginState,
|
|
4
|
-
sleep
|
|
5
|
-
} from "../../core/browser/index.js";
|
|
6
|
-
import {
|
|
7
|
-
HEALTH_STATUS,
|
|
8
|
-
runSelfHealCheck
|
|
9
|
-
} from "../../core/self-heal/index.js";
|
|
10
|
-
|
|
11
|
-
function compactProbe(probe = {}) {
|
|
12
|
-
return {
|
|
13
|
-
id: probe.id || "",
|
|
14
|
-
type: probe.type || "",
|
|
15
|
-
status: probe.status || "",
|
|
16
|
-
count: probe.count || 0,
|
|
17
|
-
required: Boolean(probe.required),
|
|
18
|
-
error: probe.error || null
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function compactRecoveryHealth(check = null) {
|
|
23
|
-
if (!check) return null;
|
|
24
|
-
return {
|
|
25
|
-
domain: check.domain || "",
|
|
26
|
-
status: check.status || "",
|
|
27
|
-
summary: check.summary || null,
|
|
28
|
-
drift_report: check.drift_report || null,
|
|
29
|
-
probes: (check.probes || []).map(compactProbe)
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function createRecoverySettleError(domain, settle = {}) {
|
|
34
|
-
const status = settle.status || settle.reason || "unknown";
|
|
35
|
-
const error = new Error(`${domain} mini fresh-start settle failed: ${status}`);
|
|
36
|
-
error.code = `${String(domain || "boss").toUpperCase()}_RECOVERY_SETTLE_FAILED`;
|
|
37
|
-
error.recovery_settle = settle;
|
|
38
|
-
error.retryable = true;
|
|
39
|
-
return error;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export async function waitForMiniFreshStartSettle(client, {
|
|
43
|
-
domain = "boss",
|
|
44
|
-
timeoutMs = 90000,
|
|
45
|
-
intervalMs = 800,
|
|
46
|
-
settleMs = 0,
|
|
47
|
-
readinessLabel = "ready",
|
|
48
|
-
checkReady = null,
|
|
49
|
-
selfHealConfig = null,
|
|
50
|
-
resolveSelfHealRoots = null
|
|
51
|
-
} = {}) {
|
|
52
|
-
const started = Date.now();
|
|
53
|
-
let lastReady = null;
|
|
54
|
-
let lastHealth = null;
|
|
55
|
-
let lastRoots = null;
|
|
56
|
-
let lastLoginDetection = null;
|
|
57
|
-
|
|
58
|
-
if (typeof client?.Network?.setCacheDisabled === "function") {
|
|
59
|
-
await client.Network.setCacheDisabled({ cacheDisabled: true }).catch(() => null);
|
|
60
|
-
}
|
|
61
|
-
await bringPageToFront(client).catch(() => null);
|
|
62
|
-
if (settleMs > 0) await sleep(settleMs);
|
|
63
|
-
|
|
64
|
-
while (Date.now() - started <= timeoutMs) {
|
|
65
|
-
lastLoginDetection = await detectBossLoginState(client).catch((error) => ({
|
|
66
|
-
requires_login: false,
|
|
67
|
-
reason: "login_detection_failed",
|
|
68
|
-
error: error?.message || String(error || "")
|
|
69
|
-
}));
|
|
70
|
-
if (lastLoginDetection?.requires_login) {
|
|
71
|
-
return {
|
|
72
|
-
ok: false,
|
|
73
|
-
domain,
|
|
74
|
-
status: "login_required",
|
|
75
|
-
reason: "login_required",
|
|
76
|
-
elapsed_ms: Date.now() - started,
|
|
77
|
-
login_detection: lastLoginDetection,
|
|
78
|
-
readiness: lastReady,
|
|
79
|
-
health: compactRecoveryHealth(lastHealth),
|
|
80
|
-
roots: lastRoots
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (typeof checkReady === "function") {
|
|
85
|
-
lastReady = await checkReady({
|
|
86
|
-
elapsedMs: Date.now() - started,
|
|
87
|
-
remainingMs: Math.max(1, timeoutMs - (Date.now() - started))
|
|
88
|
-
}).catch((error) => ({
|
|
89
|
-
ok: false,
|
|
90
|
-
reason: "readiness_check_failed",
|
|
91
|
-
error: error?.message || String(error || "")
|
|
92
|
-
}));
|
|
93
|
-
if (lastReady?.ok) {
|
|
94
|
-
return {
|
|
95
|
-
ok: true,
|
|
96
|
-
domain,
|
|
97
|
-
status: "ready",
|
|
98
|
-
reason: readinessLabel,
|
|
99
|
-
elapsed_ms: Date.now() - started,
|
|
100
|
-
readiness: lastReady,
|
|
101
|
-
health: compactRecoveryHealth(lastHealth),
|
|
102
|
-
roots: lastRoots
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (selfHealConfig && typeof resolveSelfHealRoots === "function") {
|
|
108
|
-
const rootsResult = await resolveSelfHealRoots(client, selfHealConfig).catch((error) => ({
|
|
109
|
-
roots: {},
|
|
110
|
-
error: error?.message || String(error || "")
|
|
111
|
-
}));
|
|
112
|
-
lastRoots = rootsResult?.roots || {};
|
|
113
|
-
lastHealth = await runSelfHealCheck({
|
|
114
|
-
client,
|
|
115
|
-
domain,
|
|
116
|
-
roots: lastRoots,
|
|
117
|
-
selectorProbes: selfHealConfig.selectorProbes || [],
|
|
118
|
-
accessibilityProbes: selfHealConfig.accessibilityProbes || [],
|
|
119
|
-
viewportProbes: selfHealConfig.viewportProbes || []
|
|
120
|
-
}).catch((error) => ({
|
|
121
|
-
domain,
|
|
122
|
-
status: "failed",
|
|
123
|
-
summary: {
|
|
124
|
-
status: "failed",
|
|
125
|
-
failed_required: 1
|
|
126
|
-
},
|
|
127
|
-
probes: [],
|
|
128
|
-
drift_report: [],
|
|
129
|
-
error: error?.message || String(error || "")
|
|
130
|
-
}));
|
|
131
|
-
if (lastHealth?.status === HEALTH_STATUS.HEALTHY) {
|
|
132
|
-
return {
|
|
133
|
-
ok: true,
|
|
134
|
-
domain,
|
|
135
|
-
status: HEALTH_STATUS.HEALTHY,
|
|
136
|
-
reason: "self_heal_healthy",
|
|
137
|
-
elapsed_ms: Date.now() - started,
|
|
138
|
-
readiness: lastReady,
|
|
139
|
-
health: compactRecoveryHealth(lastHealth),
|
|
140
|
-
roots: lastRoots
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
await sleep(intervalMs);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
ok: false,
|
|
150
|
-
domain,
|
|
151
|
-
status: lastHealth?.status || lastReady?.reason || "timeout",
|
|
152
|
-
reason: "timeout",
|
|
153
|
-
elapsed_ms: Date.now() - started,
|
|
154
|
-
login_detection: lastLoginDetection,
|
|
155
|
-
readiness: lastReady,
|
|
156
|
-
health: compactRecoveryHealth(lastHealth),
|
|
157
|
-
roots: lastRoots
|
|
158
|
-
};
|
|
159
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
bringPageToFront,
|
|
3
|
+
detectBossLoginState,
|
|
4
|
+
sleep
|
|
5
|
+
} from "../../core/browser/index.js";
|
|
6
|
+
import {
|
|
7
|
+
HEALTH_STATUS,
|
|
8
|
+
runSelfHealCheck
|
|
9
|
+
} from "../../core/self-heal/index.js";
|
|
10
|
+
|
|
11
|
+
function compactProbe(probe = {}) {
|
|
12
|
+
return {
|
|
13
|
+
id: probe.id || "",
|
|
14
|
+
type: probe.type || "",
|
|
15
|
+
status: probe.status || "",
|
|
16
|
+
count: probe.count || 0,
|
|
17
|
+
required: Boolean(probe.required),
|
|
18
|
+
error: probe.error || null
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function compactRecoveryHealth(check = null) {
|
|
23
|
+
if (!check) return null;
|
|
24
|
+
return {
|
|
25
|
+
domain: check.domain || "",
|
|
26
|
+
status: check.status || "",
|
|
27
|
+
summary: check.summary || null,
|
|
28
|
+
drift_report: check.drift_report || null,
|
|
29
|
+
probes: (check.probes || []).map(compactProbe)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createRecoverySettleError(domain, settle = {}) {
|
|
34
|
+
const status = settle.status || settle.reason || "unknown";
|
|
35
|
+
const error = new Error(`${domain} mini fresh-start settle failed: ${status}`);
|
|
36
|
+
error.code = `${String(domain || "boss").toUpperCase()}_RECOVERY_SETTLE_FAILED`;
|
|
37
|
+
error.recovery_settle = settle;
|
|
38
|
+
error.retryable = true;
|
|
39
|
+
return error;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function waitForMiniFreshStartSettle(client, {
|
|
43
|
+
domain = "boss",
|
|
44
|
+
timeoutMs = 90000,
|
|
45
|
+
intervalMs = 800,
|
|
46
|
+
settleMs = 0,
|
|
47
|
+
readinessLabel = "ready",
|
|
48
|
+
checkReady = null,
|
|
49
|
+
selfHealConfig = null,
|
|
50
|
+
resolveSelfHealRoots = null
|
|
51
|
+
} = {}) {
|
|
52
|
+
const started = Date.now();
|
|
53
|
+
let lastReady = null;
|
|
54
|
+
let lastHealth = null;
|
|
55
|
+
let lastRoots = null;
|
|
56
|
+
let lastLoginDetection = null;
|
|
57
|
+
|
|
58
|
+
if (typeof client?.Network?.setCacheDisabled === "function") {
|
|
59
|
+
await client.Network.setCacheDisabled({ cacheDisabled: true }).catch(() => null);
|
|
60
|
+
}
|
|
61
|
+
await bringPageToFront(client).catch(() => null);
|
|
62
|
+
if (settleMs > 0) await sleep(settleMs);
|
|
63
|
+
|
|
64
|
+
while (Date.now() - started <= timeoutMs) {
|
|
65
|
+
lastLoginDetection = await detectBossLoginState(client).catch((error) => ({
|
|
66
|
+
requires_login: false,
|
|
67
|
+
reason: "login_detection_failed",
|
|
68
|
+
error: error?.message || String(error || "")
|
|
69
|
+
}));
|
|
70
|
+
if (lastLoginDetection?.requires_login) {
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
domain,
|
|
74
|
+
status: "login_required",
|
|
75
|
+
reason: "login_required",
|
|
76
|
+
elapsed_ms: Date.now() - started,
|
|
77
|
+
login_detection: lastLoginDetection,
|
|
78
|
+
readiness: lastReady,
|
|
79
|
+
health: compactRecoveryHealth(lastHealth),
|
|
80
|
+
roots: lastRoots
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (typeof checkReady === "function") {
|
|
85
|
+
lastReady = await checkReady({
|
|
86
|
+
elapsedMs: Date.now() - started,
|
|
87
|
+
remainingMs: Math.max(1, timeoutMs - (Date.now() - started))
|
|
88
|
+
}).catch((error) => ({
|
|
89
|
+
ok: false,
|
|
90
|
+
reason: "readiness_check_failed",
|
|
91
|
+
error: error?.message || String(error || "")
|
|
92
|
+
}));
|
|
93
|
+
if (lastReady?.ok) {
|
|
94
|
+
return {
|
|
95
|
+
ok: true,
|
|
96
|
+
domain,
|
|
97
|
+
status: "ready",
|
|
98
|
+
reason: readinessLabel,
|
|
99
|
+
elapsed_ms: Date.now() - started,
|
|
100
|
+
readiness: lastReady,
|
|
101
|
+
health: compactRecoveryHealth(lastHealth),
|
|
102
|
+
roots: lastRoots
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (selfHealConfig && typeof resolveSelfHealRoots === "function") {
|
|
108
|
+
const rootsResult = await resolveSelfHealRoots(client, selfHealConfig).catch((error) => ({
|
|
109
|
+
roots: {},
|
|
110
|
+
error: error?.message || String(error || "")
|
|
111
|
+
}));
|
|
112
|
+
lastRoots = rootsResult?.roots || {};
|
|
113
|
+
lastHealth = await runSelfHealCheck({
|
|
114
|
+
client,
|
|
115
|
+
domain,
|
|
116
|
+
roots: lastRoots,
|
|
117
|
+
selectorProbes: selfHealConfig.selectorProbes || [],
|
|
118
|
+
accessibilityProbes: selfHealConfig.accessibilityProbes || [],
|
|
119
|
+
viewportProbes: selfHealConfig.viewportProbes || []
|
|
120
|
+
}).catch((error) => ({
|
|
121
|
+
domain,
|
|
122
|
+
status: "failed",
|
|
123
|
+
summary: {
|
|
124
|
+
status: "failed",
|
|
125
|
+
failed_required: 1
|
|
126
|
+
},
|
|
127
|
+
probes: [],
|
|
128
|
+
drift_report: [],
|
|
129
|
+
error: error?.message || String(error || "")
|
|
130
|
+
}));
|
|
131
|
+
if (lastHealth?.status === HEALTH_STATUS.HEALTHY) {
|
|
132
|
+
return {
|
|
133
|
+
ok: true,
|
|
134
|
+
domain,
|
|
135
|
+
status: HEALTH_STATUS.HEALTHY,
|
|
136
|
+
reason: "self_heal_healthy",
|
|
137
|
+
elapsed_ms: Date.now() - started,
|
|
138
|
+
readiness: lastReady,
|
|
139
|
+
health: compactRecoveryHealth(lastHealth),
|
|
140
|
+
roots: lastRoots
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
await sleep(intervalMs);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
ok: false,
|
|
150
|
+
domain,
|
|
151
|
+
status: lastHealth?.status || lastReady?.reason || "timeout",
|
|
152
|
+
reason: "timeout",
|
|
153
|
+
elapsed_ms: Date.now() - started,
|
|
154
|
+
login_detection: lastLoginDetection,
|
|
155
|
+
readiness: lastReady,
|
|
156
|
+
health: compactRecoveryHealth(lastHealth),
|
|
157
|
+
roots: lastRoots
|
|
158
|
+
};
|
|
159
|
+
}
|