dsh-plugin-hdc-phone 0.3.0 → 0.3.1

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 CHANGED
@@ -1,14 +1,46 @@
1
1
  # dsh-plugin-hdc-phone
2
2
 
3
- Drive a second HarmonyOS phone through a local HTTP hdc bridge.
3
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-hdc-phone?color=4c6ef5)](https://www.npmjs.com/package/dsh-plugin-hdc-phone)
4
+ [![license](https://img.shields.io/npm/l/dsh-plugin-hdc-phone?color=2f9e44)](./LICENSE)
4
5
 
5
- The bridge (custom ArkTS/HAP side, e.g. **HdcBridge** or DSH NEXT) owns `hdc` and
6
- listens on loopback; this plugin only validates tool arguments and formats the
7
- JSON answers.
6
+ Drive a target HarmonyOS phone through the local HTTP bridge that a
7
+ companion app (e.g. **HdcBridge** or DSH NEXT) runs on the host. The bridge
8
+ owns `hdc`; this plugin only validates tool arguments and formats the JSON
9
+ answers, so the agent never has to shell out to `hdc` itself.
8
10
 
11
+ <!-- TODO: drop a screenshot of the target phone + tool call here, then uncomment
12
+ ![screenshot](./assets/screenshot.png)
13
+ -->
14
+
15
+ ## Features
16
+
17
+ - **7 tools**: observe the UI tree, tap by text or coordinates, swipe, back/home,
18
+ type text, launch an ability, health-check the bridge.
19
+ - **Destructive actions are gated**: tapping 删除 / 支付 / 转账 / 卸载 / 清空 /
20
+ 退出登录 requires an explicit `confirm: true`.
21
+ - **Configurable endpoint**: env vars, a JSON config file, or the
22
+ `phone_bridge` tool — nothing is hard-coded to one port.
23
+ - **Zero dependencies** beyond the host's `@deepseek-ai/dsh-tools`.
24
+
25
+ ## Requirements
26
+
27
+ - DeepSeek Harness **>= 0.2.0-rc.1** (installed as a bundle plugin).
28
+ - Node.js **>= 24.9.0** (the DSH runtime satisfies this).
29
+ - The bridge app must be running on the host and listening on loopback.
30
+ - Target phone connected to that bridge via `hdc` (`hdc list targets` works).
31
+
32
+ ## Install
33
+
34
+ ```sh
35
+ # from npm
36
+ dsh plugin --profile <name> add dsh-plugin-hdc-phone
37
+
38
+ # from a local tarball
39
+ dsh plugin --profile <name> add /path/to/dsh-plugin-hdc-phone-0.3.1.tgz
9
40
  ```
10
- POST http://<host>:<port>/tool/<observe|tap|swipe|key|input|launch|health>
11
- ```
41
+
42
+ The package ships a `cordis.patch.yml`, so installing it as a bundle
43
+ auto-registers the `hdc-phone` plugin row — no manual `cordis.yml` edit.
12
44
 
13
45
  ## Tools
14
46
 
@@ -23,6 +55,12 @@ POST http://<host>:<port>/tool/<observe|tap|swipe|key|input|launch|health>
23
55
  | `phone_launch` | `aa start <bundle> <ability>` |
24
56
  | `phone_health` | Bridge / target connectivity |
25
57
 
58
+ Wire protocol — the plugin POSTs to the bridge, the bridge answers:
59
+
60
+ ```
61
+ POST http://<host>:<port>/tool/<observe|tap|swipe|key|input|launch|health>
62
+ ```
63
+
26
64
  ## Bridge endpoint (port)
27
65
 
28
66
  Resolution order:
@@ -43,15 +81,10 @@ Change it from the model side:
43
81
  The bridge app must listen on the same port. On the phone both the bridge app
44
82
  and DSH NEXT cannot share one port, so give one of them a different one.
45
83
 
46
- ## Install
47
-
48
- ```sh
49
- # from npm (after it is published)
50
- dsh plugin --profile <name> add dsh-plugin-hdc-phone
84
+ ## Security
51
85
 
52
- # from a local tarball
53
- dsh plugin --profile <name> add /path/to/dsh-plugin-hdc-phone-0.3.0.tgz
54
- ```
86
+ The bridge binds loopback only and (in the current HdcBridge build) has no
87
+ authentication: any local app can call it. Do not expose the port to a LAN.
55
88
 
56
89
  ## Publish
57
90
 
@@ -61,7 +94,6 @@ npm pack
61
94
  npm publish --access public
62
95
  ```
63
96
 
64
- ## Security
97
+ ## License
65
98
 
66
- The bridge binds loopback only and (in the current HdcBridge build) has no
67
- authentication: any local app can call it. Do not expose the port to a LAN.
99
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,8 @@
1
+ # dsh-plugin-hdc-phone —— DSH Bundle patch
2
+ #
3
+ # 作为 bundle 合入 profile 时,自动插入本插件行。
4
+ # 插件本身通过 env(DSH_HDC_PHONE_HOST / DSH_HDC_PHONE_PORT)或
5
+ # <DSH_HOME|HOME>/.dsh-hdc-phone.json 读取桥接地址,因此这里不需要 config。
6
+ - insert:
7
+ - id: hdc-phone
8
+ name: dsh-plugin-hdc-phone
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-hdc-phone",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Drive a second phone through a local HTTP hdc bridge (HdcBridge / DSH NEXT): observe/tap/swipe/key/input/launch, with configurable bridge host/port.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "files": [
12
12
  "src",
13
+ "cordis.patch.yml",
13
14
  "README.md",
14
15
  "LICENSE"
15
16
  ],
@@ -17,6 +18,7 @@
17
18
  "dsh-plugin",
18
19
  "dsh",
19
20
  "deepseek-harness",
21
+ "cordis-plugin",
20
22
  "harmonyos",
21
23
  "openharmony",
22
24
  "hdc",
@@ -24,7 +26,32 @@
24
26
  "remote-control"
25
27
  ],
26
28
  "license": "MIT",
29
+ "author": "moyuge123",
30
+ "homepage": "https://github.com/Yunfung/dsh-plugin-hdc-phone#readme",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/Yunfung/dsh-plugin-hdc-phone.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/Yunfung/dsh-plugin-hdc-phone/issues"
37
+ },
27
38
  "engines": {
28
39
  "node": ">=24.9.0"
40
+ },
41
+ "peerDependencies": {
42
+ "@deepseek-ai/dsh-tools": ">=0.1.0-rc.1 <0.2.0-0 || >=0.2.0-rc.1 <0.3.0-0"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@deepseek-ai/dsh-tools": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "dsh": {
50
+ "bundle": {
51
+ "patch": "./cordis.patch.yml"
52
+ },
53
+ "engines": {
54
+ "dsh": ">=0.2.0-rc.1"
55
+ }
29
56
  }
30
57
  }