Extract HarmonyOS behind a platform plugin interface, then ship it as @agent-device/harmonyos (0.22)

Đang mở
#4,317 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
devtools, mobile-dev

Hướng nghiên cứu

Start with the provider plugin registry and ADR 0034, then trace platform and HarmonyOS references in packages/kernel/src/device.ts, packages/kernel/src/contracts.ts, and packages/platform-harmonyos. Define the platform registration interface and move HarmonyOS into @agent-device/harmonyos. Done means the listed commands work with the plugin, selectors give a typed install hint without it, live evidence is committed under docs/evidence/, and an ADR records the interface.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

refactor

Purpose

HarmonyOS is wired into core today. packages/platform-harmonyos is a private package, and harmonyos is hard-coded in packages/kernel/src/device.ts (PLATFORMS) and packages/kernel/src/contracts.ts (SESSION_RUNTIME_PLATFORMS and the harmonyos-instance backend). Every HarmonyOS change therefore lands in core and is reviewed against core, even though CI has no HarmonyOS device or HDC lane to verify it.

Providers already plug in through the provider plugin registry (ADR 0034), and first-party providers ship as plugins: @agent-device/webos, and planned for 0.22 @agent-device/limrun (#3311) and @agent-device/browserstack (#3309). Platforms have no equivalent interface. HarmonyOS should be the first platform to move behind one, in the same 0.22 window as the other extractions under #3747.

Required behavior

Two steps, in order:

  1. Platform plugin interface. A platform registers itself, along with its device kinds, selector flags, session runtime and backend, through a plugin registry like the provider registry, instead of being listed in closed kernel enums. Core keeps one owner for platform admission. Built-in platforms (Apple, Android, Linux, web, Vega) can stay built in; the interface only has to let a platform live outside core.
  2. HarmonyOS as a plugin. Move platform-harmonyos behind that interface and publish it as @agent-device/harmonyos, loaded the way provider plugins are. Remove the HarmonyOS entries from the kernel enums in the same change. Add no compatibility shims; this is a 0.22 break, like the other extractions.

Completion conditions

  • No harmonyos literal remains in packages/kernel outside a test fixture.
  • With the plugin installed, devices, open, snapshot, press and close work on a HarmonyOS device. The live evidence is committed under docs/evidence/, since CI cannot run HarmonyOS.
  • Without the plugin installed, HarmonyOS selectors fail with a typed reason naming the plugin to install.
  • An ADR amendment, or a new ADR next to ADR 0034, records the platform plugin interface.

Dependencies

  • Lands in 0.22, alongside #3747 and #3759.
  • Starts after 0.21.37 ships, matching the existing plugin-extraction hold.
  • Open HarmonyOS feature PRs should land first, or be rebased onto the plugin package once it exists. The order is tracked in the contributor umbrella.
Ngôn ngữ chính
TypeScript
Star
5.3k
Fork
377
Merge trung bình
13 giờ 58 phút
Pull request đã merge (30 ngày)
654

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstack/agent-device

Tất cả issue của callstack/agent-device

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.