@reconcrap/boss-recommend-mcp 2.0.24 → 2.0.25
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 +1 -1
- package/src/domains/chat/detail.js +43 -1
package/package.json
CHANGED
|
@@ -1139,6 +1139,7 @@ export async function clickChatAskResume(client, {
|
|
|
1139
1139
|
} = {}) {
|
|
1140
1140
|
const started = Date.now();
|
|
1141
1141
|
let lastState = null;
|
|
1142
|
+
let lastDisabledAskResume = null;
|
|
1142
1143
|
while (Date.now() - started <= timeoutMs) {
|
|
1143
1144
|
const state = await readChatConversationReadyState(client);
|
|
1144
1145
|
lastState = state;
|
|
@@ -1172,6 +1173,9 @@ export async function clickChatAskResume(client, {
|
|
|
1172
1173
|
};
|
|
1173
1174
|
}
|
|
1174
1175
|
}
|
|
1176
|
+
if (state.ask_resume?.node_id && state.ask_resume.disabled) {
|
|
1177
|
+
lastDisabledAskResume = state.ask_resume;
|
|
1178
|
+
}
|
|
1175
1179
|
if (state.already_requested_resume) {
|
|
1176
1180
|
return {
|
|
1177
1181
|
ok: true,
|
|
@@ -1181,6 +1185,16 @@ export async function clickChatAskResume(client, {
|
|
|
1181
1185
|
}
|
|
1182
1186
|
await sleep(250);
|
|
1183
1187
|
}
|
|
1188
|
+
if (lastDisabledAskResume) {
|
|
1189
|
+
return {
|
|
1190
|
+
ok: false,
|
|
1191
|
+
already_requested: true,
|
|
1192
|
+
request_pending: true,
|
|
1193
|
+
error: "ASK_RESUME_BUTTON_DISABLED",
|
|
1194
|
+
control: lastDisabledAskResume,
|
|
1195
|
+
state: lastState
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1184
1198
|
return {
|
|
1185
1199
|
ok: false,
|
|
1186
1200
|
error: "ASK_RESUME_BUTTON_NOT_FOUND",
|
|
@@ -1317,6 +1331,7 @@ export async function waitForChatResumeRequestMessage(client, {
|
|
|
1317
1331
|
export async function requestChatResumeForPassedCandidate(client, {
|
|
1318
1332
|
greetingText = "Hi同学,能麻烦发下简历吗?",
|
|
1319
1333
|
maxAttempts = 3,
|
|
1334
|
+
askResumeTimeoutMs = 8000,
|
|
1320
1335
|
dryRun = false
|
|
1321
1336
|
} = {}) {
|
|
1322
1337
|
const effectiveGreetingText = normalizeDetailText(greetingText) || "Hi同学,能麻烦发下简历吗?";
|
|
@@ -1362,13 +1377,17 @@ export async function requestChatResumeForPassedCandidate(client, {
|
|
|
1362
1377
|
const attempts = [];
|
|
1363
1378
|
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
1364
1379
|
const before = await getChatResumeRequestMessageState(client);
|
|
1365
|
-
const askResult = await clickChatAskResume(client
|
|
1380
|
+
const askResult = await clickChatAskResume(client, {
|
|
1381
|
+
timeoutMs: askResumeTimeoutMs
|
|
1382
|
+
});
|
|
1366
1383
|
let confirmResult = {
|
|
1367
1384
|
confirmed: false,
|
|
1368
1385
|
assumed_requested: Boolean(askResult.already_requested),
|
|
1369
1386
|
skipped: true,
|
|
1370
1387
|
reason: askResult.attachment_resume_available
|
|
1371
1388
|
? "attachment_resume_already_available"
|
|
1389
|
+
: askResult.request_pending
|
|
1390
|
+
? "resume_request_already_pending"
|
|
1372
1391
|
: askResult.ok
|
|
1373
1392
|
? "already_requested"
|
|
1374
1393
|
: (askResult.error || "ask_resume_not_clicked")
|
|
@@ -1394,6 +1413,29 @@ export async function requestChatResumeForPassedCandidate(client, {
|
|
|
1394
1413
|
attempts
|
|
1395
1414
|
};
|
|
1396
1415
|
}
|
|
1416
|
+
if (askResult.request_pending || askResult.already_requested) {
|
|
1417
|
+
attempts.push({
|
|
1418
|
+
attempt: attempt + 1,
|
|
1419
|
+
ask_result: askResult,
|
|
1420
|
+
confirm_result: confirmResult,
|
|
1421
|
+
message_before_count: before.count,
|
|
1422
|
+
message_after_count: before.count,
|
|
1423
|
+
resume_attachment_before_count: before.resume_attachment_count || 0,
|
|
1424
|
+
resume_attachment_after_count: before.resume_attachment_count || 0,
|
|
1425
|
+
message_observed: false,
|
|
1426
|
+
message_last_text: before.last_success_text || before.last_text || ""
|
|
1427
|
+
});
|
|
1428
|
+
return {
|
|
1429
|
+
requested: false,
|
|
1430
|
+
skipped: true,
|
|
1431
|
+
reason: "resume_request_already_pending",
|
|
1432
|
+
initial_state: initialState,
|
|
1433
|
+
close_before_greeting: closeBeforeGreeting,
|
|
1434
|
+
greeting_sent: true,
|
|
1435
|
+
greeting_send_result: sendResult,
|
|
1436
|
+
attempts
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1397
1439
|
if (askResult.ok && !askResult.already_requested) {
|
|
1398
1440
|
confirmResult = await clickChatConfirmRequestResume(client);
|
|
1399
1441
|
}
|