@honor-claw/yoyo 2026.9.3-alpha.2 → 2026.9.3-beta.1

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 (72) hide show
  1. package/dist/capabilities/cloud-invoke/invoke.mjs +11 -11
  2. package/dist/capabilities/node/index.mjs +0 -1
  3. package/dist/capabilities/node/invoke.mjs +4 -4
  4. package/dist/capabilities/node/list.mjs +9 -9
  5. package/dist/capabilities/remote-file/remote-file.mjs +11 -11
  6. package/dist/channel/lifecycle.mjs +1 -1
  7. package/dist/cli/login/impl.mjs +11 -12
  8. package/dist/cloud-channel/channel.mjs +33 -34
  9. package/dist/cloud-channel/handlers/context/handler.mjs +50 -56
  10. package/dist/cloud-channel/protocol/v2-adapter.mjs +1 -3
  11. package/dist/command/help.mjs +6 -9
  12. package/dist/command/index.mjs +12 -15
  13. package/dist/command/parser.mjs +10 -14
  14. package/dist/core/hooks/entry.mjs +7 -8
  15. package/dist/core/hooks/gateway-lifecycle.mjs +10 -13
  16. package/dist/core/hooks/prompt.mjs +1 -1
  17. package/dist/core/prompt/builder.mjs +10 -12
  18. package/dist/diagnose/collectors/account.mjs +1 -1
  19. package/dist/honor-auth/browser/flow.mjs +13 -13
  20. package/dist/honor-auth/login/impl.mjs +4 -4
  21. package/dist/honor-auth/logout.mjs +7 -7
  22. package/dist/honor-auth/vault/legacy-migration.mjs +8 -8
  23. package/dist/messaging/dispatchers/stream/session.mjs +38 -38
  24. package/dist/messaging/inbound/context.mjs +18 -19
  25. package/dist/messaging/index.mjs +0 -6
  26. package/dist/messaging/send/frame.mjs +17 -36
  27. package/dist/messaging/send/text.mjs +16 -14
  28. package/dist/messaging/target/address.mjs +11 -14
  29. package/dist/messaging/target/index.mjs +0 -1
  30. package/dist/messaging/target/outbound.mjs +13 -20
  31. package/dist/modules/configs/agent-defaults.mjs +12 -15
  32. package/dist/modules/configs/index.mjs +0 -1
  33. package/dist/modules/configs/plugin-init.mjs +1 -1
  34. package/dist/modules/device/device-info.mjs +1 -1
  35. package/dist/provisioning/registration/register.mjs +8 -8
  36. package/dist/schemas.mjs +1 -5
  37. package/dist/tools/index.mjs +3 -5
  38. package/dist/tools/remote-file-upload/run.mjs +19 -19
  39. package/openclaw.plugin.json +1 -2
  40. package/package.json +1 -1
  41. package/skills/yoyo-phone-control/SKILL.md +0 -314
  42. package/skills/yoyo-phone-control/mcptools/adjust_brightness.json +10 -10
  43. package/skills/yoyo-phone-control/mcptools/create_schedule.json +3 -3
  44. package/skills/yoyo-phone-control/mcptools/device_operation.json +2 -2
  45. package/skills/yoyo-phone-control/mcptools/modify_schedule.json +8 -0
  46. package/skills/yoyo-phone-control/mcptools/screen_recorder.json +1 -1
  47. package/skills/yoyo-phone-control/mcptools/search_message.json +5 -21
  48. package/skills/yoyo-phone-control/mcptools/vibration_mode.json +1 -1
  49. package/skills/yoyo-phone-control/mcptools/volume.json +12 -12
  50. package/dist/capabilities/cron/delivery-capture.mjs +0 -49
  51. package/dist/capabilities/cron/events.mjs +0 -93
  52. package/dist/capabilities/cron/index.mjs +0 -3
  53. package/dist/capabilities/cron/service.mjs +0 -140
  54. package/dist/capabilities/node/device-target.mjs +0 -49
  55. package/dist/cloud-channel/handlers/context/cron.mjs +0 -58
  56. package/dist/cloud-channel/handlers/push-inbound.mjs +0 -8
  57. package/dist/command/mock/handler.mjs +0 -92
  58. package/dist/command/mock/help.mjs +0 -10
  59. package/dist/command/mock/index.mjs +0 -3
  60. package/dist/command/mock/parser.mjs +0 -18
  61. package/dist/core/hooks/cron-observer.mjs +0 -26
  62. package/dist/core/prompt/cron.mjs +0 -19
  63. package/dist/messaging/notification/inbound.mjs +0 -66
  64. package/dist/messaging/notification/index.mjs +0 -4
  65. package/dist/messaging/notification/notify.mjs +0 -28
  66. package/dist/messaging/notification/outbox.mjs +0 -148
  67. package/dist/messaging/notification/types.mjs +0 -6
  68. package/dist/modules/configs/owner-allow-from.mjs +0 -53
  69. package/dist/tools/send-message/index.mjs +0 -2
  70. package/dist/tools/send-message/tool.mjs +0 -71
  71. package/dist/tools/send-message/types.mjs +0 -8
  72. package/skills/yoyo-phone-control/mcptools/memorySearch.json +0 -100
@@ -1,16 +1,16 @@
1
1
  import { toErrorMessage as e } from "../../utils/error.mjs";
2
2
  import { clawLogger as t } from "../../utils/claw-logger.mjs";
3
- import { createClawCloudClient as n } from "../../apis/claw-cloud.mjs";
4
- import "../../apis/index.mjs";
5
- import { HonorAccount as r } from "../../honor-auth/vault/impl.mjs";
3
+ import { HonorAccount as n } from "../../honor-auth/vault/impl.mjs";
4
+ import { createClawCloudClient as r } from "../../apis/claw-cloud.mjs";
6
5
  import { loadDeviceInfo as i } from "../../modules/device/device-info.mjs";
7
6
  import "../../modules/device/index.mjs";
8
7
  import "../../honor-auth/vault/index.mjs";
8
+ import "../../apis/index.mjs";
9
9
  import { ToolError as a } from "../../tools/error.mjs";
10
10
  //#region src/capabilities/cloud-invoke/invoke.ts
11
11
  var o = t("capabilities");
12
12
  async function s(t) {
13
- let s = await r.fromUser().current();
13
+ let s = await n.fromUser().current();
14
14
  if (!s?.token || !s.userId) throw o.error("cloud invoke skipped: no current user"), new a("unauthorized", "missing current user token");
15
15
  let c;
16
16
  try {
@@ -19,19 +19,19 @@ async function s(t) {
19
19
  throw o.error("cloud invoke failed to get device info", e), new a("ctx missing", "failed to get device info", { cause: e });
20
20
  }
21
21
  try {
22
- let e = await n().invokeCloudTool(c, s, {
22
+ let e = await r().invokeCloudTool(c, s, {
23
23
  serviceId: t.toolId,
24
24
  pluginParams: t.params ?? {},
25
25
  ...t.timeoutMs === void 0 ? {} : { timeoutMs: t.timeoutMs }
26
- }), r = e.data, i = e.status >= 200 && e.status < 300, l = r?.code === "0", u = r?.code === "ICS-500";
26
+ }), n = e.data, i = e.status >= 200 && e.status < 300, l = n?.code === "0", u = n?.code === "ICS-500";
27
27
  if (!i || !l && !u) throw o.error("cloud invoke response not ok", null, {
28
28
  status: e.status,
29
- code: r?.code,
30
- cnMessage: r?.cnMessage,
31
- cpErrorCode: r?.data?.cpErrorCode
32
- }), new a("api_failed", `code=${r?.code ?? "-"} cpErrorCode=${r?.data?.cpErrorCode ?? "-"} message=${r?.cnMessage ?? "-"}`);
29
+ code: n?.code,
30
+ cnMessage: n?.cnMessage,
31
+ cpErrorCode: n?.data?.cpErrorCode
32
+ }), new a("api_failed", `code=${n?.code ?? "-"} cpErrorCode=${n?.data?.cpErrorCode ?? "-"} message=${n?.cnMessage ?? "-"}`);
33
33
  return {
34
- ...r.data === void 0 ? {} : { pluginResponse: r.data },
34
+ ...n.data === void 0 ? {} : { pluginResponse: n.data },
35
35
  code: e.data.code,
36
36
  cnMessage: e.data.cnMessage
37
37
  };
@@ -1,5 +1,4 @@
1
1
  import "./list.mjs";
2
- import "./device-target.mjs";
3
2
  import "./directory.mjs";
4
3
  import "./invoke.mjs";
5
4
  import "./types.mjs";
@@ -1,13 +1,13 @@
1
1
  import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
2
  import { buildEndpoint as t } from "../../cloud-channel/protocol/target.mjs";
3
3
  import { resolveEnabledYoyoAccountId as n } from "../../modules/configs/channel.mjs";
4
- import { resolveOutboundTraceInfo as r } from "../../messaging/trace/tool-context.mjs";
4
+ import { ClawClient as r } from "../../connection/registry.mjs";
5
+ import { resolveOutboundTraceInfo as i } from "../../messaging/trace/tool-context.mjs";
5
6
  import "../../messaging/trace/index.mjs";
6
- import { ClawClient as i } from "../../connection/registry.mjs";
7
7
  //#region src/capabilities/node/invoke.ts
8
8
  var a = e("capabilities");
9
9
  async function o(e) {
10
- let a = r(e.toolCallId), o = {
10
+ let a = i(e.toolCallId), o = {
11
11
  to: t("node", e.nodeId),
12
12
  msgType: "nodeInvokeRequest",
13
13
  data: { node: {
@@ -18,7 +18,7 @@ async function o(e) {
18
18
  } },
19
19
  ...a ? { traceInfo: a } : {}
20
20
  }, c = n();
21
- return i.forAccount(c).request(o, {
21
+ return r.forAccount(c).request(o, {
22
22
  timeoutMs: e.timeoutMs,
23
23
  matchResult: s(e.toolCallId)
24
24
  });
@@ -1,12 +1,12 @@
1
1
  import { toErrorMessage as e } from "../../utils/error.mjs";
2
2
  import { clawLogger as t } from "../../utils/claw-logger.mjs";
3
- import { isOKResponse as n } from "../../apis/helpers.mjs";
4
- import { createClawCloudClient as r } from "../../apis/claw-cloud.mjs";
5
- import "../../apis/index.mjs";
6
- import { HonorAccount as i } from "../../honor-auth/vault/impl.mjs";
3
+ import { HonorAccount as n } from "../../honor-auth/vault/impl.mjs";
4
+ import { isOKResponse as r } from "../../apis/helpers.mjs";
5
+ import { createClawCloudClient as i } from "../../apis/claw-cloud.mjs";
7
6
  import { loadDeviceInfo 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
10
  import { ToolError as o } from "../../tools/error.mjs";
11
11
  import { DeviceStatus as s } from "../../types.mjs";
12
12
  //#region src/capabilities/node/list.ts
@@ -21,7 +21,7 @@ function l(e) {
21
21
  };
22
22
  }
23
23
  async function u(t) {
24
- let s = await i.fromUser().current();
24
+ let s = await n.fromUser().current();
25
25
  if (!s?.token || !s.userId) throw c.error("node device list skipped: no current user"), new o("unauthorized", "missing current user token");
26
26
  let u;
27
27
  try {
@@ -30,8 +30,8 @@ async function u(t) {
30
30
  throw c.error("node device list failed to get device info", e), new o("device_info", "failed to get device info", { cause: e });
31
31
  }
32
32
  try {
33
- let e = await r().getDeviceList(u, s, { deviceIdList: t?.deviceIdList });
34
- if (!n(e)) {
33
+ let e = await i().getDeviceList(u, s, { deviceIdList: t?.deviceIdList });
34
+ if (!r(e)) {
35
35
  let t = e.data?.code, n = e.data?.cnMessage;
36
36
  throw c.error("node device list response not ok", null, {
37
37
  status: e.status,
@@ -39,8 +39,8 @@ async function u(t) {
39
39
  cnMessage: n
40
40
  }), new o("api_failed", `code=${t} message=${n}`);
41
41
  }
42
- let i = e.data.data?.deviceList;
43
- return { devices: Array.isArray(i) ? i.map(l) : [] };
42
+ let n = e.data.data?.deviceList;
43
+ return { devices: Array.isArray(n) ? n.map(l) : [] };
44
44
  } catch (t) {
45
45
  throw t instanceof o ? t : (c.error("node device list failed", t), new o("network_error", e(t), { cause: t }));
46
46
  }
@@ -1,41 +1,41 @@
1
1
  import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
- import { isClawResponseOk as t } from "../../apis/helpers.mjs";
3
- import { createClawCloudClient as n } from "../../apis/claw-cloud.mjs";
4
- import "../../apis/index.mjs";
5
- import { HonorAccount as r } from "../../honor-auth/vault/impl.mjs";
2
+ import { HonorAccount as t } from "../../honor-auth/vault/impl.mjs";
3
+ import { isClawResponseOk as n } from "../../apis/helpers.mjs";
4
+ import { createClawCloudClient as r } from "../../apis/claw-cloud.mjs";
6
5
  import { loadDeviceInfo as i } from "../../modules/device/device-info.mjs";
7
6
  import "../../modules/device/index.mjs";
8
7
  import "../../honor-auth/vault/index.mjs";
8
+ import "../../apis/index.mjs";
9
9
  import { ToolError as a } from "../../tools/error.mjs";
10
10
  import { errorLogMeta as o, normalizeNetworkError as s, normalizeUploadLinkError as c } from "./normalize.mjs";
11
11
  //#region src/capabilities/remote-file/remote-file.ts
12
12
  var l = e("capabilities");
13
13
  async function u() {
14
- let e = await r.fromUser().current();
14
+ let e = await t.fromUser().current();
15
15
  if (!e?.token || !e.userId) throw l.error("remote file skipped: no current user"), new a("unauthorized", "missing current user token");
16
- let t;
16
+ let n;
17
17
  try {
18
- t = await i();
18
+ n = await i();
19
19
  } catch (e) {
20
20
  throw l.error("remote file failed to get device info", e), new a("device_info", "failed to get device info", { cause: e });
21
21
  }
22
22
  return {
23
- deviceInfo: t,
23
+ deviceInfo: n,
24
24
  token: e.token,
25
25
  userId: e.userId
26
26
  };
27
27
  }
28
- async function d(e, r) {
28
+ async function d(e, t) {
29
29
  let { deviceInfo: i, token: d } = await u(), f = { token: d }, p;
30
30
  try {
31
- p = await n().getUploadLink(i, f, { fileList: e }, { signal: r });
31
+ p = await r().getUploadLink(i, f, { fileList: e }, { signal: t });
32
32
  } catch (t) {
33
33
  throw t instanceof a ? t : (l.error("upload link request failed", t, {
34
34
  fileCount: e.length,
35
35
  ...o(t)
36
36
  }), s(t));
37
37
  }
38
- if (t(p)) {
38
+ if (n(p)) {
39
39
  let e = p.data.data;
40
40
  return {
41
41
  code: "OK",
@@ -2,9 +2,9 @@ import { clawLogger as e } from "../utils/claw-logger.mjs";
2
2
  import { disposeAccountMessaging as t } from "../messaging/dispose.mjs";
3
3
  import { loadConfig as n, saveConfig as r } from "../modules/configs/config-store.mjs";
4
4
  import { resolveEnabledYoyoAccountId as i, setYoyoChannelAccountEnabled as a } from "../modules/configs/channel.mjs";
5
+ import "../modules/configs/index.mjs";
5
6
  import { HonorAccount as o } from "../honor-auth/vault/impl.mjs";
6
7
  import "../honor-auth/vault/index.mjs";
7
- import "../modules/configs/index.mjs";
8
8
  import "../messaging/index.mjs";
9
9
  import { monitorAccount as s } from "../connection/monitor.mjs";
10
10
  import "../connection/index.mjs";
@@ -2,21 +2,20 @@ import { withCommandRuntime as e } from "../../core/runtime.mjs";
2
2
  import { clawLogger as t } from "../../utils/claw-logger.mjs";
3
3
  import { loadConfig as n, saveConfig as r } from "../../modules/configs/config-store.mjs";
4
4
  import { patchYoyoChannelConfig as i, resolveEnabledYoyoAccountId as a, setAllYoyoChannelAccountsEnabled as o, setYoyoChannelAccountEnabled as s } from "../../modules/configs/channel.mjs";
5
- import { refreshOwnerAllowFrom as c } from "../../modules/configs/owner-allow-from.mjs";
6
5
  import "../../modules/configs/index.mjs";
7
- import { performLogin as l } from "../../honor-auth/login/impl.mjs";
6
+ import { performLogin as c } from "../../honor-auth/login/impl.mjs";
8
7
  import "../../honor-auth/index.mjs";
9
8
  //#region src/cli/login/impl.ts
10
- var u = t("login-cli");
11
- function d(t, d) {
12
- d.command("login").description("login to Honor and register devices").option("-u, --uid <userId>", "login with a specific user ID").option("--token <token>", "login with a specific token").action(async (d) => e(t.runtime, async () => {
13
- let { token: e } = d;
14
- u.debug("login CLI command called");
15
- let t = a(), f = await l({ token: e });
16
- if (!f) return;
17
- let p = o((await c(n())).config, !1);
18
- t && t === f.userId && await r(p), await r(i(s(p, f.userId, !0), { enabled: !0 })), console.log("✅ yoyo channel account enabled.");
9
+ var l = t("login-cli");
10
+ function u(t, u) {
11
+ u.command("login").description("login to Honor and register devices").option("-u, --uid <userId>", "login with a specific user ID").option("--token <token>", "login with a specific token").action(async (u) => e(t.runtime, async () => {
12
+ let { token: e } = u;
13
+ l.debug("login CLI command called");
14
+ let t = a(), d = await c({ token: e });
15
+ if (!d) return;
16
+ let f = o(n(), !1);
17
+ t && t === d.userId && await r(f), await r(i(s(f, d.userId, !0), { enabled: !0 })), console.log("✅ yoyo channel account enabled.");
19
18
  }));
20
19
  }
21
20
  //#endregion
22
- export { d as registerLoginCommand };
21
+ export { u as registerLoginCommand };
@@ -9,20 +9,19 @@ import { registerAuthHandler as o } from "./handlers/auth.mjs";
9
9
  import { registerContextHandler as s } from "./handlers/context/handler.mjs";
10
10
  import "./handlers/context/index.mjs";
11
11
  import { registerPairingHandler as c } from "./handlers/pairing.mjs";
12
- import { registerPushInboundHandler as l } from "./handlers/push-inbound.mjs";
13
- import { registerUserMessageHandler as u } from "./handlers/user-message.mjs";
14
- import { summarizeServiceEvent as d } from "./log-summary.mjs";
15
- import { V1Adapter as f } from "./protocol/v1-adapter.mjs";
16
- import { V2Adapter as p } from "./protocol/v2-adapter.mjs";
12
+ import { registerUserMessageHandler as l } from "./handlers/user-message.mjs";
13
+ import { summarizeServiceEvent as u } from "./log-summary.mjs";
14
+ import { V1Adapter as d } from "./protocol/v1-adapter.mjs";
15
+ import { V2Adapter as f } from "./protocol/v2-adapter.mjs";
17
16
  import "./protocol/index.mjs";
18
- import { UNEXPECTED_RAW_CODE_SEMANTICS as m } from "./protocol/semantics.mjs";
19
- import { CloudSocket as h } from "./transport/cloud-socket.mjs";
20
- import { CloudEventBus as g } from "./transport/event-bus.mjs";
21
- import { MessageHandler as _ } from "./transport/message-handler.mjs";
17
+ import { UNEXPECTED_RAW_CODE_SEMANTICS as p } from "./protocol/semantics.mjs";
18
+ import { CloudSocket as m } from "./transport/cloud-socket.mjs";
19
+ import { CloudEventBus as h } from "./transport/event-bus.mjs";
20
+ import { MessageHandler as g } from "./transport/message-handler.mjs";
22
21
  import "./transport/index.mjs";
23
- import { buildCloudSocketConnectParams as v } from "./utils.mjs";
22
+ import { buildCloudSocketConnectParams as _ } from "./utils.mjs";
24
23
  //#region src/cloud-channel/channel.ts
25
- var y = e("cloud-channel"), b = 3e4, x = "v2", S = class {
24
+ var v = e("cloud-channel"), y = 3e4, b = "v2", x = class {
26
25
  config;
27
26
  cloudSocket;
28
27
  gatewaySessions;
@@ -35,8 +34,8 @@ var y = e("cloud-channel"), b = 3e4, x = "v2", S = class {
35
34
  businessPingTimer = new r("recurring");
36
35
  constructor(e) {
37
36
  this.config = e;
38
- let t = new g();
39
- this.protocol = e.protocol ?? x, this.context = { accountId: e.accountId }, this.messageHandler = new _(t, this.context), this.adapter = C(this.protocol), this.cloudSocket = new h({
37
+ let t = new h();
38
+ this.protocol = e.protocol ?? b, this.context = { accountId: e.accountId }, this.messageHandler = new g(t, this.context), this.adapter = S(this.protocol), this.cloudSocket = new m({
40
39
  loadConnectParams: this.provideConnectParams,
41
40
  onFrame: this.handleCloudFrame,
42
41
  onOpen: this.handleCloudOpen,
@@ -48,78 +47,78 @@ var y = e("cloud-channel"), b = 3e4, x = "v2", S = class {
48
47
  }), this.authorizationRefreshManager = new i({
49
48
  accountId: e.accountId,
50
49
  outbound: this.dispatcher
51
- }), this.gatewaySessions = new n(this.dispatcher), c(this.gatewaySessions, t), u(this.gatewaySessions, t), s(this.dispatcher, t), o(this.authorizationRefreshManager, t), l(t);
50
+ }), this.gatewaySessions = new n(this.dispatcher), c(this.gatewaySessions, t), l(this.gatewaySessions, t), s(this.dispatcher, t), o(this.authorizationRefreshManager, t);
52
51
  }
53
52
  start() {
54
- y.info("starting connection"), this.cloudSocket.start();
53
+ v.info("starting connection"), this.cloudSocket.start();
55
54
  }
56
55
  destroy() {
57
- y.info("closing connection"), this.businessPingTimer.stop(), this.authorizationRefreshManager.destroy(), this.gatewaySessions.closeAll(), this.dispatcher.destroy(), this.cloudSocket.stop();
56
+ v.info("closing connection"), this.businessPingTimer.stop(), this.authorizationRefreshManager.destroy(), this.gatewaySessions.closeAll(), this.dispatcher.destroy(), this.cloudSocket.stop();
58
57
  }
59
58
  getOutboundPort() {
60
59
  return this.dispatcher;
61
60
  }
62
61
  provideConnectParams = async () => {
63
62
  let e = await this.config.credentialProvider();
64
- return e ? v(e.token, this.protocol) : null;
63
+ return e ? _(e.token, this.protocol) : null;
65
64
  };
66
65
  handleCloudOpen = () => {
67
- y.info("cloud connection established"), this.businessPingTimer.start(this.sendBusinessPing, b), this.authorizationRefreshManager.start(), this.config.onOpen?.();
66
+ v.info("cloud connection established"), this.businessPingTimer.start(this.sendBusinessPing, y), this.authorizationRefreshManager.start(), this.config.onOpen?.();
68
67
  };
69
68
  handleCloudClose = () => {
70
- y.info("cloud connection closed"), this.businessPingTimer.stop(), this.config.onClose?.();
69
+ v.info("cloud connection closed"), this.businessPingTimer.stop(), this.config.onClose?.();
71
70
  };
72
71
  sendBusinessPing = async () => {
73
72
  await this.dispatcher.send({
74
73
  to: t("yoyoclawservice"),
75
74
  msgType: "pingMessage",
76
75
  silent: !0
77
- }) || y.warn("failed to send pingMessage");
76
+ }) || v.warn("failed to send pingMessage");
78
77
  };
79
78
  handleCloudFrame = (e) => {
80
79
  let t;
81
80
  try {
82
81
  t = this.adapter.normalize(e);
83
82
  } catch (e) {
84
- y.error("protocol adapter failed", e);
83
+ v.error("protocol adapter failed", e);
85
84
  return;
86
85
  }
87
86
  switch (t.kind) {
88
87
  case "SUCCESS": {
89
88
  let e = t.serviceEvent;
90
89
  if (e.payload.msgType === "pingMessage") {
91
- y.debug("ignored inbound pingMessage", d(e));
90
+ v.debug("ignored inbound pingMessage", u(e));
92
91
  return;
93
92
  }
94
- y.debug("normalized cloud message", d(e)), this.dispatcher.consume(e), this.messageHandler.handleCloudMessage(e);
93
+ v.debug("normalized cloud message", u(e)), this.dispatcher.consume(e), this.messageHandler.handleCloudMessage(e);
95
94
  return;
96
95
  }
97
96
  case "TARGET_OFFLINE":
98
- y.info("remote device offline", { session: t.offlineSocketId }), this.gatewaySessions.closeSession(t.offlineSocketId);
97
+ v.info("remote device offline", { session: t.offlineSocketId }), this.gatewaySessions.closeSession(t.offlineSocketId);
99
98
  return;
100
99
  case "DEVICE_NOT_REGISTERED":
101
- y.info("device not registered, notifying connection layer"), this.config.onError?.({ type: "device-not-registered" });
100
+ v.info("device not registered, notifying connection layer"), this.config.onError?.({ type: "device-not-registered" });
102
101
  return;
103
102
  case "TOKEN_EXPIRED":
104
- y.warn("unauthorized by cloud, pausing refresh"), this.authorizationRefreshManager.pauseForUnauthorized();
103
+ v.warn("unauthorized by cloud, pausing refresh"), this.authorizationRefreshManager.pauseForUnauthorized();
105
104
  return;
106
105
  case "UNEXPECTED": {
107
- let e = m[t.rawCode];
108
- e ? y.warn(e, { rawCode: t.rawCode }) : y.warn("unexpected message", { rawCode: t.rawCode });
106
+ let e = p[t.rawCode];
107
+ e ? v.warn(e, { rawCode: t.rawCode }) : v.warn("unexpected message", { rawCode: t.rawCode });
109
108
  return;
110
109
  }
111
110
  case "INVALID":
112
- y.error("failed to parse message", t.error);
111
+ v.error("failed to parse message", t.error);
113
112
  return;
114
- default: y.warn("non-success control code", { kind: t.kind });
113
+ default: v.warn("non-success control code", { kind: t.kind });
115
114
  }
116
115
  };
117
116
  handleSocketError = (e) => {
118
- y.info("cloud socket error, notifying connection layer", { type: e.type }), this.config.onError?.(e);
117
+ v.info("cloud socket error, notifying connection layer", { type: e.type }), this.config.onError?.(e);
119
118
  };
120
119
  };
121
- function C(e) {
122
- return e === "v1" ? new f() : new p();
120
+ function S(e) {
121
+ return e === "v1" ? new d() : new f();
123
122
  }
124
123
  //#endregion
125
- export { S as ClawChannel };
124
+ export { x as ClawChannel };
@@ -8,39 +8,36 @@ import { switchModel as a } from "../../../capabilities/routing/model-switch.mjs
8
8
  import "../../../capabilities/routing/index.mjs";
9
9
  import { createDeviceToolSetUpdateAck as o } from "../../../provisioning/toolset/ack.mjs";
10
10
  import "../../../provisioning/toolset/index.mjs";
11
- import { CRON_LIST_CONTEXT_NAME as s, CRON_REMOVE_CONTEXT_NAME as c, cronListFetchHandler as l, cronRemoveUpdateHandler as u } from "./cron.mjs";
12
11
  //#region src/cloud-channel/handlers/context/handler.ts
13
- var d = t("cloud-handlers"), f = {
12
+ var s = t("cloud-handlers"), c = {
14
13
  style: "SOUL.md",
15
14
  soul: "SOUL.md"
16
- }, p = new Set(["DeviceToolSet", "UniversalToolSet"]), m = new Set([s, c]);
17
- function h(e, t) {
15
+ }, l = new Set(["DeviceToolSet", "UniversalToolSet"]);
16
+ function u(e, t) {
18
17
  let n = r(), i = {
19
18
  adminCapability: n,
20
19
  outbound: e,
21
- updateHandlers: g(n),
22
- fetchHandlers: _(n)
23
- }, a = (e, t) => b(e, i, t);
20
+ updateHandlers: d(n),
21
+ fetchHandlers: f(n)
22
+ }, a = (e) => h(e, i);
24
23
  t.register("fetchContexts", a), t.register("updateContexts", a);
25
24
  }
26
- function g(e) {
25
+ function d(e) {
27
26
  return {
28
- style: ({ payload: t }) => e.setAgentFile(f.style, typeof t?.content == "string" ? t.content : ""),
29
- soul: ({ payload: t }) => T(e, t),
30
- "model.primary": ({ payload: e, event: t }) => v(e, t),
31
- DeviceToolSet: ({ payload: e, context: t }) => E(e, t),
32
- UniversalToolSet: ({ payload: e, context: t }) => E(e, t),
33
- [c]: u
27
+ style: ({ payload: t }) => e.setAgentFile(c.style, typeof t?.content == "string" ? t.content : ""),
28
+ soul: ({ payload: t }) => b(e, t),
29
+ "model.primary": ({ payload: e, event: t }) => p(e, t),
30
+ DeviceToolSet: ({ payload: e, context: t }) => x(e, t),
31
+ UniversalToolSet: ({ payload: e, context: t }) => x(e, t)
34
32
  };
35
33
  }
36
- function _(e) {
34
+ function f(e) {
37
35
  return {
38
36
  skills: () => e.getSkillsStatus(),
39
- "models.list": ({ event: e }) => y(e),
40
- [s]: l
37
+ "models.list": ({ event: e }) => m(e)
41
38
  };
42
39
  }
43
- async function v(e, t) {
40
+ async function p(e, t) {
44
41
  let r = typeof e?.provider == "string" ? e.provider : "", i = typeof e?.id == "string" ? e.id : "", o = await a({
45
42
  accountId: n(),
46
43
  deviceId: t.from.deviceId,
@@ -59,7 +56,7 @@ async function v(e, t) {
59
56
  }
60
57
  };
61
58
  }
62
- async function y(e) {
59
+ async function m(e) {
63
60
  let t = await i(n(), e.from.deviceId ?? "");
64
61
  return t.ok ? {
65
62
  ok: !0,
@@ -69,59 +66,56 @@ async function y(e) {
69
66
  error: t.error
70
67
  };
71
68
  }
72
- async function b(t, n, r) {
73
- let { from: i, payload: a } = t, o = a.msgType, s = o === "updateContexts", c = i.deviceId;
74
- d.info("handling context request", {
75
- msgType: o,
69
+ async function h(t, n) {
70
+ let { from: r, payload: i } = t, a = i.msgType, o = a === "updateContexts", c = r.deviceId;
71
+ s.info("handling context request", {
72
+ msgType: a,
76
73
  sourceDeviceId: c
77
74
  });
78
- let l = t.data?.contexts?.[0], u = x(l);
79
- if (!u.valid || !u.context) {
80
- await S(n.outbound, o, t, l, u.error ?? "Invalid context");
75
+ let u = t.data?.contexts?.[0], d = g(u);
76
+ if (!d.valid || !d.context) {
77
+ await _(n.outbound, a, t, u, d.error ?? "Invalid context");
81
78
  return;
82
79
  }
83
- let f = u.context, m = f.header.name;
84
- s && p.has(m) && (f.payload = {
80
+ let f = d.context, p = f.header.name;
81
+ o && l.has(p) && (f.payload = {
85
82
  ...f.payload,
86
83
  nodeId: c
87
84
  });
88
85
  try {
89
- let e = s ? n.updateHandlers[m] : n.fetchHandlers[m];
86
+ let e = o ? n.updateHandlers[p] : n.fetchHandlers[p];
90
87
  if (!e) {
91
- await S(n.outbound, o, t, l, `Unsupported context name: ${m}`);
88
+ await _(n.outbound, a, t, u, `Unsupported context name: ${p}`);
92
89
  return;
93
90
  }
94
- if (w(s, m) && !await n.adminCapability.waitForReady()) {
95
- await S(n.outbound, o, t, f, "Admin gateway client not ready");
91
+ if (y(o, p) && !await n.adminCapability.waitForReady()) {
92
+ await _(n.outbound, a, t, f, "Admin gateway client not ready");
96
93
  return;
97
94
  }
98
- let i = s ? await e({
95
+ let r = o ? await e({
99
96
  payload: f.payload,
100
97
  context: f,
101
98
  event: t
102
- }) : await e({
103
- event: t,
104
- accountId: r.accountId
105
- });
106
- if (i.noReply) {
107
- d.info(`${s ? "update" : "fetch"} context processed (no reply)`, { contextName: m });
99
+ }) : await e({ event: t });
100
+ if (r.noReply) {
101
+ s.info(`${o ? "update" : "fetch"} context processed (no reply)`, { contextName: p });
108
102
  return;
109
103
  }
110
- i.ok ? (d.info(`${s ? "update" : "fetch"} context successfully`), await C(n.outbound, o, t, l, i.responsePayload ?? {
104
+ r.ok ? (s.info(`${o ? "update" : "fetch"} context successfully`), await v(n.outbound, a, t, u, r.responsePayload ?? {
111
105
  ok: !0,
112
- ...i.data
113
- })) : (d.error(`failed to ${s ? "update" : "fetch"} context`, i.error, { contextName: m }), await C(n.outbound, o, t, l, i.responsePayload ?? {
106
+ ...r.data
107
+ })) : (s.error(`failed to ${o ? "update" : "fetch"} context`, r.error, { contextName: p }), await v(n.outbound, a, t, u, r.responsePayload ?? {
114
108
  ok: !1,
115
- error: i.error,
116
- ...i.data,
117
- ...s && { name: m }
109
+ error: r.error,
110
+ ...r.data,
111
+ ...o && { name: p }
118
112
  }));
119
113
  } catch (r) {
120
114
  let i = e(r);
121
- d.error(`error ${s ? "updating" : "fetching"} context`, r, { contextName: m }), await S(n.outbound, o, t, l, i);
115
+ s.error(`error ${o ? "updating" : "fetching"} context`, r, { contextName: p }), await _(n.outbound, a, t, u, i);
122
116
  }
123
117
  }
124
- function x(e) {
118
+ function g(e) {
125
119
  return e?.header?.name ? {
126
120
  valid: !0,
127
121
  context: e
@@ -130,13 +124,13 @@ function x(e) {
130
124
  error: "Missing context name"
131
125
  };
132
126
  }
133
- async function S(e, t, n, r, i) {
134
- d.error(i), await C(e, t, n, r, {
127
+ async function _(e, t, n, r, i) {
128
+ s.error(i), await v(e, t, n, r, {
135
129
  ok: !1,
136
130
  error: i
137
131
  });
138
132
  }
139
- async function C(e, t, n, r, i) {
133
+ async function v(e, t, n, r, i) {
140
134
  let a = [{
141
135
  header: r?.header ?? {
142
136
  name: "unknown",
@@ -150,11 +144,11 @@ async function C(e, t, n, r, i) {
150
144
  data: { contexts: a }
151
145
  });
152
146
  }
153
- function w(e, t) {
154
- return m.has(t) ? !1 : !e || !p.has(t);
147
+ function y(e, t) {
148
+ return !e || !l.has(t);
155
149
  }
156
- async function T(e, t) {
157
- let n = await e.setAgentFile(f.soul, typeof t?.md == "string" ? t.md : ""), r = t?.id;
150
+ async function b(e, t) {
151
+ let n = await e.setAgentFile(c.soul, typeof t?.md == "string" ? t.md : ""), r = t?.id;
158
152
  return r === void 0 ? n : {
159
153
  ...n,
160
154
  data: {
@@ -163,7 +157,7 @@ async function T(e, t) {
163
157
  }
164
158
  };
165
159
  }
166
- async function E(e, t) {
160
+ async function x(e, t) {
167
161
  let n = await o({
168
162
  namespace: t?.header.namespace,
169
163
  payload: e
@@ -175,4 +169,4 @@ async function E(e, t) {
175
169
  };
176
170
  }
177
171
  //#endregion
178
- export { h as registerContextHandler };
172
+ export { u as registerContextHandler };
@@ -50,8 +50,7 @@ function n(e) {
50
50
  ...e.lastId ? { lastId: e.lastId } : {},
51
51
  ...e.contexts ? { contexts: e.contexts } : {},
52
52
  ...e.node ? { node: e.node } : {},
53
- ...e.agentMessage ? { agentMessage: e.agentMessage } : {},
54
- ...e.notification ? { notification: e.notification } : {}
53
+ ...e.agentMessage ? { agentMessage: e.agentMessage } : {}
55
54
  };
56
55
  return Object.keys(t).length ? { data: t } : {};
57
56
  }
@@ -81,7 +80,6 @@ function i(e) {
81
80
  case "interrupt":
82
81
  case "newSession":
83
82
  case "agentReply":
84
- case "agentPush":
85
83
  case "nodeInvokeRequest":
86
84
  case "nodeInvokeResult":
87
85
  case "pingMessage":
@@ -1,8 +1,5 @@
1
- import { isBetaVersion as e } from "../utils/version.mjs";
2
- import { MOCK_COMMAND_HELP_ITEMS as t } from "./mock/help.mjs";
3
- import "./mock/index.mjs";
4
1
  //#region src/command/help.ts
5
- var n = [
2
+ var e = [
6
3
  {
7
4
  example: "/yoyo help",
8
5
  description: "查看 YOYO 控虾可用指令及使用方式"
@@ -24,10 +21,10 @@ var n = [
24
21
  description: "查看指定消息轮次的处理时间线和异常信息"
25
22
  }
26
23
  ];
27
- function r() {
28
- let r = e() ? [...n, ...t] : n, i = ["YOYO 控虾命令帮助"];
29
- for (let e of r) i.push("", e.example, ` ${e.description}`);
30
- return i.join("\n");
24
+ function t() {
25
+ let t = ["YOYO 控虾命令帮助"];
26
+ for (let n of e) t.push("", n.example, ` ${n.description}`);
27
+ return t.join("\n");
31
28
  }
32
29
  //#endregion
33
- export { r as handleHelpCommand };
30
+ export { t as handleHelpCommand };