@ycodium-ai/plugin-devices 0.0.0-stage → 0.2.2800
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 +92 -2
- package/assets/icon.svg +5 -0
- package/assets/ui.js +545 -0
- package/dist/helper.mjs +286 -0
- package/dist/index.js +2870 -0
- package/locales/en.json +209 -0
- package/locales/zh-CN.json +209 -0
- package/package.json +160 -3
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ycodium-ai/plugin-devices
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lets agents drive the iOS Simulators and Android Emulators on a Ycodium machine:
|
|
4
|
+
list them, boot one, take screenshots, and operate it with the `agent-device`
|
|
5
|
+
command line. The plugin is off by default; turning it on is the single switch
|
|
6
|
+
for device support.
|
|
7
|
+
|
|
8
|
+
## What it does
|
|
9
|
+
|
|
10
|
+
Nothing is installed or started when the plugin is turned on. The first time an
|
|
11
|
+
agent or a person actually uses a device (listing or opening one), the plugin:
|
|
12
|
+
|
|
13
|
+
1. Checks which platforms this machine can run. iOS needs macOS with `xcrun`;
|
|
14
|
+
Android needs an SDK with `adb` and `emulator`. A machine that can run
|
|
15
|
+
neither installs nothing.
|
|
16
|
+
2. Installs the two device tools at pinned versions into the plugin data
|
|
17
|
+
directory (`<dataDir>/tools/<package>/<version>`): `expo-device-hub` for the
|
|
18
|
+
device screens and `agent-device` for driving devices. It downloads its own
|
|
19
|
+
copy of npm, checks it against a pinned sha512 integrity, and runs it with the
|
|
20
|
+
Node the Ycodium server runs on. It never uses `npx` or the `node` on `PATH`.
|
|
21
|
+
3. Starts the device hub on `127.0.0.1` and hands it to Ycodium's plugin network
|
|
22
|
+
proxy as the service `hub`, so a paired client can reach only the routes listed
|
|
23
|
+
in this package's manifest. The `agent-device` daemon starts the same way.
|
|
24
|
+
|
|
25
|
+
Turning the plugin off stops both processes.
|
|
26
|
+
|
|
27
|
+
## Agent tools
|
|
28
|
+
|
|
29
|
+
On MCP the tools are prefixed with the plugin id (`devices_device_list`, …).
|
|
30
|
+
|
|
31
|
+
- **device_list** lists simulators and emulators with their state.
|
|
32
|
+
- **device_open** boots a device if needed and returns the `agent-device`
|
|
33
|
+
command to drive it: the launcher's absolute path plus `--config <file>
|
|
34
|
+
--session <id>`, which pin the command to this device and this conversation.
|
|
35
|
+
On Windows the launcher is a `.cmd` file, elsewhere a shell script.
|
|
36
|
+
- **device_screenshot** returns the current screen as a PNG image.
|
|
37
|
+
- **device_close** closes one device or every device in the conversation, and
|
|
38
|
+
can also power it off.
|
|
39
|
+
|
|
40
|
+
Tapping, typing, installing apps and reading logs all go through the
|
|
41
|
+
`agent-device` command line rather than more MCP tools. It carries its own
|
|
42
|
+
semantic snapshots and versions, and forwarding its dozens of tools would weigh
|
|
43
|
+
down every conversation's tool list.
|
|
44
|
+
|
|
45
|
+
## Settings card
|
|
46
|
+
|
|
47
|
+
- **Android SDK location**: leave it empty to use `ANDROID_HOME` or Android
|
|
48
|
+
Studio's default location.
|
|
49
|
+
- **Check tool versions** reads the installed and running versions without
|
|
50
|
+
installing or starting anything.
|
|
51
|
+
- **Install or update tools** installs the pinned versions. Running tools switch
|
|
52
|
+
over the next time they start.
|
|
53
|
+
|
|
54
|
+
## Tool updates
|
|
55
|
+
|
|
56
|
+
Each plugin version pins one version of `expo-device-hub` and one of
|
|
57
|
+
`agent-device`; the plugin never follows the registry's latest release. When a
|
|
58
|
+
newer plugin pins newer tools, they install automatically the next time a device
|
|
59
|
+
is used, and the panel shows "Updating Device hub from 0.11.0 to 0.12.0…".
|
|
60
|
+
Installing needs network access. The plugin never falls back to an older install
|
|
61
|
+
it finds on disk: if the required version cannot be installed, the panel shows
|
|
62
|
+
the failure with a Retry button, and the installed files stay as they were.
|
|
63
|
+
|
|
64
|
+
The panel's **Tool versions** popover shows the required, installed and running
|
|
65
|
+
version of each tool. **Check versions** only reads the install directory and
|
|
66
|
+
installs or starts nothing; **Update to …** appears when the required version is
|
|
67
|
+
missing and installs it without starting anything. After a tool starts, older
|
|
68
|
+
installs are removed, keeping the previous one and any install a running process
|
|
69
|
+
still uses.
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
|
|
73
|
+
A Ycodium server with plugin API version 3, including `process.spawn` for
|
|
74
|
+
`host:node` (at most eight processes at once) and `network.serve` for the `hub`
|
|
75
|
+
service. The first install needs outbound HTTPS to `registry.npmjs.org`.
|
|
76
|
+
|
|
77
|
+
To move to another tool version, change `DEVICE_HUB_VERSION` or
|
|
78
|
+
`AGENT_DEVICE_VERSION` in `src/toolchain.ts` and check the `hub` route allowlist
|
|
79
|
+
in `package.json` against the new hub, since the allowlist and the screen
|
|
80
|
+
protocol are written for the pinned versions.
|
|
81
|
+
|
|
82
|
+
## Not yet verified on real hardware
|
|
83
|
+
|
|
84
|
+
The plugin is covered by unit tests with fake processes and a fake hub. The
|
|
85
|
+
following have not been run end to end yet: Android Emulators, iOS Simulators,
|
|
86
|
+
screen streaming over Relay, and the mobile app.
|
|
87
|
+
|
|
88
|
+
## Install
|
|
89
|
+
|
|
90
|
+
Bundled with Ycodium and off by default. Turn it on under Settings → Plugins.
|
|
91
|
+
|
|
92
|
+
Third-party license notices for `expo-device-hub` and `agent-device` are in the
|
|
93
|
+
repository's `THIRD_PARTY_NOTICES.md`.
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<rect x="4" y="4" width="14" height="24" rx="3" stroke="#3B82F6" stroke-width="2"/>
|
|
3
|
+
<path d="M9 24h4" stroke="#3B82F6" stroke-width="2" stroke-linecap="round"/>
|
|
4
|
+
<rect x="21" y="10" width="8" height="14" rx="2" stroke="#3B82F6" stroke-width="2"/>
|
|
5
|
+
</svg>
|