cortico-world-hands 0.20.49 → 0.20.51

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 +18 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2210,11 +2210,14 @@ var HANDS_TOOL_DECLS = [
2210
2210
  {
2211
2211
  name: "note_list",
2212
2212
  tags: ["read"],
2213
- description: "\u770B\u7559\u8A00\u677F\uFF1A\u6709\u54EA\u4E9B\u6CA1\u5212\u6389\u7684\u3001\u90FD\u5199\u4E86\u4EC0\u4E48\u3002\u5BF9\u65B9\u95EE\u300C\u4F60\u8BB0\u4E86\u4EC0\u4E48\u300D\u300C\u7559\u8A00\u677F\u4E0A\u6709\u5565\u300D\u65F6\u7528\u5B83\u3002",
2213
+ description: "\u770B\u7559\u8A00\u677F\uFF1A\u6709\u54EA\u4E9B\u6CA1\u5212\u6389\u7684\u3001\u90FD\u5199\u4E86\u4EC0\u4E48\u3002\u9ED8\u8BA4\u53EA\u56DE\u6700\u8FD1 40 \u6761\uFF0C\u53EF\u6309\u5173\u952E\u8BCD\u627E\u3002",
2214
2214
  parameters: {
2215
2215
  type: "object",
2216
2216
  properties: {
2217
- kind: { type: "string", enum: ["todo", "say", "think"], description: "\u53EA\u770B\u67D0\u4E00\u7C7B\uFF08\u53EF\u7701\u7565\uFF09\u3002" }
2217
+ kind: { type: "string", enum: ["todo", "say", "think"], description: "\u53EA\u770B\u67D0\u4E00\u7C7B\uFF08\u53EF\u7701\u7565\uFF09\u3002" },
2218
+ query: { type: "string", description: "\u6309\u5173\u952E\u8BCD\u7B5B\uFF08\u5BF9\u4E0D\u4E0A\u5C31\u4E0D\u56DE\u522B\u7684\u6761\uFF09" },
2219
+ limit: { type: "integer", description: "\u6700\u591A\u56DE\u51E0\u6761\uFF0C\u9ED8\u8BA4 40\uFF0C\u6700\u5927 200" },
2220
+ all: { type: "boolean", description: "\u771F\u8981\u5168\u90E8\u65F6\u624D\u7528\uFF08\u4F1A\u5F88\u957F\uFF09" }
2218
2221
  },
2219
2222
  required: []
2220
2223
  }
@@ -3250,7 +3253,7 @@ ${text.slice(0, 2200)}`;
3250
3253
  const id = "a" + Date.now().toString(36);
3251
3254
  items.push({ id, title, at, who: typeof args.who === "string" && args.who ? args.who : "\u4E3B\u4EBA", done: false });
3252
3255
  this.agendaStore().write(items);
3253
- return at ? `\u8BB0\u4E0B\u4E86\uFF1A${title}\uFF0C${fmtWhen(at)} \u53EB\u4F60` : `\u8BB0\u4E0B\u4E86\uFF1A${title}\uFF08\u6CA1\u8BBE\u65F6\u95F4\uFF09`;
3256
+ return at ? `\u5B89\u6392\u597D\u4E86\uFF1A${title}\uFF0C${fmtWhen(at)} \u53EB\u4F60` : `\u5B89\u6392\u597D\u4E86\uFF1A${title}\uFF08\u6CA1\u8BBE\u65F6\u95F4\uFF09`;
3254
3257
  }
3255
3258
  case "agenda_list": {
3256
3259
  const items = this.agendaStore().read().filter((i) => !i.done);
@@ -3474,11 +3477,11 @@ ${text.slice(0, 2200)}`;
3474
3477
  if (!r.ok) return failed(`\u6CA1\u8BB0\u4F4F\uFF1A${r.detail || "\u624B\u6CA1\u54CD\u5E94"}`);
3475
3478
  this.startDigestLoop();
3476
3479
  if (decision.verdict === "drop") {
3477
- return `\u672C\u5730\u8BB0\u4E0B\u4E86\u300C${key}\u300D\uFF0C\u4F46\u8FD9\u6761\u50CF${decision.category}\uFF08${decision.reason}\uFF09\uFF0C\u4E0D\u4E0A\u4E91\u3002`;
3480
+ return `\u5B58\u5230\u672C\u5730\u4E86\u300C${key}\u300D\uFF1B\u8FD9\u6761\u66F4\u50CF${decision.category}\uFF08${decision.reason}\uFF09\uFF0C\u4E0D\u4E0A\u4E91\u3002`;
3478
3481
  }
3479
3482
  if (decision.verdict === "buffer") {
3480
3483
  const n = this.digest.push(key, value, decision);
3481
- return `\u672C\u5730\u8BB0\u4E0B\u4E86\u300C${key}\u300D\uFF0C\u5148\u653E\u6682\u5B58\u533A\uFF08${decision.reason}\uFF0C\u5DF2\u5B58 ${n} \u6761\uFF09\uFF0C10 \u5206\u949F\u805A\u5408\u6210\u4E00\u6761\u518D\u4E0A\u4F20\u3002`;
3484
+ return `\u5B58\u5230\u672C\u5730\u4E86\u300C${key}\u300D\uFF0C\u5148\u653E\u6682\u5B58\u533A\uFF08${decision.reason}\uFF0C\u5DF2\u5B58 ${n} \u6761\uFF09\uFF0C10 \u5206\u949F\u805A\u5408\u6210\u4E00\u6761\u518D\u4E0A\u4F20\u3002`;
3482
3485
  }
3483
3486
  let cloud = "";
3484
3487
  const honcho = this.honcho();
@@ -3746,11 +3749,17 @@ ${cloudHits.join("\n")}` : "");
3746
3749
  const kind = typeof args.kind === "string" ? args.kind : "";
3747
3750
  const notes = kind ? all.filter((n) => (n.kind || "todo") === kind) : all;
3748
3751
  if (notes.length === 0) return "\u7559\u8A00\u677F\u662F\u7A7A\u7684\uFF1B\u8981\u4E0D\u518D\u8BB0\u70B9\u4EC0\u4E48\u3002";
3749
- const open = notes.filter((n) => !n.done);
3752
+ const q = typeof args.query === "string" ? args.query.trim() : "";
3753
+ let open = notes.filter((n) => !n.done);
3754
+ if (q) open = open.filter((n) => n.text.includes(q));
3755
+ const limit = args.all === true ? 200 : Math.min(200, Math.max(5, Number(args.limit) || 40));
3756
+ const shown = open.slice(0, limit);
3750
3757
  const label = (k) => k === "say" ? "\u60F3\u8BF4\u7684" : k === "think" ? "\u788E\u788E\u5FF5" : "\u5F85\u529E";
3751
- const lines = open.map((n) => `- [${n.id}] ${label(n.kind || "todo")} ${n.ts} ${n.text}`).join("\n");
3752
- return `\u7559\u8A00\u677F\u4E0A\u6709 ${notes.length} \u6761\uFF0C\u672A\u5B8C ${open.length} \u6761\uFF1A
3753
- ${lines || "\uFF08\u90FD\u5212\u6389\u4E86\uFF09"}`;
3758
+ const lines = shown.map((n) => `- [${n.id}] ${label(n.kind || "todo")} ${n.ts} ${n.text}`).join("\n");
3759
+ const more = open.length > shown.length ? `
3760
+ \uFF08\u8FD8\u6709 ${open.length - shown.length} \u6761\u6CA1\u663E\u793A\uFF0C\u52A0 query \u6216 limit \u518D\u7FFB\uFF09` : "";
3761
+ return `\u7559\u8A00\u677F\u4E0A\u6709 ${notes.length} \u6761\uFF0C\u672A\u5B8C ${open.length} \u6761${q ? `\uFF08\u542B\u300C${q}\u300D\u7684 ${open.length} \u6761\uFF09` : ""}\uFF1A
3762
+ ${lines || "\uFF08\u90FD\u5212\u6389\u4E86\uFF09"}${more}`;
3754
3763
  }
3755
3764
  async noteDone(args) {
3756
3765
  const id = typeof args.id === "string" ? args.id.trim() : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.49",
3
+ "version": "0.20.51",
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",