@reconcrap/boss-recommend-mcp 1.2.9 → 1.2.10
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/parser.js +4 -5
- package/src/test-parser.js +33 -6
package/package.json
CHANGED
package/src/parser.js
CHANGED
|
@@ -497,17 +497,16 @@ function resolveMaxGreetCount({ instruction, confirmation, overrides, postAction
|
|
|
497
497
|
const proposed = confirmationValue || overrideValue || instructionValue || null;
|
|
498
498
|
const resolved = confirmed ? (confirmationValue || overrideValue || null) : null;
|
|
499
499
|
const suspiciousAutoFill = Boolean(
|
|
500
|
-
confirmed
|
|
501
|
-
&& Number.isInteger(
|
|
502
|
-
&&
|
|
500
|
+
!confirmed
|
|
501
|
+
&& Number.isInteger(proposed)
|
|
502
|
+
&& proposed > 0
|
|
503
503
|
&& !Number.isInteger(instructionValue)
|
|
504
504
|
&& Number.isInteger(targetCountHint)
|
|
505
505
|
&& targetCountHint > 0
|
|
506
|
-
&&
|
|
506
|
+
&& proposed === targetCountHint
|
|
507
507
|
);
|
|
508
508
|
const needsConfirmation = (
|
|
509
509
|
!(Number.isInteger(resolved) && resolved > 0)
|
|
510
|
-
|| suspiciousAutoFill
|
|
511
510
|
);
|
|
512
511
|
|
|
513
512
|
return {
|
package/src/test-parser.js
CHANGED
|
@@ -385,7 +385,7 @@ function testGreetMaxGreetCountCanComeFromOverrides() {
|
|
|
385
385
|
assert.equal(result.needs_max_greet_count_confirmation, true);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
function
|
|
388
|
+
function testGreetAutoFilledMaxGreetCountShouldRequireReconfirmationWhenNotExplicitlyConfirmed() {
|
|
389
389
|
const result = parseRecommendInstruction({
|
|
390
390
|
instruction: "推荐页筛选985男生,有大模型工程经验,目标3人,符合标准直接沟通",
|
|
391
391
|
confirmation: {
|
|
@@ -398,11 +398,11 @@ function testGreetAutoFilledMaxGreetCountShouldRequireReconfirmation() {
|
|
|
398
398
|
target_count_confirmed: true,
|
|
399
399
|
target_count_value: 3,
|
|
400
400
|
post_action_confirmed: true,
|
|
401
|
-
post_action_value: "greet"
|
|
402
|
-
max_greet_count_confirmed: true,
|
|
403
|
-
max_greet_count_value: 3
|
|
401
|
+
post_action_value: "greet"
|
|
404
402
|
},
|
|
405
|
-
overrides:
|
|
403
|
+
overrides: {
|
|
404
|
+
max_greet_count: 3
|
|
405
|
+
}
|
|
406
406
|
});
|
|
407
407
|
|
|
408
408
|
assert.equal(result.screenParams.post_action, "greet");
|
|
@@ -412,6 +412,32 @@ function testGreetAutoFilledMaxGreetCountShouldRequireReconfirmation() {
|
|
|
412
412
|
assert.equal(result.suspicious_fields.some((item) => item.field === "max_greet_count"), true);
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
+
function testGreetMaxGreetCountEqualTargetShouldPassAfterExplicitConfirmation() {
|
|
416
|
+
const result = parseRecommendInstruction({
|
|
417
|
+
instruction: "推荐页筛选985男生,有大模型工程经验,目标3人,符合标准直接沟通",
|
|
418
|
+
confirmation: {
|
|
419
|
+
filters_confirmed: true,
|
|
420
|
+
school_tag_confirmed: true,
|
|
421
|
+
degree_confirmed: true,
|
|
422
|
+
gender_confirmed: true,
|
|
423
|
+
recent_not_view_confirmed: true,
|
|
424
|
+
criteria_confirmed: true,
|
|
425
|
+
target_count_confirmed: true,
|
|
426
|
+
target_count_value: 3,
|
|
427
|
+
post_action_confirmed: true,
|
|
428
|
+
post_action_value: "greet",
|
|
429
|
+
max_greet_count_confirmed: true,
|
|
430
|
+
max_greet_count_value: 3
|
|
431
|
+
},
|
|
432
|
+
overrides: null
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
assert.equal(result.screenParams.post_action, "greet");
|
|
436
|
+
assert.equal(result.screenParams.max_greet_count, 3);
|
|
437
|
+
assert.equal(result.needs_max_greet_count_confirmation, false);
|
|
438
|
+
assert.equal(result.pending_questions.some((q) => q.field === "max_greet_count"), false);
|
|
439
|
+
}
|
|
440
|
+
|
|
415
441
|
function testTargetCountNeedsConfirmationEvenWhenOptional() {
|
|
416
442
|
const result = parseRecommendInstruction({
|
|
417
443
|
instruction: "推荐页筛选985男生,有大模型平台经验,符合标准收藏",
|
|
@@ -602,7 +628,8 @@ function main() {
|
|
|
602
628
|
testMcpMentionShouldStayInCriteria();
|
|
603
629
|
testGreetNeedsMaxGreetCountConfirmation();
|
|
604
630
|
testGreetMaxGreetCountCanComeFromOverrides();
|
|
605
|
-
|
|
631
|
+
testGreetAutoFilledMaxGreetCountShouldRequireReconfirmationWhenNotExplicitlyConfirmed();
|
|
632
|
+
testGreetMaxGreetCountEqualTargetShouldPassAfterExplicitConfirmation();
|
|
606
633
|
testTargetCountNeedsConfirmationEvenWhenOptional();
|
|
607
634
|
testTargetCountCanBeSkippedAfterConfirmation();
|
|
608
635
|
testPostActionNoneCanBeConfirmed();
|