@buaa_smat/hometrans 0.1.17 → 0.1.19
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 +120 -56
- package/agents/code-reviewer.md +321 -65
- package/agents/logic-coder.md +113 -88
- package/agents/logic-context-builder.md +47 -29
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
- package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
- package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
- package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
- package/agents/scripts/hmos-precheck/index.mjs +17 -0
- package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
- package/agents/scripts/platform_query.mjs +626 -0
- package/agents/scripts/platform_query.test.mjs +422 -0
- package/agents/self-test-fixer.md +36 -34
- package/agents/self-tester.md +123 -143
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +16 -63
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +123 -204
- package/dist/cli/uninstall.js +3 -127
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +55 -54
- package/package.json +6 -6
- package/resource/convert_pipeline_process.svg +103 -0
- package/resource/project_architecture.svg +122 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +345 -43
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/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 +648 -648
- package/skills/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 +2088 -2088
- package/skills/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 +1033 -1033
- package/skills/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 +1183 -1183
- package/skills/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 +576 -576
- package/skills/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 +297 -297
- package/skills/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 +395 -395
- package/skills/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 +902 -902
- package/skills/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 +106 -106
- package/skills/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 +1178 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/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 +354 -354
- package/skills/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 +11 -11
- package/skills/hmos-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/PersistenceV2/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 +1220 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
- package/skills/hmos-convert-pipeline/SKILL.md +168 -121
- package/skills/hmos-fix-build-errors/SKILL.md +87 -67
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/README.md +53 -36
- package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
- package/skills/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 +648 -648
- package/skills/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 +2088 -2088
- package/skills/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 +1033 -1033
- package/skills/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 +1183 -1183
- package/skills/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 +576 -576
- package/skills/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 +297 -297
- package/skills/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 +395 -395
- package/skills/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 +902 -902
- package/skills/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 +106 -106
- package/skills/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 +1178 -1178
- package/skills/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 +911 -911
- package/skills/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 +354 -354
- package/skills/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 +11 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/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 +1220 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
- package/skills/hmos-integration-test/README.md +61 -70
- package/skills/hmos-integration-test/SKILL.md +128 -111
- package/skills/hmos-resources-convert/SKILL.md +334 -66
- package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
- package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
- package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
- package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
- package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
- package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
- package/skills/hmos-spec-generate/SKILL.md +293 -214
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
- package/skills/hmos-spec-generate/template/REQ.txt +22 -0
- package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
- package/skills/hmos-test-case-generation/README.md +241 -0
- package/skills/hmos-test-case-generation/SKILL.md +324 -0
- package/skills/hmos-test-case-generation/references/contract.md +315 -0
- package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
- package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
- package/tools/bfs-crawl/README.md +73 -0
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
- package/tools/test-tools/autotest/config.ts +175 -0
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +266 -0
- package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
- package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
- package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
- package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
- package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
- package/tools/test-tools/autotest/paths.ts +41 -0
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
- package/tools/test-tools/autotest/runner/logger.ts +45 -0
- package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
- package/tools/test-tools/autotest/validate.ts +167 -0
- package/agents/build-fixer.md +0 -385
- package/agents/logic-coder/scripts/platform_context_query.py +0 -568
- package/agents/review-fixer.md +0 -405
- package/agents/spec-generator.md +0 -541
- package/dist/cli/mcp-setup.js +0 -258
- package/dist/cli/mcp.js +0 -94
- package/dist/context/index.js +0 -694
- package/resource/migration_process.svg +0 -94
- package/resource/migration_process_transparent.svg +0 -93
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
- package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
- package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
- package/skills/hmos-resources-convert/evals/evals.json +0 -171
- package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
- package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
- package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
- package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
- package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
- package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
- package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
- package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
- package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
- package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
- package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
- package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
- package/tools/test-tools/autotest/README.md +0 -238
- package/tools/test-tools/autotest/pyproject.toml +0 -26
- package/tools/test-tools/autotest/report_tool.py +0 -759
- package/tools/test-tools/autotest/self_test_runner.py +0 -895
- package/tools/test-tools/autotest/testcases_tool.py +0 -215
- package/tools/test-tools/autotest/uv.lock +0 -3156
- package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
package/dist/cli/init.js
CHANGED
|
@@ -12,7 +12,6 @@ import { fileURLToPath } from 'node:url';
|
|
|
12
12
|
import chalk from 'chalk';
|
|
13
13
|
import figlet from 'figlet';
|
|
14
14
|
import inquirer from 'inquirer';
|
|
15
|
-
import { setupMcpForAllEditors } from './mcp-setup.js';
|
|
16
15
|
import { deriveSdkPaths, expandHome, getConfigDir, getConfigPath, getToolsDir, isPlaceholderApiKey, loadHomeTransConfig, saveHomeTransConfig, syncModelEnvIntoConfig, } from './config-store.js';
|
|
17
16
|
import { persistEnvVars } from './env-vars.js';
|
|
18
17
|
function ensureChalkColor() {
|
|
@@ -94,7 +93,7 @@ function maskKey(key) {
|
|
|
94
93
|
* Stored once in the `autotest.unified_model` block of ~/.hometrans/config.json
|
|
95
94
|
* and additionally exported as the HOMETRANS_MODEL_* machine environment
|
|
96
95
|
* variables (see maybePersistMachineEnv), so each runtime reads the same config:
|
|
97
|
-
* - self_test_runner.
|
|
96
|
+
* - self_test_runner.ts reads autotest.unified_model from config.json;
|
|
98
97
|
* - app_feature_verify.py reads the HOMETRANS_MODEL_* env vars (falling back
|
|
99
98
|
* to config.json).
|
|
100
99
|
* Prompts for the four essentials (api_key / name / base_url / provider);
|
|
@@ -104,17 +103,18 @@ function maskKey(key) {
|
|
|
104
103
|
async function promptModelConfig(config) {
|
|
105
104
|
const um = config.autotest.unified_model;
|
|
106
105
|
console.log('');
|
|
107
|
-
console.log(chalk.blue(' MultiModel LLM Configuration')
|
|
106
|
+
console.log(chalk.blue(' MultiModel LLM Configuration') +
|
|
107
|
+
chalk.gray(' (MultiModal LLM info for ui alignment + integration test)'));
|
|
108
108
|
try {
|
|
109
109
|
const answers = await inquirer.prompt([
|
|
110
|
+
{ type: 'input', name: 'model_base_url', message: 'model_base_url:', default: um.base_url },
|
|
111
|
+
{ type: 'input', name: 'model_name', message: 'model_name:', default: um.name },
|
|
110
112
|
{
|
|
111
113
|
type: 'input',
|
|
112
114
|
name: 'model_api_key',
|
|
113
|
-
message: 'model_api_key
|
|
115
|
+
message: 'model_api_key:',
|
|
114
116
|
default: isPlaceholderApiKey(um.api_key) ? undefined : um.api_key,
|
|
115
117
|
},
|
|
116
|
-
{ type: 'input', name: 'model_name', message: 'model_name:', default: um.name },
|
|
117
|
-
{ type: 'input', name: 'model_base_url', message: 'model_base_url:', default: um.base_url },
|
|
118
118
|
]);
|
|
119
119
|
if (answers.model_api_key.trim())
|
|
120
120
|
um.api_key = answers.model_api_key.trim();
|
|
@@ -201,12 +201,10 @@ export function mapAgentMarkdownColorToHex(content) {
|
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* opencode-style editors (DevEco Code, OpenCode) only accept hex `color:` in
|
|
204
|
-
* agent frontmatter
|
|
205
|
-
* command:[]}` MCP format. Identify them by that format so no per-editor config
|
|
206
|
-
* flag is needed.
|
|
204
|
+
* agent frontmatter. They are flagged with `hexAgentColor` in the editor list.
|
|
207
205
|
*/
|
|
208
206
|
function needsHexAgentColor(editor) {
|
|
209
|
-
return editor.
|
|
207
|
+
return editor.hexAgentColor === true;
|
|
210
208
|
}
|
|
211
209
|
/** Copy one agent file, mapping the frontmatter color to hex for `.md` when requested. */
|
|
212
210
|
async function copyAgentFile(src, dest, mapColorToHex) {
|
|
@@ -452,8 +450,8 @@ function whichSync(cmd) {
|
|
|
452
450
|
}
|
|
453
451
|
/**
|
|
454
452
|
* Run a tool's verify command and return its first non-empty output line.
|
|
455
|
-
* Reads the configured stream first (stdout by default
|
|
456
|
-
*
|
|
453
|
+
* Reads the configured stream first (stdout by default, or whichever stream the
|
|
454
|
+
* tool declares), falling back to the combined output if that stream is empty.
|
|
457
455
|
*/
|
|
458
456
|
function captureVerify(cmd, args, stream) {
|
|
459
457
|
const r = spawnSync(cmd, args, { encoding: 'utf-8', timeout: 5000 });
|
|
@@ -694,7 +692,7 @@ async function detectInstalledEditors(editors) {
|
|
|
694
692
|
}
|
|
695
693
|
/**
|
|
696
694
|
* Config env keys that are useful as real OS environment variables (the SDK
|
|
697
|
-
* paths + tool dir). PATH entries for node/
|
|
695
|
+
* paths + tool dir). PATH entries for node/hdc are not included here —
|
|
698
696
|
* those are documented as manual PATH setup.
|
|
699
697
|
*
|
|
700
698
|
* The multimodal model config (HOMETRANS_MODEL_*) is included too: its canonical
|
|
@@ -788,14 +786,13 @@ async function maybePersistMachineEnv(config) {
|
|
|
788
786
|
console.log(chalk.green(` + Environment variables ${note}`));
|
|
789
787
|
}
|
|
790
788
|
/**
|
|
791
|
-
* Run `
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* so the command is run through the shell there.
|
|
789
|
+
* Run `git --version`. Returns the trimmed first output line on success (exit 0),
|
|
790
|
+
* or null when git is missing / exits non-zero. Used by `installGit` for
|
|
791
|
+
* idempotent detection before and after auto-provisioning.
|
|
795
792
|
*/
|
|
796
|
-
function
|
|
793
|
+
function gitVersion() {
|
|
797
794
|
try {
|
|
798
|
-
const out = execFileSync('
|
|
795
|
+
const out = execFileSync('git', ['--version'], {
|
|
799
796
|
encoding: 'utf-8',
|
|
800
797
|
timeout: 15000,
|
|
801
798
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
@@ -808,62 +805,59 @@ function homegraphVersion() {
|
|
|
808
805
|
}
|
|
809
806
|
}
|
|
810
807
|
/**
|
|
811
|
-
*
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
candidates.push(path.join(home, '.local', 'bin', isWin ? 'uv.exe' : 'uv'));
|
|
823
|
-
for (const cmd of candidates) {
|
|
824
|
-
try {
|
|
825
|
-
const out = execFileSync(cmd, ['--version'], {
|
|
826
|
-
encoding: 'utf-8',
|
|
827
|
-
timeout: 15000,
|
|
828
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
829
|
-
});
|
|
830
|
-
return (out ?? '').split('\n').map((l) => l.trim()).filter(Boolean)[0] ?? '';
|
|
831
|
-
}
|
|
832
|
-
catch {
|
|
833
|
-
// try next candidate
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
return null;
|
|
837
|
-
}
|
|
838
|
-
/**
|
|
839
|
-
* Node-CLI part of the Dependency Installation step — installs the global Node
|
|
840
|
-
* CLIs the spec-generation skill needs (step 2「生成需求规格」): `homegraph` plus
|
|
841
|
-
* `arkanalyzer` (arkanalyzer parses ArkTS `.ets` and must be installed globally
|
|
842
|
-
* alongside homegraph). Verifies the result with `homegraph --version`.
|
|
843
|
-
* Idempotent: if homegraph already reports a version, the install is skipped.
|
|
808
|
+
* Git part of the Dependency Installation step — git is required for the
|
|
809
|
+
* diff-based agent precheck runs and generally assumed by npm and the skills.
|
|
810
|
+
* Idempotent: `git --version` returning normally skips the install. Per-OS auto
|
|
811
|
+
* provisioning:
|
|
812
|
+
* - Windows: `winget install --id Git.Git -e --source winget` when winget is
|
|
813
|
+
* on PATH; otherwise print the manual download URL.
|
|
814
|
+
* - macOS: `brew install git` when Homebrew is on PATH; otherwise offer to
|
|
815
|
+
* install Homebrew first via its official installer, then `brew install git`.
|
|
816
|
+
* MacPorts / `xcode-select --install` are shown as fallbacks.
|
|
817
|
+
* - Linux: print the common package-manager commands (apt / dnf / pacman)
|
|
818
|
+
* — auto-install would need sudo, which we don't want to grab silently.
|
|
844
819
|
* Never throws — failures are reported and `ht init` continues. The
|
|
845
820
|
* "Dependency Installation" section header is printed once by the caller.
|
|
846
821
|
*/
|
|
847
|
-
async function
|
|
848
|
-
console.log(chalk.gray('
|
|
849
|
-
|
|
850
|
-
const existing = homegraphVersion();
|
|
822
|
+
async function installGit() {
|
|
823
|
+
console.log(chalk.gray(' git'));
|
|
824
|
+
const existing = gitVersion();
|
|
851
825
|
if (existing !== null) {
|
|
852
|
-
console.log(chalk.green(` +
|
|
826
|
+
console.log(chalk.green(` + git already installed (${existing || 'version unknown'}) — skipping.`));
|
|
853
827
|
return;
|
|
854
828
|
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
829
|
+
const platform = process.platform;
|
|
830
|
+
if (platform === 'win32') {
|
|
831
|
+
await installGitWindows();
|
|
858
832
|
return;
|
|
859
833
|
}
|
|
834
|
+
if (platform === 'darwin') {
|
|
835
|
+
await installGitMacOS();
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
// Linux / other Unix: print instructions only.
|
|
839
|
+
console.log(chalk.yellow(' ! git not found. Install it with your distro package manager:'));
|
|
840
|
+
console.log(chalk.gray(' Debian/Ubuntu: sudo apt-get install -y git'));
|
|
841
|
+
console.log(chalk.gray(' Fedora/RHEL: sudo dnf install -y git'));
|
|
842
|
+
console.log(chalk.gray(' Arch: sudo pacman -S --noconfirm git'));
|
|
843
|
+
console.log(chalk.gray(' Docs: https://git-scm.com/download/linux'));
|
|
844
|
+
}
|
|
845
|
+
/** Windows branch of installGit — uses winget when available, prints download URL otherwise. */
|
|
846
|
+
async function installGitWindows() {
|
|
847
|
+
if (!whichSync('winget')) {
|
|
848
|
+
console.log(chalk.yellow(' ! git not found and winget is unavailable on this Windows host.'));
|
|
849
|
+
console.log(chalk.gray(' Install Git for Windows manually: https://git-scm.com/download/win'));
|
|
850
|
+
console.log(chalk.gray(' Then re-run `ht init`.'));
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
const cmdText = 'winget install --id Git.Git -e --source winget';
|
|
860
854
|
let proceed = true;
|
|
861
855
|
try {
|
|
862
856
|
const answers = await inquirer.prompt([
|
|
863
857
|
{
|
|
864
858
|
type: 'confirm',
|
|
865
859
|
name: 'install',
|
|
866
|
-
message:
|
|
860
|
+
message: `git not found. Install it now via winget?\n ${cmdText}`,
|
|
867
861
|
default: true,
|
|
868
862
|
},
|
|
869
863
|
]);
|
|
@@ -876,65 +870,50 @@ async function installNodeDependencies() {
|
|
|
876
870
|
}
|
|
877
871
|
if (!proceed) {
|
|
878
872
|
console.log(chalk.yellow(' Skipped — install later with:'));
|
|
879
|
-
console.log(chalk.gray(
|
|
873
|
+
console.log(chalk.gray(` ${cmdText}`));
|
|
880
874
|
return;
|
|
881
875
|
}
|
|
882
|
-
console.log(chalk.gray(
|
|
876
|
+
console.log(chalk.gray(` Running: ${cmdText} ...`));
|
|
883
877
|
try {
|
|
884
|
-
|
|
885
|
-
// resolve the `npm.cmd` shim; shell:true is required on Windows for that.
|
|
886
|
-
execFileSync('npm', ['install', '-g', 'homegraph', 'arkanalyzer'], {
|
|
887
|
-
stdio: 'inherit',
|
|
888
|
-
timeout: 5 * 60 * 1000,
|
|
889
|
-
shell: process.platform === 'win32',
|
|
890
|
-
});
|
|
878
|
+
execFileSync('winget', ['install', '--id', 'Git.Git', '-e', '--source', 'winget'], { stdio: 'inherit', timeout: 10 * 60 * 1000, shell: true });
|
|
891
879
|
}
|
|
892
880
|
catch (err) {
|
|
893
|
-
console.log(chalk.red(` !
|
|
894
|
-
console.log(chalk.gray(
|
|
881
|
+
console.log(chalk.red(` ! winget install failed: ${err.message}`));
|
|
882
|
+
console.log(chalk.gray(` Re-run manually: ${cmdText}`));
|
|
883
|
+
console.log(chalk.gray(' Or download the installer: https://git-scm.com/download/win'));
|
|
895
884
|
return;
|
|
896
885
|
}
|
|
897
|
-
|
|
898
|
-
const version = homegraphVersion();
|
|
886
|
+
const version = gitVersion();
|
|
899
887
|
if (version !== null) {
|
|
900
|
-
console.log(chalk.green(` +
|
|
888
|
+
console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
|
|
901
889
|
}
|
|
902
890
|
else {
|
|
903
|
-
console.log(chalk.yellow(' ! Installed, but `
|
|
904
|
-
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify:
|
|
891
|
+
console.log(chalk.yellow(' ! Installed, but `git --version` did not return successfully.'));
|
|
892
|
+
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: git --version'));
|
|
905
893
|
}
|
|
906
894
|
}
|
|
907
|
-
/**
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
* - Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
913
|
-
* - macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh (wget fallback)
|
|
914
|
-
* Idempotent: a working `uv --version` skips the install. Never throws —
|
|
915
|
-
* failures are reported and `ht init` continues. The "Dependency Installation"
|
|
916
|
-
* section header is printed once by the caller.
|
|
917
|
-
*/
|
|
918
|
-
async function installUv() {
|
|
919
|
-
console.log(chalk.gray(' uv'));
|
|
920
|
-
// Idempotent: a working `uv --version` means uv is already there.
|
|
921
|
-
const existing = uvVersion();
|
|
922
|
-
if (existing !== null) {
|
|
923
|
-
console.log(chalk.green(` + uv already installed (${existing || 'version unknown'}) — skipping.`));
|
|
895
|
+
/** macOS branch of installGit — prefers Homebrew, offers to install Homebrew first if missing. */
|
|
896
|
+
async function installGitMacOS() {
|
|
897
|
+
// Homebrew present → straight `brew install git`.
|
|
898
|
+
if (whichSync('brew')) {
|
|
899
|
+
await runBrewInstallGit();
|
|
924
900
|
return;
|
|
925
901
|
}
|
|
926
|
-
|
|
927
|
-
const
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
902
|
+
// No Homebrew: offer to install it via the official installer, then brew install git.
|
|
903
|
+
const brewInstallCmd = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
|
|
904
|
+
console.log(chalk.yellow(' ! git not found and Homebrew is unavailable on this macOS host.'));
|
|
905
|
+
console.log(chalk.gray(' HomeTrans can install Homebrew via the official installer, then run `brew install git`.'));
|
|
906
|
+
console.log(chalk.gray(` ${brewInstallCmd}`));
|
|
907
|
+
console.log(chalk.gray(' Alternatives:'));
|
|
908
|
+
console.log(chalk.gray(' MacPorts: sudo port install git (requires MacPorts already installed)'));
|
|
909
|
+
console.log(chalk.gray(' Xcode CLT: xcode-select --install (ships Apple\'s git build)'));
|
|
931
910
|
let proceed = true;
|
|
932
911
|
try {
|
|
933
912
|
const answers = await inquirer.prompt([
|
|
934
913
|
{
|
|
935
914
|
type: 'confirm',
|
|
936
915
|
name: 'install',
|
|
937
|
-
message:
|
|
916
|
+
message: 'Install Homebrew now, then install git via brew?',
|
|
938
917
|
default: true,
|
|
939
918
|
},
|
|
940
919
|
]);
|
|
@@ -946,93 +925,50 @@ async function installUv() {
|
|
|
946
925
|
console.log(chalk.yellow(' Non-interactive: proceeding with install.'));
|
|
947
926
|
}
|
|
948
927
|
if (!proceed) {
|
|
949
|
-
console.log(chalk.yellow(' Skipped — install later
|
|
950
|
-
console.log(chalk.gray(` ${installCmdText}`));
|
|
951
|
-
console.log(chalk.gray(` Docs: ${docs}`));
|
|
928
|
+
console.log(chalk.yellow(' Skipped — install git later using one of the options above.'));
|
|
952
929
|
return;
|
|
953
930
|
}
|
|
954
|
-
console.log(chalk.gray(` Running: ${
|
|
931
|
+
console.log(chalk.gray(` Running: ${brewInstallCmd} ...`));
|
|
955
932
|
try {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
// `curl | sh` needs a shell to pipe; prefer curl, fall back to wget so the
|
|
961
|
-
// installer also works on minimal systems that ship only one of them.
|
|
962
|
-
const script = 'if command -v curl >/dev/null 2>&1; then curl -LsSf https://astral.sh/uv/install.sh | sh; ' +
|
|
963
|
-
'else wget -qO- https://astral.sh/uv/install.sh | sh; fi';
|
|
964
|
-
execFileSync('sh', ['-c', script], { stdio: 'inherit', timeout: 5 * 60 * 1000 });
|
|
965
|
-
}
|
|
933
|
+
execFileSync('/bin/bash', ['-c', `$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)`], {
|
|
934
|
+
stdio: 'inherit',
|
|
935
|
+
timeout: 15 * 60 * 1000,
|
|
936
|
+
});
|
|
966
937
|
}
|
|
967
938
|
catch (err) {
|
|
968
|
-
console.log(chalk.red(` !
|
|
969
|
-
console.log(chalk.gray(
|
|
970
|
-
console.log(chalk.gray(` Docs: ${docs}`));
|
|
939
|
+
console.log(chalk.red(` ! Homebrew install failed: ${err.message}`));
|
|
940
|
+
console.log(chalk.gray(' Fallback: xcode-select --install (ships Apple\'s git build)'));
|
|
971
941
|
return;
|
|
972
942
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
console.log(chalk.green(` + uv installed & verified (${version || 'version unknown'}).`));
|
|
977
|
-
}
|
|
978
|
-
else {
|
|
979
|
-
console.log(chalk.yellow(' ! Installed, but `uv --version` did not return successfully.'));
|
|
980
|
-
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: uv --version'));
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* Editor name (as in config.json / defaultEditors) → homegraph `install --target`
|
|
985
|
-
* slug. homegraph ships its own MCP-into-editor installer; after the homegraph CLI
|
|
986
|
-
* is installed globally we invoke it so the homegraph MCP server is registered into
|
|
987
|
-
* the same editors HomeTrans is configuring. Scope intentionally matches init's
|
|
988
|
-
* supported editors — editors without a mapping (a user-added custom editor, or one
|
|
989
|
-
* homegraph doesn't support) are simply skipped.
|
|
990
|
-
*/
|
|
991
|
-
const HOMEGRAPH_TARGET_BY_EDITOR = {
|
|
992
|
-
'Claude Code': 'claude',
|
|
993
|
-
Cursor: 'cursor',
|
|
994
|
-
Codex: 'codex',
|
|
995
|
-
OpenCode: 'opencode',
|
|
996
|
-
'DevEco Code': 'deveco',
|
|
997
|
-
CodeBuddy: 'codebuddy',
|
|
998
|
-
};
|
|
999
|
-
/**
|
|
1000
|
-
* Register the homegraph MCP server into the selected editors via the homegraph
|
|
1001
|
-
* CLI (`homegraph install --target=<...> --location=global --yes`). Runs after
|
|
1002
|
-
* installNodeDependencies() so the homegraph binary is present. A single invocation
|
|
1003
|
-
* with a comma-joined target list configures every selected editor at once. Never
|
|
1004
|
-
* throws — failures are reported and `ht init` continues. On Windows the global npm
|
|
1005
|
-
* bin is a `.cmd` shim, so the command runs through the shell there (same as
|
|
1006
|
-
* homegraphVersion()).
|
|
1007
|
-
*/
|
|
1008
|
-
async function installHomegraphToEditors(selectedEditors) {
|
|
1009
|
-
const targets = selectedEditors
|
|
1010
|
-
.map((name) => HOMEGRAPH_TARGET_BY_EDITOR[name])
|
|
1011
|
-
.filter((t) => Boolean(t));
|
|
1012
|
-
if (targets.length === 0)
|
|
1013
|
-
return;
|
|
1014
|
-
const targetArg = `--target=${targets.join(',')}`;
|
|
1015
|
-
console.log(chalk.gray(' homegraph MCP -> editors'));
|
|
1016
|
-
// Needs the homegraph CLI on PATH. A fresh `npm install -g` may not be visible
|
|
1017
|
-
// until a PATH refresh, but homegraphVersion() probes through the shell so the
|
|
1018
|
-
// shim is usually resolvable within the same `ht init` run.
|
|
1019
|
-
if (homegraphVersion() === null) {
|
|
1020
|
-
console.log(chalk.yellow(' ! homegraph not available — skipping MCP registration into editors.'));
|
|
1021
|
-
console.log(chalk.gray(` After homegraph is installed, run: homegraph install ${targetArg} --location=global --yes`));
|
|
943
|
+
if (!whichSync('brew')) {
|
|
944
|
+
console.log(chalk.yellow(' ! Homebrew installed, but `brew` is not on PATH in this shell.'));
|
|
945
|
+
console.log(chalk.gray(' Open a new terminal and run: brew install git'));
|
|
1022
946
|
return;
|
|
1023
947
|
}
|
|
1024
|
-
|
|
948
|
+
await runBrewInstallGit();
|
|
949
|
+
}
|
|
950
|
+
/** `brew install git` + verification helper, shared by both Homebrew branches on macOS. */
|
|
951
|
+
async function runBrewInstallGit() {
|
|
952
|
+
const cmdText = 'brew install git';
|
|
953
|
+
console.log(chalk.gray(` Running: ${cmdText} ...`));
|
|
1025
954
|
try {
|
|
1026
|
-
execFileSync('
|
|
955
|
+
execFileSync('brew', ['install', 'git'], {
|
|
1027
956
|
stdio: 'inherit',
|
|
1028
|
-
timeout:
|
|
1029
|
-
shell: process.platform === 'win32',
|
|
957
|
+
timeout: 15 * 60 * 1000,
|
|
1030
958
|
});
|
|
1031
|
-
console.log(chalk.green(` + homegraph MCP registered into: ${targets.join(', ')}`));
|
|
1032
959
|
}
|
|
1033
960
|
catch (err) {
|
|
1034
|
-
console.log(chalk.red(` !
|
|
1035
|
-
console.log(chalk.gray(
|
|
961
|
+
console.log(chalk.red(` ! brew install git failed: ${err.message}`));
|
|
962
|
+
console.log(chalk.gray(' Fallback: xcode-select --install (ships Apple\'s git build)'));
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
const version = gitVersion();
|
|
966
|
+
if (version !== null) {
|
|
967
|
+
console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
|
|
968
|
+
}
|
|
969
|
+
else {
|
|
970
|
+
console.log(chalk.yellow(' ! Installed, but `git --version` did not return successfully.'));
|
|
971
|
+
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: git --version'));
|
|
1036
972
|
}
|
|
1037
973
|
}
|
|
1038
974
|
export async function initCommand(options = {}) {
|
|
@@ -1169,42 +1105,26 @@ export async function initCommand(options = {}) {
|
|
|
1169
1105
|
// alignment and self-test. Stored in autotest.unified_model (config.json) and
|
|
1170
1106
|
// exported as HOMETRANS_MODEL_* env vars by maybePersistMachineEnv below.
|
|
1171
1107
|
await promptModelConfig(config);
|
|
1172
|
-
// Dependency Installation — auto-provisionable
|
|
1173
|
-
//
|
|
1174
|
-
//
|
|
1175
|
-
//
|
|
1176
|
-
// Check so the check reflects
|
|
1108
|
+
// Dependency Installation — auto-provisionable dep: git (required by the
|
|
1109
|
+
// diff-based agent precheck). The global npm CLIs (homegraph, arkanalyzer)
|
|
1110
|
+
// are intentionally NOT installed here — skills resolve them on demand via
|
|
1111
|
+
// `npx` — and the Python hypium_mcp layer is expected to be present on the
|
|
1112
|
+
// user's machine. Runs before the Environment Check so the check reflects
|
|
1113
|
+
// anything freshly installed.
|
|
1177
1114
|
console.log('');
|
|
1178
1115
|
console.log(chalk.cyan(' Dependency Installation'));
|
|
1116
|
+
// git first — required by the diff-based agent precheck and by some npm-install-g flows.
|
|
1179
1117
|
try {
|
|
1180
|
-
await
|
|
1181
|
-
}
|
|
1182
|
-
catch (err) {
|
|
1183
|
-
if (isPromptAbort(err))
|
|
1184
|
-
abortInit();
|
|
1185
|
-
console.log(chalk.yellow(` ! homegraph / arkanalyzer install skipped: ${err.message}`));
|
|
1186
|
-
}
|
|
1187
|
-
// With homegraph installed, register its MCP server into the editors the user
|
|
1188
|
-
// selected, using homegraph's own installer. Scoped to the selected editors so
|
|
1189
|
-
// it stays consistent with what HomeTrans configures below.
|
|
1190
|
-
try {
|
|
1191
|
-
await installHomegraphToEditors(selectedEditors);
|
|
1192
|
-
}
|
|
1193
|
-
catch (err) {
|
|
1194
|
-
console.log(chalk.yellow(` ! homegraph editor registration skipped: ${err.message}`));
|
|
1195
|
-
}
|
|
1196
|
-
try {
|
|
1197
|
-
await installUv();
|
|
1118
|
+
await installGit();
|
|
1198
1119
|
}
|
|
1199
1120
|
catch (err) {
|
|
1200
1121
|
if (isPromptAbort(err))
|
|
1201
1122
|
abortInit();
|
|
1202
|
-
console.log(chalk.yellow(` !
|
|
1123
|
+
console.log(chalk.yellow(` ! git install skipped: ${err.message}`));
|
|
1203
1124
|
}
|
|
1204
|
-
// Detect external tools (adb / hdc /
|
|
1205
|
-
//
|
|
1206
|
-
//
|
|
1207
|
-
// and uv provides the interpreter on demand.)
|
|
1125
|
+
// Detect external tools (adb / hdc / node / git + DevEco) and report
|
|
1126
|
+
// which skills/agents are impacted by anything missing. The tool set and the
|
|
1127
|
+
// per-skill dependencies both come from env-requirements.json.
|
|
1208
1128
|
try {
|
|
1209
1129
|
await runEnvironmentCheck(config.env);
|
|
1210
1130
|
}
|
|
@@ -1212,7 +1132,7 @@ export async function initCommand(options = {}) {
|
|
|
1212
1132
|
console.log(chalk.yellow(` ! environment check skipped: ${err.message}`));
|
|
1213
1133
|
}
|
|
1214
1134
|
// Copy bundled tools/ into ~/.hometrans/tools and record env.HOMETRANS_TOOL_PATH.
|
|
1215
|
-
// self_test_runner.
|
|
1135
|
+
// self_test_runner.ts (under the installed tools dir) reads the autotest
|
|
1216
1136
|
// config from ~/.hometrans/config.json at run time — see promptModelConfig.
|
|
1217
1137
|
try {
|
|
1218
1138
|
await installTools(toolsRoot, config);
|
|
@@ -1221,7 +1141,7 @@ export async function initCommand(options = {}) {
|
|
|
1221
1141
|
console.log(chalk.red(` ! tools copy: ${err.message}`));
|
|
1222
1142
|
}
|
|
1223
1143
|
// (The autotest.unified_model block in config.json was already configured by
|
|
1224
|
-
// the Model Configuration step above; self_test_runner.
|
|
1144
|
+
// the Model Configuration step above; self_test_runner.ts reads it at run time
|
|
1225
1145
|
// and the UI-alignment phone-agent reads the exported HOMETRANS_MODEL_* vars.)
|
|
1226
1146
|
// Offer to persist the resolved config values as real OS environment
|
|
1227
1147
|
// variables (Windows: setx; macOS/Linux: shell rc block). Shows what will be
|
|
@@ -1241,7 +1161,6 @@ export async function initCommand(options = {}) {
|
|
|
1241
1161
|
console.log(chalk.cyan(` Configuring ${editor.name}...`));
|
|
1242
1162
|
await installForEditor(editor, skillsRoot, agentsRoot, result);
|
|
1243
1163
|
}
|
|
1244
|
-
await setupMcpForAllEditors(editorsToSetup, result);
|
|
1245
1164
|
console.log('');
|
|
1246
1165
|
if (result.configured.length > 0) {
|
|
1247
1166
|
console.log(chalk.green(' Configured:'));
|