cortico-world-hands 0.20.67 → 0.20.69
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 +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1193,9 +1193,8 @@ var EyesClient = class {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
/** 只截一块并放大:x,y,w,h 是真实像素。 */
|
|
1195
1195
|
async zoom(x, y, w, h, maxWidth = 1080, quality = 80) {
|
|
1196
|
-
const cfg = this.cfg();
|
|
1197
1196
|
const path = `/screen.jpg?x=${Math.max(0, Math.round(x))}&y=${Math.max(0, Math.round(y))}&w=${Math.max(8, Math.round(w))}&h=${Math.max(8, Math.round(h))}&max=${Math.round(maxWidth)}&q=${Math.round(quality)}`;
|
|
1198
|
-
const res = await get(this.
|
|
1197
|
+
const res = await get(this.port(), path, 12e3);
|
|
1199
1198
|
if (res.status !== 200 || res.body.length === 0) return null;
|
|
1200
1199
|
return {
|
|
1201
1200
|
bytes: new Uint8Array(res.body),
|
|
@@ -1259,6 +1258,18 @@ var describeCommand = (command) => {
|
|
|
1259
1258
|
};
|
|
1260
1259
|
var Hands = class {
|
|
1261
1260
|
/** 「我们的日子」:新增一条。 */
|
|
1261
|
+
/** 整屏切四块放大:交给眼睛那边做。 */
|
|
1262
|
+
/** 健康检查:交给眼睛那边。 */
|
|
1263
|
+
async health() {
|
|
1264
|
+
return this.eyes.health();
|
|
1265
|
+
}
|
|
1266
|
+
/** 局部放大:交给眼睛那边。 */
|
|
1267
|
+
async zoom(x, y, w, h, maxWidth = 1080, quality = 80) {
|
|
1268
|
+
return this.eyes.zoom(x, y, w, h, maxWidth, quality);
|
|
1269
|
+
}
|
|
1270
|
+
async quadFrame(maxWidth = 1440, quality = 76) {
|
|
1271
|
+
return this.eyes.quadFrame(maxWidth, quality);
|
|
1272
|
+
}
|
|
1262
1273
|
async dayAdd(date, title, note, kind) {
|
|
1263
1274
|
const t = this.readToken() ? `&t=${encodeURIComponent(this.readToken())}` : "";
|
|
1264
1275
|
const path = `/hand/day/add?date=${encodeURIComponent(date)}&title=${encodeURIComponent(title)}` + (note ? `¬e=${encodeURIComponent(note)}` : "") + (kind ? `&kind=${encodeURIComponent(kind)}` : "") + t;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-hands",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.69",
|
|
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",
|