@honor-claw/yoyo 2026.6.9-alpha.2 → 2026.6.9-alpha.4

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 (106) hide show
  1. package/dist/apis/claw-cloud.mjs +6 -4
  2. package/dist/capabilities/node/list.mjs +25 -11
  3. package/dist/channel/accounts.mjs +1 -1
  4. package/dist/channel/consts.mjs +1 -1
  5. package/dist/channel/directory.mjs +5 -2
  6. package/dist/channel/lifecycle.mjs +9 -25
  7. package/dist/channel/security.mjs +2 -6
  8. package/dist/channel/setup-wizard.mjs +2 -4
  9. package/dist/channel/status.mjs +29 -42
  10. package/dist/cloud-channel/channel.mjs +5 -4
  11. package/dist/cloud-channel/handlers/context/handler.mjs +41 -36
  12. package/dist/cloud-channel/transport/cloud-socket.mjs +2 -2
  13. package/dist/cloud-channel/transport/index.mjs +1 -0
  14. package/dist/cloud-channel/transport/outbound-port.mjs +23 -29
  15. package/dist/commands/login/impl.mjs +13 -13
  16. package/dist/commands/status/index.mjs +8 -8
  17. package/dist/connection/client.mjs +70 -7
  18. package/dist/connection/index.mjs +1 -2
  19. package/dist/connection/monitor.mjs +14 -25
  20. package/dist/connection/registry.mjs +21 -0
  21. package/dist/core/hooks/entry.mjs +7 -6
  22. package/dist/core/hooks/gateway-lifecycle.mjs +21 -0
  23. package/dist/core/hooks/skill-refresh.mjs +9 -10
  24. package/dist/core/hooks/tool-trace.mjs +22 -44
  25. package/dist/core/prompt/skill.mjs +6 -7
  26. package/dist/core/runtime.mjs +5 -1
  27. package/dist/gateway/client/client.mjs +1 -1
  28. package/dist/honor-auth/logout.mjs +1 -1
  29. package/dist/honor-auth/vault/impl.mjs +46 -57
  30. package/dist/honor-auth/vault/legacy-migration.mjs +8 -8
  31. package/dist/index.mjs +4 -4
  32. package/dist/messaging/dispatchers/command/impl.mjs +55 -0
  33. package/dist/messaging/dispatchers/command/index.mjs +1 -0
  34. package/dist/messaging/dispatchers/stream/controller.mjs +135 -0
  35. package/dist/messaging/{stream → dispatchers/stream}/error.mjs +1 -1
  36. package/dist/messaging/dispatchers/stream/factory.mjs +17 -0
  37. package/dist/messaging/dispatchers/stream/hooks.mjs +49 -0
  38. package/dist/messaging/dispatchers/stream/index.mjs +4 -0
  39. package/dist/messaging/dispatchers/stream/registry.mjs +13 -0
  40. package/dist/messaging/{stream → dispatchers/stream}/resolvers.mjs +1 -1
  41. package/dist/messaging/{stream → dispatchers/stream}/session.mjs +15 -11
  42. package/dist/messaging/dispatchers/stream/tool/error.mjs +26 -0
  43. package/dist/messaging/dispatchers/stream/tool/event-builder.mjs +18 -0
  44. package/dist/messaging/{stream → dispatchers/stream}/tool/index.mjs +2 -2
  45. package/dist/messaging/{stream → dispatchers/stream}/tool/sanitize.mjs +1 -1
  46. package/dist/messaging/{stream → dispatchers/stream}/tool/trace-store.mjs +16 -61
  47. package/dist/messaging/inbound/abort/detect.mjs +5 -5
  48. package/dist/messaging/inbound/abort/index.mjs +1 -1
  49. package/dist/messaging/inbound/agent.mjs +5 -4
  50. package/dist/messaging/inbound/command.mjs +38 -0
  51. package/dist/messaging/inbound/context.mjs +16 -14
  52. package/dist/messaging/inbound/dispatch.mjs +25 -15
  53. package/dist/messaging/inbound/interrupt.mjs +22 -21
  54. package/dist/messaging/inbound/new-session.mjs +21 -18
  55. package/dist/messaging/inbound/user-message.mjs +3 -3
  56. package/dist/messaging/index.mjs +1 -0
  57. package/dist/messaging/send/frame.mjs +8 -13
  58. package/dist/messaging/send/text.mjs +1 -0
  59. package/dist/messaging/session/defaults.mjs +41 -0
  60. package/dist/messaging/session/index.mjs +1 -0
  61. package/dist/messaging/target/chat-id.mjs +36 -14
  62. package/dist/messaging/target/index.mjs +3 -0
  63. package/dist/modules/configs/agent-defaults.mjs +25 -0
  64. package/dist/modules/configs/channel.mjs +18 -12
  65. package/dist/modules/configs/index.mjs +2 -2
  66. package/dist/modules/configs/plugin-init.mjs +36 -26
  67. package/dist/modules/device/device-info.mjs +7 -7
  68. package/dist/modules/device/index.mjs +1 -1
  69. package/dist/modules/status/channel.mjs +1 -17
  70. package/dist/modules/status/storage.mjs +17 -15
  71. package/dist/provisioning/registration/register.mjs +52 -28
  72. package/dist/provisioning/toolset/ack.mjs +10 -15
  73. package/dist/provisioning/toolset/artifacts.mjs +37 -36
  74. package/dist/provisioning/toolset/consts.mjs +2 -2
  75. package/dist/provisioning/toolset/processor.mjs +2 -2
  76. package/dist/provisioning/toolset/skill-refresh-marker.mjs +30 -25
  77. package/dist/tools/error.mjs +9 -0
  78. package/dist/tools/index.mjs +8 -0
  79. package/dist/tools/nodes-status/index.mjs +2 -0
  80. package/dist/tools/nodes-status/mapper.mjs +19 -0
  81. package/dist/tools/nodes-status/tool.mjs +44 -0
  82. package/dist/utils/claw-logger.mjs +1 -1
  83. package/dist/utils/fs-safe.mjs +30 -30
  84. package/openclaw.plugin.json +3 -0
  85. package/package.json +3 -2
  86. package/skills/yoyo-phone-control/SKILL.md +1 -63
  87. package/skills/yoyo-phone-control/configs/sub-skills.json +2 -21
  88. package/dist/connection/manager.mjs +0 -92
  89. package/dist/core/service/index.mjs +0 -27
  90. package/dist/messaging/stream/dispatcher.mjs +0 -74
  91. package/dist/messaging/stream/tool/callbacks.mjs +0 -36
  92. package/dist/messaging/stream/tool/output.mjs +0 -38
  93. package/dist/utils/base64-json.mjs +0 -14
  94. package/skills/yoyo-phone-control/references/alarm-create.md +0 -519
  95. package/skills/yoyo-phone-control/references/alarm-delete.md +0 -370
  96. package/skills/yoyo-phone-control/references/alarm-disable.md +0 -372
  97. package/skills/yoyo-phone-control/references/alarm-enable.md +0 -372
  98. package/skills/yoyo-phone-control/references/alarm-query.md +0 -565
  99. package/skills/yoyo-phone-control/references/alarm-update.md +0 -461
  100. package/skills/yoyo-phone-control/references/countdown-timer.md +0 -393
  101. package/skills/yoyo-phone-control/references/schedule-create.md +0 -541
  102. package/skills/yoyo-phone-control/references/schedule-delete.md +0 -582
  103. package/skills/yoyo-phone-control/references/schedule-search.md +0 -673
  104. package/skills/yoyo-phone-control/references/schedule-update.md +0 -630
  105. package/skills/yoyo-phone-control/references/screen-record.md +0 -236
  106. package/skills/yoyo-phone-control/references/volume-operate.md +0 -284
@@ -57,13 +57,15 @@ var o = class {
57
57
  "x-jwt-token": n.token,
58
58
  "x-device-id": e.deviceId,
59
59
  "x-udid": e.deviceId
60
+ }, a = {
61
+ businessTag: "YOYO_CLAW",
62
+ role: "node",
63
+ ignoreBizExtInfo: !0,
64
+ ...r?.deviceIdList?.length ? { deviceIdList: r.deviceIdList } : {}
60
65
  };
61
66
  return this.httpClient.post("/v1/user/devicelist", {
62
67
  headers: i,
63
- body: {
64
- businessTag: "YOYO_CLAW",
65
- role: "node"
66
- },
68
+ body: a,
67
69
  timeout: r?.timeoutMs ?? 3e4
68
70
  });
69
71
  }
@@ -3,23 +3,37 @@ import { clawLogger as t } from "../../utils/claw-logger.mjs";
3
3
  import { getCurrentUser as n } from "../../honor-auth/vault/impl.mjs";
4
4
  import { isOKResponse as r } from "../../apis/helpers.mjs";
5
5
  import { createClawCloudClient as i } from "../../apis/claw-cloud.mjs";
6
- import "../../apis/index.mjs";
7
6
  import { getDeviceInfo as a } from "../../modules/device/device-info.mjs";
8
7
  import "../../modules/device/index.mjs";
9
8
  import "../../honor-auth/vault/index.mjs";
9
+ import "../../apis/index.mjs";
10
+ import { ToolError as o } from "../../tools/error.mjs";
10
11
  //#region src/capabilities/node/list.ts
11
- var o = t("capabilities/node");
12
- async function s() {
13
- let t = await n();
14
- if (!t?.token || !t.userId) return o.debug("node device list skipped: no current user"), null;
12
+ var s = t("capabilities/node");
13
+ async function c(t) {
14
+ let c = await n();
15
+ if (!c?.token || !c.userId) throw s.error("node device list skipped: no current user"), new o("unauthorized", "missing current user token");
16
+ let l;
17
+ try {
18
+ l = await a();
19
+ } catch (e) {
20
+ throw s.error("node device list failed to get device info", e), new o("device_info", "failed to get device info", { cause: e });
21
+ }
15
22
  try {
16
- let e = await a(), n = await i().getDeviceList(e, t);
17
- if (!r(n)) return o.warn("node device list response not ok", { status: n.status }), { devices: [] };
18
- let s = n.data.data?.deviceList;
19
- return { devices: Array.isArray(s) ? s : [] };
23
+ let e = await i().getDeviceList(l, c, { deviceIdList: t?.deviceIdList });
24
+ if (!r(e)) {
25
+ let t = e.data?.code, n = e.data?.cnMessage;
26
+ throw s.error("node device list response not ok", null, {
27
+ status: e.status,
28
+ code: t,
29
+ cnMessage: n
30
+ }), new o("api_failed", `code=${t} message=${n}`);
31
+ }
32
+ let n = e.data.data?.deviceList;
33
+ return { devices: Array.isArray(n) ? n : [] };
20
34
  } catch (t) {
21
- return o.warn("node device list failed", { error: e(t) }), null;
35
+ throw t instanceof o ? t : (s.error("node device list failed", t), new o("network_error", e(t), { cause: t }));
22
36
  }
23
37
  }
24
38
  //#endregion
25
- export { s as listNodeDevices };
39
+ export { c as listNodeDevices };
@@ -18,7 +18,7 @@ function r(e, t) {
18
18
  let o = r.accounts?.[a];
19
19
  return {
20
20
  accountId: a,
21
- enabled: o?.enabled !== !1,
21
+ enabled: r.enabled !== !1 && o?.enabled !== !1,
22
22
  configured: o !== void 0
23
23
  };
24
24
  }
@@ -1,4 +1,4 @@
1
1
  //#region src/channel/consts.ts
2
- var e = "YOYO控虾", t = "Honor/yoyo", n = "/channels/yoyo", r = "yoyo", i = "Connect OpenClaw to Honor YOYO Assistant.";
2
+ var e = "YOYO控虾", t = "HONOR/yoyo (YOYO控虾)", n = "/channels/yoyo", r = "yoyo", i = "Connect OpenClaw to Honor YOYO Assistant.";
3
3
  //#endregion
4
4
  export { i as YOYO_CHANNEL_BLURB, r as YOYO_CHANNEL_DOCS_LABEL, n as YOYO_CHANNEL_DOCS_PATH, e as YOYO_CHANNEL_LABEL, t as YOYO_CHANNEL_SELECTION_LABEL };
@@ -2,8 +2,11 @@ import { listNodeDevices as e } from "../capabilities/node/list.mjs";
2
2
  import "../capabilities/node/index.mjs";
3
3
  //#region src/channel/directory.ts
4
4
  async function t(t) {
5
- let a = await e();
6
- return a ? i(a.devices.filter((e) => r(e)).map((e) => n(e)), t) : [];
5
+ try {
6
+ return i((await e()).devices.filter((e) => r(e)).map((e) => n(e)), t);
7
+ } catch {
8
+ return [];
9
+ }
7
10
  }
8
11
  function n(e) {
9
12
  let t = e.deviceId.trim(), n = e.deviceName?.trim() || t;
@@ -1,37 +1,21 @@
1
1
  import { clawLogger as e } from "../utils/claw-logger.mjs";
2
2
  import { disposeAccountMessaging as t } from "../messaging/dispose.mjs";
3
3
  import "../messaging/index.mjs";
4
- import { setChannelAccountStatus as n } from "../modules/status/channel.mjs";
5
- import "../modules/status/index.mjs";
6
- import { monitorAccount as r } from "../connection/monitor.mjs";
4
+ import { monitorAccount as n } from "../connection/monitor.mjs";
7
5
  import "../connection/index.mjs";
8
6
  //#region src/channel/lifecycle.ts
9
- var i = e("channel/lifecycle"), a = {
7
+ var r = e("channel/lifecycle"), i = {
10
8
  async startAccount(e) {
11
9
  let t = e.accountId;
12
- i.info("start account channel", { accountId: t });
13
- try {
14
- await r({
15
- userId: t,
16
- abortSignal: e.abortSignal
17
- });
18
- } catch (e) {
19
- throw await n(t, {
20
- running: !1,
21
- connected: !1,
22
- lastStartAt: null,
23
- lastError: "account not ready"
24
- }), e;
25
- }
10
+ r.info("start account channel", { accountId: t }), await n({
11
+ accountId: t,
12
+ abortSignal: e.abortSignal
13
+ });
26
14
  },
27
15
  async stopAccount(e) {
28
- let r = e.accountId;
29
- await t(r), await n(r, {
30
- running: !1,
31
- connected: !1,
32
- lastStopAt: Date.now()
33
- }), i.info("stop account channel", { accountId: r });
16
+ let n = e.accountId;
17
+ await t(n), r.info("stop account channel", { accountId: n });
34
18
  }
35
19
  };
36
20
  //#endregion
37
- export { a as yoyoChannelGateway };
21
+ export { i as yoyoChannelGateway };
@@ -1,8 +1,4 @@
1
- import { ClawClient as e } from "../connection/client.mjs";
2
- import { getCurrentUser as t } from "../honor-auth/vault/impl.mjs";
3
- import "../honor-auth/vault/index.mjs";
4
- import "../connection/index.mjs";
5
1
  //#region src/channel/security.ts
6
- var n = { collectWarnings: async ({ account: n }) => n.configured === !1 ? ["YOYO channel has not been configured. Run `openclaw configure (channel/yoyo)`."] : n.enabled === !1 ? ["YOYO channel is disabled. Run `openclaw configure (channel/yoyo)` to enable it."] : e.connected() ? (await t())?.token ? [] : ["YOYO channel is enabled but the Honor account is not logged in."] : ["YOYO channel WebSocket is not connected."] };
2
+ var e = { collectWarnings: async ({ account: e }) => e.configured === !1 ? ["YOYO channel has not been configured. Run `openclaw configure (channel/yoyo)`."] : e.enabled === !1 ? ["YOYO channel is disabled. Run `openclaw configure (channel/yoyo)` to enable it."] : [] };
7
3
  //#endregion
8
- export { n as yoyoChannelSecurity };
4
+ export { e as yoyoChannelSecurity };
@@ -8,12 +8,10 @@ import "../honor-auth/index.mjs";
8
8
  var s = {
9
9
  channel: e,
10
10
  async getStatus(n) {
11
- let r = a(n.cfg) !== t;
12
11
  return {
13
12
  channel: e,
14
- configured: r,
15
- statusLines: [r ? "Honor account is logged in. Selecting yoyo can switch to another account" : "Honor account is not logged in. Selecting yoyo will start Honor login."],
16
- selectionHint: r ? "Ready" : "Login Required"
13
+ configured: a(n.cfg) !== t,
14
+ statusLines: []
17
15
  };
18
16
  },
19
17
  configure: async (e) => {
@@ -1,46 +1,33 @@
1
1
  import { YOYO_DEFAULT_ACCOUNT_ID as e } from "../consts.mjs";
2
- import { getChannelAccountStatus as t } from "../modules/status/channel.mjs";
3
- import "../modules/status/index.mjs";
4
- //#region src/channel/status.ts
5
- var n = {
6
- accountId: e,
7
- enabled: !1,
8
- configured: !1,
9
- running: !1,
10
- connected: !1
11
- }, r = {
12
- defaultRuntime: n,
13
- buildChannelSummary: async ({ account: e, defaultAccountId: n, snapshot: r }) => {
14
- let i = await t(e.accountId);
15
- return {
16
- accountId: e.accountId,
17
- defaultAccountId: n,
18
- configured: e.configured,
19
- enabled: e.enabled,
20
- brand: "honor",
21
- running: r.running ?? i.running,
22
- connected: r.connected ?? i.connected,
23
- lastStartAt: r.lastStartAt ?? i.lastStartAt,
24
- lastStopAt: r.lastStopAt ?? i.lastStopAt,
25
- lastError: r.lastError ?? i.lastError
26
- };
2
+ var t = {
3
+ defaultRuntime: {
4
+ accountId: e,
5
+ enabled: !1,
6
+ configured: !1,
7
+ running: !1
27
8
  },
28
- buildAccountSnapshot: async ({ account: e, runtime: r }) => {
29
- let i = await t(e.accountId), a = i.running || r?.running === !0, o = i.connected || r?.connected === !0;
30
- return {
31
- ...n,
32
- ...r,
33
- accountId: e.accountId,
34
- enabled: e.enabled,
35
- configured: e.configured,
36
- statusState: e.enabled ? o ? "connected" : "enabled" : "disabled",
37
- running: a,
38
- connected: o,
39
- lastStartAt: i.lastStartAt ?? r?.lastStartAt ?? null,
40
- lastStopAt: i.lastStopAt ?? r?.lastStopAt ?? null,
41
- lastError: i.lastError ?? r?.lastError ?? null
42
- };
43
- }
9
+ buildChannelSummary: async ({ snapshot: e }) => ({
10
+ configured: e.configured ?? !1,
11
+ running: e.running ?? !1,
12
+ brand: "honor",
13
+ lastStartAt: e.lastStartAt ?? null,
14
+ lastStopAt: e.lastStopAt ?? null,
15
+ lastError: e.lastError ?? null,
16
+ port: e.port ?? null,
17
+ probe: e.probe,
18
+ lastProbeAt: e.lastProbeAt ?? null
19
+ }),
20
+ buildAccountSnapshot: async ({ account: e, runtime: t }) => ({
21
+ accountId: e.accountId,
22
+ enabled: e.enabled,
23
+ configured: e.configured,
24
+ brand: "honor",
25
+ running: t?.running ?? !1,
26
+ lastStartAt: t?.lastStartAt ?? null,
27
+ lastStopAt: t?.lastStopAt ?? null,
28
+ lastError: t?.lastError ?? null,
29
+ port: t?.port ?? null
30
+ })
44
31
  };
45
32
  //#endregion
46
- export { r as yoyoChannelStatus };
33
+ export { t as yoyoChannelStatus };
@@ -15,8 +15,9 @@ import { V2Adapter as f } from "./protocol/v2-adapter.mjs";
15
15
  import "./protocol/index.mjs";
16
16
  import { CloudSocket as p } from "./transport/cloud-socket.mjs";
17
17
  import { CloudEventBus as m } from "./transport/event-bus.mjs";
18
- import { MessageHandler as h } from "./transport/message-handler.mjs";
19
- import { createOutboundPort as g } from "./transport/outbound-port.mjs";
18
+ import { createOutboundPort as h } from "./transport/outbound-port.mjs";
19
+ import "./transport/index.mjs";
20
+ import { MessageHandler as g } from "./transport/message-handler.mjs";
20
21
  import { buildCloudSocketConnectParams as _ } from "./utils.mjs";
21
22
  //#region src/cloud-channel/channel.ts
22
23
  var v = e("channel"), y = 3e4, b = "v2", x = class {
@@ -33,13 +34,13 @@ var v = e("channel"), y = 3e4, b = "v2", x = class {
33
34
  constructor(e) {
34
35
  this.config = e;
35
36
  let t = new m();
36
- this.protocol = e.protocol ?? b, this.messageHandler = new h(t), this.adapter = S(this.protocol), this.cloudSocket = new p({
37
+ this.protocol = e.protocol ?? b, this.messageHandler = new g(t), this.adapter = S(this.protocol), this.cloudSocket = new p({
37
38
  connectParamsProvider: this.provideConnectParams,
38
39
  onFrame: this.handleCloudFrame,
39
40
  onOpen: this.handleCloudOpen,
40
41
  onClose: this.handleCloudClose,
41
42
  onError: this.handleSocketError
42
- }), this.outbound = g(this.adapter, this.cloudSocket, e.deviceInfo), this.authorizationRefreshManager = new a({ outbound: this.outbound }), this.gatewaySessions = new r(this.adminCapability, this.outbound), c(this.gatewaySessions, t), l(this.gatewaySessions, t), s(this.adminCapability, this.outbound, t), o(this.authorizationRefreshManager, t);
43
+ }), this.outbound = h(this.adapter, this.cloudSocket, e.deviceInfo), this.authorizationRefreshManager = new a({ outbound: this.outbound }), this.gatewaySessions = new r(this.adminCapability, this.outbound), c(this.gatewaySessions, t), l(this.gatewaySessions, t), s(this.adminCapability, this.outbound, t), o(this.authorizationRefreshManager, t);
43
44
  }
44
45
  start() {
45
46
  v.info("starting connection"), this.adminCapability.start(), this.cloudSocket.start();
@@ -2,72 +2,76 @@ import { clawLogger as e } from "../../../utils/claw-logger.mjs";
2
2
  import { createDeviceToolSetUpdateAck as t } from "../../../provisioning/toolset/ack.mjs";
3
3
  import "../../../provisioning/toolset/index.mjs";
4
4
  //#region src/cloud-channel/handlers/context/handler.ts
5
- var n = e("context"), r = { style: "SOUL.md" };
6
- function i(e, t, n) {
5
+ var n = e("context"), r = { style: "SOUL.md" }, i = new Set(["DeviceToolSet", "UniversalToolSet"]);
6
+ function a(e, t, n) {
7
7
  let r = {
8
8
  adminCapability: e,
9
9
  outbound: t,
10
- updateHandlers: a(e),
11
- fetchHandlers: o(e)
12
- }, i = (e) => s(e, r);
10
+ updateHandlers: o(e),
11
+ fetchHandlers: s(e)
12
+ }, i = (e) => c(e, r);
13
13
  n.register("fetchContexts", i), n.register("updateContexts", i);
14
14
  }
15
- function a(e) {
15
+ function o(e) {
16
16
  return {
17
17
  style: (t) => e.setAgentFile(r.style, typeof t?.content == "string" ? t.content : ""),
18
18
  "model.primary": (t) => e.switchPrimaryModel(typeof t?.provider == "string" ? t.provider : "", typeof t?.id == "string" ? t.id : ""),
19
- DeviceToolSet: f,
20
- UniversalToolSet: f
19
+ DeviceToolSet: p,
20
+ UniversalToolSet: p
21
21
  };
22
22
  }
23
- function o(e) {
23
+ function s(e) {
24
24
  return {
25
25
  skills: () => e.getSkillsStatus(),
26
26
  "models.list": () => e.getModelList()
27
27
  };
28
28
  }
29
- async function s(e, t) {
30
- let { from: r, payload: i } = e, a = i.msgType, o = a === "updateContexts", s = r.deviceId;
29
+ async function c(e, t) {
30
+ let { from: r, payload: a } = e, o = a.msgType, s = o === "updateContexts", c = r.deviceId;
31
31
  n.info("handling context request", {
32
- msgType: a,
33
- sourceDeviceId: s
32
+ msgType: o,
33
+ sourceDeviceId: c
34
34
  });
35
- let f = e.data?.contexts?.[0], p = c(f);
36
- if (!p.valid || !p.context) {
37
- l(t.outbound, a, e, f, p.error ?? "Invalid context");
35
+ let p = e.data?.contexts?.[0], m = l(p);
36
+ if (!m.valid || !m.context) {
37
+ u(t.outbound, o, e, p, m.error ?? "Invalid context");
38
38
  return;
39
39
  }
40
- let m = p.context, h = m.header.name;
40
+ let h = m.context, g = h.header.name;
41
+ s && i.has(g) && (h.payload = {
42
+ ...h.payload,
43
+ nodeId: c
44
+ });
41
45
  try {
42
- let r = o ? t.updateHandlers[h] : t.fetchHandlers[h];
46
+ let r = s ? t.updateHandlers[g] : t.fetchHandlers[g];
43
47
  if (!r) {
44
- l(t.outbound, a, e, f, `Unsupported context name: ${h}`);
48
+ u(t.outbound, o, e, p, `Unsupported context name: ${g}`);
45
49
  return;
46
50
  }
47
- if (d(o, h) && !await t.adminCapability.waitForReady()) {
48
- l(t.outbound, a, e, m, "Admin gateway client not ready");
51
+ if (f(s, g) && !await t.adminCapability.waitForReady()) {
52
+ u(t.outbound, o, e, h, "Admin gateway client not ready");
49
53
  return;
50
54
  }
51
- let i = o ? await r(m.payload, m) : await r();
55
+ let i = s ? await r(h.payload, h) : await r();
52
56
  if (i.noReply) {
53
- n.info(`${o ? "update" : "fetch"} context processed (no reply)`, { contextName: h });
57
+ n.info(`${s ? "update" : "fetch"} context processed (no reply)`, { contextName: g });
54
58
  return;
55
59
  }
56
- i.ok ? (n.info(`${o ? "update" : "fetch"} context successfully`), u(t.outbound, a, e, f, i.responsePayload ?? {
60
+ i.ok ? (n.info(`${s ? "update" : "fetch"} context successfully`), d(t.outbound, o, e, p, i.responsePayload ?? {
57
61
  ok: !0,
58
62
  ...i.data
59
- })) : (n.error(`failed to ${o ? "update" : "fetch"} context`, void 0, { error: i.error }), u(t.outbound, a, e, f, i.responsePayload ?? {
63
+ })) : (n.error(`failed to ${s ? "update" : "fetch"} context`, i.error, { contextName: g }), d(t.outbound, o, e, p, i.responsePayload ?? {
60
64
  ok: !1,
61
65
  error: i.error,
62
66
  ...i.data,
63
- ...o && { name: h }
67
+ ...s && { name: g }
64
68
  }));
65
69
  } catch (r) {
66
70
  let i = r instanceof Error ? r.message : String(r);
67
- n.error(`error ${o ? "updating" : "fetching"} context`, r, { contextName: h }), l(t.outbound, a, e, f, i);
71
+ n.error(`error ${s ? "updating" : "fetching"} context`, r, { contextName: g }), u(t.outbound, o, e, p, i);
68
72
  }
69
73
  }
70
- function c(e) {
74
+ function l(e) {
71
75
  return e?.header?.name ? {
72
76
  valid: !0,
73
77
  context: e
@@ -76,13 +80,13 @@ function c(e) {
76
80
  error: "Missing context name"
77
81
  };
78
82
  }
79
- function l(e, t, r, i, a) {
80
- n.error(a), u(e, t, r, i, {
83
+ function u(e, t, r, i, a) {
84
+ n.error(a), d(e, t, r, i, {
81
85
  ok: !1,
82
86
  error: a
83
87
  });
84
88
  }
85
- function u(e, t, n, r, i) {
89
+ function d(e, t, n, r, i) {
86
90
  let a = [{
87
91
  header: r?.header ?? {
88
92
  name: "unknown",
@@ -90,15 +94,16 @@ function u(e, t, n, r, i) {
90
94
  },
91
95
  payload: i
92
96
  }];
93
- e.reply(n, {
97
+ e.send({
98
+ replyTo: n,
94
99
  msgType: t,
95
100
  data: { contexts: a }
96
101
  });
97
102
  }
98
- function d(e, t) {
99
- return !e || t !== "DeviceToolSet" && t !== "UniversalToolSet";
103
+ function f(e, t) {
104
+ return !e || !i.has(t);
100
105
  }
101
- async function f(e, n) {
106
+ async function p(e, n) {
102
107
  let r = await t({
103
108
  namespace: n?.header.namespace,
104
109
  payload: e
@@ -110,4 +115,4 @@ async function f(e, n) {
110
115
  };
111
116
  }
112
117
  //#endregion
113
- export { i as registerContextHandler };
118
+ export { a as registerContextHandler };
@@ -5,7 +5,7 @@ import { emitStatusEvent as r } from "../../modules/status/global.mjs";
5
5
  import { RecurringTimer as i } from "../../utils/recurring-timer.mjs";
6
6
  import a from "ws";
7
7
  //#region src/cloud-channel/transport/cloud-socket.ts
8
- var o = e("cloud-socket"), s = 3e4, c = 4e3, l = 1e3, u = 2, d = 999, f = class {
8
+ var o = e("cloud-socket"), s = 3e4, c = 16e3, l = 1e3, u = 2, d = 999, f = class {
9
9
  ws = null;
10
10
  options;
11
11
  retryCount = 0;
@@ -114,7 +114,7 @@ var o = e("cloud-socket"), s = 3e4, c = 4e3, l = 1e3, u = 2, d = 999, f = class
114
114
  }), this.retryTimer.start(() => void this.connect(!0), e);
115
115
  }
116
116
  calculateRetryDelay() {
117
- let e = l * u ** Math.min(this.retryCount, 2);
117
+ let e = l * u ** Math.min(this.retryCount, 4);
118
118
  return Math.min(e, c);
119
119
  }
120
120
  sendPing = () => {
@@ -0,0 +1 @@
1
+ import "./outbound-port.mjs";
@@ -1,38 +1,32 @@
1
- import { buildEndpoint as e } from "../protocol/target.mjs";
2
- import { uuid as t } from "../../utils/id.mjs";
1
+ import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
+ import { buildEndpoint as t } from "../protocol/target.mjs";
3
+ import { uuid as n } from "../../utils/id.mjs";
3
4
  //#region src/cloud-channel/transport/outbound-port.ts
4
- function n(n, i, a) {
5
- let o = e("yoyoclaw", a.deviceId, a.port);
6
- return {
7
- send(e) {
8
- let a = r(o, e, {
9
- traceId: t(),
10
- timestamp: Date.now()
11
- });
12
- return i.send(n.serialize(a), e.silent);
13
- },
14
- reply(e, t) {
15
- let a = r(o, {
16
- to: e.from,
17
- msgType: t.msgType ?? e.payload.msgType,
18
- data: t.data,
19
- bizExtInfo: t.bizExtInfo
20
- }, e.payload.traceInfo);
21
- return i.send(n.serialize(a));
22
- }
23
- };
5
+ function r(r, a, o) {
6
+ let s = e("outbound");
7
+ return { send(e) {
8
+ let c = !!e.replyTo, l = e.replyTo, u = c && l ? l.from : e.to;
9
+ if (!u) return s.warn("missing 'to' and no replyTo", { msgType: e.msgType }), !1;
10
+ let d = c && l ? l.payload.traceInfo : {
11
+ traceId: n(),
12
+ timestamp: Date.now()
13
+ };
14
+ if (!d) return s.warn("replyTo missing traceInfo", { msgType: e.msgType }), !1;
15
+ let f = i(t("yoyoclaw", o.deviceId, o.port), u, e.msgType, d, e.data, e.bizExtInfo);
16
+ return a.send(r.serialize(f), e.silent);
17
+ } };
24
18
  }
25
- function r(e, t, n) {
19
+ function i(e, t, n, r, i, a) {
26
20
  return {
27
21
  from: e,
28
- to: t.to,
22
+ to: t,
29
23
  payload: {
30
- msgType: t.msgType,
31
- traceInfo: n,
32
- ...t.bizExtInfo ? { bizExtInfo: t.bizExtInfo } : {}
24
+ msgType: n,
25
+ traceInfo: r,
26
+ ...a ? { bizExtInfo: a } : {}
33
27
  },
34
- ...t.data ? { data: t.data } : {}
28
+ ...i ? { data: i } : {}
35
29
  };
36
30
  }
37
31
  //#endregion
38
- export { n as createOutboundPort };
32
+ export { r as createOutboundPort };
@@ -1,21 +1,21 @@
1
1
  import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
- import { setYoyoChannelAccountEnabled as t } from "../../modules/configs/channel.mjs";
3
- import { loadConfig as n, saveConfig as r } from "../../modules/configs/config-store.mjs";
2
+ import { loadConfig as t, saveConfig as n } from "../../modules/configs/config-store.mjs";
3
+ import { patchYoyoChannelConfig as r, setAllYoyoChannelAccountsEnabled as i, setYoyoChannelAccountEnabled as a } from "../../modules/configs/channel.mjs";
4
4
  import "../../modules/configs/index.mjs";
5
- import { performLogin as i } from "../../honor-auth/login/impl.mjs";
5
+ import { performLogin as o } from "../../honor-auth/login/impl.mjs";
6
6
  import "../../honor-auth/index.mjs";
7
7
  //#region src/commands/login/impl.ts
8
- var a = e("login-cli");
9
- function o(e, o) {
10
- o.command("login").description("login to yoyoclaw and register devices").option("-u, --uid <userId>", "login with a specific user ID").option("--token <token>", "login with a specific token").action(async (e) => {
11
- let { uid: o, token: s } = e;
12
- if (a.debug("login CLI command called"), o && s) throw Error("please provide either --uid or --token, not both");
13
- let c = await i({
14
- userId: o,
15
- token: s
8
+ var s = e("login-cli");
9
+ function c(e, c) {
10
+ c.command("login").description("login to yoyoclaw and register devices").option("-u, --uid <userId>", "login with a specific user ID").option("--token <token>", "login with a specific token").action(async (e) => {
11
+ let { uid: c, token: l } = e;
12
+ if (s.debug("login CLI command called"), c && l) throw Error("please provide either --uid or --token, not both");
13
+ let u = await o({
14
+ userId: c,
15
+ token: l
16
16
  });
17
- c && (await r(t(n(), c.userId, !0)), console.log("✅ yoyo channel account enabled."));
17
+ u && (await n(r(a(i(t(), !1), u.userId, !0), { enabled: !0 })), console.log("✅ yoyo channel account enabled."));
18
18
  });
19
19
  }
20
20
  //#endregion
21
- export { o as registerLoginCommand };
21
+ export { c as registerLoginCommand };
@@ -1,29 +1,29 @@
1
1
  import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
- import { getCurrentUser as t } from "../../honor-auth/vault/impl.mjs";
3
- import { getEnvInfo as n } from "../../modules/configs/plugin.mjs";
2
+ import { getEnvInfo as t } from "../../modules/configs/plugin.mjs";
4
3
  import "../../modules/configs/index.mjs";
5
- import { getDeviceInfo as r } from "../../modules/device/device-info.mjs";
4
+ import { ensureStatusLoaded as n } from "../../modules/status/global.mjs";
5
+ import { getCurrentUser as r } from "../../honor-auth/vault/impl.mjs";
6
+ import { getDeviceInfo as i } from "../../modules/device/device-info.mjs";
6
7
  import "../../honor-auth/vault/index.mjs";
7
- import { ensureStatusLoaded as i } from "../../modules/status/global.mjs";
8
8
  import "../../modules/status/index.mjs";
9
9
  //#region src/commands/status/index.ts
10
10
  var a = e("status-cli");
11
11
  function o(e, o) {
12
12
  o.command("status").description("Show YOYOClaw connection status").action(async () => {
13
- if (a.debug("status CLI command called"), !await t()) {
13
+ if (a.debug("status CLI command called"), !await r()) {
14
14
  console.log("🚫 You need to login first. Please run: openclaw honor login");
15
15
  return;
16
16
  }
17
- let e = await i();
17
+ let e = await n();
18
18
  if (!await e.hasPersistedStatus()) {
19
19
  console.log("\n📭 No connection status record yet."), console.log(" The connection service has not been started, or has never persisted a status."), console.log(" The service runs with the host process; please check that it is active.");
20
20
  return;
21
21
  }
22
22
  let o = e.getStatus(), c = null;
23
23
  try {
24
- c = await r();
24
+ c = await i();
25
25
  } catch {}
26
- let l = n();
26
+ let l = t();
27
27
  s(o, c, l);
28
28
  });
29
29
  }