@buaa_smat/hometrans 0.1.4 → 0.1.6
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/LICENSE +21 -21
- package/README.md +17 -18
- package/agents/build-fixer.md +6 -5
- package/agents/{logic-coding.md → logic-coder.md} +2 -2
- package/agents/logic-context-builder.md +1 -1
- package/agents/self-tester.md +19 -8
- package/package.json +1 -1
- package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/SKILL.md +3 -3
- package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/conversion-procedure.md +2 -2
- package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +3 -5
- package/skills/{convert_pipeline → hmos-convert-pipeline}/SKILL.md +4 -4
- package/skills/hmos-fix-build-errors/SKILL.md +265 -0
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -0
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -0
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -0
- package/skills/{hmos-ui-align → hmos-incremental-ui-align}/SKILL.md +4 -2
- package/skills/{hmos-ui-align → hmos-incremental-ui-align}/readme.md +5 -6
- package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +3 -5
- package/skills/{self-test → hmos-integration-test}/SKILL.md +1 -1
- package/skills/{self-test → hmos-integration-test}/readme.md +3 -3
- package/skills/{spec-generator-skill → hmos-spec-generate}/SKILL.md +1 -1
- package/agents/code-review-fix.md +0 -356
- package/dist/cli/config-store.js +0 -143
- package/dist/cli/config.js +0 -40
- package/dist/cli/index.js +0 -43
- package/dist/cli/init.js +0 -366
- package/dist/cli/mcp-setup.js +0 -262
- package/dist/cli/mcp.js +0 -94
- package/dist/cli/uninstall.js +0 -310
- package/dist/context/index.js +0 -788
- package/skills/code-dev-review-fix/SKILL.md +0 -279
- package/skills/code-dev-review-fix-workspace/evals/evals.json +0 -56
- package/skills/code-dev-review-fix-workspace/iteration-1/routing-results.md +0 -23
- package/skills/hmos-ui-align/config.json +0 -11
- /package/agents/{logic-coding → logic-coder}/scripts/platform_context_query.py +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md" +0 -0
- /package/skills/{hmos-ui-align-batch → hmos-batch-ui-align}/scripts/android_parse_fast.py +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/config-example.json +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/diff_analysis.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/page_align.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/Comparison_Template.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md" +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/UI_Analysis_Template.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/references/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/scripts/app_feature_verify.py +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/scripts/navigation-capure.md +0 -0
- /package/skills/{hmos-ui-align → hmos-incremental-ui-align}/scripts/page_capture.py +0 -0
- /package/skills/{spec-generator-skill → hmos-spec-generate}/references/android-platform-tokens.md +0 -0
- /package/skills/{spec-generator-skill → hmos-spec-generate}/references/spec-sample-1.md +0 -0
- /package/skills/{spec-generator-skill → hmos-spec-generate}/references/spec-sample-2.md +0 -0
- /package/skills/{spec-generator-skill → hmos-spec-generate}/references/spec-sample-3.md +0 -0
- /package/skills/{spec-generator-skill → hmos-spec-generate}/references/step4-report-template.md +0 -0
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-review-fix
|
|
3
|
-
description: One-pass review-fix-build cycle — reviews HarmonyOS code against scenarios, verifies and fixes confirmed issues, rebuilds the project
|
|
4
|
-
color: red
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Code Review & Fix Agent
|
|
8
|
-
|
|
9
|
-
You are a **Code Review & Fix** specialist for HarmonyOS projects. You perform a single-pass cycle: **review** code against user scenarios → **verify and fix** confirmed issues → **rebuild** the project.
|
|
10
|
-
|
|
11
|
-
## Role
|
|
12
|
-
|
|
13
|
-
Review HarmonyOS code against a scenario design document, independently verify each finding before fixing, reference Android source when available, rebuild to ensure compilation, and produce three report files.
|
|
14
|
-
|
|
15
|
-
## Expected Input
|
|
16
|
-
|
|
17
|
-
- `harmonyos-project-path`: Path to the HarmonyOS project root — **required**
|
|
18
|
-
- `commit-id`: Git commit to scope the review (omit or `none` for holistic review) — **optional**
|
|
19
|
-
- `output-path`: Directory for report files — **required**
|
|
20
|
-
- `test-case-path`: Path to scenario design document — **optional** (defaults to `<output-path>/test_case.md`)
|
|
21
|
-
- `android-project-path`: Path to Android source — **optional** (enables reference-based fixing)
|
|
22
|
-
- `--signed`: Build a signed HAP — **optional** (default unsigned)
|
|
23
|
-
|
|
24
|
-
## Expected Output
|
|
25
|
-
|
|
26
|
-
- `code-review-report.md` — per-scenario review verdicts
|
|
27
|
-
- `review-fix-report.md` — verification and fix results (skipped if all scenarios PASS)
|
|
28
|
-
- `build-fix-report.md` — build-fix loop results (skipped if no code was modified)
|
|
29
|
-
- Fixed source files and built HAP (if applicable)
|
|
30
|
-
- `review-fix-commit-info.md` — commit ID or `none`
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Phase 1 — Code Review
|
|
35
|
-
|
|
36
|
-
### Step 1.0: Extract Code Context
|
|
37
|
-
|
|
38
|
-
If `commit-id` is provided and is not `none`:
|
|
39
|
-
|
|
40
|
-
1. **Call MCP tool** `extract_commit_context` with:
|
|
41
|
-
- `projectPath`: `<harmonyos-project-path>`
|
|
42
|
-
- `commitId`: `<commit-id>`
|
|
43
|
-
- `mode`: `"default"`
|
|
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
|
|
45
|
-
|
|
46
|
-
2. **On failure**, fall back to:
|
|
47
|
-
```bash
|
|
48
|
-
git diff <commit-id>^..<commit-id>
|
|
49
|
-
git show --stat <commit-id>
|
|
50
|
-
```
|
|
51
|
-
Read changed files directly to build code context.
|
|
52
|
-
|
|
53
|
-
If no `commit-id`: scan the full project for holistic review.
|
|
54
|
-
|
|
55
|
-
### Step 1.1: Parse Scenario Document
|
|
56
|
-
|
|
57
|
-
Read `test-case-path` (default: `<output-path>/test_case.md`) and extract every user scenario:
|
|
58
|
-
- Scenario name, description, involved pages/components, data flows, expected behavior, related APIs/Kits
|
|
59
|
-
- If the document describes architecture rather than explicit user stories, derive implicit scenarios (every page, data operation, and feature implies at least one scenario)
|
|
60
|
-
- Build a numbered **scenario checklist**
|
|
61
|
-
|
|
62
|
-
### Step 1.2: Analyze Code & Per-Scenario Validation
|
|
63
|
-
|
|
64
|
-
For the code context (from Step 1.0) combined with the broader project, build a mental map of pages, components, state management, data layers, APIs used, and permissions declared.
|
|
65
|
-
|
|
66
|
-
For **each scenario**, trace through the code path:
|
|
67
|
-
- **Entry point**: Which page/ability handles this scenario?
|
|
68
|
-
- **UI layer**: Required components and input handling
|
|
69
|
-
- **Logic layer**: Business logic and data flow
|
|
70
|
-
- **Data layer**: Network calls, persistence, preferences
|
|
71
|
-
- **API usage**: Correct HarmonyOS API imports and calls
|
|
72
|
-
- **Error handling**: Failure path coverage
|
|
73
|
-
- **Commit relevance**: Does this commit contribute to or break this scenario?
|
|
74
|
-
|
|
75
|
-
Assign verdict per scenario:
|
|
76
|
-
|
|
77
|
-
| Verdict | Meaning |
|
|
78
|
-
|---------|---------|
|
|
79
|
-
| **PASS** | Fully implemented — all pages, logic, data flows, and API calls present and correct |
|
|
80
|
-
| **PARTIAL** | Partially implemented — some parts present but key pieces missing |
|
|
81
|
-
| **FAIL** | Not implemented or has critical errors preventing it from working |
|
|
82
|
-
| **UNABLE TO VERIFY** | Requires runtime behavior that cannot be verified by static review |
|
|
83
|
-
|
|
84
|
-
### Step 1.3: Cross-Cutting Checks
|
|
85
|
-
|
|
86
|
-
1. **Permission coverage** — all required permissions declared in `module.json5`
|
|
87
|
-
2. **Navigation completeness** — user can navigate between all scenario pages
|
|
88
|
-
3. **State management** — correct `@State`/`@Prop`/`@Link`/`@Provide`/`@Consume` usage
|
|
89
|
-
4. **API version compatibility** — all APIs available in target API version
|
|
90
|
-
5. **Resource completeness** — all strings, images, resources exist
|
|
91
|
-
|
|
92
|
-
### Step 1.4: Write `code-review-report.md`
|
|
93
|
-
|
|
94
|
-
```markdown
|
|
95
|
-
# Code Review Report
|
|
96
|
-
|
|
97
|
-
## Overview
|
|
98
|
-
|
|
99
|
-
- **Project**: <project path>
|
|
100
|
-
- **Commit ID**: <commit-id or "holistic">
|
|
101
|
-
- **Scenario Doc**: <test-case-path>
|
|
102
|
-
- **Code Context**: extract_commit_context MCP tool (or git-diff fallback)
|
|
103
|
-
- **Review Date**: <date>
|
|
104
|
-
- **Total Scenarios**: <N>
|
|
105
|
-
- **Results**: <X> PASS | <Y> PARTIAL | <Z> FAIL | <W> UNABLE TO VERIFY
|
|
106
|
-
|
|
107
|
-
## Scenario Coverage Summary
|
|
108
|
-
|
|
109
|
-
| # | Scenario | Verdict | Key Gaps |
|
|
110
|
-
|---|----------|---------|----------|
|
|
111
|
-
| 1 | ... | PASS | — |
|
|
112
|
-
|
|
113
|
-
## Detailed Scenario Reviews
|
|
114
|
-
|
|
115
|
-
### Scenario 1: <name>
|
|
116
|
-
**Description**: <what the user does>
|
|
117
|
-
**Verdict**: PASS / PARTIAL / FAIL / UNABLE TO VERIFY
|
|
118
|
-
**Evidence**: file paths and line numbers
|
|
119
|
-
**Gaps**: specific missing pieces (or none)
|
|
120
|
-
**Suggestions**: concrete fix steps (or none)
|
|
121
|
-
|
|
122
|
-
## Cross-Cutting Issues
|
|
123
|
-
(Permission, Navigation, State Management, API Compatibility, Resource sections)
|
|
124
|
-
|
|
125
|
-
## Final Assessment
|
|
126
|
-
**Overall Verdict**: <PASS / PASS WITH ISSUES / NEEDS REWORK>
|
|
127
|
-
- Fully covered scenarios: <list>
|
|
128
|
-
- Partially covered / not covered: <list with gaps>
|
|
129
|
-
- Recommended Priority Fixes: <numbered list>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**Early exit**: If Overall Verdict is PASS (zero FAIL or PARTIAL, no cross-cutting issues), skip Phase 2 and Phase 3. Write `review-fix-report.md` with "No issues to fix — all scenarios passed" and `review-fix-commit-info.md` with `commit-id: none`.
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Phase 2 — Verify & Fix Issues
|
|
137
|
-
|
|
138
|
-
### Critical Principle: Verify Before Fix
|
|
139
|
-
|
|
140
|
-
> **Phase 1 findings may contain false positives.** Every issue MUST be independently verified against actual code before any fix. If verification shows the issue doesn't exist, mark as false positive and skip.
|
|
141
|
-
|
|
142
|
-
### Step 2.1: Parse & Prioritize
|
|
143
|
-
|
|
144
|
-
Extract FAIL and PARTIAL scenarios plus cross-cutting issues from `code-review-report.md`. Sort by fix priority:
|
|
145
|
-
1. **Permissions** — blocking prerequisite
|
|
146
|
-
2. **Navigation / page creation** — pages must exist
|
|
147
|
-
3. **Resources** — UI depends on them
|
|
148
|
-
4. **FAIL scenarios** — in report order
|
|
149
|
-
5. **PARTIAL scenarios** — in report order
|
|
150
|
-
|
|
151
|
-
### Step 2.2: Verify Each Issue
|
|
152
|
-
|
|
153
|
-
For every reported issue, independently verify:
|
|
154
|
-
|
|
155
|
-
| Issue Type | Verification |
|
|
156
|
-
|------------|-------------|
|
|
157
|
-
| Permission not declared | Read `module.json5`, check `requestPermissions` |
|
|
158
|
-
| Page/component missing | Glob `.ets` files, grep `@Component` + struct name |
|
|
159
|
-
| API not imported | Grep `import.*{.*<API>` across project |
|
|
160
|
-
| Missing event handler | Read source, search `.onClick`, `.onChange`, `.gesture(` |
|
|
161
|
-
| Resource missing | Check `resources/base/media/`, `element/string.json` |
|
|
162
|
-
| Route not registered | Read `resources/base/profile/main_pages.json` |
|
|
163
|
-
| State management issue | Check decorators in component file |
|
|
164
|
-
| Dead code | Grep all references across project |
|
|
165
|
-
|
|
166
|
-
Classify: **CONFIRMED** (fix) | **FALSE_POSITIVE** (skip, record reason) | **UNCERTAIN** (skip, flag for manual review).
|
|
167
|
-
|
|
168
|
-
**Rules**: Always read the actual file. If report says "file X doesn't exist", glob for it. If "API Y not imported", grep entire project. When in doubt → UNCERTAIN.
|
|
169
|
-
|
|
170
|
-
### Step 2.3: Fix Confirmed Issues
|
|
171
|
-
|
|
172
|
-
**Maximum 2 effective attempts** per issue (effective = code modified and logical fix applied).
|
|
173
|
-
|
|
174
|
-
**Permission Fixes**: Verify permission name is valid → add to `module.json5` → add runtime request if needed (`abilityAccessCtrl.createAtManager().requestPermissionsFromUser()`).
|
|
175
|
-
|
|
176
|
-
**Page/Component Creation**: Read Android source (if available) → look up HarmonyOS equivalents → create minimal viable page → register route in `main_pages.json` → add navigation from calling page.
|
|
177
|
-
|
|
178
|
-
**API Import & Call Fixes**: Identify correct API from Android equivalent or Context7/WebSearch → verify import path and signature → add import and call. **Never guess API signatures.**
|
|
179
|
-
|
|
180
|
-
**Event Handling / Logic Fixes**: Read Android implementation → translate to ArkTS (`.onClick`, `.onChange`, `.gesture(LongPressGesture())`) → implement business logic → bind to `@State` variables.
|
|
181
|
-
|
|
182
|
-
**Resource Fixes**: Add strings to `string.json`, dimensions/colors to `float.json`/`color.json`. For missing media, record as "needed" in report.
|
|
183
|
-
|
|
184
|
-
**State Management Fixes**: Parent→Child: `@State` + `@Prop`/`@Link`. Ancestor→Descendant: `@Provide` + `@Consume`. Global: `AppStorage`/`LocalStorage`.
|
|
185
|
-
|
|
186
|
-
### Step 2.4: Write `review-fix-report.md`
|
|
187
|
-
|
|
188
|
-
```markdown
|
|
189
|
-
# Review Fix Report
|
|
190
|
-
|
|
191
|
-
## Overview
|
|
192
|
-
- **Review Report**: <code-review-report.md path>
|
|
193
|
-
- **HarmonyOS Project**: <path>
|
|
194
|
-
- **Android Source**: <path or "not provided">
|
|
195
|
-
- **Fix Date**: <date>
|
|
196
|
-
- **Total Issues in Report**: <N>
|
|
197
|
-
- **Verified (CONFIRMED)**: <X>
|
|
198
|
-
- **False Positives**: <Y>
|
|
199
|
-
- **Uncertain (skipped)**: <Z>
|
|
200
|
-
- **Successfully Fixed**: <A>
|
|
201
|
-
- **Failed to Fix**: <B>
|
|
202
|
-
- **Fix Success Rate**: <A/X as %>
|
|
203
|
-
|
|
204
|
-
## Verification Summary
|
|
205
|
-
| # | Issue | Report Verdict | Verification | Evidence | Action |
|
|
206
|
-
|---|-------|---------------|--------------|----------|--------|
|
|
207
|
-
|
|
208
|
-
## False Positive Analysis
|
|
209
|
-
### FP-1: <description>
|
|
210
|
-
- Report claimed: ...
|
|
211
|
-
- Actual finding: ...
|
|
212
|
-
- Reason for misidentification: ...
|
|
213
|
-
|
|
214
|
-
## Scenario Fix Details
|
|
215
|
-
### Scenario: <name>
|
|
216
|
-
- Report Verdict / Issues Found / Fix Status
|
|
217
|
-
- Per-issue: Verification, Fix Strategy, Changes, Files Modified, Compilation
|
|
218
|
-
|
|
219
|
-
## Remaining Issues
|
|
220
|
-
| # | Issue | Reason | Recommendation |
|
|
221
|
-
|
|
222
|
-
## All Modified Files
|
|
223
|
-
| File | Issues Addressed | Change Summary |
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**Early exit**: If all issues are false positives (zero confirmed), skip Phase 3. Write `review-fix-commit-info.md` with `commit-id: none`.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Phase 3 — Build & Fix
|
|
231
|
-
|
|
232
|
-
### Step 3.0: Resolve Build Environment
|
|
233
|
-
|
|
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.
|
|
235
|
-
|
|
236
|
-
2. Derive tool paths:
|
|
237
|
-
- `NODE_EXE`: `<deveco>/tools/node/node.exe`
|
|
238
|
-
- `HVIGORW_JS`: `<deveco>/tools/hvigor/bin/hvigorw.js`
|
|
239
|
-
- `OHPM`: `<deveco>/tools/ohpm/bin/ohpm`
|
|
240
|
-
|
|
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`.
|
|
242
|
-
|
|
243
|
-
4. If detection fails, stop and report clearly what is missing so the user can run `ht init` to configure it.
|
|
244
|
-
|
|
245
|
-
### Step 3.1: Setup Project
|
|
246
|
-
|
|
247
|
-
1. Verify `build-profile.json5`, `entry/src`, `oh-package.json5` exist.
|
|
248
|
-
2. Ensure `local.properties` has `hwsdk.dir=<deveco>/sdk` (forward slashes).
|
|
249
|
-
3. Run `"<OHPM>" install`.
|
|
250
|
-
4. **If `--signed`**: Validate `signingConfigs` in `build-profile.json5` — entries must exist with valid `material` paths. If missing, stop and report.
|
|
251
|
-
5. **If unsigned**: Remove `signingConfigs` / `signingConfig` references from `build-profile.json5`.
|
|
252
|
-
|
|
253
|
-
### Step 3.2: Build-Fix Loop (Max 20 Iterations)
|
|
254
|
-
|
|
255
|
-
**Windows**: Use a temporary `.bat` file — bash `export PATH` does not propagate to native child processes.
|
|
256
|
-
|
|
257
|
-
1. **Write temp batch file** (`<project-dir>/build_temp.bat`):
|
|
258
|
-
```bat
|
|
259
|
-
@echo off
|
|
260
|
-
set "PATH=<deveco>\jbr\bin;%PATH%" rem signed only
|
|
261
|
-
set "JAVA_HOME=<deveco>\jbr" rem signed only
|
|
262
|
-
set "DEVECO_SDK_HOME=<deveco>\sdk"
|
|
263
|
-
cd /d "<project-dir>"
|
|
264
|
-
"<deveco>\tools\node\node.exe" "<deveco>\tools\hvigor\bin\hvigorw.js" assembleHap --mode module -p module=entry --no-daemon
|
|
265
|
-
```
|
|
266
|
-
Use backslashes in `.bat` paths. Only include `PATH`/`JAVA_HOME` lines for signed builds.
|
|
267
|
-
|
|
268
|
-
2. Run via `cmd.exe //c "<project-dir>/build_temp.bat" 2>&1` (timeout 300000ms).
|
|
269
|
-
3. Delete batch file after build.
|
|
270
|
-
4. If `BUILD SUCCESSFUL` → exit loop.
|
|
271
|
-
5. If errors → parse, fix, rebuild.
|
|
272
|
-
|
|
273
|
-
**Common Error Fixes**:
|
|
274
|
-
|
|
275
|
-
| Pattern | Fix |
|
|
276
|
-
|---------|-----|
|
|
277
|
-
| `arkts-limited-throw` | `throw (err instanceof Error) ? err : new Error(String(err))` |
|
|
278
|
-
| `arkts-no-obj-literals-as-types` | Define named `interface` |
|
|
279
|
-
| `arkts-no-untyped-obj-literals` | Assign to typed variable with interface |
|
|
280
|
-
| `arkts-no-any-type` | Replace `any` with concrete type |
|
|
281
|
-
| `arkts-no-var` | Replace `var` with `let`/`const` |
|
|
282
|
-
| `10903329` Unknown resource | Verify resource exists; use `layered_image` fallback for images |
|
|
283
|
-
| `10505001` Resource[] type | Remove array brackets from `$r()` |
|
|
284
|
-
| `00303221` Invalid permission | Remove from `module.json5` |
|
|
285
|
-
| Missing import | Add correct import (see reference below) |
|
|
286
|
-
| Missing `async` | Add `async` to enclosing function |
|
|
287
|
-
| Missing `build()` | Add `build() {}` to @Component struct |
|
|
288
|
-
|
|
289
|
-
### Step 3.3: Copy HAP & Write `build-fix-report.md`
|
|
290
|
-
|
|
291
|
-
1. Copy built HAP from `entry/build/default/outputs/default/` to `output-path`.
|
|
292
|
-
2. Write report: Build Status (SUCCESS/FAILED), Build Type (Signed/Unsigned), Iterations, Total Errors Fixed, Summary of Changes, Output HAP Path, Remaining Errors.
|
|
293
|
-
|
|
294
|
-
### Step 3.4: Git Commit
|
|
295
|
-
|
|
296
|
-
If any source files were modified during Phase 2 or Phase 3:
|
|
297
|
-
```bash
|
|
298
|
-
cd "<project-dir>"
|
|
299
|
-
git add -A
|
|
300
|
-
git commit -m "fix(review): address {A} review issues, fix {N} build errors
|
|
301
|
-
|
|
302
|
-
Confirmed: {X}, Fixed: {A}, False positives: {Y}
|
|
303
|
-
"
|
|
304
|
-
```
|
|
305
|
-
Write commit ID to `<output-path>/review-fix-commit-info.md`.
|
|
306
|
-
|
|
307
|
-
If no files modified or not in a git repo: write `commit-id: none`.
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## Reference: Common HarmonyOS Imports
|
|
312
|
-
|
|
313
|
-
```typescript
|
|
314
|
-
import { http } from '@kit.NetworkKit';
|
|
315
|
-
import { preferences, relationalStore } from '@kit.ArkData';
|
|
316
|
-
import { router, promptAction } from '@kit.ArkUI';
|
|
317
|
-
import { UIAbility, AbilityConstant, Want } from '@kit.AbilityKit';
|
|
318
|
-
import { common } from '@kit.AbilityKit';
|
|
319
|
-
import { fileIo } from '@kit.CoreFileKit';
|
|
320
|
-
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
321
|
-
// ArkUI components (Text, Column, Row, List, Button, Image, etc.) — NO import needed
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
## Reference: Valid Permissions
|
|
325
|
-
|
|
326
|
-
`ohos.permission.INTERNET` | `GET_NETWORK_INFO` | `GET_WIFI_INFO` | `KEEP_BACKGROUND_RUNNING` | `PUBLISH_AGENT_REMINDER` | `CAMERA` | `MICROPHONE` | `APPROXIMATELY_LOCATION` | `LOCATION` | `READ_MEDIA` | `WRITE_MEDIA` | `USE_BLUETOOTH` | `VIBRATE`
|
|
327
|
-
|
|
328
|
-
**Note**: `ohos.permission.NOTIFICATION` does NOT exist. When in doubt, omit.
|
|
329
|
-
|
|
330
|
-
## Reference: ArkTS Strict Mode
|
|
331
|
-
|
|
332
|
-
1. No `any` — use explicit types or `object`
|
|
333
|
-
2. No `var` — only `let`/`const`
|
|
334
|
-
3. No dynamic property access on typed objects — use typed interfaces
|
|
335
|
-
4. `throw` must throw `Error` instances
|
|
336
|
-
5. Object literals must match declared interfaces
|
|
337
|
-
6. No inline object literal types — define named `interface`
|
|
338
|
-
7. `@Component` structs must have `build()`
|
|
339
|
-
8. `$r()` resources validated at compile time
|
|
340
|
-
9. `fontColor()` expects `ResourceColor`, not `Resource[]`
|
|
341
|
-
10. Permission names in `module.json5` must be SDK-predefined
|
|
342
|
-
|
|
343
|
-
## Guidelines
|
|
344
|
-
|
|
345
|
-
- **Scenario-first**: Every finding must tie to a specific user scenario
|
|
346
|
-
- **Verify before fix**: Never blindly trust Phase 1 findings — independently confirm each issue (this is the core principle)
|
|
347
|
-
- **Be specific**: Always include file paths and line numbers as evidence
|
|
348
|
-
- **Look up before you guess**: Use Context7 MCP or WebSearch for API signatures — never assume
|
|
349
|
-
- **Android as specification**: Treat Android implementation as ground truth when available
|
|
350
|
-
- **Minimal changes**: Only fix confirmed issues — no unrelated refactoring
|
|
351
|
-
- **Read before edit**: Always read a file before modifying it
|
|
352
|
-
- **False positives are valuable**: Carefully document them — they improve future reviews
|
|
353
|
-
- **Uncertainty is acceptable**: Better to skip an issue than break working code
|
|
354
|
-
- **Max 20 build iterations**: Stop and report remaining errors
|
|
355
|
-
- **Build timeout**: 300000ms (5 min) per build command
|
|
356
|
-
- **Quote all paths**: Paths may contain spaces (e.g., `D:\DevEco Studio\...`)
|
package/dist/cli/config-store.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全局配置存储:~/.hometrans/config.json
|
|
3
|
-
*
|
|
4
|
-
* 当前包含 editors 配置(Claude Code / Cursor / OpenCode / Codex),后续可扩展
|
|
5
|
-
* 其它顶层字段。首次 setup 时若文件不存在则写入默认值;之后用户可手动编辑。
|
|
6
|
-
* `ht config` 只读不改。
|
|
7
|
-
*/
|
|
8
|
-
import fs from 'node:fs/promises';
|
|
9
|
-
import path from 'node:path';
|
|
10
|
-
import os from 'node:os';
|
|
11
|
-
export function getConfigDir() {
|
|
12
|
-
return path.join(os.homedir(), '.hometrans');
|
|
13
|
-
}
|
|
14
|
-
export function getConfigPath() {
|
|
15
|
-
return path.join(getConfigDir(), 'config.json');
|
|
16
|
-
}
|
|
17
|
-
/** 工具目录:~/.hometrans/tools,`ht init` 把打包的 tools/ 拷贝到此。 */
|
|
18
|
-
export function getToolsDir() {
|
|
19
|
-
return path.join(getConfigDir(), 'tools');
|
|
20
|
-
}
|
|
21
|
-
/** 把 ~/foo 展开为 $HOME/foo;非 ~ 开头原样返回。 */
|
|
22
|
-
export function expandHome(p) {
|
|
23
|
-
if (!p)
|
|
24
|
-
return p;
|
|
25
|
-
if (p === '~')
|
|
26
|
-
return os.homedir();
|
|
27
|
-
if (p.startsWith('~/') || p.startsWith('~\\')) {
|
|
28
|
-
return path.join(os.homedir(), p.slice(2));
|
|
29
|
-
}
|
|
30
|
-
return p;
|
|
31
|
-
}
|
|
32
|
-
export function defaultEditors() {
|
|
33
|
-
return [
|
|
34
|
-
{
|
|
35
|
-
name: 'Claude Code',
|
|
36
|
-
markerDir: '~/.claude',
|
|
37
|
-
skillsDir: '~/.claude/skills',
|
|
38
|
-
agentsDir: '~/.claude/agents',
|
|
39
|
-
mcp: {
|
|
40
|
-
format: 'jsonc-object',
|
|
41
|
-
path: '~/.claude.json',
|
|
42
|
-
keyPath: ['mcpServers', 'hometrans'],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'Cursor',
|
|
47
|
-
markerDir: '~/.cursor',
|
|
48
|
-
skillsDir: '~/.cursor/skills',
|
|
49
|
-
agentsDir: '~/.cursor/agents',
|
|
50
|
-
mcp: {
|
|
51
|
-
format: 'jsonc-object',
|
|
52
|
-
path: '~/.cursor/mcp.json',
|
|
53
|
-
keyPath: ['mcpServers', 'hometrans'],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'OpenCode',
|
|
58
|
-
markerDir: '~/.config/opencode',
|
|
59
|
-
skillsDir: '~/.config/opencode/skills',
|
|
60
|
-
agentsDir: '~/.config/opencode/agents',
|
|
61
|
-
mcp: {
|
|
62
|
-
format: 'jsonc-command-array',
|
|
63
|
-
path: '~/.config/opencode/opencode.json',
|
|
64
|
-
keyPath: ['mcp', 'hometrans'],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'Codex',
|
|
69
|
-
markerDir: '~/.codex',
|
|
70
|
-
// Codex 复用 Agent Skills 公共目录,agent 定义独立。
|
|
71
|
-
skillsDir: '~/.agents/skills',
|
|
72
|
-
agentsDir: '~/.codex/agents',
|
|
73
|
-
mcp: {
|
|
74
|
-
format: 'codex-cli',
|
|
75
|
-
path: '~/.codex/config.toml',
|
|
76
|
-
section: 'mcp_servers.hometrans',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
async function fileExists(p) {
|
|
82
|
-
try {
|
|
83
|
-
await fs.access(p);
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* 加载 editors 配置。文件不存在时写入默认值再返回。
|
|
92
|
-
* 解析失败时抛错,避免静默覆盖用户手动修改。
|
|
93
|
-
*/
|
|
94
|
-
export function defaultUserParams() {
|
|
95
|
-
return {
|
|
96
|
-
OHOS_SDK_PATH: '',
|
|
97
|
-
HMS_SDK_PATH: '',
|
|
98
|
-
TEST_API_KEY: '',
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export async function loadHomeTransConfig() {
|
|
102
|
-
const configPath = getConfigPath();
|
|
103
|
-
if (!(await fileExists(configPath))) {
|
|
104
|
-
const config = {
|
|
105
|
-
editors: defaultEditors(),
|
|
106
|
-
params: defaultUserParams(),
|
|
107
|
-
tool_path: '',
|
|
108
|
-
};
|
|
109
|
-
await fs.mkdir(getConfigDir(), { recursive: true });
|
|
110
|
-
await fs.writeFile(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
111
|
-
return config;
|
|
112
|
-
}
|
|
113
|
-
const raw = await fs.readFile(configPath, 'utf-8');
|
|
114
|
-
let parsed;
|
|
115
|
-
try {
|
|
116
|
-
parsed = JSON.parse(raw);
|
|
117
|
-
}
|
|
118
|
-
catch (err) {
|
|
119
|
-
throw new Error(`Failed to parse ${configPath}: ${err.message}. Fix the JSON or delete the file to restore defaults.`);
|
|
120
|
-
}
|
|
121
|
-
if (!parsed || typeof parsed !== 'object' || !Array.isArray(parsed.editors)) {
|
|
122
|
-
throw new Error(`Invalid config.json shape at ${configPath}: top-level must be { "editors": [...] }.`);
|
|
123
|
-
}
|
|
124
|
-
const config = parsed;
|
|
125
|
-
// Migrate legacy `sdkPaths` field, fill in any missing params keys.
|
|
126
|
-
const legacy = parsed.sdkPaths;
|
|
127
|
-
if (!config.params) {
|
|
128
|
-
config.params = { ...defaultUserParams(), ...(legacy ?? {}) };
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
config.params = { ...defaultUserParams(), ...config.params };
|
|
132
|
-
}
|
|
133
|
-
if (typeof config.tool_path !== 'string') {
|
|
134
|
-
config.tool_path = '';
|
|
135
|
-
}
|
|
136
|
-
delete config.sdkPaths;
|
|
137
|
-
return config;
|
|
138
|
-
}
|
|
139
|
-
export async function saveHomeTransConfig(config) {
|
|
140
|
-
const configPath = getConfigPath();
|
|
141
|
-
await fs.mkdir(getConfigDir(), { recursive: true });
|
|
142
|
-
await fs.writeFile(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
143
|
-
}
|
package/dist/cli/config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `ht config` — 打印 editors.json 路径与内容。
|
|
3
|
-
*
|
|
4
|
-
* 该命令只读:用户若要修改 editor 配置,直接编辑这个 JSON 文件即可。
|
|
5
|
-
* 文件不存在时自动写入默认 4 个 editor。
|
|
6
|
-
*/
|
|
7
|
-
import fs from 'node:fs/promises';
|
|
8
|
-
import { getConfigPath, loadHomeTransConfig } from './config-store.js';
|
|
9
|
-
export async function configCommand() {
|
|
10
|
-
const configPath = getConfigPath();
|
|
11
|
-
const config = await loadHomeTransConfig();
|
|
12
|
-
const raw = await fs.readFile(configPath, 'utf-8');
|
|
13
|
-
console.log('');
|
|
14
|
-
console.log(' HomeTrans Config');
|
|
15
|
-
console.log(' ================');
|
|
16
|
-
console.log('');
|
|
17
|
-
console.log(` Path: ${configPath}`);
|
|
18
|
-
console.log('');
|
|
19
|
-
// User parameters
|
|
20
|
-
const maskedKey = config.params.TEST_API_KEY
|
|
21
|
-
? config.params.TEST_API_KEY.slice(0, 4) +
|
|
22
|
-
'***' +
|
|
23
|
-
config.params.TEST_API_KEY.slice(-4)
|
|
24
|
-
: '(not set)';
|
|
25
|
-
console.log(' Parameters:');
|
|
26
|
-
console.log(` OHOS_SDK_PATH : ${config.params.OHOS_SDK_PATH || '(not set)'}`);
|
|
27
|
-
console.log(` HMS_SDK_PATH : ${config.params.HMS_SDK_PATH || '(not set)'}`);
|
|
28
|
-
console.log(` TEST_API_KEY : ${maskedKey}`);
|
|
29
|
-
console.log(` tool_path : ${config.tool_path || '(not set)'}`);
|
|
30
|
-
console.log('');
|
|
31
|
-
// Full config content
|
|
32
|
-
console.log(' Full Content:');
|
|
33
|
-
console.log('');
|
|
34
|
-
for (const line of raw.replace(/\r?\n$/, '').split(/\r?\n/)) {
|
|
35
|
-
console.log(` ${line}`);
|
|
36
|
-
}
|
|
37
|
-
console.log('');
|
|
38
|
-
console.log(' Edit this file to modify config, then re-run `ht init`.');
|
|
39
|
-
console.log('');
|
|
40
|
-
}
|
package/dist/cli/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { createRequire } from 'node:module';
|
|
4
|
-
import { initCommand } from './init.js';
|
|
5
|
-
import { runMcpServer } from './mcp.js';
|
|
6
|
-
import { configCommand } from './config.js';
|
|
7
|
-
import { uninstallCommand } from './uninstall.js';
|
|
8
|
-
const _require = createRequire(import.meta.url);
|
|
9
|
-
const pkg = _require('../../package.json');
|
|
10
|
-
const program = new Command();
|
|
11
|
-
program
|
|
12
|
-
.name('hometrans')
|
|
13
|
-
.description('HomeTrans installer — distribute Android-to-HarmonyOS skills and agents into AI editors')
|
|
14
|
-
.version(pkg.version);
|
|
15
|
-
program
|
|
16
|
-
.command('init')
|
|
17
|
-
.description('Initialize HomeTrans — select editors and install skills, agents, and MCP servers')
|
|
18
|
-
.option('-a, --all', 'Skip interactive selection and configure all editors')
|
|
19
|
-
.action(async (opts) => {
|
|
20
|
-
await initCommand(opts);
|
|
21
|
-
});
|
|
22
|
-
program
|
|
23
|
-
.command('mcp')
|
|
24
|
-
.description('Run the HomeTrans MCP server (stdio)')
|
|
25
|
-
.action(async () => {
|
|
26
|
-
await runMcpServer();
|
|
27
|
-
});
|
|
28
|
-
program
|
|
29
|
-
.command('config')
|
|
30
|
-
.description('Show the editors.json path and content (~/.hometrans/editors.json). Edit the file directly to customize editors, then re-run `ht init`.')
|
|
31
|
-
.action(async () => {
|
|
32
|
-
await configCommand();
|
|
33
|
-
});
|
|
34
|
-
program
|
|
35
|
-
.command('uninstall')
|
|
36
|
-
.description('Remove all hometrans skills, agents, and MCP entries from configured editors')
|
|
37
|
-
.action(async () => {
|
|
38
|
-
await uninstallCommand();
|
|
39
|
-
});
|
|
40
|
-
program.parseAsync(process.argv).catch((err) => {
|
|
41
|
-
console.error(err instanceof Error ? err.message : err);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
});
|