libp2p-mesh 2026.6.16 → 2026.6.17

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.
@@ -80,11 +80,14 @@ function isTemplateText(value) {
80
80
  return trimmed.length === 0 || TEMPLATE_PATTERN.test(trimmed) || /^\[[^\]]+\]$/.test(trimmed);
81
81
  }
82
82
  function stripMarkdown(line) {
83
+ return stripMarkdownSyntax(line).replace(FIELD_PREFIX_PATTERN, "").trim();
84
+ }
85
+ function stripMarkdownSyntax(line) {
83
86
  return line
84
- .replace(FIELD_PREFIX_PATTERN, "")
85
87
  .replace(/`([^`]+)`/g, "$1")
86
88
  .replace(/\[([^\]]+)\]\([^)]+\)/g, "$1")
87
89
  .replace(/[*_~#>]/g, " ")
90
+ .replace(/\s+/g, " ")
88
91
  .trim();
89
92
  }
90
93
  function trimCandidate(value) {
@@ -128,13 +131,14 @@ function looksLikeSentence(value) {
128
131
  return /[。.!?]/.test(value) || value.split(/\s+/).filter(Boolean).length > 4;
129
132
  }
130
133
  function fieldValue(line) {
131
- const match = line.match(FIELD_LINE_PATTERN);
134
+ const normalized = stripMarkdownSyntax(line);
135
+ const match = normalized.match(FIELD_LINE_PATTERN);
132
136
  if (!match) {
133
137
  return undefined;
134
138
  }
135
139
  return {
136
140
  field: (match[1] ?? "").toLowerCase(),
137
- value: stripMarkdown(match[2] ?? ""),
141
+ value: stripMarkdownSyntax(match[2] ?? ""),
138
142
  };
139
143
  }
140
144
  function isStableEnglishCandidate(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libp2p-mesh",
3
- "version": "2026.6.16",
3
+ "version": "2026.6.17",
4
4
  "description": "OpenClaw libp2p P2P mesh network plugin for cross-instance agent communication",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -101,11 +101,15 @@ function isTemplateText(value: string): boolean {
101
101
  }
102
102
 
103
103
  function stripMarkdown(line: string): string {
104
+ return stripMarkdownSyntax(line).replace(FIELD_PREFIX_PATTERN, "").trim();
105
+ }
106
+
107
+ function stripMarkdownSyntax(line: string): string {
104
108
  return line
105
- .replace(FIELD_PREFIX_PATTERN, "")
106
109
  .replace(/`([^`]+)`/g, "$1")
107
110
  .replace(/\[([^\]]+)\]\([^)]+\)/g, "$1")
108
111
  .replace(/[*_~#>]/g, " ")
112
+ .replace(/\s+/g, " ")
109
113
  .trim();
110
114
  }
111
115
 
@@ -162,14 +166,15 @@ function looksLikeSentence(value: string): boolean {
162
166
  }
163
167
 
164
168
  function fieldValue(line: string): { field: string; value: string } | undefined {
165
- const match = line.match(FIELD_LINE_PATTERN);
169
+ const normalized = stripMarkdownSyntax(line);
170
+ const match = normalized.match(FIELD_LINE_PATTERN);
166
171
  if (!match) {
167
172
  return undefined;
168
173
  }
169
174
 
170
175
  return {
171
176
  field: (match[1] ?? "").toLowerCase(),
172
- value: stripMarkdown(match[2] ?? ""),
177
+ value: stripMarkdownSyntax(match[2] ?? ""),
173
178
  };
174
179
  }
175
180