@buaa_smat/hometrans 0.1.16 → 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.
Files changed (235) hide show
  1. package/README.md +162 -54
  2. package/agents/code-reviewer.md +321 -65
  3. package/agents/logic-coder.md +113 -88
  4. package/agents/logic-context-builder.md +47 -29
  5. package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
  6. package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
  7. package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
  8. package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
  9. package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
  10. package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
  11. package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
  12. package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
  13. package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
  14. package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
  15. package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
  16. package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
  17. package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
  18. package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
  19. package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
  20. package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
  21. package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
  22. package/agents/scripts/hmos-precheck/index.mjs +17 -0
  23. package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
  24. package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
  25. package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
  26. package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
  27. package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
  28. package/agents/scripts/platform_query.mjs +626 -0
  29. package/agents/scripts/platform_query.test.mjs +422 -0
  30. package/agents/self-test-fixer.md +36 -34
  31. package/agents/self-tester.md +123 -143
  32. package/agents/test-case-generation-generator.md +317 -0
  33. package/agents/test-case-generation-validator.md +231 -0
  34. package/dist/cli/config-store.js +16 -63
  35. package/dist/cli/env-vars.js +1 -3
  36. package/dist/cli/index.js +0 -11
  37. package/dist/cli/init.js +127 -144
  38. package/dist/cli/uninstall.js +76 -110
  39. package/dist/utils/regex.js +8 -0
  40. package/env-requirements.json +55 -54
  41. package/package.json +6 -6
  42. package/resource/convert_pipeline_process.svg +103 -0
  43. package/resource/project_architecture.svg +122 -0
  44. package/resource/title_dark.png +0 -0
  45. package/skills/hmos-batch-ui-align/SKILL.md +345 -41
  46. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
  47. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  48. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  49. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
  80. package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
  81. package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
  82. package/skills/hmos-convert-pipeline/SKILL.md +168 -121
  83. package/skills/hmos-fix-build-errors/SKILL.md +87 -67
  84. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  85. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  86. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  87. package/skills/hmos-incremental-ui-align/README.md +53 -36
  88. package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
  89. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  90. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  91. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  121. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
  122. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  123. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  124. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  125. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
  126. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  127. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
  128. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  129. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  130. package/skills/hmos-integration-test/README.md +61 -70
  131. package/skills/hmos-integration-test/SKILL.md +128 -111
  132. package/skills/hmos-resources-convert/SKILL.md +334 -66
  133. package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
  134. package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
  135. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
  136. package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
  137. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
  138. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
  139. package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
  140. package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
  141. package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
  142. package/skills/hmos-spec-generate/SKILL.md +293 -214
  143. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
  144. package/skills/hmos-spec-generate/template/REQ.txt +22 -0
  145. package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
  146. package/skills/hmos-test-case-generation/README.md +241 -0
  147. package/skills/hmos-test-case-generation/SKILL.md +324 -0
  148. package/skills/hmos-test-case-generation/references/contract.md +315 -0
  149. package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
  150. package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
  151. package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
  152. package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
  153. package/tools/bfs-crawl/README.md +73 -0
  154. package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
  155. package/tools/test-tools/autotest/config.ts +175 -0
  156. package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
  157. package/tools/test-tools/autotest/docs/README.md +266 -0
  158. package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
  159. package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
  160. package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
  161. package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
  162. package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
  163. package/tools/test-tools/autotest/paths.ts +41 -0
  164. package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
  165. package/tools/test-tools/autotest/runner/logger.ts +45 -0
  166. package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
  167. package/tools/test-tools/autotest/validate.ts +167 -0
  168. package/agents/build-fixer.md +0 -385
  169. package/agents/logic-coder/scripts/platform_context_query.py +0 -568
  170. package/agents/review-fixer.md +0 -405
  171. package/agents/spec-generator.md +0 -541
  172. package/dist/cli/mcp-setup.js +0 -258
  173. package/dist/cli/mcp.js +0 -94
  174. package/dist/context/index.js +0 -694
  175. package/resource/migration_process.svg +0 -94
  176. package/resource/migration_process_transparent.svg +0 -93
  177. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
  178. package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
  179. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
  180. package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
  181. package/skills/hmos-resources-convert/evals/evals.json +0 -171
  182. package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
  183. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
  184. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  185. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  186. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
  187. package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
  188. package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
  189. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
  190. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
  191. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
  192. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
  193. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
  194. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
  195. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
  196. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
  197. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
  198. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
  199. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
  200. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  201. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  202. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
  203. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  204. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
  205. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
  206. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
  207. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
  208. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
  209. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
  210. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
  211. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
  212. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
  213. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
  214. package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
  215. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
  216. package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
  217. package/skills/hmos-resources-convert/tools/apktool.bat +0 -85
  218. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  219. package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
  220. package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
  221. package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
  222. package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
  223. package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
  224. package/tools/test-tools/autotest/README.md +0 -238
  225. package/tools/test-tools/autotest/pyproject.toml +0 -26
  226. package/tools/test-tools/autotest/report_tool.py +0 -759
  227. package/tools/test-tools/autotest/self_test_runner.py +0 -895
  228. package/tools/test-tools/autotest/testcases_tool.py +0 -215
  229. package/tools/test-tools/autotest/uv.lock +0 -3156
  230. package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  231. package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  232. package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  233. package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  234. package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  235. 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.py reads autotest.unified_model from config.json;
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 (multimodal LLM key for ui alignment + integration test):',
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 — they're exactly the ones using the OpenCode `{type,
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.mcp?.format === 'jsonc-command-array';
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; stderr for `java
456
- * -version`), falling back to the combined output if that stream is empty.
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/java/hdc are not included here —
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 `homegraph --version`. Returns the trimmed first output line on success
792
- * (an empty string still counts as success — exit 0), or null when the command
793
- * is missing or exits non-zero. On Windows the global npm bin is a `.cmd` shim,
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 homegraphVersion() {
793
+ function gitVersion() {
797
794
  try {
798
- const out = execFileSync('homegraph', ['--version'], {
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
- * Run `uv --version`. Returns the trimmed first output line on success (exit 0),
812
- * or null when uv is missing / exits non-zero. Probes `uv` on PATH first, then
813
- * the standalone installer's default location (`~/.local/bin/uv[.exe]`) — that
814
- * binary exists right after a fresh install, before the current process PATH is
815
- * refreshed, so verification works within the same `ht init` run.
816
- */
817
- function uvVersion() {
818
- const home = process.env.HOME || process.env.USERPROFILE || '';
819
- const isWin = process.platform === 'win32';
820
- const candidates = ['uv'];
821
- if (home)
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 installNodeDependencies() {
848
- console.log(chalk.gray(' homegraph + arkanalyzer'));
849
- // Idempotent: a working `homegraph --version` means the deps are already there.
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(` + homegraph already installed (${existing || 'version unknown'}) — skipping.`));
826
+ console.log(chalk.green(` + git already installed (${existing || 'version unknown'}) — skipping.`));
853
827
  return;
854
828
  }
855
- if (!whichSync('npm')) {
856
- console.log(chalk.yellow(' ! npm not found on PATH — cannot install homegraph / arkanalyzer.'));
857
- console.log(chalk.gray(' Install Node.js (bundles npm), then run: npm install -g homegraph arkanalyzer'));
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: 'Install homegraph + arkanalyzer globally now (npm install -g homegraph arkanalyzer)?',
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(' npm install -g homegraph arkanalyzer'));
873
+ console.log(chalk.gray(` ${cmdText}`));
880
874
  return;
881
875
  }
882
- console.log(chalk.gray(' Running: npm install -g homegraph arkanalyzer ...'));
876
+ console.log(chalk.gray(` Running: ${cmdText} ...`));
883
877
  try {
884
- // Use the bare command name (not a resolved path) so the Windows shell can
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(` ! npm install failed: ${err.message}`));
894
- console.log(chalk.gray(' Re-run manually: npm install -g homegraph arkanalyzer'));
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
- // Verify install: `homegraph --version` must return normally (exit 0).
898
- const version = homegraphVersion();
886
+ const version = gitVersion();
899
887
  if (version !== null) {
900
- console.log(chalk.green(` + homegraph installed & verified (${version || 'version unknown'}).`));
888
+ console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
901
889
  }
902
890
  else {
903
- console.log(chalk.yellow(' ! Installed, but `homegraph --version` did not return successfully.'));
904
- console.log(chalk.gray(' Open a new terminal (PATH refresh), then verify: homegraph --version'));
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
- * uv part of the Dependency Installation step — uv is the only Python toolchain
909
- * HomeTrans needs: every Python script runs via `uv run`, and uv provides the
910
- * Python interpreter on demand (no standalone Python install required). Uses the
911
- * official standalone installer (https://docs.astral.sh/uv/getting-started/installation/):
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
- const isWin = process.platform === 'win32';
927
- const installCmdText = isWin
928
- ? 'powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"'
929
- : 'curl -LsSf https://astral.sh/uv/install.sh | sh';
930
- const docs = 'https://docs.astral.sh/uv/getting-started/installation/';
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: `uv not found. Install it now via the official installer?\n ${installCmdText}`,
916
+ message: 'Install Homebrew now, then install git via brew?',
938
917
  default: true,
939
918
  },
940
919
  ]);
@@ -946,38 +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 with:'));
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: ${installCmdText} ...`));
931
+ console.log(chalk.gray(` Running: ${brewInstallCmd} ...`));
955
932
  try {
956
- if (isWin) {
957
- execFileSync('powershell', ['-ExecutionPolicy', 'ByPass', '-c', 'irm https://astral.sh/uv/install.ps1 | iex'], { stdio: 'inherit', timeout: 5 * 60 * 1000 });
958
- }
959
- else {
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(` ! uv install failed: ${err.message}`));
969
- console.log(chalk.gray(` Re-run manually: ${installCmdText}`));
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)'));
941
+ return;
942
+ }
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'));
971
946
  return;
972
947
  }
973
- // Verify install: `uv --version` must return (PATH or standalone-install path).
974
- const version = uvVersion();
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} ...`));
954
+ try {
955
+ execFileSync('brew', ['install', 'git'], {
956
+ stdio: 'inherit',
957
+ timeout: 15 * 60 * 1000,
958
+ });
959
+ }
960
+ catch (err) {
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();
975
966
  if (version !== null) {
976
- console.log(chalk.green(` + uv installed & verified (${version || 'version unknown'}).`));
967
+ console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
977
968
  }
978
969
  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'));
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'));
981
972
  }
982
973
  }
983
974
  export async function initCommand(options = {}) {
@@ -1114,33 +1105,26 @@ export async function initCommand(options = {}) {
1114
1105
  // alignment and self-test. Stored in autotest.unified_model (config.json) and
1115
1106
  // exported as HOMETRANS_MODEL_* env vars by maybePersistMachineEnv below.
1116
1107
  await promptModelConfig(config);
1117
- // Dependency Installation — auto-provisionable deps: the global npm CLIs the
1118
- // spec-generation skill needs (homegraph + arkanalyzer) and uv (the Python
1119
- // toolchain every script runs under). The section header is printed once here;
1120
- // each sub-install prints its own gray sub-line. Runs before the Environment
1121
- // Check so the check reflects anything freshly installed.
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.
1122
1114
  console.log('');
1123
1115
  console.log(chalk.cyan(' Dependency Installation'));
1116
+ // git first — required by the diff-based agent precheck and by some npm-install-g flows.
1124
1117
  try {
1125
- await installNodeDependencies();
1126
- }
1127
- catch (err) {
1128
- if (isPromptAbort(err))
1129
- abortInit();
1130
- console.log(chalk.yellow(` ! homegraph / arkanalyzer install skipped: ${err.message}`));
1131
- }
1132
- try {
1133
- await installUv();
1118
+ await installGit();
1134
1119
  }
1135
1120
  catch (err) {
1136
1121
  if (isPromptAbort(err))
1137
1122
  abortInit();
1138
- console.log(chalk.yellow(` ! uv install skipped: ${err.message}`));
1123
+ console.log(chalk.yellow(` ! git install skipped: ${err.message}`));
1139
1124
  }
1140
- // Detect external tools (adb / hdc / uv / java / homegraph + DevEco)
1141
- // and report which skills/agents are impacted by anything missing.
1142
- // (Python is no longer detected separately — every script runs via `uv run`,
1143
- // 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.
1144
1128
  try {
1145
1129
  await runEnvironmentCheck(config.env);
1146
1130
  }
@@ -1148,7 +1132,7 @@ export async function initCommand(options = {}) {
1148
1132
  console.log(chalk.yellow(` ! environment check skipped: ${err.message}`));
1149
1133
  }
1150
1134
  // Copy bundled tools/ into ~/.hometrans/tools and record env.HOMETRANS_TOOL_PATH.
1151
- // self_test_runner.py (under the installed tools dir) reads the autotest
1135
+ // self_test_runner.ts (under the installed tools dir) reads the autotest
1152
1136
  // config from ~/.hometrans/config.json at run time — see promptModelConfig.
1153
1137
  try {
1154
1138
  await installTools(toolsRoot, config);
@@ -1157,7 +1141,7 @@ export async function initCommand(options = {}) {
1157
1141
  console.log(chalk.red(` ! tools copy: ${err.message}`));
1158
1142
  }
1159
1143
  // (The autotest.unified_model block in config.json was already configured by
1160
- // the Model Configuration step above; self_test_runner.py reads it at run time
1144
+ // the Model Configuration step above; self_test_runner.ts reads it at run time
1161
1145
  // and the UI-alignment phone-agent reads the exported HOMETRANS_MODEL_* vars.)
1162
1146
  // Offer to persist the resolved config values as real OS environment
1163
1147
  // variables (Windows: setx; macOS/Linux: shell rc block). Shows what will be
@@ -1177,7 +1161,6 @@ export async function initCommand(options = {}) {
1177
1161
  console.log(chalk.cyan(` Configuring ${editor.name}...`));
1178
1162
  await installForEditor(editor, skillsRoot, agentsRoot, result);
1179
1163
  }
1180
- await setupMcpForAllEditors(editorsToSetup, result);
1181
1164
  console.log('');
1182
1165
  if (result.configured.length > 0) {
1183
1166
  console.log(chalk.green(' Configured:'));