cortico-world-hands 0.13.0 → 0.14.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/dist/index.js +15 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1105,6 +1105,15 @@ var Hands = class {
|
|
|
1105
1105
|
const res = await post(this.port(cfg.handPort), `/hand/qq/reply?${t}${toq}&text=${encodeURIComponent(text)}`, "", 2e4);
|
|
1106
1106
|
return res.body.toString("utf8");
|
|
1107
1107
|
}
|
|
1108
|
+
/** QQ 兜底:打开 QQ → 找到对话 → 粘贴 → 发送 → 切回。 */
|
|
1109
|
+
async qqOpenReply(text, to) {
|
|
1110
|
+
const cfg = this.cfg();
|
|
1111
|
+
const credential = this.readToken();
|
|
1112
|
+
const t = credential ? `t=${encodeURIComponent(credential)}` : "";
|
|
1113
|
+
const toq = to ? `&to=${encodeURIComponent(to)}` : "";
|
|
1114
|
+
const res = await post(this.port(cfg.handPort), `/hand/qq/open_reply?${t}${toq}&text=${encodeURIComponent(text)}`, "", 9e4);
|
|
1115
|
+
return res.body.toString("utf8");
|
|
1116
|
+
}
|
|
1108
1117
|
/** 解锁锁屏:密码由主人放在本机文件里,这里只触发,不接触密码。 */
|
|
1109
1118
|
async unlockScreen() {
|
|
1110
1119
|
const cfg = this.cfg();
|
|
@@ -2210,13 +2219,17 @@ ${lines.join("\n")}
|
|
|
2210
2219
|
if (!text) return failed("\u8981\u56DE\u4EC0\u4E48\uFF1F");
|
|
2211
2220
|
const to = typeof args.to === "string" ? args.to.trim() : "";
|
|
2212
2221
|
const raw = await this.hands.qqReply(text, to || void 0);
|
|
2222
|
+
let first = "";
|
|
2213
2223
|
try {
|
|
2214
2224
|
const r = JSON.parse(raw);
|
|
2215
2225
|
if (r.ok) return `\u56DE\u4E86${r.to ? "\u7ED9\u300C" + r.to + "\u300D" : ""}\uFF1A${text}`;
|
|
2216
|
-
|
|
2226
|
+
first = r.error || "\u6CA1\u56DE\u51FA\u53BB";
|
|
2217
2227
|
} catch {
|
|
2218
|
-
|
|
2228
|
+
first = raw.slice(0, 120);
|
|
2219
2229
|
}
|
|
2230
|
+
return failed(
|
|
2231
|
+
`\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`
|
|
2232
|
+
);
|
|
2220
2233
|
}
|
|
2221
2234
|
/** 解锁:成功/没锁/失败都给人话。 */
|
|
2222
2235
|
async screenUnlock() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-hands",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
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",
|