@honor-claw/yoyo 2026.6.9-beta.13 → 2026.6.9-beta.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.
@@ -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.14",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",