@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
@@ -1,258 +0,0 @@
1
- /**
2
- * `ht init` 阶段:按 editors.json 中每个 editor 的 mcp.format 把 hometrans MCP
3
- * server 注册到对应的 editor 配置文件。
4
- *
5
- * 支持的 mcp.format:
6
- * jsonc-object Cursor / Claude Code 风格:jsonc 文件,key 路径写对象
7
- * jsonc-command-array OpenCode 风格:jsonc 文件,value 是 {type, command:[]}
8
- * codex-cli Codex:优先 `codex mcp add`,失败回退追加 TOML section
9
- * toml-section 纯 TOML:追加 [<section>] 段
10
- * none 跳过 MCP 写入
11
- */
12
- import fs from 'node:fs/promises';
13
- import path from 'node:path';
14
- import { execFile, execFileSync } from 'node:child_process';
15
- import { createRequire } from 'node:module';
16
- import { promisify } from 'node:util';
17
- import { parseTree, modify, applyEdits, } from 'jsonc-parser';
18
- import { dirExists } from './init.js';
19
- import { expandHome } from './config-store.js';
20
- const execFileAsync = promisify(execFile);
21
- const _require = createRequire(import.meta.url);
22
- const _pkg = _require('../../package.json');
23
- if (typeof _pkg.version !== 'string' || !_pkg.version) {
24
- throw new Error('hometrans package.json#version is missing — cannot generate MCP fallback config.');
25
- }
26
- const PKG_NAME = typeof _pkg.name === 'string' && _pkg.name ? _pkg.name : 'hometrans';
27
- const NPX_REF = `${PKG_NAME}@${_pkg.version}`;
28
- /** Locate the globally-installed `hometrans` (or `ht`) binary. */
29
- function resolveHometransBin() {
30
- const isWin = process.platform === 'win32';
31
- const cmd = isWin ? 'where' : 'which';
32
- for (const candidate of ['hometrans', 'ht']) {
33
- try {
34
- const output = execFileSync(cmd, [candidate], {
35
- encoding: 'utf-8',
36
- timeout: 5000,
37
- stdio: ['ignore', 'pipe', 'ignore'],
38
- });
39
- const lines = output
40
- .split('\n')
41
- .map(l => l.trim())
42
- .filter(Boolean);
43
- if (lines.length === 0)
44
- continue;
45
- if (isWin) {
46
- const cmdLine = lines.find(l => /\.(cmd|bat)$/i.test(l));
47
- return cmdLine || lines[0];
48
- }
49
- return lines[0];
50
- }
51
- catch {
52
- // try next candidate
53
- }
54
- }
55
- return null;
56
- }
57
- /**
58
- * MCP server entry written to editor config.
59
- *
60
- * Prefers global binary (fast startup) over `npx -y hometrans@<version> mcp`
61
- * (cold-start may exceed Claude Code's 30s MCP connect timeout, esp. with
62
- * arkanalyzer install). Falls back to npx when binary not on PATH.
63
- */
64
- function getMcpEntry() {
65
- const bin = resolveHometransBin();
66
- if (bin) {
67
- return { command: bin, args: ['mcp'] };
68
- }
69
- if (process.platform === 'win32') {
70
- return { command: 'cmd', args: ['/c', 'npx', '-y', NPX_REF, 'mcp'] };
71
- }
72
- return { command: 'npx', args: ['-y', NPX_REF, 'mcp'] };
73
- }
74
- /** OpenCode uses a flat command-array format. */
75
- function getOpenCodeMcpEntry() {
76
- const bin = resolveHometransBin();
77
- if (bin) {
78
- return { type: 'local', command: [bin, 'mcp'] };
79
- }
80
- if (process.platform === 'win32') {
81
- return {
82
- type: 'local',
83
- command: ['cmd', '/c', 'npx', '-y', NPX_REF, 'mcp'],
84
- };
85
- }
86
- return { type: 'local', command: ['npx', '-y', NPX_REF, 'mcp'] };
87
- }
88
- function detectIndentation(raw) {
89
- const firstIndented = raw.match(/^( +|\t)/m);
90
- if (!firstIndented)
91
- return { tabSize: 2, insertSpaces: true };
92
- if (firstIndented[1] === '\t')
93
- return { tabSize: 1, insertSpaces: false };
94
- return { tabSize: firstIndented[1].length, insertSpaces: true };
95
- }
96
- /**
97
- * Merge a key/value pair into a JSONC config file, preserving comments and formatting.
98
- * Returns false if the file is genuinely corrupt (leaves it untouched).
99
- */
100
- async function mergeJsoncFile(filePath, keyPath, value) {
101
- let raw;
102
- try {
103
- raw = await fs.readFile(filePath, 'utf-8');
104
- }
105
- catch {
106
- raw = '';
107
- }
108
- if (raw.trim().length === 0) {
109
- await fs.mkdir(path.dirname(filePath), { recursive: true });
110
- const formattingOptions = { tabSize: 2, insertSpaces: true };
111
- const edits = modify('{}', keyPath, value, { formattingOptions });
112
- const result = applyEdits('{}', edits);
113
- await fs.writeFile(filePath, result, 'utf-8');
114
- return true;
115
- }
116
- const parseErrors = [];
117
- const tree = parseTree(raw, parseErrors);
118
- if (tree && tree.type === 'object' && parseErrors.length === 0) {
119
- const formattingOptions = detectIndentation(raw);
120
- const edits = modify(raw, keyPath, value, { formattingOptions });
121
- const result = applyEdits(raw, edits);
122
- await fs.writeFile(filePath, result, 'utf-8');
123
- return true;
124
- }
125
- return false;
126
- }
127
- function getTomlSection(sectionHeader) {
128
- const entry = getMcpEntry();
129
- const command = JSON.stringify(entry.command);
130
- const args = `[${entry.args.map(arg => JSON.stringify(arg)).join(', ')}]`;
131
- return `[${sectionHeader}]\ncommand = ${command}\nargs = ${args}\n`;
132
- }
133
- async function upsertTomlSection(configPath, sectionHeader) {
134
- let existing = '';
135
- try {
136
- existing = await fs.readFile(configPath, 'utf-8');
137
- }
138
- catch {
139
- existing = '';
140
- }
141
- if (existing.includes(`[${sectionHeader}]`)) {
142
- return;
143
- }
144
- const section = getTomlSection(sectionHeader);
145
- const nextContent = existing.trim().length > 0 ? `${existing.trimEnd()}\n\n${section}` : section;
146
- await fs.mkdir(path.dirname(configPath), { recursive: true });
147
- await fs.writeFile(configPath, `${nextContent.trimEnd()}\n`, 'utf-8');
148
- }
149
- // ─── Per-format writers ────────────────────────────────────────────
150
- async function writeJsoncObject(editor, result) {
151
- const mcp = editor.mcp;
152
- if (!mcp.path || !mcp.keyPath) {
153
- result.errors.push(`${editor.name} MCP: jsonc-object format requires path + keyPath`);
154
- return;
155
- }
156
- const configPath = expandHome(mcp.path);
157
- try {
158
- const ok = await mergeJsoncFile(configPath, mcp.keyPath, getMcpEntry());
159
- if (ok) {
160
- result.configured.push(`${editor.name} MCP (${prettyConfigPath(configPath)})`);
161
- }
162
- else {
163
- result.errors.push(`${editor.name} MCP: ${configPath} is corrupt — skipping to preserve existing content`);
164
- }
165
- }
166
- catch (err) {
167
- result.errors.push(`${editor.name} MCP: ${err.message}`);
168
- }
169
- }
170
- async function writeJsoncCommandArray(editor, result) {
171
- const mcp = editor.mcp;
172
- if (!mcp.path || !mcp.keyPath) {
173
- result.errors.push(`${editor.name} MCP: jsonc-command-array format requires path + keyPath`);
174
- return;
175
- }
176
- const configPath = expandHome(mcp.path);
177
- try {
178
- const ok = await mergeJsoncFile(configPath, mcp.keyPath, getOpenCodeMcpEntry());
179
- if (ok) {
180
- result.configured.push(`${editor.name} MCP (${prettyConfigPath(configPath)})`);
181
- }
182
- else {
183
- result.errors.push(`${editor.name} MCP: ${configPath} is corrupt — skipping to preserve existing content`);
184
- }
185
- }
186
- catch (err) {
187
- result.errors.push(`${editor.name} MCP: ${err.message}`);
188
- }
189
- }
190
- async function writeCodexCli(editor, result) {
191
- try {
192
- const entry = getMcpEntry();
193
- await execFileAsync('codex', ['mcp', 'add', 'hometrans', '--', entry.command, ...entry.args], { shell: process.platform === 'win32' });
194
- result.configured.push(`${editor.name} MCP (via codex mcp add)`);
195
- return;
196
- }
197
- catch {
198
- // Fall through to TOML write.
199
- }
200
- const mcp = editor.mcp;
201
- if (!mcp.path || !mcp.section) {
202
- result.errors.push(`${editor.name} MCP: codex-cli fallback requires path + section`);
203
- return;
204
- }
205
- try {
206
- const configPath = expandHome(mcp.path);
207
- await upsertTomlSection(configPath, mcp.section);
208
- result.configured.push(`${editor.name} MCP (${prettyConfigPath(configPath)})`);
209
- }
210
- catch (err) {
211
- result.errors.push(`${editor.name} MCP: ${err.message}`);
212
- }
213
- }
214
- async function writeTomlSection(editor, result) {
215
- const mcp = editor.mcp;
216
- if (!mcp.path || !mcp.section) {
217
- result.errors.push(`${editor.name} MCP: toml-section format requires path + section`);
218
- return;
219
- }
220
- try {
221
- const configPath = expandHome(mcp.path);
222
- await upsertTomlSection(configPath, mcp.section);
223
- result.configured.push(`${editor.name} MCP (${prettyConfigPath(configPath)})`);
224
- }
225
- catch (err) {
226
- result.errors.push(`${editor.name} MCP: ${err.message}`);
227
- }
228
- }
229
- function prettyConfigPath(p) {
230
- // 与 init.ts 中 prettyHome 行为一致:完整绝对路径、OS 原生分隔符,不做 ~ 缩写。
231
- return p;
232
- }
233
- async function setupOneEditor(editor, result) {
234
- const marker = expandHome(editor.markerDir);
235
- if (marker && !(await dirExists(marker))) {
236
- result.skipped.push(`${editor.name} MCP (not installed)`);
237
- return;
238
- }
239
- switch (editor.mcp.format) {
240
- case 'jsonc-object':
241
- return writeJsoncObject(editor, result);
242
- case 'jsonc-command-array':
243
- return writeJsoncCommandArray(editor, result);
244
- case 'codex-cli':
245
- return writeCodexCli(editor, result);
246
- case 'toml-section':
247
- return writeTomlSection(editor, result);
248
- case 'none':
249
- return;
250
- default:
251
- result.errors.push(`${editor.name} MCP: unknown mcp.format "${editor.mcp.format}"`);
252
- }
253
- }
254
- export async function setupMcpForAllEditors(editors, result) {
255
- for (const editor of editors) {
256
- await setupOneEditor(editor, result);
257
- }
258
- }
package/dist/cli/mcp.js DELETED
@@ -1,94 +0,0 @@
1
- /**
2
- * `ht mcp` — stdio MCP server exposing HomeTrans tools.
3
- *
4
- * Currently registers a single tool: `extract_commit_context`, which wraps
5
- * the vendored ArkTS commit-context extractor (src/context/index.ts).
6
- */
7
- import { Server } from '@modelcontextprotocol/sdk/server/index.js';
8
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
9
- import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
10
- import { extractCommitContext } from '../context/index.js';
11
- // stdio is the MCP protocol channel — any console.log from vendored code
12
- // would corrupt frames. Redirect stdout-side logging to stderr.
13
- console.log = console.error;
14
- console.info = console.error;
15
- console.dir = (...args) => process.stderr.write(args.map(a => (typeof a === 'string' ? a : JSON.stringify(a))).join(' ') + '\n');
16
- const EXTRACT_COMMIT_CONTEXT_TOOL = {
17
- name: 'extract_commit_context',
18
- description: '提取 HarmonyOS 工程指定 commit 的代码上下文索引(git diff + ArkTS 语义依赖:模块依赖、字符串/复数/数组资源依赖),供 AI 评审 Android→HarmonyOS 转换代码时使用。返回 {path, kind, ranges?, resourceNames?}[]:source 文件给出 1-based 行号区间数组,调用方按需读取;resource 文件给出引用到的资源名列表。不返回文件内容,避免上下文过长。',
19
- inputSchema: {
20
- type: 'object',
21
- properties: {
22
- projectPath: {
23
- type: 'string',
24
- description: 'HarmonyOS 工程的绝对路径(包含 .git 目录的仓库根)',
25
- },
26
- commitId: {
27
- type: 'string',
28
- description: '要分析的 git commit id(会和它的第一个父提交做 diff)',
29
- },
30
- mode: {
31
- type: 'string',
32
- description: '分析模式:default = 构建完整 call graph 做调用链上下文;其它值跳过 call graph 构建',
33
- default: 'default',
34
- },
35
- ohosSdkPath: {
36
- type: 'string',
37
- description: 'OpenHarmony SDK ETS 目录绝对路径(如 D:/DevEco Studio/sdk/default/openharmony/ets)。未传则读环境变量 OHOS_SDK_PATH。',
38
- },
39
- hmsSdkPath: {
40
- type: 'string',
41
- description: 'HMS SDK ETS 目录绝对路径(如 D:/DevEco Studio/sdk/default/hms/ets)。未传则读环境变量 HMS_SDK_PATH。',
42
- },
43
- },
44
- required: ['projectPath', 'commitId'],
45
- },
46
- };
47
- export async function runMcpServer() {
48
- const server = new Server({ name: 'hometrans', version: '0.1.2' }, { capabilities: { tools: {} } });
49
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
50
- tools: [EXTRACT_COMMIT_CONTEXT_TOOL],
51
- }));
52
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
53
- const { name, arguments: args } = request.params;
54
- if (name !== EXTRACT_COMMIT_CONTEXT_TOOL.name) {
55
- return {
56
- isError: true,
57
- content: [{ type: 'text', text: `Unknown tool: ${name}` }],
58
- };
59
- }
60
- try {
61
- const input = (args ?? {});
62
- const result = await extractCommitContext({
63
- projectPath: input.projectPath ?? '',
64
- commitId: input.commitId ?? '',
65
- mode: input.mode,
66
- ohosSdkPath: input.ohosSdkPath,
67
- hmsSdkPath: input.hmsSdkPath,
68
- });
69
- return {
70
- content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
71
- };
72
- }
73
- catch (err) {
74
- return {
75
- isError: true,
76
- content: [
77
- {
78
- type: 'text',
79
- text: `extract_commit_context failed: ${err?.message ?? String(err)}`,
80
- },
81
- ],
82
- };
83
- }
84
- });
85
- process.on('uncaughtException', err => {
86
- console.error('[hometrans/mcp] uncaughtException:', err);
87
- });
88
- process.on('unhandledRejection', err => {
89
- console.error('[hometrans/mcp] unhandledRejection:', err);
90
- });
91
- const transport = new StdioServerTransport();
92
- await server.connect(transport);
93
- console.error('[hometrans/mcp] server connected on stdio');
94
- }