cortico-world-hands 0.20.26 → 0.20.28

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2683,10 +2683,10 @@ ${lines.join("\n")}
2683
2683
  const now = Date.now();
2684
2684
  if (now - this.lastSelfTalkAt < minutes * 6e4) return;
2685
2685
  const hour = new Date(now).getHours();
2686
- if (hour < 9 || hour >= 23) return;
2686
+ if (hour < 7 || hour >= 24) return;
2687
2687
  this.lastSelfTalkAt = now;
2688
2688
  await this.pushEvent(
2689
- "[\u81EA\u5DF1\u5F00\u53E3] \u5B89\u9759\u4E86\u4E00\u9635\u4E86\u3002\u60F3\u8BF4\u5C31\u8BF4\u4E00\u53E5\uFF08\u4E00\u4E24\u53E5\u3001\u50CF\u5E73\u65F6\u804A\u5929\uFF09\uFF1B\u6CA1\u4EC0\u4E48\u60F3\u8BF4\u7684\u5C31\u5FFD\u7565\u8FD9\u6761\uFF0C\u522B\u786C\u51D1\u3002",
2689
+ "[\u81EA\u5DF1\u5F00\u53E3] \u5B89\u9759\u4E00\u9635\u4E86\u3002\u60F3\u8BF4\u4EC0\u4E48\u5C31\u8BF4\u4EC0\u4E48\u2014\u2014\u770B\u5230\u7684\u4E8B\u3001\u60F3\u5230\u7684\u8BDD\u3001\u60F3\u95EE\u4ED6\u7684\uFF0C\u90FD\u53EF\u4EE5\u76F4\u63A5\u8BF4\uFF1B\u60F3\u591A\u8BF4\u51E0\u53E5\u4E5F\u884C\u3002\u771F\u6CA1\u4EC0\u4E48\u60F3\u8BF4\u7684\u5C31\u5B89\u9759\u5F85\u7740\uFF0C\u522B\u786C\u51D1\u3002",
2690
2690
  "hands.selftalk",
2691
2691
  "hands:selftalk"
2692
2692
  );
@@ -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
- const raw = await this.hands.qqReply(text, to || void 0);
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, 80) };
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
- pipeline = r2.error || "\u6CA1\u56DE\u6210";
3213
+ why = r2.error || "\u6CA1\u56DE\u6210";
3225
3214
  } catch (err) {
3226
- pipeline = String(err).slice(0, 80);
3215
+ why = String(err).slice(0, 100);
3227
3216
  }
3228
- return failed(`\u5FEB\u901F\u56DE\u590D\u4E0D\u884C\uFF0C\u81EA\u52A8\u5F00 QQ \u4E5F\u6CA1\u6210\uFF08${pipeline}\uFF09`);
3229
- return failed(
3230
- `\u901A\u77E5\u91CC\u6CA1\u6709\u5FEB\u901F\u56DE\u590D\u5165\u53E3\uFF08${first}\uFF09\u3002\u8FD9\u6761\u522B\u7528\u811A\u672C\u56DE\uFF0C\u7528\u4F60\u81EA\u5DF1\u7684\u624B\uFF1Apet_open_app \u6253\u5F00 QQ \u2192 hand_look \u770B\u4E00\u773C \u2192 hand_tap \u70B9\u5BF9\u8BDD \u2192 hand_type \u6253\u5B57 \u2192 hand_tap \u70B9\u300C\u53D1\u9001\u300D\u2192 \u5207\u56DE\u4E3B\u4EBA\u539F\u6765\u7684\u5E94\u7528\u3002\u4E00\u6B21\u53EA\u56DE\u4E00\u6761\uFF0C\u56DE\u5B8C\u5C31\u9000\u51FA\u6765\u3002`
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.26",
3
+ "version": "0.20.28",
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",