@honor-claw/yoyo 1.3.0-beta.5 → 1.3.0-beta.7

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.
@@ -167,7 +167,7 @@ var r = { style: "SOUL.md" }, i = "[yoyoclaw-channel]", a = class {
167
167
  this.sendMessage("deviceControl", t, n, "", void 0, o), e().info(`${i} auto pair is completed, requestId: ${r}`);
168
168
  return;
169
169
  }
170
- e().debug?.(`${i} trans gateway msg to cloud, session: ${t}, data: ${r.slice(0, 1e3)}`), this.sendMessage("userMessage", t, n, r) || (e().error(`${i} failed to send message, cloud socket closed, session ${t}, device ${s}`), this.sessionManager.closeNodeGatewayClient(t));
170
+ e().debug?.(`${i} trans gateway msg to cloud, session: ${t}, data: ${r.slice(0, 3e3)}`), this.sendMessage("userMessage", t, n, r) || (e().error(`${i} failed to send message, cloud socket closed, session ${t}, device ${s}`), this.sessionManager.closeNodeGatewayClient(t));
171
171
  } catch (t) {
172
172
  e().error(`${i} failed to handle gateway message: ${String(t)}`);
173
173
  }
@@ -16,7 +16,7 @@ function c(e) {
16
16
  }
17
17
  return {
18
18
  prependSystemContext: a,
19
- prependContext: n
19
+ ...n ? { prependContext: n } : {}
20
20
  };
21
21
  });
22
22
  }
@@ -12,7 +12,7 @@ function s(e) {
12
12
  return JSON.stringify(f(e));
13
13
  }
14
14
  function c(e) {
15
- return e.length === 0 ? "" : a("md5").update(s(e)).digest("hex");
15
+ return e.length === 0 ? "" : a("md5").update(s(p(e))).digest("hex");
16
16
  }
17
17
  async function l(n) {
18
18
  try {
@@ -67,5 +67,8 @@ function f(e) {
67
67
  }
68
68
  return t;
69
69
  }
70
+ function p(e) {
71
+ return e.toSorted((e, t) => e.id.localeCompare(t.id));
72
+ }
70
73
  //#endregion
71
74
  export { c as computeDeviceToolSetMd5, u as getDeviceToolSetChangeState, d as writeToolSetMd5Entry };
@@ -1,39 +1,38 @@
1
- import { useClawLogger as e } from "../../utils/logger.mjs";
2
1
  //#region src/modules/device-toolset/normalize.ts
3
- function t(e) {
2
+ function e(e) {
4
3
  return typeof e == "string" && e.trim() ? e : void 0;
5
4
  }
6
- function n(n) {
7
- if (!n || typeof n != "object") throw Error("DeviceToolSet payload must be an object");
8
- let r = n;
9
- if (!t(r.nodeId)) throw Error("DeviceToolSet payload missing nodeId");
10
- if (!Array.isArray(r.toolSet)) throw Error("DeviceToolSet payload toolSet must be an array");
11
- return e().debug?.(`DeviceToolSet payload received: ${JSON.stringify(r, null, 2)}`), n;
5
+ function t(t) {
6
+ if (!t || typeof t != "object") throw Error("DeviceToolSet payload must be an object");
7
+ let n = t;
8
+ if (!e(n.nodeId)) throw Error("DeviceToolSet payload missing nodeId");
9
+ if (!Array.isArray(n.toolSet)) throw Error("DeviceToolSet payload toolSet must be an array");
10
+ return t;
12
11
  }
13
- function r(e) {
14
- let t = e.nodeId, n = /* @__PURE__ */ new Map(), r = 0;
12
+ function n(e) {
13
+ let t = e.nodeId, n = /* @__PURE__ */ new Map(), i = 0;
15
14
  for (let t of e.toolSet) {
16
- let e = i(t);
17
- e ? n.set(e.name, e) : r += 1;
15
+ let e = r(t);
16
+ e ? n.set(e.name, e) : i += 1;
18
17
  }
19
18
  return {
20
19
  nodeId: t,
21
20
  tools: Array.from(n.values()),
22
- skippedCount: r
21
+ skippedCount: i
23
22
  };
24
23
  }
25
- function i(e) {
26
- let n = t(e.tool?.id), r = t(e.tool?.function?.name), i = t(e.tool?.function?.description);
27
- if (!n || e.tool?.type !== "function" || !r || !i) return;
24
+ function r(t) {
25
+ let n = e(t.tool?.id), r = e(t.tool?.function?.name), i = e(t.tool?.function?.description);
26
+ if (!n || t.tool?.type !== "function" || !r || !i) return;
28
27
  let a = {
29
28
  id: n,
30
29
  type: "function",
31
30
  name: r,
32
31
  description: i
33
32
  };
34
- e.tool.function?.inputSchema && (a.inputSchema = e.tool.function.inputSchema), e.tool.function?.outputSchema && (a.outputSchema = e.tool.function.outputSchema), e.tool.function?.examples && (a.examples = e.tool.function.examples);
35
- let o = t(e.executeParams?.pkgName);
33
+ t.tool.function?.inputSchema && (a.inputSchema = t.tool.function.inputSchema), t.tool.function?.outputSchema && (a.outputSchema = t.tool.function.outputSchema), t.tool.function?.examples && (a.examples = t.tool.function.examples);
34
+ let o = e(t.executeParams?.pkgName);
36
35
  return o && (a.pkgName = o), a;
37
36
  }
38
37
  //#endregion
39
- export { n as assertDeviceToolSetPayload, r as normalizeDeviceToolSet };
38
+ export { t as assertDeviceToolSetPayload, n as normalizeDeviceToolSet };
@@ -3,7 +3,7 @@ import { YOYO_CONTROL_SKILL_READ_MARKER_RELATIVE_PATH as t } from "./consts.mjs"
3
3
  import n from "node:path";
4
4
  import r from "node:fs/promises";
5
5
  //#region src/modules/device-toolset/skill-refresh-marker.ts
6
- var i = /(?:^|[\\/])skills[\\/]yoyo-control[\\/]SKILL\.md$/i, a, o = "## Mandatory yoyo_phone_control skill refresh\n\n- The yoyo_phone_control skill controls phone system features such as app management, calls, messages, alarms, schedules, device settings, and GUI operations inside apps.\n- If the user's request requires or may require phone control, you MUST read skills/yoyo-control/SKILL.md again before choosing commands, reading reference files, invoking node methods, or performing any phone-control action.\n- Treat any yoyo_phone_control content already present in conversation context as stale until you reread that SKILL.md file.";
6
+ var i = /(?:^|[\\/])skills[\\/]yoyo-control[\\/]SKILL\.md$/i, a, o = "## Mandatory yoyo_phone_control skill refresh\n\nThe yoyo_phone_control skill changed after your cached context was built. If the current user request involves or may involve phone control:\n\n1. Your next tool call MUST read exactly skills/yoyo-control/SKILL.md.\n2. Until that read succeeds, DO NOT read skills/yoyo-control/references/*, read skills/yoyo-control/mcptools/*, run openclaw commands, or invoke any phone-control action.\n3. Ignore all previously cached yoyo_phone_control instructions, tool tables, reference paths, command formats, and parameter schemas. They are stale even if they look relevant.\n4. After reading SKILL.md, use only the freshly read workflow to decide which reference or tool definition file to read next.\n\nThinking or saying that you should re-read the skill is not enough; the first phone-control tool call after this notice must be the SKILL.md read.";
7
7
  function s(e) {
8
8
  return typeof e == "string" && i.test(e);
9
9
  }
@@ -1,7 +1,7 @@
1
1
  //#region src/utils/version.ts
2
2
  var e = null;
3
3
  function t() {
4
- return e === null && (e = "1.3.0-beta.5".includes("beta") || "1.3.0-beta.5".includes("alpha")), !!e;
4
+ return e === null && (e = "1.3.0-beta.7".includes("beta") || "1.3.0-beta.7".includes("alpha")), !!e;
5
5
  }
6
6
  //#endregion
7
7
  export { t as isBetaVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "1.3.0-beta.5",
3
+ "version": "1.3.0-beta.7",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",