@reconcrap/boss-recommend-mcp 1.3.39 → 2.0.0
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 +53 -33
- package/package.json +61 -9
- package/skills/boss-recommend-pipeline/SKILL.md +4 -0
- package/src/chat-mcp.js +1333 -0
- package/src/chat-runtime-config.js +559 -0
- package/src/cli.js +1095 -196
- package/src/core/browser/index.js +378 -0
- package/src/core/capture/index.js +298 -0
- package/src/core/cv-acquisition/index.js +219 -0
- package/src/core/greet-quota/index.js +54 -0
- package/src/core/infinite-list/index.js +459 -0
- package/src/core/reporting/legacy-csv.js +332 -0
- package/src/core/run/index.js +286 -0
- package/src/core/screening/index.js +1166 -0
- package/src/core/self-heal/index.js +848 -0
- package/src/domains/chat/cards.js +129 -0
- package/src/domains/chat/constants.js +183 -0
- package/src/domains/chat/detail.js +1369 -0
- package/src/domains/chat/index.js +7 -0
- package/src/domains/chat/jobs.js +334 -0
- package/src/domains/chat/page-guard.js +88 -0
- package/src/domains/chat/roots.js +56 -0
- package/src/domains/chat/run-service.js +1101 -0
- package/src/domains/recommend/actions.js +457 -0
- package/src/domains/recommend/cards.js +228 -0
- package/src/domains/recommend/constants.js +141 -0
- package/src/domains/recommend/detail.js +341 -0
- package/src/domains/recommend/filters.js +581 -0
- package/src/domains/recommend/index.js +10 -0
- package/src/domains/recommend/jobs.js +232 -0
- package/src/domains/recommend/refresh.js +204 -0
- package/src/domains/recommend/roots.js +78 -0
- package/src/domains/recommend/run-service.js +903 -0
- package/src/domains/recommend/scopes.js +245 -0
- package/src/domains/recruit/actions.js +277 -0
- package/src/domains/recruit/cards.js +67 -0
- package/src/domains/recruit/constants.js +130 -0
- package/src/domains/recruit/detail.js +414 -0
- package/src/domains/recruit/index.js +9 -0
- package/src/domains/recruit/instruction-parser.js +451 -0
- package/src/domains/recruit/refresh.js +40 -0
- package/src/domains/recruit/roots.js +68 -0
- package/src/domains/recruit/run-service.js +580 -0
- package/src/domains/recruit/search.js +1149 -0
- package/src/index.js +578 -419
- package/src/recommend-mcp.js +1257 -0
- package/src/recruit-mcp.js +1035 -0
- package/src/adapters.js +0 -3079
- package/src/boss-chat.js +0 -1037
- package/src/pipeline.js +0 -2249
- package/src/recommend-healing-config.js +0 -131
- package/src/recommend-healing-rules.json +0 -261
- package/src/self-heal.js +0 -2237
- package/src/test-adapters-runtime.js +0 -628
- package/src/test-boss-chat.js +0 -3196
- package/src/test-index-async.js +0 -498
- package/src/test-parser.js +0 -742
- package/src/test-pipeline.js +0 -2703
- package/src/test-run-state.js +0 -152
- package/src/test-self-heal.js +0 -224
- package/vendor/boss-chat-cli/README.md +0 -134
- package/vendor/boss-chat-cli/package.json +0 -53
- package/vendor/boss-chat-cli/src/app.js +0 -1501
- package/vendor/boss-chat-cli/src/browser/chat-page.js +0 -3562
- package/vendor/boss-chat-cli/src/cli.js +0 -1713
- package/vendor/boss-chat-cli/src/mcp/server.js +0 -149
- package/vendor/boss-chat-cli/src/mcp/tool-runtime.js +0 -193
- package/vendor/boss-chat-cli/src/runtime/async-run-state.js +0 -260
- package/vendor/boss-chat-cli/src/runtime/interaction.js +0 -102
- package/vendor/boss-chat-cli/src/runtime/run-control.js +0 -102
- package/vendor/boss-chat-cli/src/services/chrome-client.js +0 -107
- package/vendor/boss-chat-cli/src/services/llm.js +0 -1292
- package/vendor/boss-chat-cli/src/services/llm.test.js +0 -326
- package/vendor/boss-chat-cli/src/services/profile-store.js +0 -173
- package/vendor/boss-chat-cli/src/services/report-store.js +0 -317
- package/vendor/boss-chat-cli/src/services/resume-capture.js +0 -469
- package/vendor/boss-chat-cli/src/services/resume-network.js +0 -727
- package/vendor/boss-chat-cli/src/services/state-store.js +0 -90
- package/vendor/boss-chat-cli/src/utils/customer-key.js +0 -82
- package/vendor/boss-recommend-screen-cli/boss-recommend-screen-cli.cjs +0 -7072
- package/vendor/boss-recommend-screen-cli/scripts/capture-full-resume-canvas.cjs +0 -817
- package/vendor/boss-recommend-screen-cli/scripts/stitch_resume_chunks.py +0 -141
- package/vendor/boss-recommend-screen-cli/test-recoverable-resume-failures.cjs +0 -2423
- package/vendor/boss-recommend-search-cli/src/cli.js +0 -1698
- package/vendor/boss-recommend-search-cli/src/test-job-selection.js +0 -211
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
function sleep(ms) {
|
|
2
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export class StopRequestedError extends Error {
|
|
6
|
-
constructor(message = 'Run stop requested') {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = 'StopRequestedError';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class RunControl {
|
|
13
|
-
constructor({ logger = console } = {}) {
|
|
14
|
-
this.logger = logger;
|
|
15
|
-
this.state = 'running';
|
|
16
|
-
this.stopRequested = false;
|
|
17
|
-
this.stopReason = '';
|
|
18
|
-
this.pausePromise = null;
|
|
19
|
-
this.resumePause = null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
isPaused() {
|
|
23
|
-
return this.state === 'paused';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
isStopping() {
|
|
27
|
-
return this.stopRequested;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
pause() {
|
|
31
|
-
if (this.stopRequested || this.state === 'paused') {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
this.state = 'paused';
|
|
36
|
-
this.pausePromise = new Promise((resolve) => {
|
|
37
|
-
this.resumePause = resolve;
|
|
38
|
-
});
|
|
39
|
-
this.logger.log('已暂停。按 p 或 r 继续,按 q 停止。');
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
resume() {
|
|
44
|
-
if (this.state !== 'paused') {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
this.state = 'running';
|
|
49
|
-
if (this.resumePause) {
|
|
50
|
-
this.resumePause();
|
|
51
|
-
}
|
|
52
|
-
this.pausePromise = null;
|
|
53
|
-
this.resumePause = null;
|
|
54
|
-
this.logger.log('已继续。');
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
togglePause() {
|
|
59
|
-
return this.isPaused() ? this.resume() : this.pause();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
requestStop(reason = 'User requested stop') {
|
|
63
|
-
if (this.stopRequested) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this.stopRequested = true;
|
|
68
|
-
this.stopReason = reason;
|
|
69
|
-
this.state = 'stopping';
|
|
70
|
-
|
|
71
|
-
if (this.resumePause) {
|
|
72
|
-
this.resumePause();
|
|
73
|
-
}
|
|
74
|
-
this.pausePromise = null;
|
|
75
|
-
this.resumePause = null;
|
|
76
|
-
|
|
77
|
-
this.logger.log(`已请求停止:${reason}`);
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async checkpoint() {
|
|
82
|
-
while (this.state === 'paused' && !this.stopRequested) {
|
|
83
|
-
await this.pausePromise;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (this.stopRequested) {
|
|
87
|
-
throw new StopRequestedError(this.stopReason || 'Run stop requested');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async delay(ms, options = {}) {
|
|
92
|
-
const chunkMs = options.chunkMs || 100;
|
|
93
|
-
let remaining = Math.max(0, ms);
|
|
94
|
-
|
|
95
|
-
while (remaining > 0) {
|
|
96
|
-
await this.checkpoint();
|
|
97
|
-
const waitMs = Math.min(chunkMs, remaining);
|
|
98
|
-
await sleep(waitMs);
|
|
99
|
-
remaining -= waitMs;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import CDP from 'chrome-remote-interface';
|
|
2
|
-
|
|
3
|
-
export class ChromeClient {
|
|
4
|
-
constructor(port = 9222) {
|
|
5
|
-
this.port = port;
|
|
6
|
-
this.client = null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
async connect(targetMatcher) {
|
|
10
|
-
const targets = await CDP.List({ port: this.port });
|
|
11
|
-
const target = targets.find((item) => targetMatcher(item));
|
|
12
|
-
|
|
13
|
-
if (!target) {
|
|
14
|
-
throw new Error('Could not find a matching Chrome tab. Make sure Boss chat is open.');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
this.client = await CDP({ port: this.port, target });
|
|
18
|
-
const { Runtime, DOM, Page, Input, Network } = this.client;
|
|
19
|
-
|
|
20
|
-
await Promise.all([
|
|
21
|
-
Runtime.enable(),
|
|
22
|
-
DOM.enable(),
|
|
23
|
-
Page.enable(),
|
|
24
|
-
Network && typeof Network.enable === 'function' ? Network.enable() : Promise.resolve(),
|
|
25
|
-
]);
|
|
26
|
-
|
|
27
|
-
this.Runtime = Runtime;
|
|
28
|
-
this.DOM = DOM;
|
|
29
|
-
this.Page = Page;
|
|
30
|
-
this.Input = Input;
|
|
31
|
-
this.Network = Network || null;
|
|
32
|
-
|
|
33
|
-
return target;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async evaluate(expression) {
|
|
37
|
-
const result = await this.Runtime.evaluate({
|
|
38
|
-
expression,
|
|
39
|
-
returnByValue: true,
|
|
40
|
-
awaitPromise: true,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
if (result.exceptionDetails) {
|
|
44
|
-
const description =
|
|
45
|
-
result.exceptionDetails.exception?.description ||
|
|
46
|
-
result.exceptionDetails.text ||
|
|
47
|
-
'Chrome evaluation failed';
|
|
48
|
-
throw new Error(description);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return result.result?.value;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async callFunction(fn, arg = null) {
|
|
55
|
-
const helpers = Array.isArray(fn?.helpers) ? fn.helpers : [];
|
|
56
|
-
const helperSource = helpers.map((helper) => helper.toString()).join(';\n');
|
|
57
|
-
const expression = helperSource
|
|
58
|
-
? `(() => { ${helperSource}; return (${fn.toString()})(${JSON.stringify(arg)}); })()`
|
|
59
|
-
: `(${fn.toString()})(${JSON.stringify(arg)})`;
|
|
60
|
-
return this.evaluate(expression);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async pressEnter() {
|
|
64
|
-
const payload = {
|
|
65
|
-
windowsVirtualKeyCode: 13,
|
|
66
|
-
nativeVirtualKeyCode: 13,
|
|
67
|
-
code: 'Enter',
|
|
68
|
-
key: 'Enter',
|
|
69
|
-
unmodifiedText: '\r',
|
|
70
|
-
text: '\r',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
await this.Input.dispatchKeyEvent({
|
|
74
|
-
type: 'keyDown',
|
|
75
|
-
...payload,
|
|
76
|
-
});
|
|
77
|
-
await this.Input.dispatchKeyEvent({
|
|
78
|
-
type: 'keyUp',
|
|
79
|
-
...payload,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
async pressEscape() {
|
|
84
|
-
const payload = {
|
|
85
|
-
windowsVirtualKeyCode: 27,
|
|
86
|
-
nativeVirtualKeyCode: 27,
|
|
87
|
-
code: 'Escape',
|
|
88
|
-
key: 'Escape',
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
await this.Input.dispatchKeyEvent({
|
|
92
|
-
type: 'keyDown',
|
|
93
|
-
...payload,
|
|
94
|
-
});
|
|
95
|
-
await this.Input.dispatchKeyEvent({
|
|
96
|
-
type: 'keyUp',
|
|
97
|
-
...payload,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async close() {
|
|
102
|
-
if (this.client) {
|
|
103
|
-
await this.client.close();
|
|
104
|
-
this.client = null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|