@buaa_smat/hometrans 0.1.16 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -54
- package/agents/code-reviewer.md +321 -65
- package/agents/logic-coder.md +113 -88
- package/agents/logic-context-builder.md +47 -29
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
- package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
- package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
- package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
- package/agents/scripts/hmos-precheck/index.mjs +17 -0
- package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
- package/agents/scripts/platform_query.mjs +626 -0
- package/agents/scripts/platform_query.test.mjs +422 -0
- package/agents/self-test-fixer.md +36 -34
- package/agents/self-tester.md +123 -143
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +16 -63
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +127 -144
- package/dist/cli/uninstall.js +76 -110
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +55 -54
- package/package.json +6 -6
- package/resource/convert_pipeline_process.svg +103 -0
- package/resource/project_architecture.svg +122 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +345 -41
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/hmos-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
- package/skills/hmos-convert-pipeline/SKILL.md +168 -121
- package/skills/hmos-fix-build-errors/SKILL.md +87 -67
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/README.md +53 -36
- package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
- package/skills/hmos-integration-test/README.md +61 -70
- package/skills/hmos-integration-test/SKILL.md +128 -111
- package/skills/hmos-resources-convert/SKILL.md +334 -66
- package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
- package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
- package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
- package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
- package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
- package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
- package/skills/hmos-spec-generate/SKILL.md +293 -214
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
- package/skills/hmos-spec-generate/template/REQ.txt +22 -0
- package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
- package/skills/hmos-test-case-generation/README.md +241 -0
- package/skills/hmos-test-case-generation/SKILL.md +324 -0
- package/skills/hmos-test-case-generation/references/contract.md +315 -0
- package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
- package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
- package/tools/bfs-crawl/README.md +73 -0
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
- package/tools/test-tools/autotest/config.ts +175 -0
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +266 -0
- package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
- package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
- package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
- package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
- package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
- package/tools/test-tools/autotest/paths.ts +41 -0
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
- package/tools/test-tools/autotest/runner/logger.ts +45 -0
- package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
- package/tools/test-tools/autotest/validate.ts +167 -0
- package/agents/build-fixer.md +0 -385
- package/agents/logic-coder/scripts/platform_context_query.py +0 -568
- package/agents/review-fixer.md +0 -405
- package/agents/spec-generator.md +0 -541
- package/dist/cli/mcp-setup.js +0 -258
- package/dist/cli/mcp.js +0 -94
- package/dist/context/index.js +0 -694
- package/resource/migration_process.svg +0 -94
- package/resource/migration_process_transparent.svg +0 -93
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
- package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
- package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
- package/skills/hmos-resources-convert/evals/evals.json +0 -171
- package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
- package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
- package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
- package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
- package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
- package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
- package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
- package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
- package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
- package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
- package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
- package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/tools/apktool.bat +0 -85
- package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
- package/tools/test-tools/autotest/README.md +0 -238
- package/tools/test-tools/autotest/pyproject.toml +0 -26
- package/tools/test-tools/autotest/report_tool.py +0 -759
- package/tools/test-tools/autotest/self_test_runner.py +0 -895
- package/tools/test-tools/autotest/testcases_tool.py +0 -215
- package/tools/test-tools/autotest/uv.lock +0 -3156
- package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
package/dist/cli/mcp-setup.js
DELETED
|
@@ -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
|
-
}
|