@honor-claw/yoyo 1.2.0 → 1.2.1-beta.0
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/package.json +1 -1
- package/skills/yoyo-control/SKILL.md +12 -2
- package/skills/yoyo-control/references/airplane-mode.md +197 -0
- package/skills/yoyo-control/references/capture-screenshot.md +28 -20
- package/skills/yoyo-control/references/clean-dirty.md +163 -0
- package/skills/yoyo-control/references/express-logistics-search.md +172 -0
- package/skills/yoyo-control/references/flashlight.md +183 -0
- package/skills/yoyo-control/references/flight-monitor-create.md +233 -0
- package/skills/yoyo-control/references/flight-monitor-search.md +229 -0
- package/skills/yoyo-control/references/scan-code.md +161 -0
- package/skills/yoyo-control/references/wlan.md +93 -24
- package/skills/yoyo-control/scripts/time_infer.py +99 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flight-monitor.query
|
|
3
|
+
description: >
|
|
4
|
+
查询用户已创建的机票价格监控任务,支持按出发地、目的地、监控日期与任务状态筛选。
|
|
5
|
+
只支持飞机票价的监控任务创建,其余票务类型(如酒店、机票联程、火车票等)暂不支持。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Query Flight Monitor Task 机票监控任务查询
|
|
9
|
+
|
|
10
|
+
## Tool Provider
|
|
11
|
+
```bash
|
|
12
|
+
com.hihonor.magicvoice
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Tool Command
|
|
16
|
+
```bash
|
|
17
|
+
query_flight_monitor_task
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 集成工作流
|
|
21
|
+
|
|
22
|
+
### Step 1: 意图解析与参数组装
|
|
23
|
+
```
|
|
24
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
25
|
+
│ 意图识别与参数提取 │
|
|
26
|
+
│ - 识别操作意图: 查询 + 机票价格监控任务 │
|
|
27
|
+
│ - 提取目的地: 城市名/机场名/别称 │
|
|
28
|
+
│ - 提取出发地: 城市名/机场名/别称 │
|
|
29
|
+
│ - 提取监控日期: 具体日期/日期范围/自然语言时间 │
|
|
30
|
+
│ - 提取任务状态: 已过期/监控中/监控成功 │
|
|
31
|
+
│ - 特殊处理: "监控中的/正在监控" → 映射为监控中 │
|
|
32
|
+
│ - 特殊处理: "过期/失效" → 已过期;"成功/达成" → 监控成功 │
|
|
33
|
+
└─────────────────────────────────────────────────────────────┘
|
|
34
|
+
↓
|
|
35
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
36
|
+
│ 消歧与槽位填充 │
|
|
37
|
+
│ - 未指定任何筛选条件时,默认查询全部监控任务 │
|
|
38
|
+
│ - destination_city/departure_city/date_time/status 缺失时, │
|
|
39
|
+
│ 不对该项筛选 │
|
|
40
|
+
│ - date_time 仅当 query 含时间表述时填写 │
|
|
41
|
+
│ - "监控中的/进行中/在监控" → 映射为监控中 │
|
|
42
|
+
│ - "已失效/过期的" → 已过期;"已触发/成功了" → 监控成功 │
|
|
43
|
+
│ - 城市名需为有效地名,避免与机场简称冲突 │
|
|
44
|
+
└─────────────────────────────────────────────────────────────┘
|
|
45
|
+
↓
|
|
46
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
47
|
+
│ 生成工具调用 │
|
|
48
|
+
│ - 组装 status 及可选参数(destination_city、departure_city、 │
|
|
49
|
+
│ date_time) │
|
|
50
|
+
│ - 生成平台特定的命令格式 │
|
|
51
|
+
└─────────────────────────────────────────────────────────────┘
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Step 2: 执行调用
|
|
55
|
+
- 根据操作系统选择对应的命令格式
|
|
56
|
+
- Windows: Cmd 格式(双引号需转义)
|
|
57
|
+
- Linux: Bash 格式(单引号包裹)
|
|
58
|
+
|
|
59
|
+
## 参数定义
|
|
60
|
+
### 工具输入参数说明
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"destination_city": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "监控任务的目的地城市名称。"
|
|
66
|
+
},
|
|
67
|
+
"departure_city": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "监控任务的出发地城市名称。"
|
|
70
|
+
},
|
|
71
|
+
"date_time": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "监控时间段的自然语言描述,直接提取用户输入中日期的描述。如:下周、下周二到下周三、周一下午。"
|
|
74
|
+
},
|
|
75
|
+
"status": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"enum": ["已过期", "监控中", "监控成功"],
|
|
78
|
+
"description": "监控任务的当前生效状态。"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 工具输出参数说明
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"result_code":{
|
|
87
|
+
"type":"integer",
|
|
88
|
+
"description":"结果状态码,100:执行成功。304:未授权三方账号,用户拒绝授权三方。402:三方接口调用出错。406:授权三方失败。500:无监控任务。"
|
|
89
|
+
},
|
|
90
|
+
"result_content":{
|
|
91
|
+
"type":"string",
|
|
92
|
+
"description":"针对不同状态码场景下,详细的执行结果,包含错误原因等。"
|
|
93
|
+
},
|
|
94
|
+
"task_count":{
|
|
95
|
+
"type":"integer",
|
|
96
|
+
"description":"查询到的监控任务总数量。"
|
|
97
|
+
},
|
|
98
|
+
"task_list":{
|
|
99
|
+
"type":"string",
|
|
100
|
+
"description":"监控任务的详细列表数据。每条数据包含序号、出发地、目的地、监控日期段、监控状态。查询失败或无监控任务(500)时返回空字符串。",
|
|
101
|
+
"examples":[
|
|
102
|
+
"{\"监控任务列表\":[{\"序号\":1,\"出发地\":\"北京\",\"目的地\":\"上海\",\"开始日期\":\"2023-12-01\",\"结束日期\":\"2023-12-03\",\"状态\":\"监控中\"},{\"序号\":2,\"出发地\":\"上海\",\"目的地\":\"广州\",\"开始日期\":\"2023-12-05\",\"状态\":\"监控成功\"}]}"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 参数注意事项
|
|
109
|
+
1. **默认值或缺省行为**: 未提供任一筛选条件时,默认返回全部监控任务;某参数未提供则不作为筛选条件参与过滤。
|
|
110
|
+
2. **可选参数填写条件**: `date_time` 仅在用户输入包含时间表述时填写;`destination_city`、`departure_city` 仅在出现明确城市名时填写;`status` 仅在用户明确提及时填写。
|
|
111
|
+
3. **格式/原样保留要求**: `date_time` 必须保留用户的自然语言原始表述,不做标准化或改写。
|
|
112
|
+
|
|
113
|
+
### date_time 参数格式转换
|
|
114
|
+
1. 当用户输入包含时间表述时,工具会直接保留原始的自然语言日期表述,然后调用`scripts/time_infer.py`时间推理模型进行转换。具体执行指令如下:
|
|
115
|
+
```bash
|
|
116
|
+
python3 scripts/time_infer.py --query <date_time>
|
|
117
|
+
```
|
|
118
|
+
2. 拿到json-string格式的转换结果,重新改写`date_time`参数,并调用`openclaw nodes invoke`命令执行工具。
|
|
119
|
+
3. 注意:time_infer模型返回的结果格式如下:`{"data_time": {...}}`,用`{...}`JSONstring的完整内容重写`date_time`参数。**不能拆解{...}的内容**
|
|
120
|
+
|
|
121
|
+
## Query 示例及输出
|
|
122
|
+
|
|
123
|
+
### 示例 1: 按目的地筛选
|
|
124
|
+
**用户输入**: "帮我查一下去上海的监控任务"
|
|
125
|
+
|
|
126
|
+
**工具**: "query_flight_monitor_task"
|
|
127
|
+
|
|
128
|
+
**JSON 参数**:
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"destination_city": "上海"
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Windows (Cmd) 执行命令**:
|
|
136
|
+
```bash
|
|
137
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"query_flight_monitor_task\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"destination_city\":\"上海\"}}"'
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Linux (Bash) 执行命令**:
|
|
141
|
+
```bash
|
|
142
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"query_flight_monitor_task","appPkg":"com.hihonor.magicvoice","arguments":{"destination_city":"上海"}}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 示例 2: 按任务状态筛选
|
|
148
|
+
**用户输入**: "查询所有监控中的任务"
|
|
149
|
+
|
|
150
|
+
**工具**: "query_flight_monitor_task"
|
|
151
|
+
|
|
152
|
+
**JSON 参数**:
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"status": "监控中"
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Windows (Cmd) 执行命令**:
|
|
160
|
+
```bash
|
|
161
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"query_flight_monitor_task\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"status\":\"监控中\"}}"'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Linux (Bash) 执行命令**:
|
|
165
|
+
```bash
|
|
166
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"query_flight_monitor_task","appPkg":"com.hihonor.magicvoice","arguments":{"status":"监控中"}}'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### 示例 3: 按时间与状态组合筛选(自然语言时间)
|
|
172
|
+
**用户输入**: "查询下周监控中的任务"
|
|
173
|
+
|
|
174
|
+
**工具**: "query_flight_monitor_task"
|
|
175
|
+
|
|
176
|
+
**JSON 参数**:
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"date_time": "下周",
|
|
180
|
+
"status": "监控中"
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
**调用时间推理模型**:
|
|
184
|
+
```bash
|
|
185
|
+
python3 scripts/time_infer.py --query "下周"
|
|
186
|
+
```
|
|
187
|
+
返回结果:{"data_time": <json-string-data>} (注意字符串转义的问题!!!)
|
|
188
|
+
|
|
189
|
+
**Windows (Cmd) 执行命令**:
|
|
190
|
+
```bash
|
|
191
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"query_flight_monitor_task\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"date_time\":\"<json-string-data>\",\"status\":\"监控中\"}}"'
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Linux (Bash) 执行命令**:
|
|
195
|
+
```bash
|
|
196
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"query_flight_monitor_task","appPkg":"com.hihonor.magicvoice","arguments":{"date_time":"<json-string-data>","status":"监控中"}}'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### 示例 4: 按时间范围与状态组合筛选
|
|
202
|
+
**用户输入**: "查询十月一号到十月七号监控中的任务"
|
|
203
|
+
|
|
204
|
+
**工具**: "query_flight_monitor_task"
|
|
205
|
+
|
|
206
|
+
**JSON 参数**:
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"date_time": "十月一号到十月七号",
|
|
210
|
+
"status": "监控中"
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
**调用时间推理模型**:
|
|
214
|
+
```bash
|
|
215
|
+
python3 scripts/time_infer.py --query "十月一号到十月七号"
|
|
216
|
+
```
|
|
217
|
+
返回结果:{"data_time": <json-string-data>} (注意字符串转义的问题!!!)
|
|
218
|
+
|
|
219
|
+
**Windows (Cmd) 执行命令**:
|
|
220
|
+
```bash
|
|
221
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"query_flight_monitor_task\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"date_time\":\"<json-string-data>\",\"status\":\"监控中\"}}"'
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Linux (Bash) 执行命令**:
|
|
225
|
+
```bash
|
|
226
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"query_flight_monitor_task","appPkg":"com.hihonor.magicvoice","arguments":{date_time":"<json-string-data>","status":"监控中"}}'
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scan-code
|
|
3
|
+
description: >
|
|
4
|
+
调用系统相机或指定应用内的扫码功能,适用于扫描二维码/条形码以实现信息获取、登录、支付、页面跳转等操作。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Scan Code 扫码功能
|
|
8
|
+
|
|
9
|
+
## Tool Provider
|
|
10
|
+
```bash
|
|
11
|
+
com.hihonor.magicvoice
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Tool Command
|
|
15
|
+
```bash
|
|
16
|
+
scan_code
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 集成工作流
|
|
20
|
+
|
|
21
|
+
### Step 1: 意图解析与参数组装
|
|
22
|
+
```
|
|
23
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
24
|
+
│ 意图识别与参数提取 │
|
|
25
|
+
│ - 识别操作意图: 打开/启动 + 扫码功能 │
|
|
26
|
+
│ - 识别操作对象: 系统相机/支持扫码的应用 │
|
|
27
|
+
│ - 提取应用名称: 如微信/支付宝/淘宝/QQ/相机等 │
|
|
28
|
+
│ - 提取修饰词: 应用名称 │
|
|
29
|
+
│ - 特殊处理: "扫一扫/扫码/扫描"等同义词统一识别 │
|
|
30
|
+
│ - 特殊处理: "系统相机/相机/摄像头" → 映射为相机 │
|
|
31
|
+
└─────────────────────────────────────────────────────────────┘
|
|
32
|
+
↓
|
|
33
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
34
|
+
│ 消歧与槽位填充 │
|
|
35
|
+
│ - 未指定应用时,默认为系统相机扫码 │
|
|
36
|
+
│ - 当提及微信/支付宝/淘宝/QQ时,填写对应应用 │
|
|
37
|
+
│ - "相机/系统相机/摄像头" → 映射为相机 │
|
|
38
|
+
│ - 验证应用可用性,无法启动时回退至系统相机 │
|
|
39
|
+
└─────────────────────────────────────────────────────────────┘
|
|
40
|
+
↓
|
|
41
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ 生成工具调用 │
|
|
43
|
+
│ - 组装 app 及可选参数 │
|
|
44
|
+
│ - 生成平台特定的命令格式 │
|
|
45
|
+
└─────────────────────────────────────────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 2: 执行调用
|
|
49
|
+
- 根据操作系统选择对应的命令格式
|
|
50
|
+
- Windows: Cmd 格式(双引号需转义)
|
|
51
|
+
- Linux: Bash 格式(单引号包裹)
|
|
52
|
+
|
|
53
|
+
## 参数定义
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"app": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "指定需要打开其扫码功能的应用显示名,如微信、QQ、相机、支付宝等。当希望在某个具体应用(如系统相机或支持扫码能力的应用)中直接进入扫码界面时填写;若未指定,则默认打开系统相机的扫码功能。",
|
|
59
|
+
"default": ""
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 参数注意事项
|
|
65
|
+
1. **默认值或缺省行为**: 未填写`app`,默认调用系统相机的扫码功能。
|
|
66
|
+
2. **可选参数填写条件**: 仅当用户明确点名应用(如 微信、支付宝、淘宝、QQ 等)时填写`app`;否则不填以触发默认行为。
|
|
67
|
+
3. **格式/原样保留要求**: `app`应使用应用的“显示名”,按照用户输入进行原文提取。
|
|
68
|
+
|
|
69
|
+
## Query 示例及输出
|
|
70
|
+
|
|
71
|
+
### 示例 1: 打开系统相机的扫码页面
|
|
72
|
+
**用户输入**: "打开相机扫码页面"
|
|
73
|
+
|
|
74
|
+
**工具**: "scan_code"
|
|
75
|
+
|
|
76
|
+
**JSON 参数**:
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"app": "相机"
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Windows (Cmd) 执行命令**:
|
|
84
|
+
```bash
|
|
85
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"scan_code\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"app\":\"相机\"}}"'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Linux (Bash) 执行命令**:
|
|
89
|
+
```bash
|
|
90
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"scan_code","appPkg":"com.hihonor.magicvoice","arguments":{"app":"相机"}}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 示例 2: 在微信内打开扫一扫
|
|
96
|
+
**用户输入**: "打开微信扫一扫"
|
|
97
|
+
|
|
98
|
+
**工具**: "scan_code"
|
|
99
|
+
|
|
100
|
+
**JSON 参数**:
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"app": "微信"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Windows (Cmd) 执行命令**:
|
|
108
|
+
```bash
|
|
109
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"scan_code\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"app\":\"微信\"}}"'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Linux (Bash) 执行命令**:
|
|
113
|
+
```bash
|
|
114
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"scan_code","appPkg":"com.hihonor.magicvoice","arguments":{"app":"微信"}}'
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### 示例 3: 使用淘宝扫描价格/条码
|
|
120
|
+
**用户输入**: "帮我用淘宝扫一下价格"
|
|
121
|
+
|
|
122
|
+
**工具**: "scan_code"
|
|
123
|
+
|
|
124
|
+
**JSON 参数**:
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"app": "淘宝"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Windows (Cmd) 执行命令**:
|
|
132
|
+
```bash
|
|
133
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"scan_code\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{\"app\":\"淘宝\"}}"'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Linux (Bash) 执行命令**:
|
|
137
|
+
```bash
|
|
138
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"scan_code","appPkg":"com.hihonor.magicvoice","arguments":{"app":"淘宝"}}'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### 示例 4: 默认调用(未指定应用)
|
|
144
|
+
**用户输入**: "扫描屏幕上的二维码"
|
|
145
|
+
|
|
146
|
+
**工具**: "scan_code"
|
|
147
|
+
|
|
148
|
+
**JSON 参数**:
|
|
149
|
+
```json
|
|
150
|
+
{}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Windows (Cmd) 执行命令**:
|
|
154
|
+
```bash
|
|
155
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command mcp.tool.call --params "{\"name\":\"scan_code\",\"appPkg\":\"com.hihonor.magicvoice\",\"arguments\":{}}"'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Linux (Bash) 执行命令**:
|
|
159
|
+
```bash
|
|
160
|
+
openclaw nodes invoke --node <ID> --command mcp.tool.call --params '{"name":"scan_code","appPkg":"com.hihonor.magicvoice","arguments":{}}'
|
|
161
|
+
```
|
|
@@ -3,6 +3,7 @@ name: wlan
|
|
|
3
3
|
description: >
|
|
4
4
|
WLAN(无线网络、WiFi)管理工具。提供对WLAN及其相关能力的统一管理与控制,
|
|
5
5
|
支持WLAN的开启与关闭、参数设置与状态查询,并可对WLAN使用的流量与流量提醒进行管理。
|
|
6
|
+
支持连接到指定WLAN网络名称和密码的WLAN(无线网络、WiFi)。
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# WLAN WiFi管理
|
|
@@ -23,7 +24,8 @@ wlan
|
|
|
23
24
|
│ - 识别操作类型: 打开/关闭/设置/查询 │
|
|
24
25
|
│ - 识别操作对象: WLAN/WiFi/无线网络/wlan+/WLAN直连 │
|
|
25
26
|
│ - 提取目标网络: wlan/wlan+/wlan直连 │
|
|
26
|
-
│ - 提取网络名称: 特定WiFi
|
|
27
|
+
│ - 提取网络名称: 特定WiFi名称(连接或查询时由用户提供) │
|
|
28
|
+
│ - 提取密码: 在连接特定WiFi名称时,由用户提供 │
|
|
27
29
|
│ - 提取流量类型: 流量/流量提醒(流量管理时) │
|
|
28
30
|
│ - 提取应用指定: 特定应用名称(应用内操作时) │
|
|
29
31
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -34,18 +36,19 @@ wlan
|
|
|
34
36
|
│ - 增强功能识别: wlan+/WLAN+ 映射为 wlan+ │
|
|
35
37
|
│ - 直连功能识别: WLAN直连/wlan直连 映射为 wlan直连 │
|
|
36
38
|
│ - 状态查询类缺省时,默认查询当前WLAN状态 │
|
|
39
|
+
| - 连接动作识别:连接/加入 → 连接 |
|
|
37
40
|
└─────────────────────────────────────────────────────────────┘
|
|
38
41
|
↓
|
|
39
42
|
┌─────────────────────────────────────────────────────────────┐
|
|
40
43
|
│ 必填参数校验 │
|
|
41
|
-
│ - 校验 actionType: 必须为
|
|
44
|
+
│ - 校验 actionType: 必须为 设置/查询/打开/关闭/连接 之一 │
|
|
42
45
|
│ - 校验 target: 必须为 wlan/wlan+/wlan直连 之一 │
|
|
43
46
|
│ - 两必填参数缺失时,根据意图推断默认值 │
|
|
44
47
|
└─────────────────────────────────────────────────────────────┘
|
|
45
48
|
↓
|
|
46
49
|
┌─────────────────────────────────────────────────────────────┐
|
|
47
50
|
│ 生成工具调用 │
|
|
48
|
-
│ - 组装 actionType, target,
|
|
51
|
+
│ - 组装 actionType, target 及可选参数:ssid, password, ata_type, app │
|
|
49
52
|
│ - 生成平台特定的命令格式 │
|
|
50
53
|
└─────────────────────────────────────────────────────────────┘
|
|
51
54
|
```
|
|
@@ -64,7 +67,7 @@ wlan
|
|
|
64
67
|
| **关闭WiFi** | 关闭/停用/停止 + WLAN/WiFi/无线网络 | `关闭` | `wlan` | `app` |
|
|
65
68
|
| **WiFi设置** | 设置/配置/修改 + WLAN设置/WiFi参数 | `设置` | `wlan` | `app` |
|
|
66
69
|
| **WiFi状态查询** | 查看/查询/获取 + WiFi状态/WLAN信息 | `查询` | `wlan` | - |
|
|
67
|
-
| **连接指定网络** | 连接/加入 + 具体WiFi名称 |
|
|
70
|
+
| **连接指定网络** | 连接/加入 + 具体WiFi名称 | `连接` | `wlan` | `ssid`, `password` |
|
|
68
71
|
| **开启WLAN+** | 打开/开启 + WLAN+/网络增强 | `打开` | `wlan+` | `app` |
|
|
69
72
|
| **关闭WLAN+** | 关闭/停用 + WLAN+ | `关闭` | `wlan+` | `app` |
|
|
70
73
|
| **WLAN+设置** | 设置/配置 + WLAN+ | `设置` | `wlan+` | `app` |
|
|
@@ -79,8 +82,8 @@ wlan
|
|
|
79
82
|
{
|
|
80
83
|
"actionType": {
|
|
81
84
|
"type": "string",
|
|
82
|
-
"enum": ["设置", "查询", "打开", "关闭"],
|
|
83
|
-
"description": "必填参数,WLAN
|
|
85
|
+
"enum": ["设置", "查询", "打开", "关闭", "连接"],
|
|
86
|
+
"description": "必填参数,WLAN相关操作的动作类型,用于明确本次指令的主要行为。设置:修改WLAN、流量或相关功能配置;查询:获取当前WLAN状态、配置或流量信息;打开:启用WLAN或相关能力;关闭:停用WLAN或相关能力;连接:连接到某个WLAN网络。",
|
|
84
87
|
"required": true
|
|
85
88
|
},
|
|
86
89
|
"target": {
|
|
@@ -89,15 +92,19 @@ wlan
|
|
|
89
92
|
"description": "必填参数,WLAN操作的具体对象,用于限定actionType的作用范围。wlan:基础无线网络功能;wlan+:网络增强或组合能力;wlan直连:设备间直连相关操作。",
|
|
90
93
|
"required": true
|
|
91
94
|
},
|
|
92
|
-
"
|
|
93
|
-
"type": "string",
|
|
94
|
-
"description": "需要操作或查询的WLAN网络名称(SSID)。当用户明确提及某个具体无线网络,或在存在多个可选网络时填写,用于精确定位目标WLAN。"
|
|
95
|
-
},
|
|
96
|
-
"data_type": {
|
|
95
|
+
"dataType": {
|
|
97
96
|
"type": "string",
|
|
98
97
|
"enum": ["流量", "流量提醒"],
|
|
99
98
|
"description": "WLAN流量相关的操作或查询类型。流量:流量使用情况;流量提醒:流量阈值、提醒或通知设置。"
|
|
100
99
|
},
|
|
100
|
+
"ssid": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "需要连接的 WLAN 网络名称(SSID)。当用户明确提及某个具体无线网络,或在存在多个可选网络时填写,用于精确定位目标 WLAN。"
|
|
103
|
+
},
|
|
104
|
+
"password": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"description": "连接的 WLAN 需要输入的密码"
|
|
107
|
+
},
|
|
101
108
|
"app": {
|
|
102
109
|
"type": "string",
|
|
103
110
|
"description": "指定通过某个应用执行WLAN相关操作。当用户明确要求在特定应用内进行网络配置或查询时填写。"
|
|
@@ -107,14 +114,21 @@ wlan
|
|
|
107
114
|
|
|
108
115
|
### 参数注意事项
|
|
109
116
|
|
|
110
|
-
1. **必填参数**:`actionType` 和 `target`
|
|
117
|
+
1. **必填参数**:`actionType` 和 `target` 为必填参数,必须同时传入,其取值必须满足枚举值范围。
|
|
111
118
|
2. **target 枚举值**:
|
|
112
119
|
- `wlan`:基础无线网络(WiFi)
|
|
113
120
|
- `wlan+`:网络增强功能
|
|
114
121
|
- `wlan直连`:设备间直连功能
|
|
115
|
-
3. **
|
|
116
|
-
4. **
|
|
117
|
-
5. **
|
|
122
|
+
3. **dataType**:仅在流量管理场景下使用,区分流量查询和流量提醒设置
|
|
123
|
+
4. **ssid**:连接特定网络时使用,传入目标WiFi的SSID名称
|
|
124
|
+
5. **password**:连接特定网络时使用,传入目标WiFi的密码
|
|
125
|
+
6. **app**:用户明确要求在特定应用内操作时填写
|
|
126
|
+
7. **默认值或缺省行为**: 未指定 `target` 时默认取 "wlan";用户仅说“连接网络/连上 Wi‑Fi”且未给出 `ssid`/`password` 时,优先处理为开启 WLAN(`actionType`="打开")。
|
|
127
|
+
|
|
128
|
+
### 连接特定WLAN网络的参数校验
|
|
129
|
+
当 `actionType`为 "连接" 时需检查用户是否提供目标WiFi名称和目标WiFi密码:
|
|
130
|
+
- 如果用户未提供目标WiFi名称,则主动提示用户提供目标WiFi名称。
|
|
131
|
+
- 如果用户未提供目标WiFi密码,则生成提示话术与用户确认目标WiFi是否为开放网络,如果用户确认目标WiFi为开放网络,则执行连接操作;如果用户确认目标WiFi为加密网络,则主动提示用户提供目标WiFi密码。
|
|
118
132
|
|
|
119
133
|
## 出参定义
|
|
120
134
|
|
|
@@ -140,19 +154,19 @@ wlan
|
|
|
140
154
|
"302": "出错后人需要执行NEXT"
|
|
141
155
|
}
|
|
142
156
|
},
|
|
143
|
-
"
|
|
157
|
+
"resultContent": {
|
|
144
158
|
"type": "string",
|
|
145
159
|
"description": "针对不同状态码场景下,详细的执行结果,包含错误原因等。"
|
|
146
160
|
},
|
|
147
|
-
"
|
|
161
|
+
"itemName": {
|
|
148
162
|
"type": "string",
|
|
149
163
|
"description": "当前执行的功能项的名称"
|
|
150
164
|
},
|
|
151
|
-
"
|
|
165
|
+
"itemStatus": {
|
|
152
166
|
"type": "bool",
|
|
153
167
|
"description": "当前执行的功能项的状态,一般为开启或者关闭"
|
|
154
168
|
},
|
|
155
|
-
"
|
|
169
|
+
"showString": {
|
|
156
170
|
"type": "string",
|
|
157
171
|
"description": "任务执行结束后反馈给用户的答复语"
|
|
158
172
|
}
|
|
@@ -270,31 +284,86 @@ openclaw nodes invoke --node <ID> --command wlan --params '{"actionType":"查询
|
|
|
270
284
|
|
|
271
285
|
---
|
|
272
286
|
|
|
273
|
-
### 示例 5: 打开WLAN
|
|
287
|
+
### 示例 5: 打开WLAN以便连接网络
|
|
274
288
|
|
|
275
|
-
**用户输入**: "
|
|
289
|
+
**用户输入**: "帮我连接网络"
|
|
276
290
|
|
|
277
291
|
**JSON 参数**:
|
|
278
292
|
|
|
279
293
|
```json
|
|
280
294
|
{
|
|
281
295
|
"actionType": "打开",
|
|
282
|
-
"target": "wlan
|
|
296
|
+
"target": "wlan"
|
|
283
297
|
}
|
|
284
298
|
```
|
|
285
299
|
|
|
286
300
|
**Windows (Cmd) 执行命令**:
|
|
287
301
|
|
|
288
302
|
```bash
|
|
289
|
-
cmd /c 'openclaw nodes invoke --node <ID> --command wlan --params "{\"actionType\":\"打开\",\"target\":\"wlan
|
|
303
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command wlan --params "{\"actionType\":\"打开\",\"target\":\"wlan\"}"'
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Linux (Bash) 执行命令**:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
openclaw nodes invoke --node <ID> --command wlan --params '{"actionType":"打开","target":"wlan"}'
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### 示例 6: 连接指定开放网络
|
|
315
|
+
**用户输入**: "帮我连接名为 HT_AP 的wifi网络"
|
|
316
|
+
**缺少密码信息,生成追问话术**:"请问 HT_AP 是开放网络还是加密网络?如果是加密网络,您还需要告诉我密码我才能帮你连接哦~~"
|
|
317
|
+
**用户输入**: "HT_AP 是开放网络,不需要密码"
|
|
318
|
+
**JSON 参数**:
|
|
319
|
+
```json
|
|
320
|
+
{
|
|
321
|
+
"actionType": "连接",
|
|
322
|
+
"target": "wlan",
|
|
323
|
+
"ssid": "HT_AP"
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**Windows (Cmd) 执行命令**:
|
|
328
|
+
```bash
|
|
329
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command wlan --params "{\"actionType\":\"连接\",\"target\":\"wlan\",\"ssid\":\"HT_AP\"}"'
|
|
290
330
|
```
|
|
291
331
|
|
|
292
332
|
**Linux (Bash) 执行命令**:
|
|
333
|
+
```bash
|
|
334
|
+
openclaw nodes invoke --node <ID> --command wlan --params '{"actionType":"连接","target":"wlan","ssid":"HT_AP"}'
|
|
335
|
+
```
|
|
293
336
|
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
### 示例 7: 连接指定加密网络
|
|
340
|
+
**用户输入**: "帮我连接名为HT_AP 123的wifi网络"
|
|
341
|
+
**缺少密码信息,生成追问话术**:"哎呀,好像忘记输入密码啦!请问您要连接的这个WiFi是开放网络吗?
|
|
342
|
+
如果是公共开放网络,您可以直接回复我【连接】。
|
|
343
|
+
如果是加密网络,麻烦您补充一下密码,我马上帮您连上!"
|
|
344
|
+
**用户输入**: "密码是 <PASSWORD>"
|
|
345
|
+
**JSON 参数**:
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"actionType": "连接",
|
|
349
|
+
"target": "wlan",
|
|
350
|
+
"ssid": "HT_AP 123",
|
|
351
|
+
"password": "<PASSWORD>"
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Windows (Cmd) 执行命令**:
|
|
356
|
+
```bash
|
|
357
|
+
cmd /c 'openclaw nodes invoke --node <ID> --command wlan --params "{\"actionType\":\"连接\",\"target\":\"wlan\",\"ssid\":\"HT_AP 123\",\"password\":\"<PASSWORD>\"}"'
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**Linux (Bash) 执行命令**:
|
|
294
361
|
```bash
|
|
295
|
-
openclaw nodes invoke --node <ID> --command wlan --params '{"actionType":"
|
|
362
|
+
openclaw nodes invoke --node <ID> --command wlan --params '{"actionType":"连接","target":"wlan","ssid":"HT_AP 123", "password":"<PASSWORD>"}'
|
|
296
363
|
```
|
|
297
364
|
|
|
365
|
+
---
|
|
366
|
+
|
|
298
367
|
## 返回结果说明
|
|
299
368
|
|
|
300
369
|
操作成功时(result_code=200),返回执行结果:
|