libp2p-mesh 2026.6.15 → 2026.6.16
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.
|
@@ -9,12 +9,23 @@ const FIELD_LINE_PATTERN = /^(?:[-*]\s*)?(?:#{1,6}\s*)?(name|what to call them|n
|
|
|
9
9
|
const TEMPLATE_PATTERN = /\b(?:todo|tbd|n\/a|none|unknown|your name|add notes here|template placeholder|placeholder)\b/i;
|
|
10
10
|
const EXPLICIT_LIST_SEPARATOR_PATTERN = /[,,、;;|/]/;
|
|
11
11
|
const ENGLISH_TAG_PATTERN = /^(?:[A-Za-z][A-Za-z0-9]*(?:\.[A-Za-z0-9]+)?|libp2p|node\.js)$/i;
|
|
12
|
+
const TECH_TOKEN_PATTERN = /\b(?:[A-Z][A-Z0-9]{1,}|[A-Za-z]*[0-9][A-Za-z0-9]*|libp2p|node\.js)\b/g;
|
|
12
13
|
const CHINESE_TAG_PATTERN = /[\p{Script=Han}]{2,8}/gu;
|
|
13
14
|
const CHINESE_CONTEXT_PATTERNS = [
|
|
14
15
|
/(?:在|来自|加入|参与|负责)([\p{Script=Han}]{2,8})(?:做|写|用|项目|团队|实验室|方向)?/gu,
|
|
15
16
|
/(?:做|写|维护|负责|参与)([\p{Script=Han}]{2,8})(?:项目|插件|工具|方向)?/gu,
|
|
16
17
|
];
|
|
17
18
|
const CHINESE_SENTENCE_WORD_PATTERN = /(?:今天|明天|昨天|今晚|晚上|早上|上午|下午|八点|同步|一下|进展|开会|讨论|安排|提醒|需要|已经|可以|应该|我们|你们|他们)/u;
|
|
19
|
+
const CHINESE_STOP_WORDS = new Set([
|
|
20
|
+
"关于",
|
|
21
|
+
"正在",
|
|
22
|
+
"当前",
|
|
23
|
+
"相关",
|
|
24
|
+
"工作",
|
|
25
|
+
"项目",
|
|
26
|
+
"网络",
|
|
27
|
+
"专注",
|
|
28
|
+
]);
|
|
18
29
|
const COMMON_WORDS = new Set([
|
|
19
30
|
"and",
|
|
20
31
|
"also",
|
|
@@ -43,6 +54,17 @@ const ENGLISH_TAG_FIELDS = new Set([
|
|
|
43
54
|
"interest",
|
|
44
55
|
"interests",
|
|
45
56
|
]);
|
|
57
|
+
const TECH_TOKEN_FIELDS = new Set([
|
|
58
|
+
"notes",
|
|
59
|
+
"note",
|
|
60
|
+
"context",
|
|
61
|
+
"project",
|
|
62
|
+
"projects",
|
|
63
|
+
"skill",
|
|
64
|
+
"skills",
|
|
65
|
+
"interest",
|
|
66
|
+
"interests",
|
|
67
|
+
]);
|
|
46
68
|
export function resolveUserMdPath(customPath) {
|
|
47
69
|
if (customPath) {
|
|
48
70
|
return customPath;
|
|
@@ -79,8 +101,19 @@ function trimChineseCandidate(value) {
|
|
|
79
101
|
}
|
|
80
102
|
function isStableChineseCandidate(value) {
|
|
81
103
|
return (/^[\p{Script=Han}]{2,8}$/u.test(value) &&
|
|
104
|
+
!CHINESE_STOP_WORDS.has(value) &&
|
|
82
105
|
!CHINESE_SENTENCE_WORD_PATTERN.test(value));
|
|
83
106
|
}
|
|
107
|
+
function collectTechnicalTokens(value) {
|
|
108
|
+
const tokens = [];
|
|
109
|
+
for (const match of value.matchAll(TECH_TOKEN_PATTERN)) {
|
|
110
|
+
const token = trimCandidate(match[0] ?? "");
|
|
111
|
+
if (isStableEnglishCandidate(token)) {
|
|
112
|
+
tokens.push(token);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return tokens;
|
|
116
|
+
}
|
|
84
117
|
function collectChineseCandidates(value) {
|
|
85
118
|
const candidates = [];
|
|
86
119
|
for (const match of value.matchAll(CHINESE_TAG_PATTERN)) {
|
|
@@ -147,6 +180,9 @@ function collectCandidates(line) {
|
|
|
147
180
|
}
|
|
148
181
|
const explicitField = fieldValue(line);
|
|
149
182
|
const explicitFieldValue = explicitField?.value;
|
|
183
|
+
if (explicitField && TECH_TOKEN_FIELDS.has(explicitField.field)) {
|
|
184
|
+
candidates.push(...collectTechnicalTokens(explicitField.value));
|
|
185
|
+
}
|
|
150
186
|
if (/^[\p{Script=Han}]{2,8}$/u.test(text) && isStableChineseCandidate(text)) {
|
|
151
187
|
candidates.push(text);
|
|
152
188
|
}
|
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ const TEMPLATE_PATTERN =
|
|
|
16
16
|
/\b(?:todo|tbd|n\/a|none|unknown|your name|add notes here|template placeholder|placeholder)\b/i;
|
|
17
17
|
const EXPLICIT_LIST_SEPARATOR_PATTERN = /[,,、;;|/]/;
|
|
18
18
|
const ENGLISH_TAG_PATTERN = /^(?:[A-Za-z][A-Za-z0-9]*(?:\.[A-Za-z0-9]+)?|libp2p|node\.js)$/i;
|
|
19
|
+
const TECH_TOKEN_PATTERN = /\b(?:[A-Z][A-Z0-9]{1,}|[A-Za-z]*[0-9][A-Za-z0-9]*|libp2p|node\.js)\b/g;
|
|
19
20
|
const CHINESE_TAG_PATTERN = /[\p{Script=Han}]{2,8}/gu;
|
|
20
21
|
const CHINESE_CONTEXT_PATTERNS = [
|
|
21
22
|
/(?:在|来自|加入|参与|负责)([\p{Script=Han}]{2,8})(?:做|写|用|项目|团队|实验室|方向)?/gu,
|
|
@@ -23,6 +24,16 @@ const CHINESE_CONTEXT_PATTERNS = [
|
|
|
23
24
|
];
|
|
24
25
|
const CHINESE_SENTENCE_WORD_PATTERN =
|
|
25
26
|
/(?:今天|明天|昨天|今晚|晚上|早上|上午|下午|八点|同步|一下|进展|开会|讨论|安排|提醒|需要|已经|可以|应该|我们|你们|他们)/u;
|
|
27
|
+
const CHINESE_STOP_WORDS = new Set([
|
|
28
|
+
"关于",
|
|
29
|
+
"正在",
|
|
30
|
+
"当前",
|
|
31
|
+
"相关",
|
|
32
|
+
"工作",
|
|
33
|
+
"项目",
|
|
34
|
+
"网络",
|
|
35
|
+
"专注",
|
|
36
|
+
]);
|
|
26
37
|
const COMMON_WORDS = new Set([
|
|
27
38
|
"and",
|
|
28
39
|
"also",
|
|
@@ -51,6 +62,17 @@ const ENGLISH_TAG_FIELDS = new Set([
|
|
|
51
62
|
"interest",
|
|
52
63
|
"interests",
|
|
53
64
|
]);
|
|
65
|
+
const TECH_TOKEN_FIELDS = new Set([
|
|
66
|
+
"notes",
|
|
67
|
+
"note",
|
|
68
|
+
"context",
|
|
69
|
+
"project",
|
|
70
|
+
"projects",
|
|
71
|
+
"skill",
|
|
72
|
+
"skills",
|
|
73
|
+
"interest",
|
|
74
|
+
"interests",
|
|
75
|
+
]);
|
|
54
76
|
|
|
55
77
|
export type UserMdAttributeSource = {
|
|
56
78
|
path?: string;
|
|
@@ -104,10 +126,24 @@ function trimChineseCandidate(value: string): string {
|
|
|
104
126
|
function isStableChineseCandidate(value: string): boolean {
|
|
105
127
|
return (
|
|
106
128
|
/^[\p{Script=Han}]{2,8}$/u.test(value) &&
|
|
129
|
+
!CHINESE_STOP_WORDS.has(value) &&
|
|
107
130
|
!CHINESE_SENTENCE_WORD_PATTERN.test(value)
|
|
108
131
|
);
|
|
109
132
|
}
|
|
110
133
|
|
|
134
|
+
function collectTechnicalTokens(value: string): string[] {
|
|
135
|
+
const tokens: string[] = [];
|
|
136
|
+
|
|
137
|
+
for (const match of value.matchAll(TECH_TOKEN_PATTERN)) {
|
|
138
|
+
const token = trimCandidate(match[0] ?? "");
|
|
139
|
+
if (isStableEnglishCandidate(token)) {
|
|
140
|
+
tokens.push(token);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return tokens;
|
|
145
|
+
}
|
|
146
|
+
|
|
111
147
|
function collectChineseCandidates(value: string): string[] {
|
|
112
148
|
const candidates: string[] = [];
|
|
113
149
|
|
|
@@ -191,6 +227,10 @@ function collectCandidates(line: string): string[] {
|
|
|
191
227
|
const explicitField = fieldValue(line);
|
|
192
228
|
const explicitFieldValue = explicitField?.value;
|
|
193
229
|
|
|
230
|
+
if (explicitField && TECH_TOKEN_FIELDS.has(explicitField.field)) {
|
|
231
|
+
candidates.push(...collectTechnicalTokens(explicitField.value));
|
|
232
|
+
}
|
|
233
|
+
|
|
194
234
|
if (/^[\p{Script=Han}]{2,8}$/u.test(text) && isStableChineseCandidate(text)) {
|
|
195
235
|
candidates.push(text);
|
|
196
236
|
}
|