@honor-claw/yoyo 2026.6.9-beta.13 → 2026.6.9-beta.15

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.
@@ -11,7 +11,7 @@ import "./logout/index.mjs";
11
11
  function a(a) {
12
12
  a.registerCli((o) => {
13
13
  let s = o.program.command("honor").description("Commands for Honor yoyoclaw");
14
- r(a, s), i(a, s), t(a, s), e() && n(a, s);
14
+ r(a, s), i(a, s), e() && (n(a, s), t(a, s));
15
15
  }, { commands: ["honor"] });
16
16
  }
17
17
  //#endregion
@@ -1,14 +1,24 @@
1
1
  import { withCommandRuntime as e } from "../../core/runtime.mjs";
2
2
  import { toErrorMessage as t } from "../../utils/error.mjs";
3
3
  import { clawLogger as n } from "../../utils/claw-logger.mjs";
4
- import { performLogout as r } from "../../honor-auth/logout.mjs";
4
+ import { loadConfig as r, saveConfig as i } from "../../modules/configs/config-store.mjs";
5
+ import { removeYoyoChannelAccount as a, resolveEnabledYoyoAccountId as o } from "../../modules/configs/channel.mjs";
6
+ import "../../modules/configs/index.mjs";
7
+ import { performLogout as s } from "../../honor-auth/logout.mjs";
5
8
  //#region src/cli/logout/impl.ts
6
- var i = n("logout-cli");
7
- function a(n, a) {
8
- a.command("logout").description("Logout and clear user configuration").action(async () => e(n.runtime, async () => {
9
- i.info("logout CLI command called");
9
+ var c = n("logout-cli");
10
+ function l(n, l) {
11
+ l.command("logout").description("Logout and clear user configuration").action(async () => e(n.runtime, async () => {
12
+ c.info("logout CLI command called");
13
+ let e = o();
10
14
  try {
11
- await r(), console.log("✅ Logout successful, gateway will automatically restart to handle new configuration");
15
+ await s(e);
16
+ try {
17
+ await i(a(r(), e));
18
+ } catch (t) {
19
+ c.error("failed to remove channel account after logout", t, { userId: e });
20
+ }
21
+ console.log("✅ Logout successful, gateway will automatically stop the account connection");
12
22
  } catch (e) {
13
23
  let n = t(e);
14
24
  console.error("🚫 Logout failed:", n);
@@ -16,4 +26,4 @@ function a(n, a) {
16
26
  }));
17
27
  }
18
28
  //#endregion
19
- export { a as registerLogoutCommand };
29
+ export { l as registerLogoutCommand };
@@ -5,12 +5,12 @@ import { loadDeviceInfo as r } from "../modules/device/device-info.mjs";
5
5
  import "./vault/index.mjs";
6
6
  import "../apis/index.mjs";
7
7
  //#region src/honor-auth/logout.ts
8
- async function i() {
9
- let i = e.fromUser(), a = await i.current();
10
- if (!a) throw Error("⚠️ Not logged in");
11
- let o = await r(), s = await n().logoutDevice(o, a);
12
- if (!t(s)) throw Error(s.data?.cnMessage || "Unknown error");
13
- await i.clear();
8
+ async function i(i) {
9
+ let a = e.fromUser(i), o = await a.current();
10
+ if (!o) throw Error("Not logged in, please login first!");
11
+ let s = await r(), c = await n().logoutDevice(s, o);
12
+ if (!t(c)) throw Error(c.data?.cnMessage || "Unknown error");
13
+ await a.clear();
14
14
  }
15
15
  //#endregion
16
16
  export { i as performLogout };
@@ -35,12 +35,21 @@ function a(e, t, r) {
35
35
  function o(e, t, n) {
36
36
  return a(e, t, { enabled: n });
37
37
  }
38
- function s() {
38
+ function s(e, t) {
39
+ let r = n(e), a = r.accounts;
40
+ if (!a || !(t in a)) return e;
41
+ let o = { ...a };
42
+ return delete o[t], i(e, {
43
+ ...r,
44
+ accounts: o
45
+ });
46
+ }
47
+ function c() {
39
48
  let e = n(t()).accounts ?? {};
40
49
  for (let [t, n] of Object.entries(e)) if (n?.enabled !== !1) return t;
41
50
  return "";
42
51
  }
43
- function c(e, t) {
52
+ function l(e, t) {
44
53
  let r = n(e), a = r.accounts ?? {}, o = Object.entries(a), s = {};
45
54
  for (let [e, n] of o) s[e] = {
46
55
  ...n,
@@ -53,4 +62,4 @@ function c(e, t) {
53
62
  });
54
63
  }
55
64
  //#endregion
56
- export { r as patchYoyoChannelConfig, n as readYoyoChannelConfig, s as resolveEnabledYoyoAccountId, c as setAllYoyoChannelAccountsEnabled, o as setYoyoChannelAccountEnabled };
65
+ export { r as patchYoyoChannelConfig, n as readYoyoChannelConfig, s as removeYoyoChannelAccount, c as resolveEnabledYoyoAccountId, l as setAllYoyoChannelAccountsEnabled, o as setYoyoChannelAccountEnabled };
@@ -3,7 +3,7 @@ import { findPackageRoot as t, readPackageJson as n } from "./package-json.mjs";
3
3
  //#region src/utils/version.ts
4
4
  var r = "@honor-claw/yoyo";
5
5
  function i() {
6
- let e = c();
6
+ let e = l();
7
7
  return e.includes("beta") || e.includes("alpha");
8
8
  }
9
9
  function a(e, t) {
@@ -12,13 +12,18 @@ function a(e, t) {
12
12
  return !Number.isFinite(n) || n < 0 || t !== void 0 && n > t ? 0 : n;
13
13
  }
14
14
  function o() {
15
- let [e, t, n] = c().split("-", 1)[0].split("."), r = a(e), i = a(t, 99), o = a(n, 99);
16
- return r * 1e4 + i * 100 + o;
15
+ let [e, t] = l().split("-", 2), [n, r, i] = e.split("."), o = a(n), c = a(r, 99), u = a(i, 99), d = s(t);
16
+ return (o * 1e4 + c * 100 + u) * 10 + d;
17
17
  }
18
- function s() {
19
- return c();
18
+ function s(e) {
19
+ if (!e || !/^\d+$/.test(e)) return 0;
20
+ let t = Number.parseInt(e, 10);
21
+ return !Number.isFinite(t) || t < 0 || t > 9 ? 0 : t;
20
22
  }
21
23
  function c() {
24
+ return l();
25
+ }
26
+ function l() {
22
27
  try {
23
28
  let e = t(import.meta.url, r);
24
29
  if (!e) return "0.0.0";
@@ -27,31 +32,31 @@ function c() {
27
32
  } catch {}
28
33
  return "0.0.0";
29
34
  }
30
- var l = 3;
31
- function u() {
35
+ var u = 3;
36
+ function d() {
32
37
  try {
33
38
  let t = e().version;
34
- return d(t);
39
+ return f(t);
35
40
  } catch {
36
- return l;
41
+ return u;
37
42
  }
38
43
  }
39
- function d(e) {
40
- let t = f(e);
41
- return t && p(t, [
44
+ function f(e) {
45
+ let t = p(e);
46
+ return t && m(t, [
42
47
  2026,
43
48
  5,
44
49
  12
45
- ]) >= 0 ? 4 : l;
50
+ ]) >= 0 ? 4 : u;
46
51
  }
47
- function f(e) {
52
+ function p(e) {
48
53
  if (!e) return null;
49
54
  let t = e.split("-", 1)[0].split(".");
50
55
  if (t.length === 0) return null;
51
56
  let n = t.map((e) => Number.parseInt(e, 10));
52
57
  return n.some((e) => !Number.isFinite(e) || e < 0) ? null : n;
53
58
  }
54
- function p(e, t) {
59
+ function m(e, t) {
55
60
  let n = Math.max(e.length, t.length);
56
61
  for (let r = 0; r < n; r += 1) {
57
62
  let n = e[r] ?? 0, i = t[r] ?? 0;
@@ -60,4 +65,4 @@ function p(e, t) {
60
65
  return 0;
61
66
  }
62
67
  //#endregion
63
- export { u as getProtocolVersion, o as getYoyoPluginVersionCode, i as isBetaVersion, s as readYoyoPluginVersion };
68
+ export { d as getProtocolVersion, o as getYoyoPluginVersionCode, i as isBetaVersion, c as readYoyoPluginVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "2026.6.9-beta.13",
3
+ "version": "2026.6.9-beta.15",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",
@@ -4,7 +4,8 @@ description: >
4
4
  启动基于 GUI 的应用操作任务(UI Agent),调用后立即返回 task_id,
5
5
  需通过 task-result-query 轮询查询执行结果。用于在手机上对指定 App
6
6
  发起一次独立的操控流程;单一 App 禁止拆分任务,多 App 或含条件的流程
7
- 需拆分为多次调用,续办需携带上次任务的 task_id。
7
+ 需拆分为多次调用,且必须串行下发(等前一任务 isFinal=true 后再下发下一个,
8
+ 设备同一时刻仅允许一个 GUI 任务,并发会被拒为 busy),续办需携带上次任务的 task_id。
8
9
  ---
9
10
 
10
11
  # Gui Task Create GUI 任务创建
@@ -77,10 +78,16 @@ description: >
77
78
 
78
79
  ## 3. 业务规则
79
80
 
81
+ ### GUI 任务全局串行约束
82
+
83
+ > ⚠️ **同一设备同一时刻只允许执行一个 GUI 任务**。若在上一任务尚未执行完成(未轮询到 `isFinal = true`)时再次调用 `gui.create`,设备会直接对后续任务返回 **busy** 状态码——这些任务会被拒收、不会执行。例如用户一次说出多个 App 的操作(如”用小红书搜…、在文件管理找…、在通讯录搜…、在 QQ 音乐收藏…”),拆解出的多个子任务只有第一个能执行,其余全部 busy 失败。
84
+ >
85
+ > 因此,凡需要多次调用 `gui.create` 的场景,**必须严格串行**:下发 task1 → 轮询 `task-result-query` 直至 `isFinal = true` → 才能下发 task2 → 再轮询至完成 → …依此类推。严禁并发下发,也严禁”仍在轮询前一任务时就提前下发后一任务”。
86
+
80
87
  ### 适用场景及操作流程
81
88
  1. 针对单一 App 的任何 GUI 操作任务,禁止拆分任务,必须直接发起调用
82
- 2. 涉及多个 App 的连续操作需拆分为多个独立任务,逐个调用
83
- 3. 涉及条件判断(如“若…则…”)时,将条件判断与执行任务拆分为两次调用
89
+ 2. 涉及多个 App 的连续操作需拆分为多个独立任务,**串行下发**:必须等上一个任务轮询到 `isFinal = true`(执行完成)后,才能发起下一个 `gui.create`(详见上方「GUI 任务全局串行约束」)
90
+ 3. 涉及条件判断(如”若…则…”)时,将条件判断与执行任务拆分为两次调用
84
91
  4. 若为对未结束任务的补充/修改/继续,需在请求中补充对应的 `task_id`(输入参数)
85
92
 
86
93
  ### 特定交互