@buaa_smat/hometrans 0.1.1 → 0.1.3

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.
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: build-fixer
2
3
  description: Automatically builds a HarmonyOS project, parses compile errors, fixes them, and retries in a loop until build succeeds
3
4
  color: orange
4
5
  ---
@@ -28,35 +29,40 @@ Execute a build-fix loop: resolve environment → validate project → build →
28
29
 
29
30
  The build requires the **DevEco Studio installation path**, from which Node.js, hvigor, and ohpm are derived.
30
31
 
31
- ### 0a. Read the plugin config
32
+ ### 0a. Read the HomeTrans config
32
33
 
33
- Read the config file at `android-harmonyos-converter/.claude-plugin/converter-config.json` (locate the plugin root by searching for the `android-harmonyos-converter/.claude-plugin/plugin.json` file). It may contain:
34
+ Read the config file written by `ht init` at `~/.hometrans/config.json` (`$HOME/.hometrans/config.json`; on Windows `%USERPROFILE%\.hometrans\config.json`). Its shape is:
34
35
 
35
36
  ```jsonc
36
37
  {
37
- "node_path": "...",
38
- "deveco_studio_path": "...", // e.g. "D:\\DevEco Studio"
39
- "harmonyos_sdk_path": "...",
40
- "python_path": "...",
41
- "java_home": "..."
38
+ "editors": [ /* ... */ ],
39
+ "params": {
40
+ "OHOS_SDK_PATH": "...", // OpenHarmony SDK ETS path, e.g. "D:/DevEco Studio/sdk/default/openharmony/ets"
41
+ "HMS_SDK_PATH": "...", // HMS SDK ETS path, e.g. "D:/DevEco Studio/sdk/default/hms/ets"
42
+ "TEST_API_KEY": "..."
43
+ }
42
44
  }
43
45
  ```
44
46
 
45
- Extract `deveco_studio_path` from this file.
47
+ Read `params.OHOS_SDK_PATH` from this file.
46
48
 
47
- ### 0b. Derive tool paths from DevEco Studio
49
+ ### 0b. Derive the DevEco Studio root and tool paths
48
50
 
49
- If `deveco_studio_path` is present and valid, derive:
50
- - **Node executable**: `<deveco_studio_path>/tools/node/node.exe`
51
- - **Hvigor script**: `<deveco_studio_path>/tools/hvigor/bin/hvigorw.js`
52
- - **ohpm**: `<deveco_studio_path>/tools/ohpm/bin/ohpm`
53
- - **SDK directory**: `<deveco_studio_path>/sdk`
51
+ The DevEco Studio installation root is the part of `OHOS_SDK_PATH` before the SDK suffix. Strip the trailing `/sdk/default/openharmony/ets` (or `\sdk\default\openharmony\ets`) from `OHOS_SDK_PATH` to get `<deveco>`.
54
52
 
55
- Verify these files exist. If they do, use them and skip auto-detection.
53
+ > Example: `OHOS_SDK_PATH = D:/DevEco Studio/sdk/default/openharmony/ets` `<deveco> = D:/DevEco Studio`.
54
+
55
+ From `<deveco>`, derive:
56
+ - **Node executable**: `<deveco>/tools/node/node.exe`
57
+ - **Hvigor script**: `<deveco>/tools/hvigor/bin/hvigorw.js`
58
+ - **ohpm**: `<deveco>/tools/ohpm/bin/ohpm`
59
+ - **SDK directory**: `<deveco>/sdk`
60
+
61
+ Verify these files exist. If they do, use them and skip auto-detection. (Fall back to `params.HMS_SDK_PATH` — stripping `/sdk/default/hms/ets` — if `OHOS_SDK_PATH` is absent but `HMS_SDK_PATH` is present.)
56
62
 
57
63
  ### 0c. Auto-detect if config is missing or invalid
58
64
 
59
- If the config file is empty, missing, or the paths don't point to real files, auto-detect:
65
+ If `~/.hometrans/config.json` is missing, has empty `params.OHOS_SDK_PATH`/`HMS_SDK_PATH`, or the derived paths don't point to real files, auto-detect:
60
66
 
61
67
  1. **Find DevEco Studio installation**:
62
68
  - Search common locations: `D:\DevEco Studio`, `C:\DevEco Studio`, `C:\Program Files\DevEco Studio`
@@ -67,7 +73,7 @@ If the config file is empty, missing, or the paths don't point to real files, au
67
73
  - `where node` (Windows) or `which node` (Unix)
68
74
  - Verify it runs: `node --version`
69
75
 
70
- If auto-detection fails for any critical path, **stop and report clearly** what is missing so the user can run `/setup` to configure it.
76
+ If auto-detection fails for any critical path, **stop and report clearly** what is missing so the user can run `ht init` to configure it.
71
77
 
72
78
  ### 0d. Store resolved paths
73
79
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: code-review-fix
2
3
  description: One-pass review-fix-build cycle — reviews HarmonyOS code against scenarios, verifies and fixes confirmed issues, rebuilds the project
3
4
  color: red
4
5
  ---
@@ -40,7 +41,7 @@ If `commit-id` is provided and is not `none`:
40
41
  - `projectPath`: `<harmonyos-project-path>`
41
42
  - `commitId`: `<commit-id>`
42
43
  - `mode`: `"default"`
43
- - `ohosSdkPath` / `hmsSdkPath`: from environment or omit
44
+ - `ohosSdkPath` / `hmsSdkPath`: omit to let the tool read `params.OHOS_SDK_PATH` / `params.HMS_SDK_PATH` from the `ht init` config (`~/.hometrans/config.json`), falling back to the `OHOS_SDK_PATH` / `HMS_SDK_PATH` env vars
44
45
 
45
46
  2. **On failure**, fall back to:
46
47
  ```bash
@@ -230,16 +231,16 @@ Classify: **CONFIRMED** (fix) | **FALSE_POSITIVE** (skip, record reason) | **UNC
230
231
 
231
232
  ### Step 3.0: Resolve Build Environment
232
233
 
233
- 1. Read `android-harmonyos-converter/.claude-plugin/converter-config.json` (locate plugin root by searching for `android-harmonyos-converter/.claude-plugin/plugin.json`). Extract `deveco_studio_path`.
234
+ 1. Read the `ht init` config at `~/.hometrans/config.json` (Windows: `%USERPROFILE%\.hometrans\config.json`). Take `params.OHOS_SDK_PATH` (e.g. `D:/DevEco Studio/sdk/default/openharmony/ets`) and strip the trailing `/sdk/default/openharmony/ets` to get the DevEco Studio root `<deveco>`. Fall back to `params.HMS_SDK_PATH` (strip `/sdk/default/hms/ets`) if needed.
234
235
 
235
236
  2. Derive tool paths:
236
237
  - `NODE_EXE`: `<deveco>/tools/node/node.exe`
237
238
  - `HVIGORW_JS`: `<deveco>/tools/hvigor/bin/hvigorw.js`
238
239
  - `OHPM`: `<deveco>/tools/ohpm/bin/ohpm`
239
240
 
240
- 3. If config missing, auto-detect: search `D:\DevEco Studio`, `C:\DevEco Studio`, `C:\Program Files\DevEco Studio` for `tools/hvigor/bin/hvigorw.js`.
241
+ 3. If the config is missing or `params.OHOS_SDK_PATH`/`HMS_SDK_PATH` are empty, auto-detect: search `D:\DevEco Studio`, `C:\DevEco Studio`, `C:\Program Files\DevEco Studio` for `tools/hvigor/bin/hvigorw.js`.
241
242
 
242
- 4. If detection fails, stop and report clearly what is missing.
243
+ 4. If detection fails, stop and report clearly what is missing so the user can run `ht init` to configure it.
243
244
 
244
245
  ### Step 3.1: Setup Project
245
246
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: code-reviewer
2
3
  description: Reviews HarmonyOS code against user scenarios to validate functional coverage
3
4
  color: red
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: logic-coding
2
3
  description: "Execute the HarmonyOS ArkTS app contract without reopening design choices."
3
4
  color: blue
4
5
  min-model: sonnet
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: logic-context-builder
2
3
  description: "Constrain HarmonyOS ArkTS app changes into an executable decision contract."
3
4
  color: blue
4
5
  min-model: sonnet
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: review-fixer
2
3
  description: Fixes issues from code review reports — verifies each issue before fixing, references Android source, and uses cautious per-scenario fix strategies
3
4
  color: red
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: self-test-fixer
2
3
  description: Fixes issues identified by self-testing — reads self-test report, white-box verifies failures in HarmonyOS code, plans and executes fixes in order, produces detailed report
3
4
  color: cyan
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: self-tester
2
3
  description: Self-Tester — parses test_case.md into testcases.json + app-metadata.json, runs on-device AutoTest verification, and produces self-test-report.md. The `setup` boolean controls whether the parse phase runs.
3
4
  color: green
4
5
  ---
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: spec-generator
2
3
  description: Generates requirement specification (spec) documents for each requirement description file in a given folder by exploring an Android project and decomposing each requirement into atomic user scenarios
3
4
  color: cyan
4
5
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buaa_smat/hometrans",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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
  "type": "module",