@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.
- package/agents/build-fixer.md +23 -17
- package/agents/code-review-fix.md +5 -4
- package/agents/code-reviewer.md +1 -0
- package/agents/logic-coding.md +1 -0
- package/agents/logic-context-builder.md +1 -0
- package/agents/review-fixer.md +1 -0
- package/agents/self-test-fixer.md +1 -0
- package/agents/self-tester.md +1 -0
- package/agents/spec-generator.md +1 -0
- package/package.json +1 -1
package/agents/build-fixer.md
CHANGED
|
@@ -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
|
|
32
|
+
### 0a. Read the HomeTrans config
|
|
32
33
|
|
|
33
|
-
Read the config file at
|
|
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
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
47
|
+
Read `params.OHOS_SDK_PATH` from this file.
|
|
46
48
|
|
|
47
|
-
### 0b. Derive
|
|
49
|
+
### 0b. Derive the DevEco Studio root and tool paths
|
|
48
50
|
|
|
49
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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 `
|
|
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
|
|
package/agents/code-reviewer.md
CHANGED
package/agents/logic-coding.md
CHANGED
package/agents/review-fixer.md
CHANGED
package/agents/self-tester.md
CHANGED
package/agents/spec-generator.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buaa_smat/hometrans",
|
|
3
|
-
"version": "0.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",
|