@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.
@@ -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
- if (res.data.length === 0) {
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
- res.data.forEach(s => {
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()}`));
@@ -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 badChars = questionMarks + replacements;
65
+ const badRatio = (questionMarks + replacements) / len;
66
66
 
67
- // 连续3个以上 ? 几乎一定是编码问题
68
- if (/\?{3,}/.test(text)) return true;
69
-
70
- // 超过 20% 的字符是 ? replacement character
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw-cn/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "The official CLI for OpenClaw-CN Agent ecosystem",
5
5
  "bin": {
6
6
  "claw": "./bin/claw.js"