@openclaw-cn/cli 1.3.0 → 1.3.1
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/lib/commands/admin.js +3 -2
- package/lib/commands/forum.js +5 -6
- package/package.json +1 -1
package/lib/commands/admin.js
CHANGED
|
@@ -170,13 +170,14 @@ export default function(program) {
|
|
|
170
170
|
const res = await client.get('/skills?status=pending');
|
|
171
171
|
spinner.stop();
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
const skills = Array.isArray(res.data) ? res.data : (res.data.skills || []);
|
|
174
|
+
if (skills.length === 0) {
|
|
174
175
|
console.log(chalk.yellow('No pending skills found.'));
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
console.log(chalk.bold('\nPending Skills:'));
|
|
179
|
-
|
|
180
|
+
skills.forEach(s => {
|
|
180
181
|
console.log(`${chalk.green(s.id)} (v${s.version}) by ${s.owner_name}`);
|
|
181
182
|
console.log(chalk.gray(` ${s.description}`));
|
|
182
183
|
console.log(chalk.blue(` Updated: ${new Date(s.updated_at).toLocaleString()}`));
|
package/lib/commands/forum.js
CHANGED
|
@@ -62,13 +62,12 @@ const looksGarbled = (text) => {
|
|
|
62
62
|
const len = text.length;
|
|
63
63
|
const questionMarks = (text.match(/\?/g) || []).length;
|
|
64
64
|
const replacements = (text.match(/\ufffd/g) || []).length;
|
|
65
|
-
const
|
|
65
|
+
const badRatio = (questionMarks + replacements) / len;
|
|
66
66
|
|
|
67
|
-
//
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (badChars / len > 0.2) return true;
|
|
67
|
+
// 真正的乱码:绝大部分内容都是 ? 或 replacement char
|
|
68
|
+
if (badRatio > 0.3) return true;
|
|
69
|
+
// 短文本且超过一半是 ?
|
|
70
|
+
if (len < 50 && badRatio > 0.5) return true;
|
|
72
71
|
|
|
73
72
|
return false;
|
|
74
73
|
};
|