dsh-apk-vm 0.6.1 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ Sidebar workspace, APK debugging, network and regression tools.
6
+
7
+ ### Added
8
+
9
+ - **Collapsible tools aside**, **expand/full-window**, **in-app floating VM window**, remembered
10
+ expand state, double-click expand, keyboard `Esc` restore and a dedicated close button.
11
+ - **Multi-instance grid** with frame thumbnails and one-click instance switching.
12
+ - **Stream quality presets** (540p/30, 720p/60, 960p/60) that restart only the scrcpy session,
13
+ a quick rotate control, first-boot hint, and stale-client/version warning.
14
+ - **One-click environment setup** for SDK tools, system image and AVD creation with explicit
15
+ download confirmation; single-step setup actions remain available.
16
+ - **APK quick actions**: launch installed app, validated deep links, grant/revoke permissions,
17
+ plus existing stop/clear-data/uninstall. `.aab` uploads convert through bundletool when available.
18
+ - **Named VM snapshots**: save, restore and delete per-AVD snapshots.
19
+ - **Passive clipboard**: explicit “copy device clipboard to host” and “paste host clipboard to
20
+ device” actions; no polling, listeners or background sync.
21
+ - **HAR network panel**: load a HAR exported by an external proxy/DevTools, summarize status
22
+ classes/bytes/domains and inspect up to 500 requests with bounded fields.
23
+ - **UI check/visual baseline**: run UIAutomator assertions and SHA-256 screenshot baselines,
24
+ return a JSON/Markdown report, and copy a `curl` for HAR entries.
25
+ - **Remote adb host:port input** for attached network devices.
26
+
27
+ ### Notes
28
+
29
+ - AAB conversion requires `bundletool` (executable, `BUNDLETOOL_JAR`, or a jar in the repo/tools dir).
30
+ - Visual regression is exact-byte baseline comparison; it does not ship a pixel-diff image library.
31
+ - Clipboard remains passive by design; there is no automatic sync.
32
+
33
+ ## 0.7.0
34
+
35
+ Sidebar usability and streaming controls.
36
+
37
+ ### Added
38
+
39
+ - **Expand / restore button** in the VM panel header. It turns the panel into a
40
+ full-window overlay so a narrow `dsh-better-sidebar` tab can show a large phone screen;
41
+ press Escape or click the button again to restore the sidebar layout. The last state is
42
+ remembered, double-clicking the phone toggles it, and the overlay has a dedicated close button.
43
+ - **Collapsible tools aside** in the embedded sidebar: APK/debug cards are hidden by default
44
+ so the phone gets the available height; a Tools button reveals them.
45
+ - **Stream quality presets** — Low 540p/30, Balanced 720p/60, High 960p/60. Changing the
46
+ preset restarts only the scrcpy session and lets the panel reconnect.
47
+ - Quick **rotate** and **first-boot hint** in the stage controls.
48
+ - **Version and stale-UI warning** — the header shows the client version, and a
49
+ client/host version mismatch offers a Reload UI action.
50
+ - **APK quick actions** — launch an installed app, open a validated deep link, grant/revoke a
51
+ permission, plus the existing stop/clear/uninstall controls.
52
+ - **One-click environment setup** — an explicit button chains SDK tools, system image,
53
+ AVD creation and VM start; the click confirms downloads even when global auto-download is off.
54
+ - **Passive clipboard** — host clipboard is read/written only when the user clicks
55
+ “paste host clipboard” or “copy device clipboard”. No polling or background sync.
56
+
57
+ ## 0.6.2
58
+
59
+ Sidebar usability.
60
+
61
+ ### Added
62
+
63
+ - **Expand / restore button** in the VM panel header. It turns the panel into a
64
+ full-window overlay so a narrow `dsh-better-sidebar` tab can show a large phone screen;
65
+ press Escape or click the button again to restore the sidebar layout.
66
+ - The overlay hides the APK/debug aside, keeps the H.264 stream and input controls, and
67
+ reuses the existing canvas/WebSocket session (no second stream).
68
+
3
69
  ## 0.6.1
4
70
 
5
71
  Network panel completeness.
package/README.md CHANGED
@@ -8,6 +8,27 @@
8
8
 
9
9
  **Run a real Android APK inside a local, rooted, open-source Android VM and preview it in the DeepSeek Harness sidebar — streamed as H.264/WebCodecs video at up to 60 fps.**
10
10
 
11
+ <p align="center">
12
+ <a href="docs/screenshot-panel.png">
13
+ <img src="docs/screenshot-panel.png" alt="APK Virtual Machine panel with a live H.264 Android screen in DeepSeek Harness" width="820">
14
+ </a>
15
+ </p>
16
+ <p align="center"><sub>Real panel capture: rooted Android 14 guest, live H.264 stream, input controls and installed-app tools — no mockup.</sub></p>
17
+ <p align="center">
18
+ <code>dsh plugin --profile web add dsh-apk-vm</code>
19
+ &nbsp;·&nbsp;
20
+ <a href="examples/README.md">reproducible demo</a>
21
+ </p>
22
+
23
+ **Why it is useful**
24
+
25
+ - **Sidebar-first Android** — install and use an APK without opening a separate emulator window.
26
+ - **Real, low-latency stream** — H.264/WebCodecs up to 60 fps with tap, swipe, key and text input.
27
+ - **Agent-native** — `apk_vm` tools, a live UI Inspector, copy-ready selectors and record/replay flows.
28
+ - **Local and inspectable** — open-source AOSP emulator, rooted debug API, network/storage controls, no telemetry.
29
+ - **Expandable viewer** — turn the narrow sidebar panel into a full-window VM with one click; Escape restores it.
30
+ - **Large-screen controls** — collapsible tools, quality presets (540p/30 → 960p/60), double-click expand, quick rotate, and a stale-UI/version warning.
31
+
11
32
  This repository contains the static DSH plugin `dsh-apk-vm`. It adds a first-class sidebar
12
33
  entry ("APK Virtual Machine" / "APK 虚拟机") whose main panel boots an AOSP Android Emulator,
13
34
  installs an APK into the guest, streams the guest display into the panel, and forwards
@@ -24,7 +45,7 @@ same-origin, loopback-only debug HTTP API and an `apk_vm` Agent tool.
24
45
  > 当前 **Windows x64 与 Linux x86_64(headless)为端到端已验证平台**;macOS 仅做探测/CI
25
46
  > 覆盖,详见 `docs/LINUX-E2E.md`。
26
47
 
27
- **Status:** `0.6.1` · Apache-2.0 · no npm runtime dependencies · no build step.
48
+ **Status:** `0.8.0` · Apache-2.0 · no npm runtime dependencies · no build step.
28
49
 
29
50
  This is an open-source DSH plugin published on npm as **`dsh-apk-vm`**. Repository:
30
51
  [github.com/yuxiaole-bili/dsh-apk-vm](https://github.com/yuxiaole-bili/dsh-apk-vm).
@@ -581,12 +602,16 @@ JSON bodies are bounded to 64 KiB; the raw APK upload is bounded to 500 MiB.
581
602
  | POST | `/apk-vm/device` | `{"serial":"<adb-serial>"}` attach an online physical/network device; `{"serial":""}` detach and restore the managed AVD. |
582
603
  | POST | `/apk-vm/vm` | `{"action":"start"\|"stop"\|"restart"\|"snapshot"}`. |
583
604
  | POST | `/apk-vm/install` | `{"path":"C:/path/app.apk"}` → install + launch. |
584
- | POST | `/apk-vm/upload` | Raw APK bytes (≤ 500 MiB) with the file name in the `x-apk-name` header → validate ZIP/APK magic, write to the OS temp dir, install + launch. |
605
+ | POST | `/apk-vm/upload` | Raw APK/APKS/XAPK/AAB bytes (≤ 500 MiB) with the file name in the `x-apk-name` header → validate ZIP/APK magic, write to the OS temp dir, install + launch. |
585
606
  | GET | `/apk-vm/frame?t=…` | Latest PNG frame (`409` while the VM is not ready). |
586
607
  | POST | `/apk-vm/input` | `tap` / `swipe` / `key` / `text` payloads. |
587
608
  | POST | `/apk-vm/touch` | Multi-touch scrcpy control (`{"action":"down\|move\|up\|cancel","pointerId":0,"x":…,"y":…}` in video-frame coordinates) for pinch/zoom. |
588
- | GET/POST | `/apk-vm/clipboard` | Read the device clipboard (`GET`, scrcpy `GET_CLIPBOARD`) or write text (`POST {"text":…}`). |
609
+ | GET/POST | `/apk-vm/clipboard` | Read the device clipboard (`GET`, scrcpy `GET_CLIPBOARD`) or write text (`POST {"text":…}`). Explicit calls only; no background clipboard sync. |
610
+ | GET/POST | `/apk-vm/snapshots` | List named AVD snapshots; `POST {"action":"save\|load\|delete","name":…}`. |
611
+ | POST | `/apk-vm/ui-test` | `{"name":…,"assertions":[…],"updateBaseline":false}` — UIAutomator assertions + exact-byte screenshot baseline; returns JSON and Markdown. |
612
+ | POST | `/apk-vm/network/har` | `{"path":"…har","method"?,"status"?,"domain"?,"search"?}` — load an external proxy HAR, summarize/filter and include bounded entries + curl. |
589
613
  | POST | `/apk-vm/stream` | `{"fps":1–10}` — set the PNG fallback target frame rate. |
614
+ | POST | `/apk-vm/stream/quality` | `{"preset":"low\|balanced\|high"}` — change H.264 resolution/bitrate/fps; the scrcpy session reconnects. |
590
615
  | GET (upgrade) | `/apk-vm/ws` | WebSocket H.264 stream (see above). |
591
616
  | GET | `/apk-vm/instances` | List default + extra VM instances, including `owner`, `lastUsedAt`, `idleMs`, `idleTimeoutMs`, `videoClients`. |
592
617
  | POST | `/apk-vm/instances` | `{"name":"agent-a","start":true}` — create an isolated AVD/VM; every extra instance has its own H.264 stream. |