Manuscript Offprint

arXiv:2611.08321

ControlAnything: Generative UI and On-Demand Device Integration for Mixed-Reality Hand Interaction by a Coding Agent

Bektur Ryskeldiev

ABSTRACT

Connecting hand input in mixed reality (MR) to a nearby physical device typically requires an integration written in advance for that device, its transport and the mapping. ControlAnything defers this integration to the moment of use and assigns it to a coding agent. On a Meta Quest 3, the wearer selects an object outlined by SAM 3.1 and states what their hands should control. An agent built on Meta's Muse Spark model then writes a connector program on the wearer's laptop, tests it against the live device through hand-written MIDI, Bluetooth and key-press transports, and returns augmented-reality (AR) controls, a per-frame hand program, or both. These outputs are a form of generative UI, interfaces created by an AI model; here, the agent also generates and tests the code that binds the interface to a physical device. In a single-session technical evaluation with the author as the only wearer, nine of ten requests addressing five targets reached a ready state, and the wearer stopped one. The median time to ready was 32.5 s (range 24.9–57.8 s, excluding speech transcription); sequential model calls accounted for a median of 89.9% of this time, and 91.7% of input tokens came from the prompt cache. The system's evidence of success extends to transport acknowledgements but not to physical effects. These findings point to connector reuse and the observation of effects through the headset's own sensors as next steps for on-demand device integration in MR. A user study with first-time wearers is planned.

Keywords mixed reality · generative user interfaces · coding agents · hand interaction · device integration · WebXR · large language models

Code and video: https://github.com/Apolotary/controlanything (MIT license).

1 Introduction

Mixed-reality (MR) headsets track the wearer's head and hands continuously, and a long line of research has used computer-augmented views to interact with physical devices [1–3]. Each connection between hand input and a device, however, requires an integration specific to the device, its transport and the intended mapping: a synthesizer receives MIDI over USB, a phone gimbal accepts commands over a vendor Bluetooth protocol, and a video feed in a web browser responds to key presses. Toolkits, trigger-action platforms and recent MR systems that generate control panels lower this cost for devices that are already integrated or described in a machine-readable form [4–7]. Many everyday devices are neither, and a developer still writes their integration ahead of time.

We explore an alternative in which a coding agent writes the integration at the moment of use, in response to the wearer's request. Agents based on large language models (LLMs) write, execute and repair programs using feedback from tools [8–10], and recent systems apply them to device integration during development [11, 12]. Inside an MR interaction loop, however, the program must connect a device that the wearer has just selected, while the wearer waits to use its output.

A PREPRINT

Figure

(a) Tagged laptop

Figure

(b) Agent code card

Figure

(c) Touch on the visual synthesizer

(d) Reels hand program and buttons

(e) OP-1 filter controls

(f) Gimbal hand program

Figure 1: ControlAnything on a Meta Quest 3, in frames from the headset's system recordings of the evaluation session. (a) SAM 3.1 outline and tag of the laptop; all ten requests addressed this tag. (b) A code card streams the agent's commands and files while it writes a connector (R1). (c) A fingertip on the laptop screen ripples the visual synthesizer through a generated hand program (R1). (d) Instagram Reels in Chrome scrolled by a generated hand program, with generated Prev and Like buttons (R3). (e) Generated knobs and keys for the filter of an OP-1 Field synthesizer (R4). (f) A DJI Osmo Mobile 4 gimbal steered by finger (R7). Run labels refer to Table 1.

ControlAnything implements this loop on a Meta Quest 3 (Fig. 1). The wearer tags an object outlined by SAM 3.1 and states a goal, such as "give me knobs for my OP1 filter connected to this Mac". An agent on the wearer's laptop, built on Meta's Muse Spark model, writes a connector, a small Node program that declares named actions such as cutoff and translates them into device messages. The agent runs the connector, sends test values through it to the live device and reads the acknowledgements, log lines recording that the transport accepted each message. It then returns AR controls bound to the connector's actions, a hand program that the headset runs on every frame to map tracked hands to those actions, or both. No connector, control layout or hand mapping exists before the wearer asks. The transports, the paths from a connector to a device (Web MIDI, a Bluetooth bridge for a DJI gimbal and macOS key presses), are hand-written and documented in the agent's prompt.

These controls and hand programs are generative UI, interfaces created by AI models [13]. Generative UI systems produce web pages, malleable task interfaces and virtual scenes [14–16], and LLMs assemble AR control panels for devices whose integration already exists [6, 7]. ControlAnything applies generative UI to physical devices that lack such an integration: the agent generates the interface together with the code that connects it to the device, and the interface reaches the wearer only after that code is running and every binding has passed the server's checks.

This paper makes three contributions:

  • A generative UI loop for MR, in which selecting a real object and stating a goal yields a generated connector and generated controls or a hand program bound to it (§3).
  • An agent runtime for this loop, with a budgeted tool loop, a connector host that reports acknowledgements, checked and restricted hand programs, and a stop path independent of the model (§4).
  • A log-based technical evaluation of one session on a real Quest 3 with five targets over MIDI, Bluetooth and AppleScript, including where the time is spent and what evidence the loop obtains (§5); and a recorder for head and 25-joint hand poses.

In that session, nine of ten requests reached a ready state (median time to ready 32.5 s); a user study with first-time wearers is planned (§6).

References (38)