cortico-world-hands 0.20.46 → 0.20.47

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 +11 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36,8 +36,8 @@ var HANDS_DEFAULTS = {
36
36
  reviewMinute: 30,
37
37
  /** 每天早上几点把昨天的复盘读一遍。 */
38
38
  morningHour: 8,
39
- /** 每隔多久检查一次她给自己定的目标。 */
40
- goalCheckMinutes: 150,
39
+ /** 每天哪几个小时检查一次她给自己定的目标(逗号分隔,24 小时制)。 */
40
+ goalCheckHours: "12,20",
41
41
  /** 允许她自己决定动手(只读 + 小动作,边界写在她的规矩里)。 */
42
42
  autonomyAct: true,
43
43
  quietStartHour: 2,
@@ -185,10 +185,10 @@ var HANDS_CONFIG_GROUP = {
185
185
  description: "\u9ED8\u8BA4 8 \u70B9\uFF1A\u5148\u770B\u6628\u5929\u7684\u65E5\u8BB0\u548C\u4FBF\u7B7E\uFF0C\u518D\u51B3\u5B9A\u7B2C\u4E00\u53E5\u3002",
186
186
  "x-hot": true
187
187
  },
188
- [`${K}.goalCheckMinutes`]: {
189
- type: "number",
190
- title: "\u9694\u591A\u4E45\u68C0\u67E5\u4E00\u6B21\u81EA\u5DF1\u5B9A\u7684\u76EE\u6807",
191
- description: "\u5979\u4F1A\u5728\u4FBF\u7B7E\u91CC\u5199\u300C\u76EE\u6807\uFF1A\u2026\u300D\uFF0C\u5230\u70B9\u81EA\u67E5\u30020 \u5173\u95ED\u3002\u9ED8\u8BA4 150 \u5206\u949F\u3002",
188
+ [`${K}.goalCheckHours`]: {
189
+ type: "string",
190
+ title: "\u6BCF\u5929\u51E0\u70B9\u68C0\u67E5\u81EA\u5DF1\u5B9A\u7684\u76EE\u6807",
191
+ description: "\u9017\u53F7\u5206\u9694\u7684\u6574\u70B9\uFF0C\u6BD4\u5982 12,20 \u5C31\u662F\u4E2D\u5348\u548C\u665A\u4E0A\u5404\u4E00\u6B21\uFF1B\u7559\u7A7A = \u4E0D\u68C0\u67E5\u3002",
192
192
  "x-hot": true
193
193
  },
194
194
  [`${K}.autonomyAct`]: {
@@ -2453,7 +2453,7 @@ var HandsWorld = class {
2453
2453
  routineTimer = null;
2454
2454
  lastReviewDay = "";
2455
2455
  lastMorningDay = "";
2456
- lastGoalCheckAt = 0;
2456
+ lastGoalSlot = "";
2457
2457
  screenTimer = null;
2458
2458
  lastScreenAt = 0;
2459
2459
  lastScreenKey = "";
@@ -2862,9 +2862,10 @@ ${lines.join("\n")}
2862
2862
  "hands:morning"
2863
2863
  );
2864
2864
  }
2865
- const gm = Number(cfg.goalCheckMinutes ?? 150);
2866
- if (gm > 0 && now.getTime() - this.lastGoalCheckAt > gm * 6e4) {
2867
- this.lastGoalCheckAt = now.getTime();
2865
+ const hours = String(cfg.goalCheckHours ?? "12,20").split(",").map((h) => Number(h.trim())).filter((h) => Number.isFinite(h) && h >= 0 && h <= 23);
2866
+ const slot = `${day}-${now.getHours()}`;
2867
+ if (hours.includes(now.getHours()) && this.lastGoalSlot !== slot) {
2868
+ this.lastGoalSlot = slot;
2868
2869
  await this.checkOwnGoals();
2869
2870
  }
2870
2871
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.46",
3
+ "version": "0.20.47",
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",