@buaa_smat/hometrans 0.1.8 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buaa_smat/hometrans",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "HomeTrans (Android-to-HarmonyOS) skill + agent installer. Run `ht init` to distribute conversion skills and subagents into AI editors.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -16,7 +16,6 @@
16
16
  "dist",
17
17
  "skills",
18
18
  "agents",
19
-
20
19
  "tools",
21
20
  "resource"
22
21
  ],
@@ -30,11 +30,11 @@ Extract the following from the user's message. If any required input is missing,
30
30
  | Variable | Required | Meaning | Typical Phrasing |
31
31
  |----------|----------|---------|------------------|
32
32
  | `test-case-path` | yes | Path to test_case.md | "测试用例在...", "用例文件...", "test case path" |
33
- | `output-path` | no (default: directory of `test-case-path`) | Directory for all output artifacts | "输出到...", "产物目录...", "output to..." |
34
33
  | `hap-path` | yes | Path to the signed .hap file | "HAP路径...", "安装包在...", "hap file..." |
35
- | `pre-test-case-path` | optional | Path to pre_test_case.md | "前置用例...", "pre test case..." |
36
- | `android-project-path` | optional (for fix loop) | Path to Android source project for reference-based fixing | "Android路径...", "android project..." |
37
- | `max-rounds` | optional, default `3` | Max iterations for the test-and-fix loop. Must be a positive integer (`>= 1`). Only meaningful when the fix loop is enabled. | "最多 X 轮", "max rounds X", "迭代 X 次" |
34
+ | `output-path` | no (default: directory of `test-case-path`) | Directory for all output artifacts | "输出到...", "产物目录...", "output to..." |
35
+ | `pre-test-case-path` | no | Path to pre_test_case.md | "前置用例...", "pre test case..." |
36
+ | `android-project-path` | no (for fix loop) | Path to Android source project for reference-based fixing | "Android路径...", "android project..." |
37
+ | `max-rounds` | no (default `3`) | Max iterations for the test-and-fix loop. Must be a positive integer (`>= 1`). Only meaningful when the fix loop is enabled. | "最多 X 轮", "max rounds X", "迭代 X 次" |
38
38
 
39
39
  **AskUserQuestion template (use this exact shape — do NOT ad-lib free-form questions):**
40
40
 
@@ -18,7 +18,7 @@ HarmonyOS 应用自测执行器。负责把自然语言写的测试用例(`tes
18
18
  | `hdc` | 设备连接 / 安装 HAP | `hdc version` |
19
19
  | `python` ≥ 3.10 | 入口脚本 | `python --version` |
20
20
 
21
- > `uv sync`(拉取 6 个 whl)由 `self_test_runner.py` 自动执行,无需手动 `pip install`。
21
+ > `uv sync`(从本地 `tools/test-tools/` 目录加载 6 个 whl)由 `self_test_runner.py` 自动执行,无需手动 `pip install`。
22
22
 
23
23
  ### 2. 填写 `config.yaml`(包含真实 api_key)
24
24
 
@@ -183,7 +183,7 @@ uv run python report_tool.py validate <out>/self-test-report.md
183
183
  agents/test-tools/autotest/
184
184
  ├── README.md # 本文件
185
185
  ├── .gitignore # 排除 .venv / config.yaml / 运行期日志等
186
- ├── pyproject.toml # 声明 6 个远程 whl URL(harmony-autotest / hypium_mcp / hypium / xdevice*3
186
+ ├── pyproject.toml # 声明 6 个本地 whl 路径(harmony-autotest / hypium_mcp / hypium / xdevice*3,均在上一级 tools/test-tools/)
187
187
  ├── uv.lock # 与 pyproject.toml 配套的版本锁定文件
188
188
  ├── config.yaml.example # 用户拷贝填 api_key 的模板
189
189
  ├── config.yaml # 用户填好的真实配置(.gitignore 中,不入库)
@@ -202,13 +202,13 @@ agents/test-tools/autotest/
202
202
  A: 复制 `config.yaml.example` → `config.yaml` 并填入真实 api_key 后重试。
203
203
 
204
204
  **Q: `uv sync` 卡住或失败**
205
- A: 6 个 whl 都从 gitcode API v5 拉,需要外网访问 `gitcode.com`。失败时检查代理 / 网络;也可以 `--force-reinit` 强制重建。
205
+ A: 6 个 whl 改为从本地 `tools/test-tools/` 目录加载(`pyproject.toml` `[tool.uv.sources]` 用相对路径 `../*.whl`)。失败时确认这 6 个 whl 文件存在于上一级目录;其余依赖仍从清华 PyPI 镜像拉取,需基本网络。也可以 `--force-reinit` 强制重建。
206
206
 
207
207
  **Q: 测试过程被打断,下次跑会冲突吗?**
208
208
  A: 不会。`self_test_runner.py run` 启动时会扫描并 kill 残留的 `AutoTest.batch` / `hypium_mcp` / `harmony_autotest` 进程(不止靠 PID 文件,按命令行名兜底),并自动清掉本目录顶层的 `tmp_hypium/` / `hypium_mcp.log` 等遗留中间产物。`task/` 目录在 agent 流程里也会被清空。
209
209
 
210
210
  **Q: 想彻底重置一遍本地状态再跑?**
211
- A: 跑一次 `python self_test_runner.py clean`:杀残留 → 删 `.venv` → 删 `tmp_hypium/` / `hypium_mcp.log` / `batch.pid` / `batch_stdout.log`。**不要**手工 `uv cache clean`——全局缓存清空后重装 6 个 whl 要从 gitcode 重新拉(1–3 分钟);保留缓存的话 `uv sync` 只需几秒。
211
+ A: 跑一次 `python self_test_runner.py clean`:杀残留 → 删 `.venv` → 删 `tmp_hypium/` / `hypium_mcp.log` / `batch.pid` / `batch_stdout.log`。**不要**手工 `uv cache clean`——全局缓存清空后重装 6 个 whl 要从 gitcode 重新拉(1–3 分钟);这 6 个 whl 现在从本地加载、不走网络,但其余依赖仍走缓存,保留缓存的话 `uv sync` 只需几秒。
212
212
 
213
213
  **Q: 想自己改 `testcases.json` 后再跑?**
214
214
  A: 改完后跑一遍校验,再交给 `self-tester`(`setup=false`):
@@ -4,13 +4,23 @@ version = "0.1.0"
4
4
  description = "Self-test runner harness for HarmonyOS apps; delegates execution to the harmony-autotest whl."
5
5
  requires-python = ">=3.10"
6
6
  dependencies = [
7
- "harmony-autotest @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/harmony_autotest-0.1.0-py3-none-any.whl?ref=main",
8
- "hypium_mcp @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium_mcp-0.6.5-py3-none-any.whl?ref=main",
9
- "hypium @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium-6.1.0.210-py3-none-any.whl?ref=main",
10
- "xdevice @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice-6.1.0.210-py3-none-any.whl?ref=main",
11
- "xdevice-ohos @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl?ref=main",
12
- "xdevice-devicetest @ https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl?ref=main",
7
+ "harmony-autotest",
8
+ "hypium_mcp",
9
+ "hypium",
10
+ "xdevice",
11
+ "xdevice-ohos",
12
+ "xdevice-devicetest",
13
13
  ]
14
14
 
15
+ # 6 个 whl 改为从本地加载(仓库里放在上一级 tools/test-tools/ 目录),
16
+ # 路径相对于本 pyproject.toml;不再从 gitcode 远程拉取。
17
+ [tool.uv.sources]
18
+ harmony-autotest = { path = "../harmony_autotest-0.1.0-py3-none-any.whl" }
19
+ hypium_mcp = { path = "../hypium_mcp-0.6.5-py3-none-any.whl" }
20
+ hypium = { path = "../hypium-6.1.0.210-py3-none-any.whl" }
21
+ xdevice = { path = "../xdevice-6.1.0.210-py3-none-any.whl" }
22
+ xdevice-ohos = { path = "../xdevice_ohos-6.1.0.210-py3-none-any.whl" }
23
+ xdevice-devicetest = { path = "../xdevice_devicetest-6.1.0.210-py3-none-any.whl" }
24
+
15
25
  [[tool.uv.index]]
16
26
  url = "https://pypi.tuna.tsinghua.edu.cn/simple"
@@ -22,8 +22,8 @@
22
22
 
23
23
  后台:python -m AutoTest.batch(循环执行 testcases.jsonl,cwd 为 task_<timestamp> 子目录)
24
24
 
25
- 依赖:harmony-autotest 与 hypium_mcp 均在 pyproject.toml 中声明为远程 whl URL
26
- 依赖;`uv sync` 会拉取到本目录 .venv 内,不再需要手动 pip install。
25
+ 依赖:harmony-autotest 与 hypium_mcp 6 个 whl 在 pyproject.toml 中声明为本地路径
26
+ 依赖(上一级 tools/test-tools/ 目录);`uv sync` 会安装到本目录 .venv 内,不再需要手动 pip install。
27
27
 
28
28
  AutoTest.batch 启动时 cwd 设为 task_<timestamp>,因此 hypium_mcp.log / tmp_hypium/
29
29
  等中间产物会落在 task 子目录内,避免污染插件源码目录。
@@ -707,8 +707,8 @@ def cmd_clean(args):
707
707
  - 删除 .venv 及 __pycache__
708
708
  - 删除本目录顶层的 tmp_hypium / hypium_mcp.log / batch.pid / batch_stdout.log
709
709
 
710
- NOT touched: 全局 uv 缓存。重建缓存需重新从 gitcode 拉 6 个 whl
711
- 单纯"重跑一遍"不需要碰它。需要的话用 `uv cache clean` 自己清。
710
+ NOT touched: 全局 uv 缓存。6 个 whl 已改为从本地加载,不走网络;
711
+ 单纯"重跑一遍"不需要碰缓存。需要的话用 `uv cache clean` 自己清。
712
712
  """
713
713
  # 控制台输出即可,不写 self_test_*.log(避免污染 output-dir)
714
714
  logging.basicConfig(
@@ -96,12 +96,12 @@ dependencies = [
96
96
 
97
97
  [package.metadata]
98
98
  requires-dist = [
99
- { name = "harmony-autotest", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/harmony_autotest-0.1.0-py3-none-any.whl?ref=main" },
100
- { name = "hypium", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium-6.1.0.210-py3-none-any.whl?ref=main" },
101
- { name = "hypium-mcp", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium_mcp-0.6.5-py3-none-any.whl?ref=main" },
102
- { name = "xdevice", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice-6.1.0.210-py3-none-any.whl?ref=main" },
103
- { name = "xdevice-devicetest", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl?ref=main" },
104
- { name = "xdevice-ohos", url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl?ref=main" },
99
+ { name = "harmony-autotest", path = "../harmony_autotest-0.1.0-py3-none-any.whl" },
100
+ { name = "hypium", path = "../hypium-6.1.0.210-py3-none-any.whl" },
101
+ { name = "hypium-mcp", path = "../hypium_mcp-0.6.5-py3-none-any.whl" },
102
+ { name = "xdevice", path = "../xdevice-6.1.0.210-py3-none-any.whl" },
103
+ { name = "xdevice-devicetest", path = "../xdevice_devicetest-6.1.0.210-py3-none-any.whl" },
104
+ { name = "xdevice-ohos", path = "../xdevice_ohos-6.1.0.210-py3-none-any.whl" },
105
105
  ]
106
106
 
107
107
  [[package]]
@@ -767,7 +767,7 @@ wheels = [
767
767
  [[package]]
768
768
  name = "harmony-autotest"
769
769
  version = "0.1.0"
770
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/harmony_autotest-0.1.0-py3-none-any.whl?ref=main" }
770
+ source = { path = "../harmony_autotest-0.1.0-py3-none-any.whl" }
771
771
  dependencies = [
772
772
  { name = "hypium" },
773
773
  { name = "hypium-mcp" },
@@ -777,7 +777,7 @@ dependencies = [
777
777
  { name = "pyyaml" },
778
778
  ]
779
779
  wheels = [
780
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/harmony_autotest-0.1.0-py3-none-any.whl?ref=main", hash = "sha256:ffdc241bf93cad5c05f51a19c11ac84f35bbb5344d3ba6cc4cb3df8252302051" },
780
+ { filename = "harmony_autotest-0.1.0-py3-none-any.whl", hash = "sha256:ffdc241bf93cad5c05f51a19c11ac84f35bbb5344d3ba6cc4cb3df8252302051" },
781
781
  ]
782
782
 
783
783
  [package.metadata]
@@ -830,7 +830,7 @@ wheels = [
830
830
  [[package]]
831
831
  name = "hypium"
832
832
  version = "6.1.0.210"
833
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium-6.1.0.210-py3-none-any.whl?ref=main" }
833
+ source = { path = "../hypium-6.1.0.210-py3-none-any.whl" }
834
834
  dependencies = [
835
835
  { name = "lxml" },
836
836
  { name = "opencv-python" },
@@ -840,7 +840,7 @@ dependencies = [
840
840
  { name = "xdevice-ohos" },
841
841
  ]
842
842
  wheels = [
843
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium-6.1.0.210-py3-none-any.whl?ref=main", hash = "sha256:cb85939bfb9f459fb61d0067108ef7aae15c7ca54fc095b42f64b05b9d247af5" },
843
+ { filename = "hypium-6.1.0.210-py3-none-any.whl", hash = "sha256:cb85939bfb9f459fb61d0067108ef7aae15c7ca54fc095b42f64b05b9d247af5" },
844
844
  ]
845
845
 
846
846
  [package.metadata]
@@ -860,7 +860,7 @@ provides-extras = ["advance", "qr"]
860
860
  [[package]]
861
861
  name = "hypium-mcp"
862
862
  version = "0.6.5"
863
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium_mcp-0.6.5-py3-none-any.whl?ref=main" }
863
+ source = { path = "../hypium_mcp-0.6.5-py3-none-any.whl" }
864
864
  dependencies = [
865
865
  { name = "av" },
866
866
  { name = "fastmcp" },
@@ -874,7 +874,7 @@ dependencies = [
874
874
  { name = "scikit-learn", version = "1.8.0", source = { registry = "https://pypi.tuna.tsinghua.edu.cn/simple" }, marker = "python_full_version >= '3.11'" },
875
875
  ]
876
876
  wheels = [
877
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/hypium_mcp-0.6.5-py3-none-any.whl?ref=main", hash = "sha256:58ac3f66d3577cdc18e8d19d4ba8a4b7ea6de4d78df930d44760bb81ba61e2e8" },
877
+ { filename = "hypium_mcp-0.6.5-py3-none-any.whl", hash = "sha256:58ac3f66d3577cdc18e8d19d4ba8a4b7ea6de4d78df930d44760bb81ba61e2e8" },
878
878
  ]
879
879
 
880
880
  [package.metadata]
@@ -3075,7 +3075,7 @@ wheels = [
3075
3075
  [[package]]
3076
3076
  name = "xdevice"
3077
3077
  version = "6.1.0.210"
3078
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice-6.1.0.210-py3-none-any.whl?ref=main" }
3078
+ source = { path = "../xdevice-6.1.0.210-py3-none-any.whl" }
3079
3079
  dependencies = [
3080
3080
  { name = "filelock" },
3081
3081
  { name = "paramiko" },
@@ -3084,7 +3084,7 @@ dependencies = [
3084
3084
  { name = "sqlmodel", marker = "platform_system != 'HarmonyOS'" },
3085
3085
  ]
3086
3086
  wheels = [
3087
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice-6.1.0.210-py3-none-any.whl?ref=main", hash = "sha256:77b1634850333fd490e61a9e9bb04047a4fa946312eecae2227cd51deb9fc8e4" },
3087
+ { filename = "xdevice-6.1.0.210-py3-none-any.whl", hash = "sha256:77b1634850333fd490e61a9e9bb04047a4fa946312eecae2227cd51deb9fc8e4" },
3088
3088
  ]
3089
3089
 
3090
3090
  [package.metadata]
@@ -3106,13 +3106,13 @@ provides-extras = ["full"]
3106
3106
  [[package]]
3107
3107
  name = "xdevice-devicetest"
3108
3108
  version = "6.1.0.210"
3109
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl?ref=main" }
3109
+ source = { path = "../xdevice_devicetest-6.1.0.210-py3-none-any.whl" }
3110
3110
  dependencies = [
3111
3111
  { name = "jinja2" },
3112
3112
  { name = "xdevice" },
3113
3113
  ]
3114
3114
  wheels = [
3115
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl?ref=main", hash = "sha256:1c80f0da8d497d4e034f9873e966e8b2d8ef23ecc376c64c839c1493a813980e" },
3115
+ { filename = "xdevice_devicetest-6.1.0.210-py3-none-any.whl", hash = "sha256:1c80f0da8d497d4e034f9873e966e8b2d8ef23ecc376c64c839c1493a813980e" },
3116
3116
  ]
3117
3117
 
3118
3118
  [package.metadata]
@@ -3130,13 +3130,13 @@ provides-extras = ["full"]
3130
3130
  [[package]]
3131
3131
  name = "xdevice-ohos"
3132
3132
  version = "6.1.0.210"
3133
- source = { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl?ref=main" }
3133
+ source = { path = "../xdevice_ohos-6.1.0.210-py3-none-any.whl" }
3134
3134
  dependencies = [
3135
3135
  { name = "requests" },
3136
3136
  { name = "xdevice" },
3137
3137
  ]
3138
3138
  wheels = [
3139
- { url = "https://gitcode.com/api/v5/repos/SMAT/HomeTrans/raw/agents/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl?ref=main", hash = "sha256:548a09bb6fc9fcfd92a7dbb5b69180de0159ce8959057e133dec34774054bb12" },
3139
+ { filename = "xdevice_ohos-6.1.0.210-py3-none-any.whl", hash = "sha256:548a09bb6fc9fcfd92a7dbb5b69180de0159ce8959057e133dec34774054bb12" },
3140
3140
  ]
3141
3141
 
3142
3142
  [package.metadata]