@reconcrap/boss-recruit-mcp 1.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.
@@ -0,0 +1,79 @@
1
+ import assert from "node:assert/strict";
2
+ import { parseRecruitInstruction } from "./parser.js";
3
+
4
+ function testNeedInput() {
5
+ const r = parseRecruitInstruction({
6
+ instruction: "帮我找做过AI infra的人选",
7
+ confirmation: null,
8
+ overrides: null
9
+ });
10
+
11
+ assert.equal(r.needs_keyword_confirmation, true);
12
+ assert.equal(r.proposed_keyword?.toLowerCase(), "ai infra");
13
+ }
14
+
15
+ function testExampleExtraction() {
16
+ const instruction =
17
+ "帮我找35岁以下,做过AI infra的人选,地点在杭州,学历本科及以上,毕业院校必须是985、211或者qs100的学校,必须发表过CCF-A区论文。至少筛选500位人选。";
18
+
19
+ const firstPass = parseRecruitInstruction({
20
+ instruction,
21
+ confirmation: null,
22
+ overrides: null
23
+ });
24
+
25
+ assert.equal(firstPass.needs_keyword_confirmation, true);
26
+ assert.equal(firstPass.proposed_keyword?.toLowerCase(), "ai infra");
27
+ assert.equal(firstPass.searchParams.city, "杭州");
28
+ assert.equal(firstPass.searchParams.degree, "本科及以上");
29
+ assert.deepEqual(firstPass.searchParams.schools.sort(), ["211院校", "985院校", "QS 100"].sort());
30
+ assert.equal(firstPass.screenParams.target_count, 500);
31
+
32
+ const confirmed = parseRecruitInstruction({
33
+ instruction,
34
+ confirmation: { keyword_confirmed: true, keyword_value: "ai infra" },
35
+ overrides: null
36
+ });
37
+
38
+ assert.equal(confirmed.needs_keyword_confirmation, false);
39
+ assert.equal(confirmed.searchParams.keyword, "ai infra");
40
+ assert.equal(confirmed.missing_fields.length, 0);
41
+ }
42
+
43
+ function testMissingFieldsBatch() {
44
+ const r = parseRecruitInstruction({
45
+ instruction: "帮我筛选做过推荐系统的人",
46
+ confirmation: { keyword_confirmed: true, keyword_value: "推荐系统" },
47
+ overrides: null
48
+ });
49
+
50
+ assert.deepEqual(r.missing_fields.sort(), ["city", "degree", "schools", "target_count"].sort());
51
+ }
52
+
53
+ function testStructuredInputAndCriteriaCleanup() {
54
+ const r = parseRecruitInstruction({
55
+ instruction:
56
+ "使用boss-recruit-pipeline skills帮我在boss上找做过AI infra的人选,必须发表过CCF-A区论文。城市:杭州,学历:本科,学校:985、211、qs100,目标人数:10人",
57
+ confirmation: { keyword_confirmed: true, keyword_value: "AI infra" },
58
+ overrides: null
59
+ });
60
+
61
+ assert.equal(r.searchParams.city, "杭州");
62
+ assert.equal(r.searchParams.degree, "本科");
63
+ assert.equal(r.screenParams.target_count, 10);
64
+ assert.equal(
65
+ r.screenParams.criteria,
66
+ "做过AI infra;必须发表过CCF-A区论文"
67
+ );
68
+ }
69
+
70
+ function main() {
71
+ testNeedInput();
72
+ testExampleExtraction();
73
+ testMissingFieldsBatch();
74
+ testStructuredInputAndCriteriaCleanup();
75
+ // eslint-disable-next-line no-console
76
+ console.log("parser tests passed");
77
+ }
78
+
79
+ main();