@honor-claw/yoyo 1.1.4-beta.4 → 1.1.4-beta.5
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.
- package/index.ts +6 -0
- package/package.json +3 -1
- package/skills/yoyo-control/SKILL.md +10 -0
- package/skills/yoyo-control/references/autoscreen-onnotice.md +196 -0
- package/skills/yoyo-control/references/brightness.md +224 -0
- package/skills/yoyo-control/references/dark-mode.md +200 -0
- package/skills/yoyo-control/references/device-operation.md +226 -0
- package/skills/yoyo-control/references/eyecomfort.md +226 -0
- package/skills/yoyo-control/references/location-service.md +184 -0
- package/skills/yoyo-control/references/nfc.md +196 -0
- package/skills/yoyo-control/references/schedule-delete.md +27 -15
- package/skills/yoyo-control/references/status-bar-show.md +211 -0
- package/skills/yoyo-control/references/usb-shared-network.md +198 -0
- package/src/apis/claw-cloud.ts +1 -1
- package/src/apis/http-client.ts +1 -1
- package/src/apis/index.ts +0 -1
- package/src/cloud-channel/admin-client-manager.ts +2 -2
- package/src/cloud-channel/channel.ts +1 -1
- package/src/cloud-channel/client.ts +61 -10
- package/src/cloud-channel/message-handler.ts +208 -50
- package/src/cloud-channel/session-manager.ts +1 -1
- package/src/cloud-channel/types.ts +3 -2
- package/src/commands/env/impl.ts +1 -1
- package/src/commands/logout/impl.ts +1 -1
- package/src/gateway-client/admin-client.ts +55 -0
- package/src/gateway-client/client.ts +2 -2
- package/src/gateway-client/index.ts +3 -3
- package/src/gateway-client/{node-gateway-client.ts → node-client.ts} +2 -2
- package/src/gateway-client/protocol-client.ts +18 -36
- package/src/gateway-client/types/index.ts +4 -0
- package/src/gateway-client/types/model.ts +12 -0
- package/src/gateway-client/{protocol/types.ts → types/protocol.ts} +47 -0
- package/src/honor-auth/browser.ts +1 -1
- package/src/honor-auth/cloud.ts +1 -1
- package/src/{apis/honor-auth.ts → honor-auth/honor-auth-client.ts} +5 -5
- package/src/honor-auth/index.ts +1 -0
- package/src/honor-auth/token-manager.ts +1 -1
- package/src/modules/{claw-configs → configs}/config-manager.ts +1 -1
- package/src/modules/{claw-configs → configs}/identity-persist.ts +193 -193
- package/src/{gateway-client → modules}/device/auth.ts +1 -24
- package/src/modules/device/credential-builder.ts +58 -0
- package/src/modules/device/device-info.ts +7 -4
- package/src/{gateway-client → modules}/device/helpers.ts +0 -14
- package/src/modules/device/identity.ts +214 -213
- package/src/modules/device/index.ts +3 -0
- package/src/modules/device/providers/base.ts +8 -2
- package/src/modules/device/providers/index.ts +56 -56
- package/src/modules/device/providers/linux.ts +66 -52
- package/src/modules/device/providers/macos.ts +54 -48
- package/src/modules/device/providers/pad.ts +13 -6
- package/src/modules/device/providers/windows.ts +118 -58
- package/src/modules/device/registry.ts +1 -1
- package/src/modules/device/types.ts +43 -0
- package/src/modules/login/impl.ts +1 -1
- package/src/modules/prompt/index.ts +6 -0
- package/src/runtime.ts +1 -1
- package/src/services/connection/impl.ts +22 -108
- package/src/services/connection/status-tracker/events.ts +35 -8
- package/src/services/connection/status-tracker/tracker.ts +6 -2
- package/src/agent/copy-templates.ts +0 -54
- package/src/agent/index.ts +0 -3
- package/src/agent/templates/AGENTS.md +0 -234
- package/src/gateway-client/admin-gateway-client.ts +0 -37
- package/src/gateway-client/device/builder.ts +0 -91
- package/src/gateway-client/device/index.ts +0 -25
- package/src/gateway-client/device/types.ts +0 -50
- package/src/gateway-client/protocol/index.ts +0 -3
- /package/src/gateway-client/{protocol → types}/client.ts +0 -0
- /package/src/gateway-client/{protocol/skill.ts → types/skills.ts} +0 -0
- /package/src/modules/{claw-configs → configs}/hosts.ts +0 -0
- /package/src/modules/{claw-configs → configs}/index.ts +0 -0
- /package/src/modules/{claw-configs → configs}/provider.ts +0 -0
- /package/src/modules/{claw-configs → configs}/types.ts +0 -0
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
2
2
|
import { registerCommands } from "./src/commands/index.js";
|
|
3
|
+
import { AGENT_PROMPT } from "./src/modules/prompt/index.js";
|
|
3
4
|
import { setYoyoRuntime } from "./src/runtime.js";
|
|
4
5
|
import { YoyoPluginConfigSchema } from "./src/schemas.js";
|
|
5
6
|
import { createClawConnectionService } from "./src/services/connection/index.js";
|
|
@@ -17,6 +18,11 @@ const plugin = {
|
|
|
17
18
|
// 利用服务来管理核心连接任务进行~
|
|
18
19
|
api.registerService(createClawConnectionService(api));
|
|
19
20
|
|
|
21
|
+
// Inject core skill & safety rules into system prompt every turn
|
|
22
|
+
api.on("before_prompt_build", async () => ({
|
|
23
|
+
prependSystemContext: AGENT_PROMPT,
|
|
24
|
+
}));
|
|
25
|
+
|
|
20
26
|
// 注册所有的命令行
|
|
21
27
|
registerCommands(api);
|
|
22
28
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honor-claw/yoyo",
|
|
3
|
-
"version": "1.1.4-beta.
|
|
3
|
+
"version": "1.1.4-beta.5",
|
|
4
4
|
"description": "OpenClaw Honor Yoyo connection plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
"test:unit:watch": "vitest"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@honor-claw/safe-exec": "0.0.1",
|
|
34
35
|
"http-proxy-agent": "^8.0.0",
|
|
35
36
|
"https-proxy-agent": "^8.0.0",
|
|
36
37
|
"jsonwebtoken": "^9.0.3",
|
|
37
38
|
"nanoid": "^5.1.6",
|
|
38
39
|
"open": "^11.0.0",
|
|
39
40
|
"undici": "^7.3.0",
|
|
41
|
+
"winreg": "^1.2.5",
|
|
40
42
|
"ws": "^8.18.0",
|
|
41
43
|
"zod": "^4.3.6"
|
|
42
44
|
},
|
|
@@ -107,6 +107,16 @@ Before executing any device control operation, you **MUST** consult the correspo
|
|
|
107
107
|
| `schedule` | `references/schedule-update.md` | 日程编辑修改工具。用于修改设备上已创建日程的属性,支持修改时间、内容、地点等。当用户询问"修改/编辑/更改日程"等意图时调用。用于更新日程的工具。当用户意图涉及修改日程/安排属性时,属于编辑修改日程。 |
|
|
108
108
|
| `wlan` | `references/wlan.md` | WLAN(无线网络、WiFi)管理工具。提供对WLAN及其相关能力的统一管理与控制,支持WLAN的开启与关闭、参数设置与状态查询,并可对WLAN使用的流量与流量提醒进行管理。 |
|
|
109
109
|
| `bluetooth` | `references/bluetooth.md` | 蓝牙设备管理工具。提供蓝牙设备的统一管理与控制,支持蓝牙的打开/关闭、参数设置、状态查询、设备搜索与配对,并能管理已接收的蓝牙文件。 |
|
|
110
|
+
| `location-service` | `references/location-service.md` | 设备定位服务管理工具。支持开启/关闭定位、设置相关权限或策略,并查询当前定位服务状态。 |
|
|
111
|
+
| `nfc` | `references/nfc.md` | 设备 NFC 管理与控制工具。支持开启/关闭、设置使用策略与参数、查询当前状态,以及基于 NFC 的刷卡感应操作。 |
|
|
112
|
+
| `usb-shared-network` | `references/usb-shared-network.md` | 统一管理与控制 USB 共享网络功能,支持开启/关闭、参数设置与状态查询,可结合指定应用进行操作。 |
|
|
113
|
+
| `eyecomfort` | `references/eye-comfort.md` | 护眼模式与视觉健康功能管理工具。支持开启/关闭、设置、查询与定时控制,并可独立管理助眠显示、干眼友好、视力舒缓、自然色彩显示及照明闪烁检测。 |
|
|
114
|
+
| `brightness` | `references/brightness.md` | 屏幕亮度管理工具。支持开启/关闭、调高/调低、设定指定亮度值、查询当前亮度与自动调节状态,并可管理自动调节亮度功能。 |
|
|
115
|
+
| `dark-mode` | `references/dark-mode.md` | 深色模式管理工具。支持开启、关闭、设置与查询,并可按指定应用执行操作,提升夜间或弱光环境下的观看舒适度。 |
|
|
116
|
+
| `device-operation` | `references/device-operation.md` | 设备电源与屏幕控制工具,支持开机、关机、重启、待机、休眠、灭屏、亮屏、锁屏等操作,并可结合定时、二次确认与指定应用执行。 |
|
|
117
|
+
| `status-bar-show` | `references/status-bar-show.md` | 状态栏显示统一管理工具。支持对运营商名称、实时网速、流量、通知与纯净模式进行开启、关闭、设置与查询,并可结合指定应用执行显示策略。 |
|
|
118
|
+
| `autoscreen-onnotice`| `references/autoscreen-onnotice.md`| 管理收到通知时自动亮屏功能。支持开启/关闭、进入设置、查询当前状态,并可按指定应用进行精细化控制。 |
|
|
119
|
+
|
|
110
120
|
|
|
111
121
|
### Command and Parameters Construction Workflow
|
|
112
122
|
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autoscreen-onnotice
|
|
3
|
+
description: >
|
|
4
|
+
管理收到通知时自动亮屏功能。支持开启/关闭、进入设置、查询当前状态,并可按指定应用进行精细化控制。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Autoscreen Onnotice 通知自动亮屏
|
|
8
|
+
|
|
9
|
+
## Tool Command
|
|
10
|
+
```bash
|
|
11
|
+
autoscreen-onnotice
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 集成工作流
|
|
15
|
+
|
|
16
|
+
### Step 1: 意图解析与参数组装
|
|
17
|
+
```
|
|
18
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
19
|
+
│ 意图识别与参数提取 │
|
|
20
|
+
│ - 识别操作类型: 设置/查询/打开/关闭 │
|
|
21
|
+
│ - 提取应用名称: 明确提及具体应用时识别 │
|
|
22
|
+
│ - 特殊处理: "开启/启用" → 映射为打开;"禁用/停用" → 关闭 │
|
|
23
|
+
│ - 特殊处理: "设置/配置/进入设置页面" → 映射为设置;"查看状态 │
|
|
24
|
+
│ /是否开启" → 映射为查询 │
|
|
25
|
+
│ - 特殊处理: "消息"等同"通知"统一识别 │
|
|
26
|
+
└─────────────────────────────────────────────────────────────┘
|
|
27
|
+
↓
|
|
28
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
29
|
+
│ 消歧与槽位填充 │
|
|
30
|
+
│ - 未指定应用时,默认为系统全局设置 │
|
|
31
|
+
│ - 未明确操作类型时,需向用户追问目标操作 │
|
|
32
|
+
│ - app仅当query含具体应用名称时填写 │
|
|
33
|
+
│ - 应用级操作需验证应用名称有效性 │
|
|
34
|
+
└─────────────────────────────────────────────────────────────┘
|
|
35
|
+
↓
|
|
36
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
37
|
+
│ 生成工具调用 │
|
|
38
|
+
│ - 组装 actionType 及可选参数(app) │
|
|
39
|
+
│ - 生成平台特定的命令格式 │
|
|
40
|
+
└─────────────────────────────────────────────────────────────┘
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 2: 执行调用
|
|
44
|
+
- 根据操作系统选择对应的命令格式
|
|
45
|
+
- Windows: Cmd 格式(双引号需转义)
|
|
46
|
+
- Linux: Bash 格式(单引号包裹)
|
|
47
|
+
|
|
48
|
+
## 参数定义
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"actionType": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"enum": [
|
|
54
|
+
"设置",
|
|
55
|
+
"查询",
|
|
56
|
+
"打开",
|
|
57
|
+
"关闭"
|
|
58
|
+
],
|
|
59
|
+
"description": "必填参数,通知自动亮屏相关操作的动作类型,用于明确本次指令的主要行为。当涉及调整通知亮屏触发规则或应用范围时使用设置;当获取当前通知自动亮屏功能是否启用及其配置状态时使用查询;当要求启用收到通知时自动点亮屏幕的功能时使用打开;当要求关闭通知触发亮屏功能以减少干扰或节省电量时使用关闭。"
|
|
60
|
+
},
|
|
61
|
+
"app": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "指定与通知自动亮屏功能相关的应用名称。当需要仅对某个特定应用的通知启用或禁用亮屏行为时填写。"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 参数注意事项
|
|
69
|
+
1. 必填参数取值:`actionType` 为必填参数,且 `actionType` 的取值必须在枚举列表中。
|
|
70
|
+
2. 同义词/间接表述映射: "开启/启用"→`打开`;"禁用/停用"→`关闭`;"设置/配置/进入设置页面"→`设置`;"查看状态/是否开启"→`查询`。
|
|
71
|
+
3. 默认值或缺省行为: 未指定`app`时,操作作用于系统全局通知亮屏设置;当`actionType`为`查询`且未指定`app`时,返回系统全局状态。
|
|
72
|
+
4. 参数间关联/依赖/互斥关系: 指定`app`时,`打开/关闭/查询`均限定在该应用范围内;`设置`一般为进入配置页面,`app`可选,用于进入某应用的相关配置。
|
|
73
|
+
5. 可选参数填写条件: `app`仅在用户明确提及具体应用名称时填写,不做推断;应用名称需为设备上已安装或可识别的应用。
|
|
74
|
+
|
|
75
|
+
## Query 示例及输出
|
|
76
|
+
|
|
77
|
+
### 示例 1: 全局开启通知自动亮屏
|
|
78
|
+
**用户输入**: "打开收到通知自动亮屏"
|
|
79
|
+
|
|
80
|
+
**工具**: "autoscreen-onnotice"
|
|
81
|
+
|
|
82
|
+
**JSON 参数**:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"actionType": "打开"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Windows (Cmd) 执行命令**:
|
|
90
|
+
```bash
|
|
91
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params "{\"actionType\":\"打开\"}"'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Linux (Bash) 执行命令**:
|
|
95
|
+
```bash
|
|
96
|
+
openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params '{"actionType":"打开"}'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### 示例 2: 全局关闭通知自动亮屏
|
|
102
|
+
**用户输入**: "关闭收到通知自动亮屏"
|
|
103
|
+
|
|
104
|
+
**工具**: "autoscreen-onnotice"
|
|
105
|
+
|
|
106
|
+
**JSON 参数**:
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"actionType": "关闭"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Windows (Cmd) 执行命令**:
|
|
114
|
+
```bash
|
|
115
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params "{\"actionType\":\"关闭\"}"'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Linux (Bash) 执行命令**:
|
|
119
|
+
```bash
|
|
120
|
+
openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params '{"actionType":"关闭"}'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 示例 3: 进入通知自动亮屏设置页面
|
|
126
|
+
**用户输入**: "进入收到通知自动亮屏设置页面"
|
|
127
|
+
|
|
128
|
+
**工具**: "autoscreen-onnotice"
|
|
129
|
+
|
|
130
|
+
**JSON 参数**:
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"actionType": "设置"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Windows (Cmd) 执行命令**:
|
|
138
|
+
```bash
|
|
139
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params "{\"actionType\":\"设置\"}"'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Linux (Bash) 执行命令**:
|
|
143
|
+
```bash
|
|
144
|
+
openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params '{"actionType":"设置"}'
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### 示例 4: 仅微信通知自动亮屏
|
|
150
|
+
**用户输入**: "打开微信消息亮屏"
|
|
151
|
+
|
|
152
|
+
**工具**: "autoscreen-onnotice"
|
|
153
|
+
|
|
154
|
+
**JSON 参数**:
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"actionType": "打开",
|
|
158
|
+
"app": "微信"
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Windows (Cmd) 执行命令**:
|
|
163
|
+
```bash
|
|
164
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params "{\"actionType\":\"打开\",\"app\":\"微信\"}"'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Linux (Bash) 执行命令**:
|
|
168
|
+
```bash
|
|
169
|
+
openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params '{"actionType":"打开","app":"微信"}'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### 示例 5: 查询当前状态(全局)
|
|
175
|
+
**用户输入**: "查看通知亮屏是否开启"
|
|
176
|
+
|
|
177
|
+
**工具**: "autoscreen-onnotice"
|
|
178
|
+
|
|
179
|
+
**JSON 参数**:
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"actionType": "查询"
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Windows (Cmd) 执行命令**:
|
|
187
|
+
```bash
|
|
188
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params "{\"actionType\":\"查询\"}"'
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Linux (Bash) 执行命令**:
|
|
192
|
+
```bash
|
|
193
|
+
openclaw nodes invoke --node <ID> --command autoscreen-onnotice --params '{"actionType":"查询"}'
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brightness
|
|
3
|
+
description: >
|
|
4
|
+
屏幕亮度管理工具。支持开启/关闭、调高/调低、设定指定亮度值、查询当前亮度与自动调节状态,并可管理自动调节亮度功能。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Brightness 屏幕亮度管理
|
|
8
|
+
|
|
9
|
+
## Tool Command
|
|
10
|
+
```bash
|
|
11
|
+
brightness
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 集成工作流
|
|
15
|
+
|
|
16
|
+
### Step 1: 意图解析与参数组装
|
|
17
|
+
```
|
|
18
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
19
|
+
│ 意图识别与参数提取 │
|
|
20
|
+
│ - 识别操作类型: 设置/查询/打开/关闭/调大/调小/设值 │
|
|
21
|
+
│ - 识别操作对象: 亮度/自动调节亮度 │
|
|
22
|
+
│ - 提取设备名称: 设备名/别称(手机、电视、灯等) │
|
|
23
|
+
│ - 提取数值信息: 数字、百分比、级别、分数、极值、倍数 │
|
|
24
|
+
│ - 判断数值表达类型: 数字/百分比/级别/分数/极值 │
|
|
25
|
+
│ - 特殊处理: “变亮/提高/增强”→调大,“变暗/降低/减少”→调小 │
|
|
26
|
+
│ - 特殊处理: “自动亮度/自适应亮度”统一识别为自动调节亮度 │
|
|
27
|
+
└─────────────────────────────────────────────────────────────┘
|
|
28
|
+
↓
|
|
29
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
30
|
+
│ 消歧与槽位填充 │
|
|
31
|
+
│ - 未明确目标对象时,默认对“亮度”进行操作 │
|
|
32
|
+
│ - 未指定设备时,默认当前设备 │
|
|
33
|
+
│ - 数值缺失时,需向用户追问具体目标值或调整幅度 │
|
|
34
|
+
│ - numberType仅当query含明确数值表达时填写,可据number推断 │
|
|
35
|
+
│ - “最高/最大/最亮”与“最低/最小/最暗” → 映射为极值 │
|
|
36
|
+
└─────────────────────────────────────────────────────────────┘
|
|
37
|
+
↓
|
|
38
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ 生成工具调用 │
|
|
40
|
+
│ - 组装 actionType, target 及可选参数(device, number, │
|
|
41
|
+
│ numberType, app) │
|
|
42
|
+
│ - 生成平台特定的命令格式 │
|
|
43
|
+
└─────────────────────────────────────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 2: 执行调用
|
|
47
|
+
- 根据操作系统选择对应的命令格式
|
|
48
|
+
- Windows: Cmd 格式(双引号需转义)
|
|
49
|
+
- Linux: Bash 格式(单引号包裹)
|
|
50
|
+
|
|
51
|
+
## 参数定义
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"actionType": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": ["设置", "查询", "打开", "关闭", "调大", "调小", "设值"],
|
|
57
|
+
"description": "必填参数,亮度相关操作的动作类型,用于明确本次指令的主要行为。当涉及亮度参数或调节策略的配置时使用设置;当获取当前亮度水平或自动调节状态时使用查询;当要求启用亮度显示或自动亮度功能时使用打开;当要求停用亮度相关功能(如自动调节)时使用关闭;当基于当前亮度基础上进行提升时使用调大;当基于当前亮度基础上进行降低时使用调小;当需要直接指定目标亮度数值时使用设值。"
|
|
58
|
+
},
|
|
59
|
+
"device": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "指定执行亮度相关操作的设备名称。当存在多个可控设备或需明确作用对象时填写。"
|
|
62
|
+
},
|
|
63
|
+
"target": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"enum": ["亮度", "自动调节亮度"],
|
|
66
|
+
"description": "亮度调节的具体对象,用于限定 actionType 的作用范围。当进行屏幕亮度数值调整时选择亮度;当管理系统根据环境状态自动调整亮度的功能时选择自动调节亮度。"
|
|
67
|
+
},
|
|
68
|
+
"number": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "亮度调整所使用的具体数值或表达结果,用于配合设值、调大或调小等操作,表示期望的调整幅度或目标亮度。"
|
|
71
|
+
},
|
|
72
|
+
"numberType": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["数字", "极值", "百分比", "级别", "分数"],
|
|
75
|
+
"description": "用于描述 number 参数所采用的数值表达类型。当以具体数值表示亮度水平时使用数字;当使用最大或最小等边界值表达时使用极值;当按比例描述亮度变化时使用百分比;当以系统预设档位进行调节时使用级别;当以分段或分数形式描述亮度大小时使用分数。"
|
|
76
|
+
},
|
|
77
|
+
"app": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "指定执行亮度相关操作的应用名称。当明确要求仅在某个特定应用场景下调整亮度显示效果时填写。"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 参数注意事项
|
|
85
|
+
1. 必填参数取值:`actionType` 为必填参数,且 `actionType` 的取值必须在枚举列表中。
|
|
86
|
+
2. **设置与调大/调小的区别**:`设值`为绝对值设定("调到50"),`调大`/`调小`为相对值调整("调大20")
|
|
87
|
+
3. **numberType 匹配**: `number` 需与 `numberType` 配合使用——"50"对应数字、"50%"对应百分比、"最大/最小"对应极值、"3格/3档"对应级别、"1/3/三分之一"对应分数
|
|
88
|
+
4. **number取值规则**:如果numberType为“百分比”,该值必须为小数!!!如:用户说“调节音量到30%”,number取值为0.3"
|
|
89
|
+
5. 同义词/间接表述映射: “变亮/调高/提高/增加/增强”统一识别为`actionType`=`调大`;“变暗/调低/降低/减少/减弱”统一识别为`actionType`=`调小`;“固定/锁定亮度/不要自动”识别为`actionType`=`关闭`且`target`=`自动调节亮度`;“自动亮度/自适应亮度”统一识别为`target`=`自动调节亮度`。
|
|
90
|
+
6. 默认值或缺省行为: 未指明`target`时默认使用`亮度`;未提供`device`时默认当前设备;`numberType`可依据`number`内容推断,若`actionType`=`设值`但未提供`number`,需追问目标值。
|
|
91
|
+
7. 参数间关联/依赖关系: `number`与`numberType`需一致(如含“%”对应`百分比`,“档/格”对应`级别`,“最高/最低”对应`极值`)。
|
|
92
|
+
|
|
93
|
+
## Query 示例及输出
|
|
94
|
+
|
|
95
|
+
### 示例 1: 打开自动调节亮度
|
|
96
|
+
**用户输入**: "打开屏幕自动调节亮度"
|
|
97
|
+
|
|
98
|
+
**工具**: "brightness"
|
|
99
|
+
|
|
100
|
+
**JSON 参数**:
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"actionType": "打开",
|
|
104
|
+
"target": "自动调节亮度"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Windows (Cmd) 执行命令**:
|
|
109
|
+
```bash
|
|
110
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command brightness --params "{\"actionType\":\"打开\",\"target\":\"自动调节亮度\"}"'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Linux (Bash) 执行命令**:
|
|
114
|
+
```bash
|
|
115
|
+
openclaw nodes invoke --node <ID> --command brightness --params '{"actionType":"打开","target":"自动调节亮度"}'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### 示例 2: 设定亮度为一半
|
|
121
|
+
**用户输入**: "亮度调到一半"
|
|
122
|
+
|
|
123
|
+
**工具**: "brightness"
|
|
124
|
+
|
|
125
|
+
**JSON 参数**:
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"actionType": "设值",
|
|
129
|
+
"target": "亮度",
|
|
130
|
+
"number": "一半",
|
|
131
|
+
"numberType": "分数"
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Windows (Cmd) 执行命令**:
|
|
136
|
+
```bash
|
|
137
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command brightness --params "{\"actionType\":\"设值\",\"target\":\"亮度\",\"number\":\"一半\",\"numberType\":\"分数\"}"'
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Linux (Bash) 执行命令**:
|
|
141
|
+
```bash
|
|
142
|
+
openclaw nodes invoke --node <ID> --command brightness --params '{"actionType":"设值","target":"亮度","number":"一半","numberType":"分数"}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 示例 3: 亮度设为3档
|
|
148
|
+
**用户输入**: "亮度调大到3档"
|
|
149
|
+
|
|
150
|
+
**工具**: "brightness"
|
|
151
|
+
|
|
152
|
+
**JSON 参数**:
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"actionType": "设值",
|
|
156
|
+
"target": "亮度",
|
|
157
|
+
"number": "3档",
|
|
158
|
+
"numberType": "级别"
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Windows (Cmd) 执行命令**:
|
|
163
|
+
```bash
|
|
164
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command brightness --params "{\"actionType\":\"设值\",\"target\":\"亮度\",\"number\":\"3档\",\"numberType\":\"级别\"}"'
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Linux (Bash) 执行命令**:
|
|
168
|
+
```bash
|
|
169
|
+
openclaw nodes invoke --node <ID> --command brightness --params '{"actionType":"设值","target":"亮度","number":"3档","numberType":"级别"}'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### 示例 4: 台灯亮度设为最高值
|
|
175
|
+
**用户输入**: "台灯亮度调到最高值"
|
|
176
|
+
|
|
177
|
+
**工具**: "brightness"
|
|
178
|
+
|
|
179
|
+
**JSON 参数**:
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"actionType": "设值",
|
|
183
|
+
"device": "台灯",
|
|
184
|
+
"target": "亮度",
|
|
185
|
+
"number": "最高",
|
|
186
|
+
"numberType": "极值"
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Windows (Cmd) 执行命令**:
|
|
191
|
+
```bash
|
|
192
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command brightness --params "{\"actionType\":\"设值\",\"device\":\"台灯\",\"target\":\"亮度\",\"number\":\"最高\",\"numberType\":\"极值\"}"'
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Linux (Bash) 执行命令**:
|
|
196
|
+
```bash
|
|
197
|
+
openclaw nodes invoke --node <ID> --command brightness --params '{"actionType":"设值","device":"台灯","target":"亮度","number":"最高","numberType":"极值"}'
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### 示例 5: 查询电视当前亮度
|
|
203
|
+
**用户输入**: "查询当前电视的亮度"
|
|
204
|
+
|
|
205
|
+
**工具**: "brightness"
|
|
206
|
+
|
|
207
|
+
**JSON 参数**:
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"actionType": "查询",
|
|
211
|
+
"device": "电视",
|
|
212
|
+
"target": "亮度"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Windows (Cmd) 执行命令**:
|
|
217
|
+
```bash
|
|
218
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command brightness --params "{\"actionType\":\"查询\",\"device\":\"电视\",\"target\":\"亮度\"}"'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Linux (Bash) 执行命令**:
|
|
222
|
+
```bash
|
|
223
|
+
openclaw nodes invoke --node <ID> --command brightness --params '{"actionType":"查询","device":"电视","target":"亮度"}'
|
|
224
|
+
```
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dark-mode
|
|
3
|
+
description: >
|
|
4
|
+
深色模式管理工具。支持开启、关闭、设置与查询,并可按指定应用执行操作,提升夜间或弱光环境下的观看舒适度。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Dark Mode 深色模式
|
|
8
|
+
|
|
9
|
+
## Tool Command
|
|
10
|
+
```bash
|
|
11
|
+
dark-mode
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 集成工作流
|
|
15
|
+
|
|
16
|
+
### Step 1: 意图解析与参数组装
|
|
17
|
+
```
|
|
18
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
19
|
+
│ 意图识别与参数提取 │
|
|
20
|
+
│ - 识别操作类型: 设置/查询/打开/关闭 │
|
|
21
|
+
│ - 提取修饰词: 应用名称 │
|
|
22
|
+
│ - 判断是否涉及应用级操作: 是否提及具体应用名 │
|
|
23
|
+
│ - 特殊处理: "浅色外观/亮色模式/明亮模式" → 映射为关闭 │
|
|
24
|
+
│ - 特殊处理: "夜间模式/黑暗模式/深色主题"等同义词统一识别 │
|
|
25
|
+
│ - 特殊处理: "切换至/启用/打开"→打开;"关闭/禁用/退出"→关闭 │
|
|
26
|
+
└─────────────────────────────────────────────────────────────┘
|
|
27
|
+
↓
|
|
28
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
29
|
+
│ 消歧与槽位填充 │
|
|
30
|
+
│ - 未指定操作类型时,需向用户追问动作意图 │
|
|
31
|
+
│ - 未指定应用名称时,默认为系统全局操作 │
|
|
32
|
+
│ - app仅当query含具体应用名时填写 │
|
|
33
|
+
│ - "切换深色模式"语义不明确时需确认目标状态 │
|
|
34
|
+
│ - 应用级操作需验证应用名称有效性 │
|
|
35
|
+
│ - query保持用户原始输入,不改写 │
|
|
36
|
+
└─────────────────────────────────────────────────────────────┘
|
|
37
|
+
↓
|
|
38
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
39
|
+
│ 生成工具调用 │
|
|
40
|
+
│ - 组装 actionType 及可选参数(app) │
|
|
41
|
+
│ - 生成平台特定的命令格式 │
|
|
42
|
+
└─────────────────────────────────────────────────────────────┘
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 2: 执行调用
|
|
46
|
+
- 根据操作系统选择对应的命令格式
|
|
47
|
+
- Windows: Cmd 格式(双引号需转义)
|
|
48
|
+
- Linux: Bash 格式(单引号包裹)
|
|
49
|
+
|
|
50
|
+
## 参数定义
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"actionType": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": [
|
|
56
|
+
"设置",
|
|
57
|
+
"查询",
|
|
58
|
+
"打开",
|
|
59
|
+
"关闭"
|
|
60
|
+
],
|
|
61
|
+
"description": "必填参数,深色模式相关操作的动作类型,用于明确本次指令的主要行为。当涉及调整深色模式相关显示参数或策略时使用设置;当获取当前深色模式开启状态或配置信息时使用查询;当要求启用深色模式显示效果时使用打开;当要求停用深色模式并恢复其他显示样式时使用关闭。"
|
|
62
|
+
},
|
|
63
|
+
"app": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "指定执行深色模式相关操作的应用名称。当用户明确要求仅在某个特定应用内启用、关闭或配置深色模式时填写。"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 参数注意事项
|
|
71
|
+
1. 必填参数取值:`actionType` 为必填参数,且 `actionType` 的取值必须在枚举列表中。
|
|
72
|
+
2. 同义词/间接表述映射: 用户口语化表述需映射到`actionType`。例如:`"浅色外观"、"亮色模式"、"明亮模式"`→`"关闭"`;`"夜间模式"、"黑暗模式"、"深色主题"`统一识别为深色模式相关;`"进入设置/配置深色模式"`→`"设置"`;`"启用/打开/切换到深色模式"`→`"打开"`;`"禁用/关闭/退出深色模式"`→`"关闭"`。
|
|
73
|
+
3. 默认值或缺省行为: 未指定`app`时默认为系统全局操作;当无法从用户输入中可靠判断`actionType`时需追问确认,不进行默认推断。
|
|
74
|
+
4. 参数间关联/依赖关系: 当`actionType`为`"设置"`、`"打开"`或`"关闭"`时,`app`可用于限定到某个应用;当`actionType`为`"查询"`时,若提供`app`则查询该应用的深色模式状态,未提供则查询系统全局状态。
|
|
75
|
+
5. 可选参数填写条件: `app`仅在用户明确提及具体应用(如`"微信"、"微博"、"浏览器"`)时填写,不进行应用名称的推断或改写。
|
|
76
|
+
|
|
77
|
+
## Query 示例及输出
|
|
78
|
+
|
|
79
|
+
### 示例 1: 系统级开启深色模式
|
|
80
|
+
|
|
81
|
+
**用户输入**: "打开深色模式"
|
|
82
|
+
|
|
83
|
+
**工具**: "dark-mode"
|
|
84
|
+
|
|
85
|
+
**JSON 参数**:
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"actionType": "打开"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Windows (Cmd) 执行命令**:
|
|
93
|
+
```bash
|
|
94
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command dark-mode --params "{\"actionType\":\"打开\"}"'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Linux (Bash) 执行命令**:
|
|
98
|
+
```bash
|
|
99
|
+
openclaw nodes invoke --node <ID> --command dark-mode --params '{"actionType":"打开"}'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### 示例 2: 系统级关闭深色模式
|
|
105
|
+
|
|
106
|
+
**用户输入**: "关闭深色模式"
|
|
107
|
+
|
|
108
|
+
**工具**: "dark-mode"
|
|
109
|
+
|
|
110
|
+
**JSON 参数**:
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"actionType": "关闭"
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Windows (Cmd) 执行命令**:
|
|
118
|
+
```bash
|
|
119
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command dark-mode --params "{\"actionType\":\"关闭\"}"'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Linux (Bash) 执行命令**:
|
|
123
|
+
```bash
|
|
124
|
+
openclaw nodes invoke --node <ID> --command dark-mode --params '{"actionType":"关闭"}'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### 示例 3: 进入深色模式设置页面
|
|
130
|
+
|
|
131
|
+
**用户输入**: "进入深色模式设置页面"
|
|
132
|
+
|
|
133
|
+
**工具**: "dark-mode"
|
|
134
|
+
|
|
135
|
+
**JSON 参数**:
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"actionType": "设置"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Windows (Cmd) 执行命令**:
|
|
143
|
+
```bash
|
|
144
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command dark-mode --params "{\"actionType\":\"设置\"}"'
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Linux (Bash) 执行命令**:
|
|
148
|
+
```bash
|
|
149
|
+
openclaw nodes invoke --node <ID> --command dark-mode --params '{"actionType":"设置"}'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### 示例 4: 通过浅色外观反向关闭深色模式
|
|
155
|
+
|
|
156
|
+
**用户输入**: "打开浅色外观"
|
|
157
|
+
|
|
158
|
+
**工具**: "dark-mode"
|
|
159
|
+
|
|
160
|
+
**JSON 参数**:
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"actionType": "关闭"
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Windows (Cmd) 执行命令**:
|
|
168
|
+
```bash
|
|
169
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command dark-mode --params "{\"actionType\":\"关闭\"}"'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Linux (Bash) 执行命令**:
|
|
173
|
+
```bash
|
|
174
|
+
openclaw nodes invoke --node <ID> --command dark-mode --params '{"actionType":"关闭"}'
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### 示例 5: 口语化切换为开启
|
|
180
|
+
|
|
181
|
+
**用户输入**: "请帮我切换深色模式"
|
|
182
|
+
|
|
183
|
+
**工具**: "dark-mode"
|
|
184
|
+
|
|
185
|
+
**JSON 参数**:
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"actionType": "打开"
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Windows (Cmd) 执行命令**:
|
|
193
|
+
```bash
|
|
194
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command dark-mode --params "{\"actionType\":\"打开\"}"'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Linux (Bash) 执行命令**:
|
|
198
|
+
```bash
|
|
199
|
+
openclaw nodes invoke --node <ID> --command dark-mode --params '{"actionType":"打开"}'
|
|
200
|
+
```
|