harmony-skills-standalone 1.0.0 → 1.0.2
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/autotest-agent/SKILL.md +21 -0
- package/package.json +1 -2
- package/htrace-converter/SKILL.md +0 -117
- package/htrace-converter/SKILL.zh-CN.md +0 -117
package/autotest-agent/SKILL.md
CHANGED
|
@@ -16,3 +16,24 @@ test intent or test-case input named in the prompt.
|
|
|
16
16
|
- Emit structured JSON progress lines during setup, execution, attribution, and
|
|
17
17
|
report generation.
|
|
18
18
|
- Fail when required device or application prerequisites are unavailable.
|
|
19
|
+
|
|
20
|
+
## Execution method
|
|
21
|
+
|
|
22
|
+
When the node declares a `progress` output (type `file`), use the wrapper
|
|
23
|
+
script instead of calling `batch.py` directly so that real-time stdout is
|
|
24
|
+
captured for the progress file tailer:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python "${workflow.inputs.platform_root}/scripts/run_autotest_batch.py" \
|
|
28
|
+
--task-dir "<reports-dir>" \
|
|
29
|
+
--testcases "<testcases.jsonl>" \
|
|
30
|
+
--work-dir "${workflow.inputs.platform_root}/SubAgents/AutoTestAgent-master" \
|
|
31
|
+
--category "intent-test" \
|
|
32
|
+
--progress-file "${outputs.progress}" \
|
|
33
|
+
--result "${outputs.result}"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If the node does not declare a `progress` output, call `batch.py` directly as
|
|
37
|
+
before. The wrapper script sets up the same environment (PYTHONPATH, HDC_PATH,
|
|
38
|
+
venv Python) as the platform's TestExecutionService and tees batch.py stdout
|
|
39
|
+
to the progress file for real-time tailing.
|
package/package.json
CHANGED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: htrace-converter
|
|
3
|
-
description: >
|
|
4
|
-
将鸿蒙 HarmonyOS trace 文件(.htrace、.ftrace)转换为 SQLite .db 格式。
|
|
5
|
-
当用户提到"转换 htrace"、"convert htrace"、"htrace 转 db"、"ftrace 转 db"、
|
|
6
|
-
"trace_streamer"、"解析 trace 文件"时使用。
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# HTrace 文件转换工具
|
|
10
|
-
|
|
11
|
-
将 HarmonyOS 抓取的 `.htrace` 或 `.ftrace` trace 文件,通过 `trace_streamer` 工具转换为可查询的 SQLite `.db` 格式,以便后续分析使用。
|
|
12
|
-
|
|
13
|
-
## 使用方式
|
|
14
|
-
|
|
15
|
-
| 命令 | 说明 |
|
|
16
|
-
|------|------|
|
|
17
|
-
| `/htrace-converter <trace文件路径>` | 转换指定 trace 文件为 .db |
|
|
18
|
-
| `/htrace-converter install` | 安装/更新 trace_streamer 到系统 PATH |
|
|
19
|
-
| `/htrace-converter check` | 检查当前环境中 trace_streamer 是否可用 |
|
|
20
|
-
|
|
21
|
-
## 执行步骤
|
|
22
|
-
|
|
23
|
-
### 步骤一:环境检查
|
|
24
|
-
|
|
25
|
-
检查 `trace_streamer` 是否可用,按以下顺序查找:
|
|
26
|
-
|
|
27
|
-
1. **系统 PATH**:`which trace_streamer_mac`(或对应平台名)
|
|
28
|
-
2. **当前目录**:`./trace_streamer_binary/<平台二进制名>`
|
|
29
|
-
3. **上级目录**:`../trace_streamer_binary/<平台二进制名>`
|
|
30
|
-
4. **应用包内**(macOS):`<jar所在目录>/../trace_streamer/<平台二进制名>`
|
|
31
|
-
|
|
32
|
-
检测当前平台:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
uname -s
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
平台到二进制名的映射:
|
|
39
|
-
- `Darwin`(macOS)→ `trace_streamer_mac`
|
|
40
|
-
- `Linux` → `trace_streamer_linux`
|
|
41
|
-
- `MINGW*` / `CYGWIN*`(Windows)→ `trace_streamer_windows.exe`
|
|
42
|
-
|
|
43
|
-
### 步骤二:安装 trace_streamer(仅 `/htrace-converter install` 时执行)
|
|
44
|
-
|
|
45
|
-
从 [华为 SmartPerf-Host 项目](https://gitee.com/openharmony/developtools_smartperf_host/releases) 或随 trace-analyzer 一起发布的 `trace_streamer_binary` 目录中获取二进制文件。
|
|
46
|
-
|
|
47
|
-
安装步骤:
|
|
48
|
-
1. 从 trace-analyzer 项目的 `trace_streamer_binary/` 目录复制对应平台二进制到 `/usr/local/bin/`
|
|
49
|
-
2. 赋予执行权限:`chmod +x /usr/local/bin/trace_streamer_<platform>`
|
|
50
|
-
3. 验证:运行 `trace_streamer_mac --version`(或对应名称)
|
|
51
|
-
|
|
52
|
-
**也可以直接配置环境变量指向 `trace_streamer_binary/` 目录,无需复制到系统 PATH。**
|
|
53
|
-
|
|
54
|
-
### 步骤三:执行转换
|
|
55
|
-
|
|
56
|
-
确认以下信息:
|
|
57
|
-
- **输入文件**:`.htrace` 或 `.ftrace` 文件路径
|
|
58
|
-
- **输出路径**(可选):默认输出到系统临时目录 `/tmp/trace-analyzer/<basename>.htrace_db`
|
|
59
|
-
|
|
60
|
-
执行转换命令:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# macOS
|
|
64
|
-
trace_streamer_mac <input.htrace> -e <output.db>
|
|
65
|
-
|
|
66
|
-
# Linux
|
|
67
|
-
trace_streamer_linux <input.htrace> -e <output.db>
|
|
68
|
-
|
|
69
|
-
# Windows
|
|
70
|
-
trace_streamer_windows.exe <input.htrace> -e <output.db>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**缓存策略**:如果输出 `.db` 文件已存在且比输入文件更新,跳过转换直接使用缓存。
|
|
74
|
-
|
|
75
|
-
### 步骤四:验证结果
|
|
76
|
-
|
|
77
|
-
转换完成后验证 `.db` 文件:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# 检查文件存在且非空
|
|
81
|
-
ls -lh <output.db>
|
|
82
|
-
|
|
83
|
-
# 验证是有效的 SQLite 文件(可选)
|
|
84
|
-
sqlite3 <output.db> ".tables" 2>/dev/null | head -5
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 步骤五:输出结果
|
|
88
|
-
|
|
89
|
-
成功后告知用户:
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
转换完成!
|
|
93
|
-
|
|
94
|
-
输入文件: /path/to/input.htrace
|
|
95
|
-
输出文件: /tmp/trace-analyzer/input.htrace_db
|
|
96
|
-
文件大小: XX MB
|
|
97
|
-
|
|
98
|
-
可使用以下工具继续分析:
|
|
99
|
-
- trace-analyzer <output.db> -m <线程名> # 卡顿/完成时延分析
|
|
100
|
-
- sqlite3 <output.db> # 直接查询数据库
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## 错误处理
|
|
104
|
-
|
|
105
|
-
| 错误情况 | 处理方式 |
|
|
106
|
-
|----------|----------|
|
|
107
|
-
| 输入文件不存在 | 提示用户确认文件路径 |
|
|
108
|
-
| trace_streamer 不存在 | 引导用户运行 `/htrace-converter install` |
|
|
109
|
-
| 转换失败(非零退出码) | 显示完整错误输出,建议检查文件是否损坏 |
|
|
110
|
-
| 输出目录无写权限 | 建议用户指定其他输出路径 |
|
|
111
|
-
|
|
112
|
-
## 说明
|
|
113
|
-
|
|
114
|
-
- `trace_streamer` 是华为开源的 HarmonyOS trace 解析工具,来自 [SmartPerf-Host](https://gitee.com/openharmony/developtools_smartperf_host) 项目
|
|
115
|
-
- 转换后的 `.db` 是标准 SQLite 文件,包含线程调度、函数调用、CPU 状态等信息
|
|
116
|
-
- 支持 `.htrace`(二进制格式)和 `.ftrace`(文本格式)两种输入格式
|
|
117
|
-
- 转换耗时取决于文件大小,通常 100MB 的 trace 文件需要 10-30 秒
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: htrace-converter
|
|
3
|
-
description: >
|
|
4
|
-
将鸿蒙 HarmonyOS trace 文件(.htrace、.ftrace)转换为 SQLite .db 格式。
|
|
5
|
-
当用户提到"转换 htrace"、"convert htrace"、"htrace 转 db"、"ftrace 转 db"、
|
|
6
|
-
"trace_streamer"、"解析 trace 文件"时使用。
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# HTrace 文件转换工具
|
|
10
|
-
|
|
11
|
-
将 HarmonyOS 抓取的 `.htrace` 或 `.ftrace` trace 文件,通过 `trace_streamer` 工具转换为可查询的 SQLite `.db` 格式,以便后续分析使用。
|
|
12
|
-
|
|
13
|
-
## 使用方式
|
|
14
|
-
|
|
15
|
-
| 命令 | 说明 |
|
|
16
|
-
|------|------|
|
|
17
|
-
| `/htrace-converter <trace文件路径>` | 转换指定 trace 文件为 .db |
|
|
18
|
-
| `/htrace-converter install` | 安装/更新 trace_streamer 到系统 PATH |
|
|
19
|
-
| `/htrace-converter check` | 检查当前环境中 trace_streamer 是否可用 |
|
|
20
|
-
|
|
21
|
-
## 执行步骤
|
|
22
|
-
|
|
23
|
-
### 步骤一:环境检查
|
|
24
|
-
|
|
25
|
-
检查 `trace_streamer` 是否可用,按以下顺序查找:
|
|
26
|
-
|
|
27
|
-
1. **系统 PATH**:`which trace_streamer_mac`(或对应平台名)
|
|
28
|
-
2. **当前目录**:`./trace_streamer_binary/<平台二进制名>`
|
|
29
|
-
3. **上级目录**:`../trace_streamer_binary/<平台二进制名>`
|
|
30
|
-
4. **应用包内**(macOS):`<jar所在目录>/../trace_streamer/<平台二进制名>`
|
|
31
|
-
|
|
32
|
-
检测当前平台:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
uname -s
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
平台到二进制名的映射:
|
|
39
|
-
- `Darwin`(macOS)→ `trace_streamer_mac`
|
|
40
|
-
- `Linux` → `trace_streamer_linux`
|
|
41
|
-
- `MINGW*` / `CYGWIN*`(Windows)→ `trace_streamer_windows.exe`
|
|
42
|
-
|
|
43
|
-
### 步骤二:安装 trace_streamer(仅 `/htrace-converter install` 时执行)
|
|
44
|
-
|
|
45
|
-
从 [华为 SmartPerf-Host 项目](https://gitee.com/openharmony/developtools_smartperf_host/releases) 或随 trace-analyzer 一起发布的 `trace_streamer_binary` 目录中获取二进制文件。
|
|
46
|
-
|
|
47
|
-
安装步骤:
|
|
48
|
-
1. 从 trace-analyzer 项目的 `trace_streamer_binary/` 目录复制对应平台二进制到 `/usr/local/bin/`
|
|
49
|
-
2. 赋予执行权限:`chmod +x /usr/local/bin/trace_streamer_<platform>`
|
|
50
|
-
3. 验证:运行 `trace_streamer_mac --version`(或对应名称)
|
|
51
|
-
|
|
52
|
-
**也可以直接配置环境变量指向 `trace_streamer_binary/` 目录,无需复制到系统 PATH。**
|
|
53
|
-
|
|
54
|
-
### 步骤三:执行转换
|
|
55
|
-
|
|
56
|
-
确认以下信息:
|
|
57
|
-
- **输入文件**:`.htrace` 或 `.ftrace` 文件路径
|
|
58
|
-
- **输出路径**(可选):默认输出到系统临时目录 `/tmp/trace-analyzer/<basename>.htrace_db`
|
|
59
|
-
|
|
60
|
-
执行转换命令:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# macOS
|
|
64
|
-
trace_streamer_mac <input.htrace> -e <output.db>
|
|
65
|
-
|
|
66
|
-
# Linux
|
|
67
|
-
trace_streamer_linux <input.htrace> -e <output.db>
|
|
68
|
-
|
|
69
|
-
# Windows
|
|
70
|
-
trace_streamer_windows.exe <input.htrace> -e <output.db>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**缓存策略**:如果输出 `.db` 文件已存在且比输入文件更新,跳过转换直接使用缓存。
|
|
74
|
-
|
|
75
|
-
### 步骤四:验证结果
|
|
76
|
-
|
|
77
|
-
转换完成后验证 `.db` 文件:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# 检查文件存在且非空
|
|
81
|
-
ls -lh <output.db>
|
|
82
|
-
|
|
83
|
-
# 验证是有效的 SQLite 文件(可选)
|
|
84
|
-
sqlite3 <output.db> ".tables" 2>/dev/null | head -5
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 步骤五:输出结果
|
|
88
|
-
|
|
89
|
-
成功后告知用户:
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
转换完成!
|
|
93
|
-
|
|
94
|
-
输入文件: /path/to/input.htrace
|
|
95
|
-
输出文件: /tmp/trace-analyzer/input.htrace_db
|
|
96
|
-
文件大小: XX MB
|
|
97
|
-
|
|
98
|
-
可使用以下工具继续分析:
|
|
99
|
-
- trace-analyzer <output.db> -m <线程名> # 卡顿/完成时延分析
|
|
100
|
-
- sqlite3 <output.db> # 直接查询数据库
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## 错误处理
|
|
104
|
-
|
|
105
|
-
| 错误情况 | 处理方式 |
|
|
106
|
-
|----------|----------|
|
|
107
|
-
| 输入文件不存在 | 提示用户确认文件路径 |
|
|
108
|
-
| trace_streamer 不存在 | 引导用户运行 `/htrace-converter install` |
|
|
109
|
-
| 转换失败(非零退出码) | 显示完整错误输出,建议检查文件是否损坏 |
|
|
110
|
-
| 输出目录无写权限 | 建议用户指定其他输出路径 |
|
|
111
|
-
|
|
112
|
-
## 说明
|
|
113
|
-
|
|
114
|
-
- `trace_streamer` 是华为开源的 HarmonyOS trace 解析工具,来自 [SmartPerf-Host](https://gitee.com/openharmony/developtools_smartperf_host) 项目
|
|
115
|
-
- 转换后的 `.db` 是标准 SQLite 文件,包含线程调度、函数调用、CPU 状态等信息
|
|
116
|
-
- 支持 `.htrace`(二进制格式)和 `.ftrace`(文本格式)两种输入格式
|
|
117
|
-
- 转换耗时取决于文件大小,通常 100MB 的 trace 文件需要 10-30 秒
|