@buaa_smat/hometrans 0.1.17 → 0.1.20
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 +138 -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 +35 -376
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +19 -146
- package/dist/cli/config.js +6 -8
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +147 -235
- package/dist/cli/uninstall.js +5 -129
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +57 -55
- package/package.json +6 -8
- 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 +188 -131
- 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 +57 -40
- package/skills/hmos-incremental-ui-align/SKILL.md +180 -24
- 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 +111 -79
- package/skills/hmos-integration-test/SKILL.md +216 -132
- package/skills/hmos-integration-test/scripts/report-tool.ts +791 -0
- package/skills/hmos-integration-test/scripts/resolve-metadata-tool.ts +125 -0
- package/skills/hmos-integration-test/scripts/self-test-runner.ts +756 -0
- package/skills/hmos-integration-test/scripts/testcases-tool.ts +239 -0
- 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/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_schema.md +0 -143
- 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,8 +12,7 @@ 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 {
|
|
16
|
-
import { deriveSdkPaths, expandHome, getConfigDir, getConfigPath, getToolsDir, isPlaceholderApiKey, loadHomeTransConfig, saveHomeTransConfig, syncModelEnvIntoConfig, } from './config-store.js';
|
|
15
|
+
import { deriveSdkPaths, expandHome, getConfigDir, getConfigPath, getToolsDir, isPlaceholderApiKey, loadHomeTransConfig, saveHomeTransConfig, } from './config-store.js';
|
|
17
16
|
import { persistEnvVars } from './env-vars.js';
|
|
18
17
|
function ensureChalkColor() {
|
|
19
18
|
if (process.stdout.isTTY && chalk.level === 0) {
|
|
@@ -91,42 +90,33 @@ function maskKey(key) {
|
|
|
91
90
|
/**
|
|
92
91
|
* Model Configuration step — configures the single multimodal (vision) LLM
|
|
93
92
|
* shared by BOTH the on-device self-test agent AND the UI-alignment phone-agent.
|
|
94
|
-
* Stored
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* - app_feature_verify.py reads the HOMETRANS_MODEL_* env vars (falling back
|
|
99
|
-
* to config.json).
|
|
100
|
-
* Prompts for the four essentials (api_key / name / base_url / provider);
|
|
101
|
-
* all other parameters (device / agent, temperature, …) keep their defaults —
|
|
102
|
-
* edit config.json to tune them.
|
|
93
|
+
* Stored as HOMETRANS_MODEL_* machine environment variables in config.env,
|
|
94
|
+
* exported by maybePersistMachineEnv. UI alignment and self-test both read
|
|
95
|
+
* these env vars at runtime. Agent config is in ~/.hometrans/autotest.yaml
|
|
96
|
+
* (generated by the integration-test skill).
|
|
103
97
|
*/
|
|
104
98
|
async function promptModelConfig(config) {
|
|
105
|
-
const
|
|
99
|
+
const env = config.env;
|
|
106
100
|
console.log('');
|
|
107
|
-
console.log(chalk.blue(' MultiModel LLM Configuration')
|
|
101
|
+
console.log(chalk.blue(' MultiModel LLM Configuration') +
|
|
102
|
+
chalk.gray(' (MultiModal LLM info for ui alignment + integration test)'));
|
|
108
103
|
try {
|
|
109
104
|
const answers = await inquirer.prompt([
|
|
105
|
+
{ type: 'input', name: 'model_base_url', message: 'model_base_url:', default: env.HOMETRANS_MODEL_BASE_URL || '' },
|
|
106
|
+
{ type: 'input', name: 'model_name', message: 'model_name:', default: env.HOMETRANS_MODEL_NAME || '' },
|
|
110
107
|
{
|
|
111
108
|
type: 'input',
|
|
112
109
|
name: 'model_api_key',
|
|
113
|
-
message: 'model_api_key
|
|
114
|
-
default: isPlaceholderApiKey(
|
|
110
|
+
message: 'model_api_key:',
|
|
111
|
+
default: isPlaceholderApiKey(env.HOMETRANS_MODEL_API_KEY) ? undefined : env.HOMETRANS_MODEL_API_KEY,
|
|
115
112
|
},
|
|
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
113
|
]);
|
|
119
114
|
if (answers.model_api_key.trim())
|
|
120
|
-
|
|
115
|
+
env.HOMETRANS_MODEL_API_KEY = answers.model_api_key.trim();
|
|
121
116
|
if (answers.model_name.trim())
|
|
122
|
-
|
|
117
|
+
env.HOMETRANS_MODEL_NAME = answers.model_name.trim();
|
|
123
118
|
if (answers.model_base_url.trim())
|
|
124
|
-
|
|
125
|
-
// provider is no longer prompted — default to openai when unset.
|
|
126
|
-
if (!um.provider || !um.provider.trim())
|
|
127
|
-
um.provider = 'openai';
|
|
128
|
-
// Mirror into config.env.HOMETRANS_MODEL_* so config.json stays consistent.
|
|
129
|
-
syncModelEnvIntoConfig(config);
|
|
119
|
+
env.HOMETRANS_MODEL_BASE_URL = answers.model_base_url.trim();
|
|
130
120
|
await saveHomeTransConfig(config);
|
|
131
121
|
}
|
|
132
122
|
catch (err) {
|
|
@@ -201,12 +191,10 @@ export function mapAgentMarkdownColorToHex(content) {
|
|
|
201
191
|
}
|
|
202
192
|
/**
|
|
203
193
|
* 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.
|
|
194
|
+
* agent frontmatter. They are flagged with `hexAgentColor` in the editor list.
|
|
207
195
|
*/
|
|
208
196
|
function needsHexAgentColor(editor) {
|
|
209
|
-
return editor.
|
|
197
|
+
return editor.hexAgentColor === true;
|
|
210
198
|
}
|
|
211
199
|
/** Copy one agent file, mapping the frontmatter color to hex for `.md` when requested. */
|
|
212
200
|
async function copyAgentFile(src, dest, mapColorToHex) {
|
|
@@ -452,8 +440,8 @@ function whichSync(cmd) {
|
|
|
452
440
|
}
|
|
453
441
|
/**
|
|
454
442
|
* Run a tool's verify command and return its first non-empty output line.
|
|
455
|
-
* Reads the configured stream first (stdout by default
|
|
456
|
-
*
|
|
443
|
+
* Reads the configured stream first (stdout by default, or whichever stream the
|
|
444
|
+
* tool declares), falling back to the combined output if that stream is empty.
|
|
457
445
|
*/
|
|
458
446
|
function captureVerify(cmd, args, stream) {
|
|
459
447
|
const r = spawnSync(cmd, args, { encoding: 'utf-8', timeout: 5000 });
|
|
@@ -694,12 +682,11 @@ async function detectInstalledEditors(editors) {
|
|
|
694
682
|
}
|
|
695
683
|
/**
|
|
696
684
|
* Config env keys that are useful as real OS environment variables (the SDK
|
|
697
|
-
* paths + tool dir). PATH entries for node/
|
|
685
|
+
* paths + tool dir). PATH entries for node/hdc are not included here —
|
|
698
686
|
* those are documented as manual PATH setup.
|
|
699
687
|
*
|
|
700
688
|
* The multimodal model config (HOMETRANS_MODEL_*) is included too: its canonical
|
|
701
|
-
* store is
|
|
702
|
-
* into config.env by syncModelEnvIntoConfig so this one list is the single source
|
|
689
|
+
* store is config.env (HOMETRANS_MODEL_* fields), which is the single source
|
|
703
690
|
* for both config.json's `env` block and the machine env vars. Shared by UI
|
|
704
691
|
* alignment and self-test.
|
|
705
692
|
*/
|
|
@@ -730,10 +717,8 @@ function maskEnvValue(name, value) {
|
|
|
730
717
|
* abort init on Ctrl-C.
|
|
731
718
|
*/
|
|
732
719
|
async function maybePersistMachineEnv(config) {
|
|
733
|
-
//
|
|
734
|
-
//
|
|
735
|
-
// the single source for both config.json and the machine env vars below.
|
|
736
|
-
syncModelEnvIntoConfig(config);
|
|
720
|
+
// HOMETRANS_MODEL_* are written directly to config.env by promptModelConfig,
|
|
721
|
+
// so config.env is the single source for both config.json and the machine env vars.
|
|
737
722
|
const env = config.env;
|
|
738
723
|
const allVars = MACHINE_ENV_KEYS.map((k) => [k, (env[k] ?? '').trim()]).filter(([, value]) => value.length > 0);
|
|
739
724
|
if (allVars.length === 0)
|
|
@@ -788,14 +773,13 @@ async function maybePersistMachineEnv(config) {
|
|
|
788
773
|
console.log(chalk.green(` + Environment variables ${note}`));
|
|
789
774
|
}
|
|
790
775
|
/**
|
|
791
|
-
* Run `
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* so the command is run through the shell there.
|
|
776
|
+
* Run `git --version`. Returns the trimmed first output line on success (exit 0),
|
|
777
|
+
* or null when git is missing / exits non-zero. Used by `installGit` for
|
|
778
|
+
* idempotent detection before and after auto-provisioning.
|
|
795
779
|
*/
|
|
796
|
-
function
|
|
780
|
+
function gitVersion() {
|
|
797
781
|
try {
|
|
798
|
-
const out = execFileSync('
|
|
782
|
+
const out = execFileSync('git', ['--version'], {
|
|
799
783
|
encoding: 'utf-8',
|
|
800
784
|
timeout: 15000,
|
|
801
785
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
@@ -808,62 +792,59 @@ function homegraphVersion() {
|
|
|
808
792
|
}
|
|
809
793
|
}
|
|
810
794
|
/**
|
|
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.
|
|
795
|
+
* Git part of the Dependency Installation step — git is required for the
|
|
796
|
+
* diff-based agent precheck runs and generally assumed by npm and the skills.
|
|
797
|
+
* Idempotent: `git --version` returning normally skips the install. Per-OS auto
|
|
798
|
+
* provisioning:
|
|
799
|
+
* - Windows: `winget install --id Git.Git -e --source winget` when winget is
|
|
800
|
+
* on PATH; otherwise print the manual download URL.
|
|
801
|
+
* - macOS: `brew install git` when Homebrew is on PATH; otherwise offer to
|
|
802
|
+
* install Homebrew first via its official installer, then `brew install git`.
|
|
803
|
+
* MacPorts / `xcode-select --install` are shown as fallbacks.
|
|
804
|
+
* - Linux: print the common package-manager commands (apt / dnf / pacman)
|
|
805
|
+
* — auto-install would need sudo, which we don't want to grab silently.
|
|
844
806
|
* Never throws — failures are reported and `ht init` continues. The
|
|
845
807
|
* "Dependency Installation" section header is printed once by the caller.
|
|
846
808
|
*/
|
|
847
|
-
async function
|
|
848
|
-
console.log(chalk.gray('
|
|
849
|
-
|
|
850
|
-
const existing = homegraphVersion();
|
|
809
|
+
async function installGit() {
|
|
810
|
+
console.log(chalk.gray(' git'));
|
|
811
|
+
const existing = gitVersion();
|
|
851
812
|
if (existing !== null) {
|
|
852
|
-
console.log(chalk.green(` +
|
|
813
|
+
console.log(chalk.green(` + git already installed (${existing || 'version unknown'}) — skipping.`));
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
const platform = process.platform;
|
|
817
|
+
if (platform === 'win32') {
|
|
818
|
+
await installGitWindows();
|
|
853
819
|
return;
|
|
854
820
|
}
|
|
855
|
-
if (
|
|
856
|
-
|
|
857
|
-
|
|
821
|
+
if (platform === 'darwin') {
|
|
822
|
+
await installGitMacOS();
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
// Linux / other Unix: print instructions only.
|
|
826
|
+
console.log(chalk.yellow(' ! git not found. Install it with your distro package manager:'));
|
|
827
|
+
console.log(chalk.gray(' Debian/Ubuntu: sudo apt-get install -y git'));
|
|
828
|
+
console.log(chalk.gray(' Fedora/RHEL: sudo dnf install -y git'));
|
|
829
|
+
console.log(chalk.gray(' Arch: sudo pacman -S --noconfirm git'));
|
|
830
|
+
console.log(chalk.gray(' Docs: https://git-scm.com/download/linux'));
|
|
831
|
+
}
|
|
832
|
+
/** Windows branch of installGit — uses winget when available, prints download URL otherwise. */
|
|
833
|
+
async function installGitWindows() {
|
|
834
|
+
if (!whichSync('winget')) {
|
|
835
|
+
console.log(chalk.yellow(' ! git not found and winget is unavailable on this Windows host.'));
|
|
836
|
+
console.log(chalk.gray(' Install Git for Windows manually: https://git-scm.com/download/win'));
|
|
837
|
+
console.log(chalk.gray(' Then re-run `ht init`.'));
|
|
858
838
|
return;
|
|
859
839
|
}
|
|
840
|
+
const cmdText = 'winget install --id Git.Git -e --source winget';
|
|
860
841
|
let proceed = true;
|
|
861
842
|
try {
|
|
862
843
|
const answers = await inquirer.prompt([
|
|
863
844
|
{
|
|
864
845
|
type: 'confirm',
|
|
865
846
|
name: 'install',
|
|
866
|
-
message:
|
|
847
|
+
message: `git not found. Install it now via winget?\n ${cmdText}`,
|
|
867
848
|
default: true,
|
|
868
849
|
},
|
|
869
850
|
]);
|
|
@@ -876,65 +857,50 @@ async function installNodeDependencies() {
|
|
|
876
857
|
}
|
|
877
858
|
if (!proceed) {
|
|
878
859
|
console.log(chalk.yellow(' Skipped — install later with:'));
|
|
879
|
-
console.log(chalk.gray(
|
|
860
|
+
console.log(chalk.gray(` ${cmdText}`));
|
|
880
861
|
return;
|
|
881
862
|
}
|
|
882
|
-
console.log(chalk.gray(
|
|
863
|
+
console.log(chalk.gray(` Running: ${cmdText} ...`));
|
|
883
864
|
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
|
-
});
|
|
865
|
+
execFileSync('winget', ['install', '--id', 'Git.Git', '-e', '--source', 'winget'], { stdio: 'inherit', timeout: 10 * 60 * 1000, shell: true });
|
|
891
866
|
}
|
|
892
867
|
catch (err) {
|
|
893
|
-
console.log(chalk.red(` !
|
|
894
|
-
console.log(chalk.gray(
|
|
868
|
+
console.log(chalk.red(` ! winget install failed: ${err.message}`));
|
|
869
|
+
console.log(chalk.gray(` Re-run manually: ${cmdText}`));
|
|
870
|
+
console.log(chalk.gray(' Or download the installer: https://git-scm.com/download/win'));
|
|
895
871
|
return;
|
|
896
872
|
}
|
|
897
|
-
|
|
898
|
-
const version = homegraphVersion();
|
|
873
|
+
const version = gitVersion();
|
|
899
874
|
if (version !== null) {
|
|
900
|
-
console.log(chalk.green(` +
|
|
875
|
+
console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
|
|
901
876
|
}
|
|
902
877
|
else {
|
|
903
|
-
console.log(chalk.yellow(' ! Installed, but `
|
|
904
|
-
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify:
|
|
878
|
+
console.log(chalk.yellow(' ! Installed, but `git --version` did not return successfully.'));
|
|
879
|
+
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: git --version'));
|
|
905
880
|
}
|
|
906
881
|
}
|
|
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.`));
|
|
882
|
+
/** macOS branch of installGit — prefers Homebrew, offers to install Homebrew first if missing. */
|
|
883
|
+
async function installGitMacOS() {
|
|
884
|
+
// Homebrew present → straight `brew install git`.
|
|
885
|
+
if (whichSync('brew')) {
|
|
886
|
+
await runBrewInstallGit();
|
|
924
887
|
return;
|
|
925
888
|
}
|
|
926
|
-
|
|
927
|
-
const
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
889
|
+
// No Homebrew: offer to install it via the official installer, then brew install git.
|
|
890
|
+
const brewInstallCmd = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
|
|
891
|
+
console.log(chalk.yellow(' ! git not found and Homebrew is unavailable on this macOS host.'));
|
|
892
|
+
console.log(chalk.gray(' HomeTrans can install Homebrew via the official installer, then run `brew install git`.'));
|
|
893
|
+
console.log(chalk.gray(` ${brewInstallCmd}`));
|
|
894
|
+
console.log(chalk.gray(' Alternatives:'));
|
|
895
|
+
console.log(chalk.gray(' MacPorts: sudo port install git (requires MacPorts already installed)'));
|
|
896
|
+
console.log(chalk.gray(' Xcode CLT: xcode-select --install (ships Apple\'s git build)'));
|
|
931
897
|
let proceed = true;
|
|
932
898
|
try {
|
|
933
899
|
const answers = await inquirer.prompt([
|
|
934
900
|
{
|
|
935
901
|
type: 'confirm',
|
|
936
902
|
name: 'install',
|
|
937
|
-
message:
|
|
903
|
+
message: 'Install Homebrew now, then install git via brew?',
|
|
938
904
|
default: true,
|
|
939
905
|
},
|
|
940
906
|
]);
|
|
@@ -946,93 +912,50 @@ async function installUv() {
|
|
|
946
912
|
console.log(chalk.yellow(' Non-interactive: proceeding with install.'));
|
|
947
913
|
}
|
|
948
914
|
if (!proceed) {
|
|
949
|
-
console.log(chalk.yellow(' Skipped — install later
|
|
950
|
-
console.log(chalk.gray(` ${installCmdText}`));
|
|
951
|
-
console.log(chalk.gray(` Docs: ${docs}`));
|
|
915
|
+
console.log(chalk.yellow(' Skipped — install git later using one of the options above.'));
|
|
952
916
|
return;
|
|
953
917
|
}
|
|
954
|
-
console.log(chalk.gray(` Running: ${
|
|
918
|
+
console.log(chalk.gray(` Running: ${brewInstallCmd} ...`));
|
|
955
919
|
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
|
-
}
|
|
920
|
+
execFileSync('/bin/bash', ['-c', `$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)`], {
|
|
921
|
+
stdio: 'inherit',
|
|
922
|
+
timeout: 15 * 60 * 1000,
|
|
923
|
+
});
|
|
966
924
|
}
|
|
967
925
|
catch (err) {
|
|
968
|
-
console.log(chalk.red(` !
|
|
969
|
-
console.log(chalk.gray(
|
|
970
|
-
console.log(chalk.gray(` Docs: ${docs}`));
|
|
926
|
+
console.log(chalk.red(` ! Homebrew install failed: ${err.message}`));
|
|
927
|
+
console.log(chalk.gray(' Fallback: xcode-select --install (ships Apple\'s git build)'));
|
|
971
928
|
return;
|
|
972
929
|
}
|
|
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`));
|
|
930
|
+
if (!whichSync('brew')) {
|
|
931
|
+
console.log(chalk.yellow(' ! Homebrew installed, but `brew` is not on PATH in this shell.'));
|
|
932
|
+
console.log(chalk.gray(' Open a new terminal and run: brew install git'));
|
|
1022
933
|
return;
|
|
1023
934
|
}
|
|
1024
|
-
|
|
935
|
+
await runBrewInstallGit();
|
|
936
|
+
}
|
|
937
|
+
/** `brew install git` + verification helper, shared by both Homebrew branches on macOS. */
|
|
938
|
+
async function runBrewInstallGit() {
|
|
939
|
+
const cmdText = 'brew install git';
|
|
940
|
+
console.log(chalk.gray(` Running: ${cmdText} ...`));
|
|
1025
941
|
try {
|
|
1026
|
-
execFileSync('
|
|
942
|
+
execFileSync('brew', ['install', 'git'], {
|
|
1027
943
|
stdio: 'inherit',
|
|
1028
|
-
timeout:
|
|
1029
|
-
shell: process.platform === 'win32',
|
|
944
|
+
timeout: 15 * 60 * 1000,
|
|
1030
945
|
});
|
|
1031
|
-
console.log(chalk.green(` + homegraph MCP registered into: ${targets.join(', ')}`));
|
|
1032
946
|
}
|
|
1033
947
|
catch (err) {
|
|
1034
|
-
console.log(chalk.red(` !
|
|
1035
|
-
console.log(chalk.gray(
|
|
948
|
+
console.log(chalk.red(` ! brew install git failed: ${err.message}`));
|
|
949
|
+
console.log(chalk.gray(' Fallback: xcode-select --install (ships Apple\'s git build)'));
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
const version = gitVersion();
|
|
953
|
+
if (version !== null) {
|
|
954
|
+
console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
console.log(chalk.yellow(' ! Installed, but `git --version` did not return successfully.'));
|
|
958
|
+
console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: git --version'));
|
|
1036
959
|
}
|
|
1037
960
|
}
|
|
1038
961
|
export async function initCommand(options = {}) {
|
|
@@ -1054,7 +977,7 @@ export async function initCommand(options = {}) {
|
|
|
1054
977
|
return;
|
|
1055
978
|
}
|
|
1056
979
|
// Generate an initial ~/.hometrans/config.json up front (first-use scenario):
|
|
1057
|
-
// loadHomeTransConfig writes a complete default file (editors + env
|
|
980
|
+
// loadHomeTransConfig writes a complete default file (editors + env)
|
|
1058
981
|
// when none exists, and saveHomeTransConfig flushes it again to be certain it is
|
|
1059
982
|
// on disk before any later step (e.g. Model Configuration) points the user at it.
|
|
1060
983
|
const configPath = getConfigPath();
|
|
@@ -1166,45 +1089,36 @@ export async function initCommand(options = {}) {
|
|
|
1166
1089
|
console.log(chalk.yellow(' Parameter prompts skipped (non-interactive mode).'));
|
|
1167
1090
|
}
|
|
1168
1091
|
// Model Configuration — configure the single multimodal LLM shared by UI
|
|
1169
|
-
// alignment and self-test. Stored in
|
|
1170
|
-
// exported as
|
|
1092
|
+
// alignment and self-test. Stored as HOMETRANS_MODEL_* in config.env,
|
|
1093
|
+
// exported as machine env vars by maybePersistMachineEnv below.
|
|
1171
1094
|
await promptModelConfig(config);
|
|
1172
|
-
//
|
|
1173
|
-
//
|
|
1174
|
-
//
|
|
1175
|
-
|
|
1176
|
-
|
|
1095
|
+
// Layered mode hint — the user configured unified_model above; if they
|
|
1096
|
+
// want Planner+Executor dual-agent mode, they need to set agent_mode and
|
|
1097
|
+
// fill execute_model / decision_model manually in config.json.
|
|
1098
|
+
console.log('');
|
|
1099
|
+
console.log(chalk.gray(' Tip: to use layered (Planner+Executor) mode for self-test, edit ~/.hometrans/config.json:\n' +
|
|
1100
|
+
' set "agent_mode": "layered" and fill "execute_model" / "decision_model"\n' +
|
|
1101
|
+
' with the same model as unified_model (or different models per slot).'));
|
|
1102
|
+
// Dependency Installation — auto-provisionable dep: git (required by the
|
|
1103
|
+
// diff-based agent precheck). The global npm CLIs (homegraph, arkanalyzer)
|
|
1104
|
+
// are intentionally NOT installed here — skills resolve them on demand via
|
|
1105
|
+
// `npx` — and the Python hypium_mcp layer is expected to be present on the
|
|
1106
|
+
// user's machine. Runs before the Environment Check so the check reflects
|
|
1107
|
+
// anything freshly installed.
|
|
1177
1108
|
console.log('');
|
|
1178
1109
|
console.log(chalk.cyan(' Dependency Installation'));
|
|
1110
|
+
// git first — required by the diff-based agent precheck and by some npm-install-g flows.
|
|
1179
1111
|
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();
|
|
1112
|
+
await installGit();
|
|
1198
1113
|
}
|
|
1199
1114
|
catch (err) {
|
|
1200
1115
|
if (isPromptAbort(err))
|
|
1201
1116
|
abortInit();
|
|
1202
|
-
console.log(chalk.yellow(` !
|
|
1117
|
+
console.log(chalk.yellow(` ! git install skipped: ${err.message}`));
|
|
1203
1118
|
}
|
|
1204
|
-
// Detect external tools (adb / hdc /
|
|
1205
|
-
//
|
|
1206
|
-
//
|
|
1207
|
-
// and uv provides the interpreter on demand.)
|
|
1119
|
+
// Detect external tools (adb / hdc / node / git + DevEco) and report
|
|
1120
|
+
// which skills/agents are impacted by anything missing. The tool set and the
|
|
1121
|
+
// per-skill dependencies both come from env-requirements.json.
|
|
1208
1122
|
try {
|
|
1209
1123
|
await runEnvironmentCheck(config.env);
|
|
1210
1124
|
}
|
|
@@ -1212,17 +1126,16 @@ export async function initCommand(options = {}) {
|
|
|
1212
1126
|
console.log(chalk.yellow(` ! environment check skipped: ${err.message}`));
|
|
1213
1127
|
}
|
|
1214
1128
|
// Copy bundled tools/ into ~/.hometrans/tools and record env.HOMETRANS_TOOL_PATH.
|
|
1215
|
-
//
|
|
1216
|
-
// config from ~/.hometrans/config.json at run time — see promptModelConfig.
|
|
1129
|
+
// Scripts under the installed tools dir read HOMETRANS_MODEL_* env vars at run time.
|
|
1217
1130
|
try {
|
|
1218
1131
|
await installTools(toolsRoot, config);
|
|
1219
1132
|
}
|
|
1220
1133
|
catch (err) {
|
|
1221
1134
|
console.log(chalk.red(` ! tools copy: ${err.message}`));
|
|
1222
1135
|
}
|
|
1223
|
-
// (
|
|
1224
|
-
//
|
|
1225
|
-
//
|
|
1136
|
+
// (HOMETRANS_MODEL_* env vars were configured by the Model Configuration step
|
|
1137
|
+
// above. UI-alignment reads them at run time. Agent config is in
|
|
1138
|
+
// ~/.hometrans/autotest.yaml, generated by the integration-test skill.)
|
|
1226
1139
|
// Offer to persist the resolved config values as real OS environment
|
|
1227
1140
|
// variables (Windows: setx; macOS/Linux: shell rc block). Shows what will be
|
|
1228
1141
|
// written and asks Y/N first; runs after HOMETRANS_TOOL_PATH is finalized above.
|
|
@@ -1241,7 +1154,6 @@ export async function initCommand(options = {}) {
|
|
|
1241
1154
|
console.log(chalk.cyan(` Configuring ${editor.name}...`));
|
|
1242
1155
|
await installForEditor(editor, skillsRoot, agentsRoot, result);
|
|
1243
1156
|
}
|
|
1244
|
-
await setupMcpForAllEditors(editorsToSetup, result);
|
|
1245
1157
|
console.log('');
|
|
1246
1158
|
if (result.configured.length > 0) {
|
|
1247
1159
|
console.log(chalk.green(' Configured:'));
|