@honor-claw/yoyo 0.0.1-alpha.2 → 0.0.1-beta.10
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 +2 -2
- package/openclaw.plugin.json +4 -0
- package/package.json +1 -2
- package/skills/search/SKILL.md +182 -0
- package/skills/search/scripts/search.sh +69 -0
- package/skills/yoyo-control/SKILL.md +93 -113
- package/skills/yoyo-control/references/alarm-create.md +244 -0
- package/skills/yoyo-control/references/app-close.md +265 -0
- package/skills/yoyo-control/references/app-open.md +266 -0
- package/skills/yoyo-control/references/call-phone.md +261 -0
- package/skills/yoyo-control/references/call-search.md +243 -0
- package/skills/yoyo-control/references/capture-screenshot.md +205 -54
- package/skills/yoyo-control/references/contact-search.md +235 -0
- package/skills/yoyo-control/references/hotspot.md +208 -0
- package/skills/yoyo-control/references/local-search.md +224 -15
- package/skills/yoyo-control/references/message-send.md +234 -0
- package/skills/yoyo-control/references/mobile-data.md +248 -0
- package/skills/yoyo-control/references/no-disturb.md +239 -0
- package/skills/yoyo-control/references/quiet-mode.md +228 -0
- package/skills/yoyo-control/references/ringing-mode.md +223 -0
- package/skills/yoyo-control/references/screen-record.md +220 -0
- package/skills/yoyo-control/references/sound-and-vibration.md +223 -0
- package/skills/yoyo-control/references/vibration-mode.md +240 -0
- package/skills/yoyo-control/references/volume-operate.md +274 -0
- package/src/agent/copy-templates.ts +56 -0
- package/src/agent/index.ts +3 -0
- package/src/apis/claw-cloud.ts +30 -22
- package/src/apis/honor-auth.ts +3 -1
- package/src/cloud-channel/channel.ts +196 -59
- package/src/cloud-channel/client.ts +27 -8
- package/src/cloud-channel/types.ts +21 -0
- package/src/commands/env/impl.ts +38 -0
- package/src/commands/env/index.ts +1 -0
- package/src/commands/index.ts +11 -1
- package/src/commands/login/impl.ts +6 -4
- package/src/commands/logout/impl.ts +26 -0
- package/src/commands/logout/index.ts +1 -53
- package/src/gateway-client/client.ts +16 -19
- package/src/gateway-client/types.ts +2 -2
- package/src/honor-auth/config.ts +25 -17
- package/src/modules/claw-configs/config-manager.ts +148 -11
- package/src/modules/claw-configs/hosts.ts +30 -0
- package/src/modules/claw-configs/index.ts +1 -0
- package/src/modules/claw-configs/types.ts +2 -0
- package/src/modules/device/device-info.ts +20 -9
- package/src/modules/device/providers/linux.ts +128 -0
- package/src/modules/device/providers/macos.ts +116 -0
- package/src/modules/device/providers/pad.ts +0 -16
- package/src/modules/device/registry.ts +3 -2
- package/src/modules/login/impl.ts +22 -2
- package/src/runtime.ts +20 -0
- package/src/schemas.ts +3 -2
- package/src/services/connection/impl.ts +19 -3
- package/src/utils/fs-safe.ts +544 -0
- package/src/utils/version.ts +21 -0
- package/skills/yoyo-control/references/open-app.md +0 -54
- package/skills/yoyo-control/references/phone-call.md +0 -217
- package/skills/yoyo-control/references/schedule.md +0 -107
- package/skills/yoyo-control/references/screen-recorder.md +0 -67
- package/skills/yoyo-control/references/search-contact.md +0 -37
- package/skills/yoyo-control/references/send-message.md +0 -155
- package/skills/yoyo-control/references/volume.md +0 -536
- package/skills/yoyo-control/scripts/README.md +0 -103
- package/skills/yoyo-control/scripts/invoke.js +0 -119
- package/skills/yoyo-control/scripts/volume-up.json +0 -7
package/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
|
2
2
|
import { setYoyoRuntime } from "./src/runtime.js";
|
|
3
3
|
import { registerCommands } from "./src/commands/index.js";
|
|
4
4
|
import { YoyoPluginConfigSchema } from "./src/schemas.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createClawConnectionService } from "./src/services/connection/index.js";
|
|
6
6
|
import { setClawLogger } from "./src/utils/logger.js";
|
|
7
7
|
|
|
8
8
|
const plugin = {
|
|
@@ -15,7 +15,7 @@ const plugin = {
|
|
|
15
15
|
setClawLogger(api.logger);
|
|
16
16
|
|
|
17
17
|
// 利用服务来管理核心连接任务进行~
|
|
18
|
-
api.registerService(
|
|
18
|
+
api.registerService(createClawConnectionService(api));
|
|
19
19
|
|
|
20
20
|
// 注册所有的命令行
|
|
21
21
|
registerCommands(api);
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honor-claw/yoyo",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenClaw Honor Yoyo connection plugin",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@sinclair/typebox": "0.34.48",
|
|
34
33
|
"http-proxy-agent": "^8.0.0",
|
|
35
34
|
"https-proxy-agent": "^8.0.0",
|
|
36
35
|
"jsonwebtoken": "^9.0.3",
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: "Search the web using Tavily's LLM-optimized search API. Returns relevant results with content snippets, scores, and metadata. Use when you need to find web content on any topic without writing code."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Search Skill
|
|
7
|
+
|
|
8
|
+
Search the web and get relevant results optimized for LLM consumption.
|
|
9
|
+
|
|
10
|
+
## Authentication
|
|
11
|
+
|
|
12
|
+
The script uses OAuth via the Tavily MCP server. **No manual setup required** - on first run, it will:
|
|
13
|
+
1. Check for existing tokens in `~/.mcp-auth/`
|
|
14
|
+
2. If none found, automatically open your browser for OAuth authentication
|
|
15
|
+
|
|
16
|
+
> **Note:** You must have an existing Tavily account. The OAuth flow only supports login — account creation is not available through this flow. [Sign up at tavily.com](https://tavily.com) first if you don't have an account.
|
|
17
|
+
|
|
18
|
+
### Alternative: API Key
|
|
19
|
+
|
|
20
|
+
If you prefer using an API key, get one at https://tavily.com and add to `~/.claude/settings.json`:
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"env": {
|
|
24
|
+
"TAVILY_API_KEY": "tvly-your-api-key-here"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### Using the Script
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
./scripts/search.sh '<json>'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Examples:**
|
|
38
|
+
```bash
|
|
39
|
+
# Basic search
|
|
40
|
+
./scripts/search.sh '{"query": "python async patterns"}'
|
|
41
|
+
|
|
42
|
+
# With options
|
|
43
|
+
./scripts/search.sh '{"query": "React hooks tutorial", "max_results": 10}'
|
|
44
|
+
|
|
45
|
+
# Advanced search with filters
|
|
46
|
+
./scripts/search.sh '{"query": "AI news", "time_range": "week", "max_results": 10}'
|
|
47
|
+
|
|
48
|
+
# Domain-filtered search
|
|
49
|
+
./scripts/search.sh '{"query": "machine learning", "include_domains": ["arxiv.org", "github.com"], "search_depth": "advanced"}'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Basic Search
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
curl --request POST \
|
|
56
|
+
--url https://api.tavily.com/search \
|
|
57
|
+
--header "Authorization: Bearer $TAVILY_API_KEY" \
|
|
58
|
+
--header 'Content-Type: application/json' \
|
|
59
|
+
--data '{
|
|
60
|
+
"query": "latest developments in quantum computing",
|
|
61
|
+
"max_results": 5
|
|
62
|
+
}'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Advanced Search
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl --request POST \
|
|
69
|
+
--url https://api.tavily.com/search \
|
|
70
|
+
--header "Authorization: Bearer $TAVILY_API_KEY" \
|
|
71
|
+
--header 'Content-Type: application/json' \
|
|
72
|
+
--data '{
|
|
73
|
+
"query": "machine learning best practices",
|
|
74
|
+
"max_results": 10,
|
|
75
|
+
"search_depth": "advanced",
|
|
76
|
+
"include_domains": ["arxiv.org", "github.com"]
|
|
77
|
+
}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## API Reference
|
|
81
|
+
|
|
82
|
+
### Endpoint
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
POST https://api.tavily.com/search
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Headers
|
|
89
|
+
|
|
90
|
+
| Header | Value |
|
|
91
|
+
|--------|-------|
|
|
92
|
+
| `Authorization` | `Bearer <TAVILY_API_KEY>` |
|
|
93
|
+
| `Content-Type` | `application/json` |
|
|
94
|
+
|
|
95
|
+
### Request Body
|
|
96
|
+
|
|
97
|
+
| Field | Type | Default | Description |
|
|
98
|
+
|-------|------|---------|-------------|
|
|
99
|
+
| `query` | string | Required | Search query (keep under 400 chars) |
|
|
100
|
+
| `max_results` | integer | 10 | Maximum results (0-20) |
|
|
101
|
+
| `search_depth` | string | `"basic"` | `ultra-fast`, `fast`, `basic`, `advanced` |
|
|
102
|
+
| `topic` | string | `"general"` | Search topic (general only) |
|
|
103
|
+
| `time_range` | string | null | `day`, `week`, `month`, `year` |
|
|
104
|
+
| `start_date` | string | null | Return results after this date (`YYYY-MM-DD`) |
|
|
105
|
+
| `end_date` | string | null | Return results before this date (`YYYY-MM-DD`) |
|
|
106
|
+
| `include_domains` | array | [] | Domains to include (max 300) |
|
|
107
|
+
| `exclude_domains` | array | [] | Domains to exclude (max 150) |
|
|
108
|
+
| `country` | string | null | Boost results from a specific country (general topic only) |
|
|
109
|
+
| `include_raw_content` | boolean | false | Include full page content |
|
|
110
|
+
| `include_images` | boolean | false | Include image results |
|
|
111
|
+
| `include_image_descriptions` | boolean | false | Include descriptions for images |
|
|
112
|
+
| `include_favicon` | boolean | false | Include favicon URL for each result |
|
|
113
|
+
|
|
114
|
+
### Response Format
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"query": "latest developments in quantum computing",
|
|
119
|
+
"results": [
|
|
120
|
+
{
|
|
121
|
+
"title": "Page Title",
|
|
122
|
+
"url": "https://example.com/page",
|
|
123
|
+
"content": "Extracted text snippet...",
|
|
124
|
+
"score": 0.85
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"response_time": 1.2
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Search Depth
|
|
132
|
+
|
|
133
|
+
| Depth | Latency | Relevance | Content Type |
|
|
134
|
+
|-------|---------|-----------|--------------|
|
|
135
|
+
| `ultra-fast` | Lowest | Lower | NLP summary |
|
|
136
|
+
| `fast` | Low | Good | Chunks |
|
|
137
|
+
| `basic` | Medium | High | NLP summary |
|
|
138
|
+
| `advanced` | Higher | Highest | Chunks |
|
|
139
|
+
|
|
140
|
+
**When to use each:**
|
|
141
|
+
- `ultra-fast`: Real-time chat, autocomplete
|
|
142
|
+
- `fast`: Need chunks but latency matters
|
|
143
|
+
- `basic`: General-purpose, balanced
|
|
144
|
+
- `advanced`: Precision matters (default recommendation)
|
|
145
|
+
|
|
146
|
+
## Examples
|
|
147
|
+
|
|
148
|
+
### Domain-Filtered Search
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
curl --request POST \
|
|
152
|
+
--url https://api.tavily.com/search \
|
|
153
|
+
--header "Authorization: Bearer $TAVILY_API_KEY" \
|
|
154
|
+
--header 'Content-Type: application/json' \
|
|
155
|
+
--data '{
|
|
156
|
+
"query": "Python async best practices",
|
|
157
|
+
"include_domains": ["docs.python.org", "realpython.com", "github.com"],
|
|
158
|
+
"search_depth": "advanced"
|
|
159
|
+
}'
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Search with Full Content
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
curl --request POST \
|
|
166
|
+
--url https://api.tavily.com/search \
|
|
167
|
+
--header "Authorization: Bearer $TAVILY_API_KEY" \
|
|
168
|
+
--header 'Content-Type: application/json' \
|
|
169
|
+
--data '{
|
|
170
|
+
"query": "React hooks tutorial",
|
|
171
|
+
"max_results": 3,
|
|
172
|
+
"include_raw_content": true
|
|
173
|
+
}'
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Tips
|
|
177
|
+
|
|
178
|
+
- **Keep queries under 400 characters** - Think search query, not prompt
|
|
179
|
+
- **Break complex queries into sub-queries** - Better results than one massive query
|
|
180
|
+
- **Use `include_domains`** to focus on trusted sources
|
|
181
|
+
- **Use `time_range`** for recent information
|
|
182
|
+
- **Filter by `score`** (0-1) to get highest relevance results
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Tavily Search API script
|
|
3
|
+
# Usage: ./search.sh '{"query": "your search query", ...}'
|
|
4
|
+
# Example: ./search.sh '{"query": "AI news", "time_range": "week", "max_results": 10}'
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Check for TAVILY_API_KEY environment variable
|
|
9
|
+
if [ -z "$TAVILY_API_KEY" ]; then
|
|
10
|
+
echo "Error: TAVILY_API_KEY environment variable is required" >&2
|
|
11
|
+
echo "Please set it: export TAVILY_API_KEY='your-api-key'" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
JSON_INPUT="$1"
|
|
16
|
+
|
|
17
|
+
if [ -z "$JSON_INPUT" ]; then
|
|
18
|
+
echo "Usage: ./search.sh '<json>'"
|
|
19
|
+
echo ""
|
|
20
|
+
echo "Required:"
|
|
21
|
+
echo " query: string - Search query (keep under 400 chars)"
|
|
22
|
+
echo ""
|
|
23
|
+
echo "Optional:"
|
|
24
|
+
echo " search_depth: \"ultra-fast\", \"fast\", \"basic\" (default), \"advanced\""
|
|
25
|
+
echo " topic: \"general\" (default)"
|
|
26
|
+
echo " max_results: 1-20 (default: 10)"
|
|
27
|
+
echo " time_range: \"day\", \"week\", \"month\", \"year\""
|
|
28
|
+
echo " start_date: \"YYYY-MM-DD\""
|
|
29
|
+
echo " end_date: \"YYYY-MM-DD\""
|
|
30
|
+
echo " include_domains: [\"domain1.com\", \"domain2.com\"]"
|
|
31
|
+
echo " exclude_domains: [\"domain1.com\", \"domain2.com\"]"
|
|
32
|
+
echo " country: country name (general topic only)"
|
|
33
|
+
echo " include_raw_content: true/false"
|
|
34
|
+
echo " include_images: true/false"
|
|
35
|
+
echo " include_image_descriptions: true/false"
|
|
36
|
+
echo " include_favicon: true/false"
|
|
37
|
+
echo ""
|
|
38
|
+
echo "Example:"
|
|
39
|
+
echo " ./search.sh '{\"query\": \"latest AI trends\", \"time_range\": \"week\"}'"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
MCP_REQUEST='{
|
|
44
|
+
"jsonrpc": "2.0",
|
|
45
|
+
"id": 1,
|
|
46
|
+
"method": "tools/call",
|
|
47
|
+
"params": {
|
|
48
|
+
"name": "tavily_search",
|
|
49
|
+
"arguments": '"$JSON_INPUT"'
|
|
50
|
+
}
|
|
51
|
+
}'
|
|
52
|
+
|
|
53
|
+
# Call Tavily MCP server via HTTPS
|
|
54
|
+
RESPONSE=$(curl -s --request POST \
|
|
55
|
+
--url "https://mcp.tavily.com/mcp" \
|
|
56
|
+
--header "Authorization: Bearer $TAVILY_API_KEY" \
|
|
57
|
+
--header 'Content-Type: application/json' \
|
|
58
|
+
--header 'Accept: application/json, text/event-stream' \
|
|
59
|
+
--header 'x-client-source: claude-code-skill' \
|
|
60
|
+
--data "$MCP_REQUEST")
|
|
61
|
+
|
|
62
|
+
# Parse SSE response and extract the JSON result
|
|
63
|
+
JSON_DATA=$(echo "$RESPONSE" | grep '^data:' | sed 's/^data://' | head -1)
|
|
64
|
+
|
|
65
|
+
if [ -n "$JSON_DATA" ]; then
|
|
66
|
+
echo "$JSON_DATA"
|
|
67
|
+
else
|
|
68
|
+
echo "$RESPONSE"
|
|
69
|
+
fi
|
|
@@ -5,7 +5,7 @@ description: Whenever a task requires **operating or controlling the phone**, eg
|
|
|
5
5
|
metadata: { "openclaw": { "emoji": "📱", "always": true } }
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Control
|
|
8
|
+
# YOYO Control
|
|
9
9
|
|
|
10
10
|
Follow the workflow to control phone or pad with YOYO, Don't guess the commands.
|
|
11
11
|
|
|
@@ -13,9 +13,9 @@ Follow the workflow to control phone or pad with YOYO, Don't guess the commands.
|
|
|
13
13
|
|
|
14
14
|
Follow this **4-step workflow** when using the skill:
|
|
15
15
|
|
|
16
|
-
1. Query the
|
|
17
|
-
2.
|
|
18
|
-
3.
|
|
16
|
+
1. Query the nodes status to identify available device, and determine the target device.
|
|
17
|
+
2. Plan the tool to use, and extract command & parameters according to the tool reference.
|
|
18
|
+
3. Invoke node with correct nodeId, command and parameters.
|
|
19
19
|
4. Present the result and confirm whether the operation was successful.
|
|
20
20
|
|
|
21
21
|
### Step 1. Discover Nodes
|
|
@@ -26,9 +26,11 @@ Follow this **4-step workflow** when using the skill:
|
|
|
26
26
|
|
|
27
27
|
**Execution result**:
|
|
28
28
|
|
|
29
|
+
```markdown
|
|
29
30
|
| Node | ID | IP | Detail | Status | Caps |
|
|
30
31
|
| ---------- | -------- | -------- | -------- | -------- | ------ |
|
|
31
32
|
| <nodeName> | <nodeId> | <nodeIP> | <detail> | <status> | <caps> |
|
|
33
|
+
```
|
|
32
34
|
|
|
33
35
|
#### Capability Matching Logic
|
|
34
36
|
|
|
@@ -40,10 +42,25 @@ Match device capabilities with user intent:
|
|
|
40
42
|
3. Filter nodes that support the required operation
|
|
41
43
|
```
|
|
42
44
|
|
|
45
|
+
#### Node Identifier Rules
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
49
|
+
│ CORRECT: Use ID or IP from nodes status output │
|
|
50
|
+
│ ✅ node {baseDir}/scripts/invoke.js --node 192.168.1.100 │
|
|
51
|
+
│ ✅ node {baseDir}/scripts/invoke.js --node f5f8916028aa5 │
|
|
52
|
+
├─────────────────────────────────────────────────────────────┤
|
|
53
|
+
│ INCORRECT: Use Node name column │
|
|
54
|
+
│ ❌ node {baseDir}/scripts/invoke.js --node "Honor Magic6" │
|
|
55
|
+
│ ❌ node {baseDir}/scripts/invoke.js --node "My Phone" │
|
|
56
|
+
└─────────────────────────────────────────────────────────────┘
|
|
57
|
+
```
|
|
58
|
+
|
|
43
59
|
#### Selection Rules
|
|
44
60
|
|
|
45
61
|
**Automatic Selection** (single best match):
|
|
46
62
|
|
|
63
|
+
- If there is only one node connected, then it is considered to be the target one.
|
|
47
64
|
- Only one node matches all required capabilities
|
|
48
65
|
|
|
49
66
|
**User Confirmation Required** (multiple candidates):
|
|
@@ -66,75 +83,85 @@ Match device capabilities with user intent:
|
|
|
66
83
|
- ✅ If multiple nodes match, ask user to select OR control all if appropriate
|
|
67
84
|
- ✅ If no suitable node found, clearly inform user with available options
|
|
68
85
|
|
|
69
|
-
## Step 2. Plan Tool and Extract Command &
|
|
86
|
+
## Step 2. Plan Tool and Extract Command & Paramters
|
|
70
87
|
|
|
71
|
-
**⚠️ MANDATORY: Consult tool reference
|
|
88
|
+
**⚠️ MANDATORY: Consult tool reference before every operation**
|
|
72
89
|
|
|
73
|
-
Before executing any device control operation, you **MUST** consult the corresponding tool's
|
|
90
|
+
Before executing any device control operation, you **MUST** consult the corresponding tool's definition file in the `references/` directory. This is a non-negotiable requirement to ensure correct command and parameters.
|
|
74
91
|
|
|
75
92
|
### Available Tool References
|
|
76
93
|
|
|
77
|
-
| Reference File
|
|
78
|
-
|
|
|
79
|
-
| `references/
|
|
80
|
-
| `references/
|
|
81
|
-
| `references/
|
|
82
|
-
| `references/
|
|
83
|
-
| `references/
|
|
84
|
-
| `references/
|
|
85
|
-
| `references/
|
|
86
|
-
| `references/
|
|
87
|
-
| `references/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
| Required Node Caps | Reference File | Tool Description |
|
|
95
|
+
| --------------------- | ----------------------------------- | -------------------------------------------------------------------- |
|
|
96
|
+
| `mobile-data` | `references/mobile-data.md` | 移动数据与流量管理工具 |
|
|
97
|
+
| `hotspot` | `references/hotspot.md` | 手机个人热点功能的统一与控制工具 |
|
|
98
|
+
| `volume` | `references/volume-operate.md` | 设备音量调节与管理工具 |
|
|
99
|
+
| `no-disturb` | `references/no-disturb.md` | 手机勿扰模式控制力 |
|
|
100
|
+
| `screen-record` | `references/screen-record.md` | Initiate and manage phone calls; unified control for call operations |
|
|
101
|
+
| `quiet-mode` | `references/quiet-mode.md` | 设备静音模式管理与控制工具 |
|
|
102
|
+
| `sound-and-vibration` | `references/sound-and-vibration.md` | 声音与振动管理工具 |
|
|
103
|
+
| `ringing-mode` | `references/ringing-mode.md` | 响铃模式管理工具 |
|
|
104
|
+
| `vibration-mode` | `references/vibration-mode.md` | 系统震动反馈管理与控制工具 |
|
|
105
|
+
| `capture-screenshot` | `references/capture-screenshot.md` | 截屏功能管理与触发工具 |
|
|
106
|
+
| `app` | `references/app-open.md` | 应用打开工具 |
|
|
107
|
+
| `app` | `references/app-close.md` | 应用关闭工具 |
|
|
108
|
+
| `contact` | `references/contact-search.md` | Provides the ability to search contacts |
|
|
109
|
+
| `call` | `references/call-phone.md` | 拨打电话工具 |
|
|
110
|
+
| `call` | `references/call-search.md` | 通话记录查询工具 |
|
|
111
|
+
| `message` | `references/message-send.md` | 提供发送短信的服务 |
|
|
112
|
+
| `local-search` | `references/local-search.md` | 查询手机文档、笔记、日程、图库、yoyo记忆、钱包等 |
|
|
113
|
+
| `alarm` | `references/alarm-create.md` | 手机闹钟的创建 |
|
|
114
|
+
|
|
115
|
+
### Command and Parameters Construction Workflow
|
|
116
|
+
|
|
117
|
+
Execute the following steps **in strict order** for each operation to construct parameter:
|
|
92
118
|
|
|
93
119
|
```
|
|
94
120
|
┌─────────────────────────────────────────────────────────────┐
|
|
95
121
|
│ Step 1: INTENT RECOGNITION │
|
|
96
|
-
│ Parse user request → Identify target tool
|
|
122
|
+
│ Parse user request → Identify target tool to use │
|
|
97
123
|
└─────────────────────────────────────────────────────────────┘
|
|
98
124
|
↓
|
|
99
125
|
┌─────────────────────────────────────────────────────────────┐
|
|
100
126
|
│ Step 2: DOCUMENT CONSULTATION [MANDATORY] │
|
|
101
|
-
│ Open references/*.md → Read tool
|
|
127
|
+
│ Open references/*.md → Read tool reference │
|
|
102
128
|
│ ⚠️ PROHIBITED: Skip, guess, assume, or rely on memory │
|
|
103
129
|
└─────────────────────────────────────────────────────────────┘
|
|
104
130
|
↓
|
|
105
131
|
┌─────────────────────────────────────────────────────────────┐
|
|
106
|
-
│ Step 3: PARAMETER EXTRACTION
|
|
107
|
-
│ Extract: type, enum values, required/optional, defaults │
|
|
108
|
-
└─────────────────────────────────────────────────────────────┘
|
|
109
|
-
↓
|
|
110
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
111
|
-
│ Step 4: JSON CONSTRUCTION │
|
|
112
|
-
│ Build params object conforming to JSONSchema definiton │
|
|
113
|
-
└─────────────────────────────────────────────────────────────┘
|
|
114
|
-
↓
|
|
115
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
116
|
-
│ Step 5: VALIDATION │
|
|
132
|
+
│ Step 3: PARAMETER EXTRACTION AND VALIDATION │
|
|
117
133
|
│ Verify: required fields present, enum case-sensitive match │
|
|
118
134
|
└─────────────────────────────────────────────────────────────┘
|
|
119
135
|
```
|
|
120
136
|
|
|
121
|
-
###
|
|
137
|
+
### Parameter Format Requirements
|
|
138
|
+
|
|
139
|
+
- Parameters must be valid JSON
|
|
140
|
+
- Enum values must match documentation exactly (case-sensitive)
|
|
141
|
+
- Numeric values must be within defined ranges
|
|
142
|
+
|
|
143
|
+
### Error Handling Protocolreference
|
|
122
144
|
|
|
123
|
-
| Scenario | Required Action
|
|
124
|
-
| ------------------------- |
|
|
125
|
-
| **Ambiguous Request** | User request unclear or missing required fields → Ask clarifying questions before proceeding
|
|
126
|
-
| **Unsupported Operation** | No matching tool
|
|
127
|
-
| **Capability Mismatch** | Selected node lacks required capability → Inform user and suggest alternative device or operation
|
|
145
|
+
| Scenario | Required Action |
|
|
146
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
147
|
+
| **Ambiguous Request** | User request unclear or missing required fields → Ask clarifying questions before proceeding |
|
|
148
|
+
| **Unsupported Operation** | No matching tool reference found → Inform user: "Operation '[operation]' is not supported. Available operations: [list]" |
|
|
149
|
+
| **Capability Mismatch** | Selected node lacks required capability → Inform user and suggest alternative device or operation |
|
|
128
150
|
|
|
129
151
|
### ⚠️ Prohibited Actions
|
|
130
152
|
|
|
131
|
-
- ❌ **DO NOT**
|
|
153
|
+
- ❌ **DO NOT** guess command names from user intent
|
|
132
154
|
- ❌ **DO NOT** skip document consultation before executing commands
|
|
133
155
|
- ❌ **DO NOT** use parameter values not defined in the documentation
|
|
156
|
+
- ❌ **DO NOT** infer parameter structure from similar tools
|
|
157
|
+
- ❌ **DO NOT** assume enum values without checking reference
|
|
158
|
+
|
|
159
|
+
## Step 3. Invoke Node With Command and Parameters
|
|
134
160
|
|
|
135
|
-
|
|
161
|
+
**Command**:
|
|
136
162
|
|
|
137
|
-
|
|
163
|
+
- window(CMD): `openclaw nodes invoke --node <ID|IP> --command <command> --params '<json>'`
|
|
164
|
+
- Other: `openclaw nodes invoke --node <ID|IP> --command <command> --params "<json>"`
|
|
138
165
|
|
|
139
166
|
**Purpose**: Send command to target node and initiate operation.
|
|
140
167
|
|
|
@@ -142,72 +169,35 @@ Execute the following steps **in strict order** for each operation:
|
|
|
142
169
|
|
|
143
170
|
**Execute these validation steps in order. DO NOT skip any step.**
|
|
144
171
|
|
|
145
|
-
| Step | Validation
|
|
146
|
-
| ---- |
|
|
147
|
-
| 1 | **Node Identifier**
|
|
148
|
-
| 2 | **Tool
|
|
149
|
-
| 4 | **Command Name**
|
|
150
|
-
| 3 | **Required Params**
|
|
172
|
+
| Step | Validation | Action | On Failure |
|
|
173
|
+
| ---- | ------------------- | ------------------------------------------------------ | --------------------------------------------------------------- |
|
|
174
|
+
| 1 | **Node Identifier** | Extract `ID` or `IP` column from `nodes status` output | ❌ STOP: "Cannot use node name. Use ID or IP from nodes status" |
|
|
175
|
+
| 2 | **Tool Reference** | Read `references/<tool>.md` file completely | ❌ STOP: "Tool reference not found" |
|
|
176
|
+
| 4 | **Command Name** | Extract `command` exactly from tool documentation | ❌ STOP: "Command mismatch. Check documentation" |
|
|
177
|
+
| 3 | **Required Params** | Extract `params` from tool documentation | ❌ STOP: "Missing required field: [field]" |
|
|
151
178
|
|
|
152
|
-
|
|
179
|
+
### Implementation differences between platforms
|
|
153
180
|
|
|
154
|
-
|
|
155
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
156
|
-
│ CORRECT: Use ID or IP from nodes status output │
|
|
157
|
-
│ ✅ openclaw nodes invoke 192.168.1.100 --command ... │
|
|
158
|
-
│ ✅ openclaw nodes invoke f5f8916028aa5 --command ... │
|
|
159
|
-
├─────────────────────────────────────────────────────────────┤
|
|
160
|
-
│ INCORRECT: Use Node name column │
|
|
161
|
-
│ ❌ openclaw nodes invoke "Honor Magic6" --command ... │
|
|
162
|
-
│ ❌ openclaw nodes invoke "My Phone" --command ... │
|
|
163
|
-
└─────────────────────────────────────────────────────────────┘
|
|
164
|
-
```
|
|
181
|
+
Due to the different shells parameter formats, it is necessary to **strictly** check the platform (not skippable). If it's Windows, the shell must use CMD.
|
|
165
182
|
|
|
166
|
-
|
|
183
|
+
**Platform-specific JSON parameter format:**
|
|
167
184
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
4. ✅ **MATCH** enum values character-by-character
|
|
174
|
-
|
|
175
|
-
**PROHIBITED actions that cause hallucination:**
|
|
176
|
-
|
|
177
|
-
- ❌ **DO NOT** guess command names from user intent
|
|
178
|
-
- ❌ **DO NOT** infer parameter structure from similar tools
|
|
179
|
-
- ❌ **DO NOT** assume enum values without checking documentation
|
|
180
|
-
- ❌ **DO NOT** use node names from the "Node" column in status output
|
|
181
|
-
|
|
182
|
-
### Parameter Format Requirements
|
|
185
|
+
| Platform | Shell | Quote Style | Example |
|
|
186
|
+
| ----------- | ----- | ------------------------------- | ------------------------------- |
|
|
187
|
+
| **Windows** | CMD | Double quotes, escape inner `"` | `"{\"actionType\":\"打电话\"}"` |
|
|
188
|
+
| **Linux** | Bash | Single quotes | `'{"actionType":"打电话"}'` |
|
|
189
|
+
| **macOS** | Bash | Single quotes | `'{"actionType":"打电话"}'` |
|
|
183
190
|
|
|
184
|
-
|
|
185
|
-
| ---------------------------- | --------------------------------------- | ----------------------- |
|
|
186
|
-
| **Bash (Linux/macOS)** | Single quotes wrapping JSON | `'{"level":50}'` |
|
|
187
|
-
| **Windows (PowerShell/CMD)** | Double quotes with escaped inner quotes | `"{\"level\":50}"` |
|
|
188
|
-
| **Complex Objects** | Create JSON file first | `--params @params.json` |
|
|
189
|
-
|
|
190
|
-
**Additional Requirements**:
|
|
191
|
-
|
|
192
|
-
- Parameters must be valid JSON
|
|
193
|
-
- Enum values must match documentation exactly (case-sensitive)
|
|
194
|
-
- Numeric values must be within defined ranges
|
|
195
|
-
|
|
196
|
-
### Examples
|
|
191
|
+
**Windows CMD Execution:**
|
|
197
192
|
|
|
198
193
|
```bash
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
openclaw nodes invoke 192.168.1.100 --command volume.operate --params '{"actionType":"增加","level":50}'
|
|
202
|
-
|
|
203
|
-
# ❌ INCORRECT: Using node name instead of ID/IP
|
|
204
|
-
# openclaw nodes invoke "My Phone" --command volume.operate --params '{"actionType":"增加"}'
|
|
194
|
+
openclaw nodes invoke <nodeId> --command phone.call --params "{\"actionType\":\"打电话\",\"phoneNumber\":\"10086\"}"
|
|
195
|
+
```
|
|
205
196
|
|
|
206
|
-
|
|
207
|
-
# openclaw nodes invoke <nodeId> --command volume --params '{"action":"up"}'
|
|
197
|
+
**Linux/macOS Bash Execution:**
|
|
208
198
|
|
|
209
|
-
|
|
210
|
-
|
|
199
|
+
```bash
|
|
200
|
+
openclaw nodes invoke <nodeId> --command phone.call --params '{"actionType":"打电话","phoneNumber":"10086"}'
|
|
211
201
|
```
|
|
212
202
|
|
|
213
203
|
### Error Handling
|
|
@@ -227,9 +217,9 @@ openclaw nodes invoke 192.168.1.100 --command volume.operate --params '{"actionT
|
|
|
227
217
|
|
|
228
218
|
```
|
|
229
219
|
┌─────────────────────────────────────────────────────────────┐
|
|
230
|
-
│ RETRY FLOW (Max
|
|
220
|
+
│ RETRY FLOW (Max 2 attempts) │
|
|
231
221
|
├─────────────────────────────────────────────────────────────┤
|
|
232
|
-
│ Attempt 1 → FAIL → Wait 1s → Attempt 2 → FAIL → Wait
|
|
222
|
+
│ Attempt 1 → FAIL → Wait 1s → Attempt 2 → FAIL → Wait 1s │
|
|
233
223
|
│ → Attempt 3 → FAIL → STOP & REPORT ERROR │
|
|
234
224
|
│ │
|
|
235
225
|
│ ⚠️ After 3 failed attempts: │
|
|
@@ -334,13 +324,3 @@ Would you like to check other nodes or retry later?"
|
|
|
334
324
|
- ❌ **DO NOT** expose raw error codes to users
|
|
335
325
|
- ❌ **DO NOT** assume user knows technical details
|
|
336
326
|
- ❌ **DO NOT** leave user without next steps on failure
|
|
337
|
-
|
|
338
|
-
## 快速参考命令
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
# 获取所有节点状态
|
|
342
|
-
openclaw nodes status
|
|
343
|
-
|
|
344
|
-
# 调用工具
|
|
345
|
-
openclaw nodes invoke --node <id|name|ip> --command <command> --params <json>
|
|
346
|
-
```
|