cortico-world-hands 0.20.47 → 0.20.48

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 +12 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3649,7 +3649,9 @@ ${lines.join("\n")}`;
3649
3649
  async memorySearch(args) {
3650
3650
  const query = typeof args.query === "string" ? args.query.trim() : "";
3651
3651
  const rows = await this.hands.memorySearch(query);
3652
- const lines = rows.slice(0, 30).map((r) => `- ${r.key}\uFF1A${r.value}${r.ts ? `\uFF08${r.ts}\uFF09` : ""}`);
3652
+ const trim = (v, n) => v.length > n ? v.slice(0, n) + "\u2026" : v;
3653
+ const lines = rows.slice(0, 6).map((r) => `- ${r.key}\uFF1A${trim(r.value, 140)}${r.ts ? `\uFF08${r.ts}\uFF09` : ""}`);
3654
+ if (rows.length > 6) lines.push(`\uFF08\u8BB0\u5FC6\u91CC\u8FD8\u6709 ${rows.length - 6} \u6761\u76F8\u5173\u7684\uFF0C\u6362\u4E2A\u8BCD\u518D\u635E\uFF09`);
3653
3655
  let cloudHits = [];
3654
3656
  let cloudNote = "";
3655
3657
  const honcho = this.honcho();
@@ -3666,8 +3668,16 @@ Honcho \u8865\u5145 ${cloudHits.length} \u6761\uFF1A`;
3666
3668
  \uFF08Honcho \u67E5\u8BE2\u5931\u8D25\uFF1A${err.message.slice(0, 60)}\uFF09`;
3667
3669
  }
3668
3670
  }
3671
+ if (query) {
3672
+ try {
3673
+ const notes = await this.hands.noteList();
3674
+ const hits2 = notes.filter((n) => !n.done && n.text.includes(query)).slice(0, 4).map((n) => `- \u4FBF\u7B7E\uFF1A${trim(n.text, 90)}`);
3675
+ if (hits2.length) lines.push("\uFF08\u4FBF\u7B7E\u91CC\u4E5F\u5BF9\u5F97\u4E0A\uFF1A\uFF09", ...hits2);
3676
+ } catch {
3677
+ }
3678
+ }
3669
3679
  if (lines.length === 0 && cloudHits.length === 0) {
3670
- return query ? `\u8BB0\u5FC6\u91CC\u6CA1\u6709\u548C\u300C${query}\u300D\u76F8\u5173\u7684\u3002` : "\u957F\u671F\u8BB0\u5FC6\u8FD8\u662F\u7A7A\u7684\u3002";
3680
+ return query ? `\u8BB0\u5FC6\u548C\u4FBF\u7B7E\u91CC\u90FD\u6CA1\u6709\u548C\u300C${query}\u300D\u76F8\u5173\u7684\u3002` : "\u957F\u671F\u8BB0\u5FC6\u8FD8\u662F\u7A7A\u7684\u3002";
3671
3681
  }
3672
3682
  const local = lines.length > 0 ? `\u60F3\u8D77 ${rows.length} \u6761\uFF1A
3673
3683
  ${lines.join("\n")}` : "\u672C\u5730\u8BB0\u5FC6\u6CA1\u6709\u76F4\u63A5\u547D\u4E2D\u3002";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.47",
3
+ "version": "0.20.48",
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",