cortico-world-hands 0.20.21 → 0.20.22

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 +23 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1041,29 +1041,6 @@ var EyesClient = class {
1041
1041
  }
1042
1042
  return { ok: body.ok !== false, pkg: flat(body.pkg, 120), items };
1043
1043
  }
1044
- /** 「我们的日子」:新增一条。 */
1045
- async dayAdd(date, title, note, kind) {
1046
- const t = this.readToken() ? `&t=${encodeURIComponent(this.readToken())}` : "";
1047
- const path = `/hand/day/add?date=${encodeURIComponent(date)}&title=${encodeURIComponent(title)}` + (note ? `&note=${encodeURIComponent(note)}` : "") + (kind ? `&kind=${encodeURIComponent(kind)}` : "") + t;
1048
- const res = await get(this.handPort(), path, ACTION_TIMEOUT_MS);
1049
- let body = {};
1050
- try {
1051
- body = JSON.parse(res.body.toString("utf8"));
1052
- } catch {
1053
- }
1054
- return { ok: res.status === 200 && body.ok !== false, detail: flat(body.detail || body.error || "", 80) };
1055
- }
1056
- /** 「我们的日子」:列全部。 */
1057
- async dayList() {
1058
- const t = this.readToken() ? `?t=${encodeURIComponent(this.readToken())}` : "";
1059
- const res = await get(this.handPort(), `/hand/days${t}`, ACTION_TIMEOUT_MS);
1060
- try {
1061
- const body = JSON.parse(res.body.toString("utf8"));
1062
- return body.days ?? [];
1063
- } catch {
1064
- return [];
1065
- }
1066
- }
1067
1044
  /** 只截一块并放大:x,y,w,h 是真实像素。 */
1068
1045
  async zoom(x, y, w, h, maxWidth = 1080, quality = 80) {
1069
1046
  const cfg = this.cfg();
@@ -1113,6 +1090,29 @@ var describeCommand = (command) => {
1113
1090
  }
1114
1091
  };
1115
1092
  var Hands = class {
1093
+ /** 「我们的日子」:新增一条。 */
1094
+ async dayAdd(date, title, note, kind) {
1095
+ const t = this.readToken() ? `&t=${encodeURIComponent(this.readToken())}` : "";
1096
+ const path = `/hand/day/add?date=${encodeURIComponent(date)}&title=${encodeURIComponent(title)}` + (note ? `&note=${encodeURIComponent(note)}` : "") + (kind ? `&kind=${encodeURIComponent(kind)}` : "") + t;
1097
+ const res = await get(this.handPort(), path, ACTION_TIMEOUT_MS);
1098
+ let body = {};
1099
+ try {
1100
+ body = JSON.parse(res.body.toString("utf8"));
1101
+ } catch {
1102
+ }
1103
+ return { ok: res.status === 200 && body.ok !== false, detail: flat(body.detail || body.error || "", 80) };
1104
+ }
1105
+ /** 「我们的日子」:列全部。 */
1106
+ async dayList() {
1107
+ const t = this.readToken() ? `?t=${encodeURIComponent(this.readToken())}` : "";
1108
+ const res = await get(this.handPort(), `/hand/days${t}`, ACTION_TIMEOUT_MS);
1109
+ try {
1110
+ const body = JSON.parse(res.body.toString("utf8"));
1111
+ return body.days ?? [];
1112
+ } catch {
1113
+ return [];
1114
+ }
1115
+ }
1116
1116
  /** 读屏幕上的字(转发给眼睛客户端)。 */
1117
1117
  async uiSnapshot() {
1118
1118
  return this.eyes.ui();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.21",
3
+ "version": "0.20.22",
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",