@buaa_smat/hometrans 0.1.10 → 0.1.11
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/README.md +229 -214
- package/agents/build-fixer.md +17 -10
- package/agents/code-reviewer.md +4 -2
- package/dist/cli/config-store.js +57 -0
- package/dist/cli/config.js +8 -9
- package/dist/cli/init.js +311 -19
- package/dist/cli/mcp-setup.js +2 -6
- package/dist/context/index.js +46 -0
- package/package.json +1 -1
- package/resource/choose_editor.png +0 -0
- package/resource/hometrans_config.png +0 -0
- package/skills/hmos-convert-pipeline/SKILL.md +19 -11
- package/skills/hmos-fix-build-errors/SKILL.md +13 -5
- package/skills/hmos-incremental-ui-align/SKILL.md +15 -1
- package/resource/finish_init.png +0 -0
|
@@ -17,7 +17,13 @@ You are writing ArkTS codes.
|
|
|
17
17
|
- 不要做和用户需求无关的其他修改
|
|
18
18
|
-
|
|
19
19
|
## Step 0: Load Config
|
|
20
|
-
|
|
20
|
+
Resolve the config file in this order — stop at the first hit:
|
|
21
|
+
|
|
22
|
+
1. **`config-path` argument** if the user provided one (e.g., `config-path: D:\path\to\config.json`).
|
|
23
|
+
2. **`config.json` in this skill's own directory** — `ht init` seeds it from `config-example.json` and fills `glm_api_key` + `hmos_sdk_dir` from `~/.hometrans/config.json`.
|
|
24
|
+
3. Neither exists → **ask the user** for a valid path.
|
|
25
|
+
|
|
26
|
+
Verify the resolved file with a Read; if it's missing or unreadable, fall through to the next source (or ask the user). Refer to `config-example.json` in this skill's directory for the expected schema.
|
|
21
27
|
|
|
22
28
|
Config fields:
|
|
23
29
|
|
|
@@ -33,6 +39,14 @@ Config fields:
|
|
|
33
39
|
| `glm_api_key` | Zhipu GLM API key for phone-agent |
|
|
34
40
|
| `capture_output_dir` | Base directory for captured page data |
|
|
35
41
|
|
|
42
|
+
**Fallbacks for `hmos_sdk_dir` and `glm_api_key`** when empty or missing in the resolved config — stop at the first hit:
|
|
43
|
+
|
|
44
|
+
1. `~/.hometrans/config.json` (on Windows `%USERPROFILE%\.hometrans\config.json`): `hmos_sdk_dir` = `<env.DEVECO_SDK_HOME>/default`; `glm_api_key` = `env.GLM_API_KEY`.
|
|
45
|
+
2. Environment variables: derive `hmos_sdk_dir` from `DEVECO_SDK_HOME` (append `/default`); `glm_api_key` from `GLM_API_KEY`.
|
|
46
|
+
3. **Ask the user** (suggest running `ht init` to persist them).
|
|
47
|
+
|
|
48
|
+
Validate that `hmos_sdk_dir` exists on disk before use; if it doesn't, continue down the fallback list.
|
|
49
|
+
|
|
36
50
|
## Step 1: Capture All Related Pages on Android & HarmonyOS Devices
|
|
37
51
|
|
|
38
52
|
Read `scripts/navigation-capure.md` to learn the usage of `scripts/app_feature_verify.py` (navigation) and `scripts/page_capture.py` (capture).
|
package/resource/finish_init.png
DELETED
|
Binary file
|