@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.
Files changed (227) hide show
  1. package/README.md +138 -56
  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 +35 -376
  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 +19 -146
  35. package/dist/cli/config.js +6 -8
  36. package/dist/cli/env-vars.js +1 -3
  37. package/dist/cli/index.js +0 -11
  38. package/dist/cli/init.js +147 -235
  39. package/dist/cli/uninstall.js +5 -129
  40. package/dist/utils/regex.js +8 -0
  41. package/env-requirements.json +57 -55
  42. package/package.json +6 -8
  43. package/resource/convert_pipeline_process.svg +103 -0
  44. package/resource/project_architecture.svg +122 -0
  45. package/resource/title_dark.png +0 -0
  46. package/skills/hmos-batch-ui-align/SKILL.md +345 -43
  47. package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
  48. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  49. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  50. package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  80. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
  81. package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
  82. package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
  83. package/skills/hmos-convert-pipeline/SKILL.md +188 -131
  84. package/skills/hmos-fix-build-errors/SKILL.md +87 -67
  85. package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
  86. package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
  87. package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
  88. package/skills/hmos-incremental-ui-align/README.md +57 -40
  89. package/skills/hmos-incremental-ui-align/SKILL.md +180 -24
  90. package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
  91. package/skills/hmos-incremental-ui-align/page_align.md +62 -62
  92. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. 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
  121. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  122. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
  123. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
  124. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
  125. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
  126. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
  127. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  128. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
  129. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  130. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  131. package/skills/hmos-integration-test/README.md +111 -79
  132. package/skills/hmos-integration-test/SKILL.md +216 -132
  133. package/skills/hmos-integration-test/scripts/report-tool.ts +791 -0
  134. package/skills/hmos-integration-test/scripts/resolve-metadata-tool.ts +125 -0
  135. package/skills/hmos-integration-test/scripts/self-test-runner.ts +756 -0
  136. package/skills/hmos-integration-test/scripts/testcases-tool.ts +239 -0
  137. package/skills/hmos-resources-convert/SKILL.md +334 -66
  138. package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
  139. package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
  140. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
  141. package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
  142. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
  143. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
  144. package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
  145. package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
  146. package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
  147. package/skills/hmos-spec-generate/SKILL.md +293 -214
  148. package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
  149. package/skills/hmos-spec-generate/template/REQ.txt +22 -0
  150. package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
  151. package/skills/hmos-test-case-generation/README.md +241 -0
  152. package/skills/hmos-test-case-generation/SKILL.md +324 -0
  153. package/skills/hmos-test-case-generation/references/contract.md +315 -0
  154. package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
  155. package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
  156. package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
  157. package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
  158. package/tools/bfs-crawl/README.md +73 -0
  159. package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
  160. package/agents/build-fixer.md +0 -385
  161. package/agents/logic-coder/scripts/platform_context_query.py +0 -568
  162. package/agents/review-fixer.md +0 -405
  163. package/agents/spec-generator.md +0 -541
  164. package/dist/cli/mcp-setup.js +0 -258
  165. package/dist/cli/mcp.js +0 -94
  166. package/dist/context/index.js +0 -694
  167. package/resource/migration_process.svg +0 -94
  168. package/resource/migration_process_transparent.svg +0 -93
  169. package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
  170. package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
  171. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
  172. package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
  173. package/skills/hmos-resources-convert/evals/evals.json +0 -171
  174. package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
  175. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
  176. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  177. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  178. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
  179. package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
  180. package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
  181. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
  182. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
  183. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
  184. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
  185. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
  186. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
  187. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
  188. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
  189. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
  190. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
  191. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
  192. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  193. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  194. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
  195. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  196. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
  197. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
  198. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
  199. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
  200. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
  201. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
  202. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
  203. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
  204. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
  205. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
  206. package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
  207. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
  208. package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
  209. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  210. package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
  211. package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
  212. package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
  213. package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
  214. package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
  215. package/tools/test-tools/autotest/README.md +0 -238
  216. package/tools/test-tools/autotest/pyproject.toml +0 -26
  217. package/tools/test-tools/autotest/report_tool.py +0 -759
  218. package/tools/test-tools/autotest/self_test_runner.py +0 -895
  219. package/tools/test-tools/autotest/testcases_schema.md +0 -143
  220. package/tools/test-tools/autotest/testcases_tool.py +0 -215
  221. package/tools/test-tools/autotest/uv.lock +0 -3156
  222. package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  223. package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  224. package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  225. package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  226. package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  227. 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 { setupMcpForAllEditors } from './mcp-setup.js';
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 once in the `autotest.unified_model` block of ~/.hometrans/config.json
95
- * and additionally exported as the HOMETRANS_MODEL_* machine environment
96
- * variables (see maybePersistMachineEnv), so each runtime reads the same config:
97
- * - self_test_runner.py reads autotest.unified_model from config.json;
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 um = config.autotest.unified_model;
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 (multimodal LLM key for ui alignment + integration test):',
114
- default: isPlaceholderApiKey(um.api_key) ? undefined : um.api_key,
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
- um.api_key = answers.model_api_key.trim();
115
+ env.HOMETRANS_MODEL_API_KEY = answers.model_api_key.trim();
121
116
  if (answers.model_name.trim())
122
- um.name = answers.model_name.trim();
117
+ env.HOMETRANS_MODEL_NAME = answers.model_name.trim();
123
118
  if (answers.model_base_url.trim())
124
- um.base_url = answers.model_base_url.trim();
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 — 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.
194
+ * agent frontmatter. They are flagged with `hexAgentColor` in the editor list.
207
195
  */
208
196
  function needsHexAgentColor(editor) {
209
- return editor.mcp?.format === 'jsonc-command-array';
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; stderr for `java
456
- * -version`), falling back to the combined output if that stream is empty.
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/java/hdc are not included here —
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 the `autotest.unified_model` block, but those four fields are mirrored
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
- // Refresh the mirrored HOMETRANS_MODEL_* in config.env from autotest.unified_model
734
- // (the Model Configuration step above just edited the latter), so config.env is
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 `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.
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 homegraphVersion() {
780
+ function gitVersion() {
797
781
  try {
798
- const out = execFileSync('homegraph', ['--version'], {
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
- * 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.
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 installNodeDependencies() {
848
- console.log(chalk.gray(' homegraph + arkanalyzer'));
849
- // Idempotent: a working `homegraph --version` means the deps are already there.
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(` + homegraph already installed (${existing || 'version unknown'}) — skipping.`));
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 (!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'));
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: 'Install homegraph + arkanalyzer globally now (npm install -g homegraph arkanalyzer)?',
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(' npm install -g homegraph arkanalyzer'));
860
+ console.log(chalk.gray(` ${cmdText}`));
880
861
  return;
881
862
  }
882
- console.log(chalk.gray(' Running: npm install -g homegraph arkanalyzer ...'));
863
+ console.log(chalk.gray(` Running: ${cmdText} ...`));
883
864
  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
- });
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(` ! npm install failed: ${err.message}`));
894
- console.log(chalk.gray(' Re-run manually: npm install -g homegraph arkanalyzer'));
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
- // Verify install: `homegraph --version` must return normally (exit 0).
898
- const version = homegraphVersion();
873
+ const version = gitVersion();
899
874
  if (version !== null) {
900
- console.log(chalk.green(` + homegraph installed & verified (${version || 'version unknown'}).`));
875
+ console.log(chalk.green(` + git installed & verified (${version || 'version unknown'}).`));
901
876
  }
902
877
  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'));
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
- * 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.`));
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
- 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/';
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: `uv not found. Install it now via the official installer?\n ${installCmdText}`,
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 with:'));
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: ${installCmdText} ...`));
918
+ console.log(chalk.gray(` Running: ${brewInstallCmd} ...`));
955
919
  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
- }
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(` ! uv install failed: ${err.message}`));
969
- console.log(chalk.gray(` Re-run manually: ${installCmdText}`));
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
- // Verify install: `uv --version` must return (PATH or standalone-install path).
974
- const version = uvVersion();
975
- if (version !== null) {
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
- console.log(chalk.gray(` Running: homegraph install ${targetArg} --location=global --yes ...`));
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('homegraph', ['install', targetArg, '--location=global', '--yes'], {
942
+ execFileSync('brew', ['install', 'git'], {
1027
943
  stdio: 'inherit',
1028
- timeout: 5 * 60 * 1000,
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(` ! homegraph install failed: ${err.message}`));
1035
- console.log(chalk.gray(` Re-run manually: homegraph install ${targetArg} --location=global --yes`));
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 + autotest)
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 autotest.unified_model (config.json) and
1170
- // exported as HOMETRANS_MODEL_* env vars by maybePersistMachineEnv below.
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
- // Dependency Installation — auto-provisionable deps: the global npm CLIs the
1173
- // spec-generation skill needs (homegraph + arkanalyzer) and uv (the Python
1174
- // toolchain every script runs under). The section header is printed once here;
1175
- // each sub-install prints its own gray sub-line. Runs before the Environment
1176
- // Check so the check reflects anything freshly installed.
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 installNodeDependencies();
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(` ! uv install skipped: ${err.message}`));
1117
+ console.log(chalk.yellow(` ! git install skipped: ${err.message}`));
1203
1118
  }
1204
- // Detect external tools (adb / hdc / uv / java / homegraph + DevEco)
1205
- // and report which skills/agents are impacted by anything missing.
1206
- // (Python is no longer detected separately — every script runs via `uv run`,
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
- // self_test_runner.py (under the installed tools dir) reads the autotest
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
- // (The autotest.unified_model block in config.json was already configured by
1224
- // the Model Configuration step above; self_test_runner.py reads it at run time
1225
- // and the UI-alignment phone-agent reads the exported HOMETRANS_MODEL_* vars.)
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:'));