@buaa_smat/hometrans 0.1.8 → 0.1.9

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.9",
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(