cortico-world-hands 0.20.13 → 0.20.14

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 +16 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -132,6 +132,18 @@ var HANDS_CONFIG_GROUP = {
132
132
  description: "\u586B\u4E86\u5C31\u5728\u4E16\u754C\u542F\u52A8\u65F6\u81EA\u52A8\u88C5\uFF08\u672C\u5730 HTTP \u4E5F\u884C\uFF0C\u6BD4\u5982 http://127.0.0.1:18080\uFF09\u3002",
133
133
  "x-hot": true
134
134
  },
135
+ [`${K}.mediaKeepDays`]: {
136
+ type: "number",
137
+ title: "\u9644\u4EF6\u4FDD\u7559\u51E0\u5929",
138
+ description: "\u622A\u56FE\u3001\u56FE\u7247\u8FD9\u4E9B\u9644\u4EF6\u5728\u8FD9\u4E2A\u76EE\u5F55\u91CC\u7559\u51E0\u5929\uFF0C\u8D85\u8FC7\u5C31\u5220\uFF08\u9ED8\u8BA4 1 \u5929\uFF09\u3002",
139
+ "x-hot": true
140
+ },
141
+ [`${K}.mediaCleanHour`]: {
142
+ type: "integer",
143
+ title: "\u6BCF\u5929\u51E0\u70B9\u6E05\u9644\u4EF6",
144
+ description: "\u7559\u7A7A/0 \u8868\u793A\u6BCF 6 \u5C0F\u65F6\u68C0\u67E5\u4E00\u6B21\uFF0C\u8D85\u671F\u5C31\u6E05\u3002",
145
+ "x-hot": true
146
+ },
135
147
  [`${K}.qqSelf`]: {
136
148
  type: "string",
137
149
  title: "\u5979\u81EA\u5DF1\u7684 QQ \u540D\u5B57\uFF08\u7FA4\u91CC @ \u8FD9\u4E2A\u624D\u53EB\u5979\uFF09",
@@ -2493,12 +2505,12 @@ ${lines.join("\n")}
2493
2505
  const keepDays = cfg.mediaKeepDays ?? 1;
2494
2506
  const hour = cfg.mediaCleanHour ?? 4;
2495
2507
  const now = /* @__PURE__ */ new Date();
2496
- if (now.getHours() !== hour) return;
2497
- const day = now.toISOString().slice(0, 10);
2498
- if (this.lastMediaDay === day) return;
2508
+ if (hour >= 0 && now.getHours() !== hour) return;
2509
+ const slot = Math.floor(now.getTime() / (6 * 3600 * 1e3));
2510
+ if (this.lastMediaDay === slot) return;
2499
2511
  const dir = this.mediaDir();
2500
2512
  if (!dir) return;
2501
- this.lastMediaDay = day;
2513
+ this.lastMediaDay = slot;
2502
2514
  const r = cleanMedia(dir, { keepDays, maxMB: cfg.mediaMaxMB ?? 0 });
2503
2515
  this.log?.info(`\u9644\u4EF6\u6E05\u7406\uFF1A\u5220 ${r.removed} \u4E2A\uFF0C\u91CA\u653E ${r.freedMB}MB\uFF0C\u5269 ${r.kept} \u4E2A`);
2504
2516
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.13",
3
+ "version": "0.20.14",
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",