@honor-claw/yoyo 2026.7.1-alpha.6 → 2026.7.1-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.
@@ -82,25 +82,6 @@ var r = t("capabilities"), i = null, a = class {
82
82
  };
83
83
  }
84
84
  }
85
- async restart(t) {
86
- let n = this.manager.getClient();
87
- if (!n) return {
88
- ok: !1,
89
- error: "Admin gateway client not ready"
90
- };
91
- try {
92
- return await n.restartGateway(t), r.info("plugin restart command dispatched via admin RPC", { reason: t }), {
93
- ok: !0,
94
- data: { dispatched: !0 }
95
- };
96
- } catch (t) {
97
- let n = e(t);
98
- return r.error("gateway restart RPC failed", t), {
99
- ok: !1,
100
- error: `gateway restart failed: ${n}`
101
- };
102
- }
103
- }
104
85
  };
105
86
  function o() {
106
87
  return i === null && (i = new a()), i;
@@ -1,4 +1,3 @@
1
1
  import "./route.mjs";
2
2
  import "./list.mjs";
3
3
  import "./model-switch.mjs";
4
- import "./restart.mjs";
@@ -37,9 +37,6 @@ var r = {
37
37
  async devicePairApprove(e) {
38
38
  return this.sendRequest("device.pair.approve", { requestId: e });
39
39
  }
40
- async restartGateway(e) {
41
- return this.sendRequest("gateway.restart.request", { reason: e });
42
- }
43
40
  };
44
41
  //#endregion
45
42
  export { i as default };
@@ -11,8 +11,7 @@ import { detectProvidersToRename as l, updateProviderReferences as u } from "./p
11
11
  var d = r("configs"), f = [
12
12
  "nodes_status",
13
13
  "node_invoke",
14
- "cloud_invoke",
15
- "yoyo_plugin_restart"
14
+ "cloud_invoke"
16
15
  ];
17
16
  async function p(e) {
18
17
  try {
@@ -4,11 +4,9 @@ import { nodeInvokeTool as t } from "./node-invoke/tool.mjs";
4
4
  import "./node-invoke/index.mjs";
5
5
  import { nodesStatusTool as n } from "./nodes-status/tool.mjs";
6
6
  import "./nodes-status/index.mjs";
7
- import { pluginRestartTool as r } from "./plugin-restart/tool.mjs";
8
- import "./plugin-restart/index.mjs";
9
7
  //#region src/tools/index.ts
10
- function i(i) {
11
- i.registerTool(n), i.registerTool(t), i.registerTool(e), i.registerTool(r);
8
+ function r(r) {
9
+ r.registerTool(n), r.registerTool(t), r.registerTool(e);
12
10
  }
13
11
  //#endregion
14
- export { i as registerTools };
12
+ export { r as registerTools };
@@ -7,7 +7,7 @@
7
7
  "onStartup": true
8
8
  },
9
9
  "contracts": {
10
- "tools": ["nodes_status", "node_invoke", "cloud_invoke", "yoyo_plugin_restart"]
10
+ "tools": ["nodes_status", "node_invoke", "cloud_invoke"]
11
11
  },
12
12
  "configSchema": {
13
13
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honor-claw/yoyo",
3
- "version": "2026.7.1-alpha.6",
3
+ "version": "2026.7.1-beta.1",
4
4
  "description": "OpenClaw Honor Yoyo connection plugin",
5
5
  "keywords": [
6
6
  "ai",
@@ -32,16 +32,15 @@ metadata: { "openclaw": { "emoji": "📱", "always": true } }
32
32
  - **执行过程不允许展示给用户,只向用户展示结果**
33
33
  - 不得猜测工具名称(`node_invoke.name`),必须查阅文档后再执行
34
34
  - **MCP工具参考表必须读全**:当 `read` 返回被截断时,用 `offset` 续读至文件/区块结束。在未读到参考表结尾分隔符 `</mcp_tools>` 之前,禁止得出"工具不存在""设备不支持""参数未定义"等否定结论
35
- - **工具返回结果即权威**:`node_invoke` 返回成功(`ok: true` 或 `result: true`)即为执行成功,必须如实向用户复述返回的 `message`(如"已经帮您跳转到蓝牙页面")。工具 description 中的"查询""查看""列表"等字样不保证一定回传数据(部分能力实际只跳转页面),以**实际返回**为准;`data` 为空不代表查询无结果(可能该工具为跳转型、不回传数据),严禁因 `data` 为空或未呈现预期数据形式,就改写为"❌ 不支持该操作"或追加第二次调用(含增补参数、换筛选条件等变体重试)
35
+ - **工具返回结果即权威**:`node_invoke` 返回成功(`ok: true` 或 `result: true`)即为执行成功,必须如实向用户复述返回的 `message`(如"已经帮您跳转到蓝牙页面")。工具 description 中的"查询""查看""列表"等字样不保证一定回传数据(部分能力实际只跳转页面),以**实际返回**为准;严禁因 `data` 为空或未呈现预期数据形式,就改写为"❌ 不支持该操作"
36
36
  - 不得使用文档中未定义的参数值
37
37
  - 不得从相似工具推断参数结构或枚举值
38
38
  - `params` 必须为合法 JSON 对象,枚举值区分大小写,数值在定义范围内
39
39
  - 如果执行失败,必须重新读取 `SKILL.md` 和对应的工具定义文件,然后重新执行
40
40
  - 禁止使用GUI工具作为兜底工具,除非用户明确要求在指定 App 内执行指定动作
41
41
  - 绝对不能使用任何其他设备的工具
42
- - **任务中断即丢弃**:当收到用户手动中断信号(如 dispatcher abort)时,当前任务立即终止,不思考中断原因、不处理未完成结果、不向用户提及中断,直接丢弃;收到用户新请求后,从步骤 1 重新执行5步工作流,严禁复用中断前的任何上下文
43
42
  - 不要尝试任何其他方式完成任务,不要提供替代方案
44
- - **Never try a different approach**
43
+ - **Never try a different approach**
45
44
 
46
45
  ## 步骤 1:确定目标设备
47
46
 
@@ -231,5 +231,4 @@ sub-task 2: 在微信将截图发送给好友A
231
231
  **注意**:
232
232
  - 返回给用户的回复话术严禁包含完整的 `task_id`,以免泄露隐私。
233
233
  - 回复话术使用简短的task_id,且task_id不能被特殊字符包裹,例如:成功创建了任务55cd5faf-2871-468c-86bc-415b24ee0cc4,应该返回的回复话术为:✅ GUI 任务已启动,正在规划中。\n📋 任务 ID:55cd5faf
234
- - gui.create 返回 task_id 后,**必须同时在同一回复中发起 task-result-query toolCall**,严禁仅输出文字后 stop。
235
234
  - 轮询结束(`isFinal = true`)后,将 `task-result-query` 返回的 `answer` 内容作为最终结果回复给用户。
@@ -7,17 +7,9 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
7
7
 
8
8
  # YOYO 插件更新
9
9
 
10
- 严格按下面顺序执行。所有输出使用中文。
10
+ 严格按下面顺序执行。不要输出步骤名、命令、判断过程或额外解释;只输出本文写明的用户可见文案。所有输出使用中文。
11
11
 
12
- ## 输出约束(白名单制)
13
-
14
- **只允许输出本文各步骤写明的用户可见文案**。除此之外一律禁止:
15
-
16
- - 不得输出步骤名("步骤 1/2/3..."、阶段名、判断逻辑名等)。
17
- - 不得输出命令名、命令输出片段、内部状态、debug 信息("正在执行 X"、"查询结果 Y" 之类的过程话术)。
18
- - 不得输出思路、推理、解释、补充说明、礼貌过渡。
19
- - 不得复述/预告下一步要做什么。
20
- - 不得用代码块(` ```markdown ` 等)包裹同一份文案输出两次。
12
+ 注意:所有用户可见文案以纯文本形式输出,不要用代码块(` ```markdown ` 等)包裹同一份内容两次。
21
13
 
22
14
  ## 禁止事项
23
15
 
@@ -42,8 +34,6 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
42
34
 
43
35
  从 `Spec` 判断渠道:`alpha`、`beta`、`latest` 或无标签(按 `latest`)。其他标签输出 `当前 YOYO 插件安装来源无法识别,请自行更新插件或联系开发团队确认升级渠道`,停止。
44
36
 
45
- **强制要求:必须先成功执行下列 `npm view` 命令拿到目标版本号(v{目标版本}),才允许在后续任何用户可见文案中提及"目标版本"或具体版本号。** 在拿到目标版本之前,步骤 3 不得输出,步骤 1 之后只能输出本步骤明确写明的"已停止"文案之一。
46
-
47
37
  执行 `npm view @honor-claw/yoyo dist-tags --json`,取对应渠道版本。失败时回退执行 `npm view @honor-claw/yoyo@{渠道名} version`;`latest` 可用 `npm view @honor-claw/yoyo version`。仍失败则输出 `无法获取 YOYO 插件最新版本,请稍后重试或自行更新插件`,停止。
48
38
 
49
39
  用 semver 比较当前版本和目标版本:
@@ -51,12 +41,10 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
51
41
  - 相同:输出 `当前已是最新版本(v{version}),无需更新`,停止。
52
42
  - 当前版本更高:输出 `当前版本(v{当前版本})高于当前渠道目标版本(v{目标版本}),无需更新`,停止。
53
43
  - 无法比较:输出 `无法可靠比较当前版本与目标版本,请自行更新插件或联系开发团队确认`,停止。
54
- - 目标版本更高:继续步骤 3。**步骤 3 文案中的"v{目标版本}"必须填写本步骤通过 `npm view` 实际拿到的版本号,不允许猜测、占位或省略。**
44
+ - 目标版本更高:继续步骤 3
55
45
 
56
46
  ## 步骤 3:输出更新摘要和更新阶段文案
57
47
 
58
- **前置依赖:步骤 2 必须已成功拿到 v{目标版本},否则不得进入本步骤。**
59
-
60
48
  输出以下文案:
61
49
 
62
50
  🔄 YOYO 插件更新可用
@@ -67,10 +55,10 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
67
55
 
68
56
  正在执行升级流程:
69
57
 
70
- 正在下载插件
58
+ 1. 正在下载插件
71
59
  状态:正在下载插件,请耐心等待...
72
60
 
73
- 正在更新插件
61
+ 2. 正在更新插件
74
62
  状态:正在安装并配置新版本插件,请勿中断操作
75
63
 
76
64
  ## 步骤 4:执行更新
@@ -102,43 +90,19 @@ metadata: { "openclaw": { "emoji": "🔄", "always": true } }
102
90
 
103
91
  说明:本次实际升级到 v{实际版本},高于预检查获取的目标版本 v{目标版本}。
104
92
 
105
- ## 步骤 6:根据网关运行模式重启
106
-
107
- 插件更新完成后,需要重启网关让插件生效(安装插件不再自动触发网关重启)。重启方式取决于当前网关的运行模式,必须先探测再分流。
108
-
109
- ### 6.1 探测网关运行模式
110
-
111
- 执行 `openclaw gateway status --json`,解析输出判断网关是 daemon 托管还是前台手动运行:
112
-
113
- - daemon(计划任务/schtasks 托管)的判定信号,二者需同时满足:
114
- 1. `port.listeners[].commandLine` 中被加载的脚本是 `dist/index.js`。
115
- 2. `service.runtime.detail` 不含 "even though schtasks did not report a running task" 或类似的 schtasks 没生效的说明。
116
- - 前台手动运行的判定信号,满足其一即可:
117
- 1. `port.listeners[].commandLine` 中被加载的脚本是 `openclaw.mjs`,命令为 `gateway` 或 `gateway run`(无 `--port`)。
118
- 2. `service.runtime.detail` 含 "even though schtasks did not report a running task" 或类似的 schtasks 没生效的说明。
119
- - 注意:不要用外层 `node.exe` 的路径区分(daemon 和前台都可能是同一 node 路径),要以被加载脚本(`dist/index.js` vs `openclaw.mjs`)和是否带 `--port` 为准。
120
- - `openclaw gateway status --json` 命令失败或无法解析运行模式时,按前台运行处理(走 6.3 提示手动重启),不要尝试任何自动重启方式。
121
-
122
- ### 6.2 daemon 网关:调用 yoyo_plugin_restart 工具重启
123
-
124
- - 直接调用 `yoyo_plugin_restart` 工具触发网关重启。
125
- - **不得向用户输出任何关于网关运行模式(如“当前是 daemon 模式”之类)的内部判断信息**,6.1 的探测结果仅供本步骤分流使用,对用户不可见。直接调用工具并进入步骤 7。
126
- - 不得执行 `openclaw gateway restart/stop/start` 或任何其它重启命令。
127
- - 重启是“下发即结束”:工具返回即视为重启已触发,**不要轮询网关状态、不要等待网关重新就绪、不要探测重连结果**。调用后直接进入步骤 7。
128
- - 工具返回 `ok: true`:直接进入步骤 7。
129
- - 工具返回 `ok: false`:不要改用其它重启方式,输出 `插件已更新完成,但网关重启失败,请在 OpenClaw 设备上手动重启网关生效新版本插件`,停止。不得向用户输出工具返回的原始 `errorMessage` 或内部判断信息。
130
-
131
- ### 6.3 前台运行的网关:提示手动重启
93
+ ## 步骤 6:执行安全重启
132
94
 
133
- 前台网关由用户自己起的进程托管,无法通过工具或命令自动重启。输出以下文案并停止(不输出步骤 7 的完成文案):
95
+ 插件更新完成后,必须主动执行网关安全重启(安装插件不再自动触发网关重启)。
134
96
 
135
- 插件已更新完成,请手动重启 OpenClaw 网关让新版本插件生效。
136
- (前台运行的网关无法控制自动重启,请在启动网关的终端停止当前网关并重新启动。)
97
+ - 执行命令:`openclaw gateway restart --safe`
98
+ - **`--safe` 参数不可省略**,不得执行裸 `openclaw gateway restart`、`openclaw gateway stop` / `start` 或任何其它重启方式。
99
+ - 重启会断开当前长连接,属于预期行为;执行前无需等待,执行后继续步骤 7。
100
+ - 命令执行失败时,不要改用其它重启方式,输出 `插件已更新完成,但网关安全重启失败,请在 OpenClaw 设备上手动重启网关生效插件`,停止。
137
101
 
138
102
  ## 步骤 7:输出完成结果
139
103
 
140
- 输出完成文案:
104
+ 输出阶段 3 文案:
141
105
 
142
- 插件更新完成
106
+ 3. 插件更新完成
143
107
  Claw 插件更新已完成
144
- 网关重启已下发,连接即将断开,断开后稍等片刻后会恢复...
108
+ 网关已重启,连接即将断开,稍等片刻后恢复...
@@ -1,17 +0,0 @@
1
- import { clawLogger as e } from "../../utils/claw-logger.mjs";
2
- import { useAdminCapability as t } from "../admin/impl.mjs";
3
- import "../admin/index.mjs";
4
- //#region src/capabilities/routing/restart.ts
5
- var n = e("routing");
6
- async function r(e) {
7
- let r = await t().restart(e);
8
- return n.info("plugin restart command dispatched", {
9
- ok: r.ok,
10
- reason: e
11
- }), r.ok ? { ok: !0 } : {
12
- ok: !1,
13
- error: r.error
14
- };
15
- }
16
- //#endregion
17
- export { r as restartGateway };
@@ -1 +0,0 @@
1
- import "./tool.mjs";
@@ -1,44 +0,0 @@
1
- import { toErrorMessage as e } from "../../utils/error.mjs";
2
- import { clawLogger as t } from "../../utils/claw-logger.mjs";
3
- import { restartGateway as n } from "../../capabilities/routing/restart.mjs";
4
- import "../../capabilities/routing/index.mjs";
5
- import { Type as r } from "typebox";
6
- //#region src/tools/plugin-restart/tool.ts
7
- var i = t("tool"), a = {
8
- name: "yoyo_plugin_restart",
9
- label: "YOYO Plugin Restart",
10
- description: "重启 openclaw 网关。插件升级场景下使用:调用后网关会断连重启。",
11
- parameters: r.Object({ reason: r.Optional(r.String({ description: "重启原因" })) }),
12
- async execute(e, t) {
13
- let n = await o(e, t);
14
- return {
15
- content: [{
16
- type: "text",
17
- text: JSON.stringify(n)
18
- }],
19
- details: n
20
- };
21
- }
22
- };
23
- async function o(t, r) {
24
- try {
25
- let e = await n(r.reason);
26
- return e.ok ? {
27
- ok: !0,
28
- result: { message: "restart command dispatched." }
29
- } : (i.warn("plugin restart command failed", {
30
- toolCallId: t,
31
- error: e.error
32
- }), {
33
- ok: !1,
34
- errorMessage: e.error ?? "plugin restart command failed; please manually restart the gateway"
35
- });
36
- } catch (n) {
37
- return i.error("plugin restart command threw unexpectedly", n, { toolCallId: t }), {
38
- ok: !1,
39
- errorMessage: e(n)
40
- };
41
- }
42
- }
43
- //#endregion
44
- export { a as pluginRestartTool };