cortico-world-hands 0.20.25 → 0.20.27
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/dist/index.js +16 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3193,19 +3193,7 @@ ${text.slice(0, 2200)}`;
|
|
|
3193
3193
|
const text = typeof args.text === "string" ? args.text.trim() : "";
|
|
3194
3194
|
if (!text) return failed("\u8981\u56DE\u4EC0\u4E48\uFF1F");
|
|
3195
3195
|
const to = typeof args.to === "string" ? args.to.trim() : "";
|
|
3196
|
-
|
|
3197
|
-
let first = "";
|
|
3198
|
-
try {
|
|
3199
|
-
const r = JSON.parse(raw);
|
|
3200
|
-
if (r.ok) {
|
|
3201
|
-
this.clearQqDue();
|
|
3202
|
-
return `\u56DE\u4E86${r.to ? "\u7ED9\u300C" + r.to + "\u300D" : ""}\uFF1A${text}`;
|
|
3203
|
-
}
|
|
3204
|
-
first = r.error || "\u6CA1\u56DE\u51FA\u53BB";
|
|
3205
|
-
} catch {
|
|
3206
|
-
first = raw.slice(0, 120);
|
|
3207
|
-
}
|
|
3208
|
-
let pipeline = "";
|
|
3196
|
+
let why = "";
|
|
3209
3197
|
try {
|
|
3210
3198
|
await this.hands.wakeScreen();
|
|
3211
3199
|
await new Promise((r) => setTimeout(r, 700));
|
|
@@ -3216,19 +3204,27 @@ ${text.slice(0, 2200)}`;
|
|
|
3216
3204
|
try {
|
|
3217
3205
|
r2 = JSON.parse(opened);
|
|
3218
3206
|
} catch {
|
|
3219
|
-
r2 = { error: opened.slice(0,
|
|
3207
|
+
r2 = { error: opened.slice(0, 100) };
|
|
3220
3208
|
}
|
|
3221
3209
|
if (r2.ok) {
|
|
3210
|
+
this.clearQqDue();
|
|
3222
3211
|
return `\u6211\u5524\u5C4F\u3001\u89E3\u9501\u3001\u5F00 QQ \u56DE\u7684${to ? "\uFF08" + to + "\uFF09" : ""}\uFF1A${text}`;
|
|
3223
3212
|
}
|
|
3224
|
-
|
|
3213
|
+
why = r2.error || "\u6CA1\u56DE\u6210";
|
|
3225
3214
|
} catch (err) {
|
|
3226
|
-
|
|
3215
|
+
why = String(err).slice(0, 100);
|
|
3227
3216
|
}
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3217
|
+
try {
|
|
3218
|
+
const raw = await this.hands.qqReply(text, to || void 0);
|
|
3219
|
+
const r = JSON.parse(raw);
|
|
3220
|
+
if (r.ok) {
|
|
3221
|
+
this.clearQqDue();
|
|
3222
|
+
return `\u56DE\u4E86${r.to ? "\u7ED9\u300C" + r.to + "\u300D" : ""}\uFF1A${text}`;
|
|
3223
|
+
}
|
|
3224
|
+
why += `\uFF1B\u5FEB\u901F\u56DE\u590D\u4E5F\u4E0D\u884C\uFF08${r.error || "\u6CA1\u56DE\u51FA\u53BB"}\uFF09`;
|
|
3225
|
+
} catch {
|
|
3226
|
+
}
|
|
3227
|
+
return failed(`\u4E24\u6761\u8DEF\u90FD\u6CA1\u56DE\u6210\uFF08${why}\uFF09\u3002\u61FF\u5FC3\u7684\u65E0\u969C\u788D\u53EF\u80FD\u5173\u4E86\uFF1A\u8BBE\u7F6E \u2192 \u65E0\u969C\u788D \u2192 \u61FF\u5FC3 \u2192 \u6253\u5F00\u3002`);
|
|
3232
3228
|
}
|
|
3233
3229
|
/** 解锁:成功/没锁/失败都给人话。 */
|
|
3234
3230
|
async screenUnlock() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-hands",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cortico World: hands for the desktop pet — looks at the phone screen, then taps, swipes, pinches, drags, types and presses keys through whatever actuator the device actually has",
|
|
6
6
|
"license": "MIT",
|