android2harmony 0.1.2 → 0.1.3

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 (56) hide show
  1. package/agents/self-tester.md +339 -0
  2. package/dist/index.js +625 -7
  3. package/dist/index.js.map +4 -4
  4. package/package.json +37 -29
  5. package/skills/hmos-incremental-ui-align/README.md +251 -0
  6. package/skills/hmos-incremental-ui-align/SKILL.md +365 -0
  7. package/skills/hmos-incremental-ui-align/diff_analysis.md +53 -0
  8. package/skills/hmos-incremental-ui-align/page_align.md +62 -0
  9. package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -0
  10. 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 -0
  11. 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 +2089 -0
  12. 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 -0
  13. 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 -0
  14. 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 -0
  15. 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 -0
  16. 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 -0
  17. 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 +903 -0
  18. 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 -0
  19. 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 -0
  20. 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 -0
  21. 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 +355 -0
  22. 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 -0
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
  39. package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -0
  40. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -0
  41. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -0
  42. package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -0
  43. package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +999 -0
  44. package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
  45. package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +76 -0
  46. package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
  47. package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
  48. package/tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
  49. package/tools/autotest/engine/batch-launcher.ts +326 -0
  50. package/tools/autotest/engine/report-tool.ts +773 -0
  51. package/tools/autotest/engine/self-test-runner.ts +1024 -0
  52. package/tools/autotest/engine/testcases-tool.ts +246 -0
  53. package/tools/autotest/resolve-metadata-tool.ts +143 -0
  54. package/tools/autotest/runner/logger.ts +45 -0
  55. package/tools/autotest/runner/process-utils.ts +41 -0
  56. package/tools/autotest/validate.ts +115 -0
@@ -0,0 +1,74 @@
1
+ # State Model Template
2
+
3
+ Use this template to document multi-state UI components identified in Step 1.5.
4
+
5
+ ---
6
+
7
+ ## Component: {ComponentName}
8
+
9
+ **Source files**: `{android_source_file}`, `{hmos_source_file}`
10
+ **Parent page**: `{page_name}`
11
+ **State variable**: `{variable_name}` (type: `{enum/sealed class/Int}`)
12
+
13
+ ## States
14
+
15
+ | State ID | State Name | Entry Trigger | UI Description | Source Ref |
16
+ |----------|-----------|---------------|----------------|-----------|
17
+ | S0 | {name} | {trigger description} | {visible UI in this state} | {File:Line} |
18
+ | S1 | {name} | {trigger description} | {visible UI in this state} | {File:Line} |
19
+ | S2 | {name} | {trigger description} | {visible UI in this state} | {File:Line} |
20
+
21
+ ## Transitions
22
+
23
+ | From | To | Trigger | Gesture Type | Condition/Threshold | Duration | Source Ref |
24
+ |------|-----|---------|-------------|--------------------|---------|-----------|
25
+ | S0 | S1 | {event} | {Tap/LongPress/Pan/Swipe/Sensor/Timer} | {condition if any} | {ms or N/A} | {File:Line} |
26
+ | S1 | S2 | {event} | {gesture} | {condition} | {duration} | {File:Line} |
27
+
28
+ ## Per-State UI Properties
29
+
30
+ ### S0: {state_name}
31
+ | Property | Value | Source Ref |
32
+ |----------|-------|-----------|
33
+ | visibility | {VISIBLE/GONE/INVISIBLE} | {File:Line} |
34
+ | background | {color/drawable} | {File:Line} |
35
+ | text_content | "{text}" | {File:Line} |
36
+ | text_color | {#RRGGBB} | {File:Line} |
37
+ | text_size | {value}sp → {value}fp | {File:Line} |
38
+ | animation | {description or "none"} | {File:Line} |
39
+ | corner_radius | {value}dp → {value}vp | {File:Line} |
40
+ | shadow/glow | {description or "none"} | {File:Line} |
41
+
42
+ ### S1: {state_name}
43
+ (repeat same table structure)
44
+
45
+ ## Animations Between States
46
+
47
+ | Transition | Property | From Value | To Value | Duration | Easing | Source Ref |
48
+ |-----------|----------|-----------|----------|----------|--------|-----------|
49
+ | S0→S1 | opacity | 0 | 1 | 300ms | ease-out | {File:Line} |
50
+ | S0→S1 | translateY | 100vp | 0 | 300ms | spring | {File:Line} |
51
+
52
+ ## Capture Strategy
53
+
54
+ | State | Auto-capturable? | Method | Notes |
55
+ |-------|-----------------|--------|-------|
56
+ | S0 | Yes | navigate to page, capture idle | — |
57
+ | S1 | No | manual: long press and hold | need burst during hold |
58
+ | S2 | No | manual: long press + drag up | need burst during drag |
59
+
60
+ ## Manual Capture Instructions (if applicable)
61
+
62
+ For states that cannot be auto-captured, provide step-by-step instructions:
63
+
64
+ ```
65
+ State S1 (recording):
66
+ 1. Run: node ./scripts/page_capture_burst.ts --device adb -o {output_dir} --duration 5
67
+ 2. On device: long-press the microphone button and HOLD
68
+ 3. Wait for burst to complete, then release
69
+
70
+ State S2 (cancelling):
71
+ 1. Run: node ./scripts/page_capture_burst.ts --device adb -o {output_dir} --duration 5
72
+ 2. On device: long-press mic → drag finger UP past the cancel threshold
73
+ 3. Wait for burst to complete, then release
74
+ ```
@@ -0,0 +1,34 @@
1
+ | 类别 | 文本内容 (Content) | 尺寸与布局 (Size & Layout) | 颜色与背景 (Color & Background) | 边框与轮廓 (Border & Outline) | 文本样式 (Typography) | 变换与效果 (Transform & Effect) | 状态与交互反馈 (State & Feedback) |
2
+ | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
3
+ | **具体属性名** | `text` / `content` / `title` | `width`<br>`height`<br>`minWidth` / `maxWidth`<br>`minHeight` / `maxHeight`<br>`padding`<br>`margin`<br>`constraints`<br>`aspectRatio`<br>`alignment` (子控件位置) | `backgroundColor`<br>`background` (drawable/image)<br>`foreground`<br>`color` / `textColor`<br>`tintColor` / `colorFilter`<br>`shadow` (offset, radius, color)<br>`opacity` / `alpha` | `borderWidth`<br>`borderColor`<br>`borderRadius`<br>`borderStyle` (solid, dashed, dotted)<br>`outline` | `fontSize`<br>`fontFamily`<br>`fontWeight`<br>`fontStyle` (normal, italic)<br>`letterSpacing`<br>`lineHeight`<br>`textDecoration` (underline, line-through)<br>`textAlign` / `gravity` (文字位置)<br>`textOverflow` / `maxLines` | `scale` (x, y)<br>`rotation` (z, x, y)<br>`translate` (x, y)<br>`blur`<br>`brightness`<br>`contrast`<br>`saturation`<br>`clip` (circle, path) | `state` (normal, pressed, focused, disabled, selected, error)<br>(所有上述属性均可按状态单独设置) |
4
+ | **具体例子<br>(登录按钮)** | `text = "登录"` | `width = 200vp`<br>`height = 48vp`<br>`padding = 12vp`<br>`margin = 16vp`<br>`alignment = center` (在父容器中居中) | `backgroundColor = #007AFF`<br>`textColor = #FFFFFF`<br>`shadow(offset=0, radius=4, color=#40000000)` | `borderRadius = 24vp`<br>`borderWidth = 0`<br>`borderStyle = solid` | `fontSize = 16fp`<br>`fontWeight = bold`<br>`fontFamily = sans-serif-medium`<br>`textAlign = center` (文字在按钮内居中) | `scale = 0.95` (按下时)<br>`opacity = 0.8` (禁用时) | `normal`: 蓝色背景<br>`pressed`: 深蓝色背景<br>`disabled`: 灰色背景<br>`loading`: 显示进度圈 |
5
+
6
+ ## Dynamic / Transient UI Effects
7
+
8
+ This section captures UI behaviors that are NOT visible in a static screenshot or view tree: animations, transient messages, and non-touch-triggered UI.
9
+
10
+ | Effect Type | Trigger | Duration/Timing | Target Component | Parameters | Source Reference |
11
+ |:---|:---|:---|:---|:---|:---|
12
+ | animation | e.g., page enter / button click | e.g., 300ms, ease-out | e.g., title_text | e.g., alpha 0→1, translateY -20→0 | file:line |
13
+ | transient UI | e.g., save success / network error | e.g., 2000ms auto-dismiss | e.g., Toast / Snackbar | e.g., text="保存成功", position=bottom | file:line |
14
+ | voice/sensor | e.g., mic button click / shake | e.g., until recognition ends | e.g., voice_wave_view | e.g., waveform animation + result overlay | file:line |
15
+
16
+ Fill only rows that exist for this page. Omit this section entirely if no dynamic effects are found.
17
+
18
+ ## Multi-State Component Analysis (Step 1.5 components only)
19
+
20
+ When a component is identified as multi-state in Step 1.5, expand the "状态与交互反馈" column into a full state breakdown below:
21
+
22
+ ### Component: {ComponentName}
23
+ **State variable**: `{var_name}` — Type: `{enum/sealed class/@State}`
24
+ **Total states**: {N}
25
+
26
+ | State | Visibility | Background | Text Content | Text Style | Border | Animation | Trigger to Enter |
27
+ |:------|:-----------|:-----------|:-------------|:-----------|:-------|:----------|:-----------------|
28
+ | idle | VISIBLE | transparent | "问AI或按住说话" | 14fp #666666 | none | none | initial / cancel / recognized complete |
29
+ | recording | VISIBLE | #FFFFFF | "松手发送,上移取消" | 14fp #666666 | none | blue glow pulse | LongPress mic 500ms |
30
+ | cancelling | VISIBLE | #FFE5E5 | "上移取消" | 14fp #FF4444 | 2vp dashed #FF4444 | red border dash animation | Pan.UP > 150vp |
31
+
32
+ **Source references**: List the source file(s) and line ranges where each state's UI properties are defined.
33
+
34
+ This section supplements (not replaces) the main component table. The main table should show the component's **default/idle state** properties. This expanded section shows how properties change per state.