@ycodium-ai/plugin-devices 0.2.3510 → 0.2.3576

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,103 +1,129 @@
1
1
  # @ycodium-ai/plugin-devices
2
2
 
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.
3
+ Lets agents list, open, screenshot and operate iOS Simulators and Android Emulators
4
+ on the connected Ycodium machine. The plugin is off by default. Turn it on under
5
+ Settings → Plugins, then open the Devices panel in a conversation.
7
6
 
8
7
  ## What it does
9
8
 
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
- On Windows the hub and its ordinary children are owned by a kill-on-close Job.
28
- Android Emulators started through its `emulator.exe` shim belong to the user and
29
- continue running when the hub stops. This requires the shipped Windows launcher.
30
- The launcher uses managed mode when its executable stem is `ycodium-job-launcher`
31
- (case-insensitive). Any other name selects breakaway mode and looks for a same-named
32
- `.exe` on PATH outside its own directory; Devices copies it as `emulator.exe`.
33
- The shim depends on `agent-device` finding emulator through `PATH`; an absolute
34
- SDK path bypasses it and the emulator then stops with the hub. The plugin logs a
35
- warning when a launch cannot be matched to the shim's process record.
9
+ Device helpers are delivered with Ycodium at pinned versions, including their
10
+ dependencies. Listing or opening a device starts the helpers when needed; it does
11
+ not install npm packages or download a Node interpreter. The helpers run through
12
+ Ycodium's managed Node, rather than the `node` on the machine's PATH.
13
+
14
+ The device hub listens on loopback. Paired clients reach its declared routes through
15
+ Ycodium's plugin network proxy, including when the machine is remote. The device
16
+ panel is shared by web, desktop and the mobile plugin view.
17
+
18
+ Turning the plugin off stops its helper processes and any active component download
19
+ or Apple installation process. Prepared environments, downloaded archives and
20
+ virtual device data remain on disk. Simulators themselves belong to the user and
21
+ are not shut down as part of disabling the plugin.
22
+
23
+ On Windows, keeping an emulator running after its hub stops requires Ycodium's
24
+ shipped process launcher. The emulator breakaway shim depends on the device helper
25
+ finding `emulator.exe` through PATH. An absolute SDK executable path bypasses the
26
+ shim; the plugin logs unmatched launches because those emulators can stop with the
27
+ hub.
28
+
29
+ ## Prepare a simulator
30
+
31
+ In the Devices panel, expand **Prepare simulator environment** and choose Android
32
+ or iOS. **Check prerequisites and storage** reads the machine's current setup,
33
+ download estimate, private storage location and free space. Enter an absolute
34
+ directory to use another disk on that machine. A remote machine's path is not a
35
+ path on the client computer.
36
+
37
+ For Android, the plugin detects and validates an existing SDK with runnable `adb`
38
+ and `emulator`. Existing virtual devices can be reused without installing
39
+ `avdmanager` or changing the SDK. Running an existing virtual device still writes
40
+ to that device's data. An incompatible running ADB server is reported without
41
+ stopping or restarting it.
42
+
43
+ If a private environment is needed, accept the Android SDK license and choose
44
+ **Download and prepare**. The plugin downloads fixed official Google archives for
45
+ Platform-Tools, Emulator and an Android 15 AOSP system image, checks their recorded
46
+ sizes and official checksums, and creates a private virtual device. SDK files,
47
+ Android preferences, emulator configuration, AVD data and controlled temporary files
48
+ use the selected private storage. Global environment variables and shell files are
49
+ not changed. The plugin does not install an application build toolchain or Java.
50
+ An explicitly configured SDK location in Settings takes precedence over the newly
51
+ prepared private environment.
52
+
53
+ Android preparation checks hardware virtualization before downloading. Windows
54
+ needs an enabled hypervisor, Linux needs accessible KVM, and macOS needs
55
+ Hypervisor.framework. Missing system support produces official setup guidance;
56
+ Ycodium does not elevate privileges, install drivers or enable Windows features.
57
+ The pinned emulator supports Windows x64, Linux x64 and macOS x64/arm64. Other
58
+ targets receive an unsupported-platform explanation.
59
+
60
+ The bundled iOS native helpers must load successfully on the machine. Missing or
61
+ incompatible helpers produce an explicit readiness error. For iOS, install and
62
+ initialize Xcode yourself using Apple's instructions. Ycodium
63
+ checks the selected full Xcode and first-launch status; it does not select,
64
+ initialize or upgrade Xcode. To add a simulator runtime, enter an exact iOS version
65
+ supported by that Xcode, read the storage estimate, accept the applicable agreement
66
+ and confirm installation into Apple's shared simulator environment. Ycodium uses
67
+ Apple's `xcodebuild -downloadPlatform` export and `-importPlatform` mechanism.
68
+ Download archives are private; installed runtimes are managed by Apple and shared
69
+ with other applications. Existing runtimes are retained. Apple determines the
70
+ actual download size and can require additional space or user action in Xcode.
71
+
72
+ Preparation continues if the panel closes. Open the panel again to read its current
73
+ progress. After completion, refresh the device list and open the simulator to check
74
+ its actual startup on the machine.
75
+
76
+ ## Cleanup and retention
77
+
78
+ Disabling or removing the plugin preserves environments and data. The preparation
79
+ panel shows separate sizes and cleanup actions for private download cache and
80
+ Android virtual device data. Deleting a private virtual device requires a separate
81
+ confirmation because its installed apps and data are permanently removed. Power it
82
+ off first; cleanup refuses active device lock files. The SDK is retained so a
83
+ private device can be recreated without downloading the components again.
84
+
85
+ Cleanup never removes external SDKs, external virtual devices or Apple shared
86
+ simulator runtimes. Manage Apple's runtimes in Xcode. Each private directory has an
87
+ ownership record; the plugin refuses to claim a nonempty unrelated directory.
36
88
 
37
89
  ## Agent tools
38
90
 
39
- On MCP the tools are prefixed with the plugin id (`devices_device_list`, …).
91
+ `device_list`, `device_open`, `device_screenshot` and `device_close` are exposed
92
+ through the plugin toolkit. MCP prefixes them with `devices_`.
40
93
 
41
- - **device_list** lists simulators and emulators with their state.
42
- - **device_open** boots a device if needed and returns the `agent-device`
43
- command to drive it: the launcher's absolute path plus `--config <file>
44
- --session <id>`, which pin the command to this device and this conversation.
45
- On Windows the launcher is a `.cmd` file, elsewhere a shell script.
46
- - **device_screenshot** returns the current screen as a PNG image.
47
- - **device_close** closes one device or every device in the conversation, and
48
- can also power it off.
94
+ `device_open` returns a launcher path and `--config` / `--session` arguments pinned
95
+ to the chosen device and conversation. Use that command for tapping, typing,
96
+ installing existing APKs and reading logs. The launcher uses the same managed Node
97
+ and SDK environment as the hub. It rejects device operations without the returned
98
+ configuration and session arguments.
49
99
 
50
- Tapping, typing, installing apps and reading logs all go through the
51
- `agent-device` command line rather than more MCP tools. It carries its own
52
- semantic snapshots and versions, and forwarding its dozens of tools would weigh
53
- down every conversation's tool list.
100
+ ## Settings and updates
54
101
 
55
- ## Settings card
102
+ **Android SDK location** overrides automatic detection. **Check tool versions**
103
+ reads the bundled and running helper versions. **Verify bundled tools** checks the
104
+ pinned components without downloading or starting anything. Missing or incomplete
105
+ helper artifacts require repairing or updating Ycodium on that machine.
56
106
 
57
- - **Android SDK location**: leave it empty to use `ANDROID_HOME` or Android
58
- Studio's default location.
59
- - **Check tool versions** reads the installed and running versions without
60
- installing or starting anything.
61
- - **Install or update tools** installs the pinned versions. Running tools switch
62
- over the next time they start.
107
+ ## Requirements and verification limits
63
108
 
64
- ## Tool updates
109
+ A Ycodium host supporting `host:node`, plugin network services and the plugin UI is
110
+ required. Preparing Android components needs outbound HTTPS to Google's official
111
+ download service. Preparing iOS runtimes requires macOS, initialized Xcode and
112
+ access to Apple's component service.
65
113
 
66
- Each plugin version pins one version of `expo-device-hub` and one of
67
- `agent-device`; the plugin never follows the registry's latest release. When a
68
- newer plugin pins newer tools, they install automatically the next time a device
69
- is used, and the panel shows "Updating Device hub from 0.11.0 to 0.12.0…".
70
- Installing needs network access. The plugin never falls back to an older install
71
- it finds on disk: if the required version cannot be installed, the panel shows
72
- the failure with a Retry button, and the installed files stay as they were.
114
+ Private archive extraction, integrity failures, directory ownership, retention,
115
+ cleanup, ADB coexistence and Apple command selection have isolated automated
116
+ coverage. A successful component check does not prove a virtual device boots.
117
+ Actual Android startup, iOS installation/startup on macOS, screen streaming over
118
+ Relay and the mobile application require their respective machines and integration
119
+ checks.
73
120
 
74
- The panel's **Tool versions** popover shows the required, installed and running
75
- version of each tool. **Check versions** only reads the install directory and
76
- installs or starts nothing; **Update to …** appears when the required version is
77
- missing and installs it without starting anything. After a tool starts, older
78
- installs are removed, keeping the previous one and any install a running process
79
- still uses.
121
+ ## Developing
80
122
 
81
- ## Requirements
123
+ Run `vp run test`, `vp run typecheck` and `vp run build` from this package. Update the
124
+ runtime lock together with helper version pins and verify the hub route allowlist
125
+ when changing helper versions. Runtime artifacts retain dependency licenses and
126
+ include an inventory of delivered files.
82
127
 
83
- A Ycodium server with plugin API version 3, including `process.spawn` for
84
- `host:node` (at most eight processes at once) and `network.serve` for the `hub`
85
- service. The first install needs outbound HTTPS to `registry.npmjs.org`.
86
-
87
- To move to another tool version, change `DEVICE_HUB_VERSION` or
88
- `AGENT_DEVICE_VERSION` in `src/toolchain.ts` and check the `hub` route allowlist
89
- in `package.json` against the new hub, since the allowlist and the screen
90
- protocol are written for the pinned versions.
91
-
92
- ## Not yet verified on real hardware
93
-
94
- The plugin is covered by unit tests with fake processes and a fake hub. The
95
- following have not been run end to end yet: Android Emulators, iOS Simulators,
96
- screen streaming over Relay, and the mobile app.
97
-
98
- ## Install
99
-
100
- Bundled with Ycodium and off by default. Turn it on under Settings → Plugins.
101
-
102
- Third-party license notices for `expo-device-hub` and `agent-device` are in the
103
- repository's `THIRD_PARTY_NOTICES.md`.
128
+ Third-party notices are included in Ycodium's `THIRD_PARTY_NOTICES.md` and the
129
+ delivered dependency artifacts. This first-party package is `UNLICENSED`.