[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111597":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":32,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":15,"starSnapshotCount":15,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},111597,"controlanything","Apolotary\u002Fcontrolanything","Apolotary","Point at a device in WebXR. Ask Meta Muse to write its connector and generate spatial controls live. Quest 3 plus phone and webcam demos.",null,"TypeScript",67,31,52,3,0,1,9,45.92,"MIT License",false,"master",[23,24,25,26,27,28,29,30,31],"generative-ui","hackathon","hand-tracking","meta-ai","meta-quest","midi","spatial-computing","typescript","webxr","2026-11-04 23:44:25","2026-11-19 11:09:15","# ControlAnything\n\n**Pinch a device, ask Muse what your hands should do, and watch it write the connection.**\n\nPinch a device in your Quest 3 passthrough and ask what you want to do with it. A Muse agent on your laptop writes, tests and deploys the code that connects them, then hands you controls in AR: knobs, keys, pads or your bare hands.\n\nHow it works in one line: Meta **SAM 3.1** outlines the objects around you; you select one and ask (by voice or a suggestion); the **Muse agent** (Muse Spark with a real terminal, files and device tools on the Mac) writes a connector, runs it, tests it on the device and designs the AR instrument; you watch its code stream in AR and then play. It is meant for any device your laptop can reach (USB, MIDI, serial, Bluetooth or the network); nothing is device-specific. Demonstrated with the built-in visual synth, a third-party app (Instagram Reels in Chrome), a Teenage Engineering OP-1 Field over USB-MIDI and a DJI Osmo Mobile 4 over Bluetooth, plus a virtual pet and a hand-pose recorder for physical-AI data.\n\n\u003C!-- VIDEO_URL -->\n**▶ Demo video (2:11, filmed on a real Quest 3):** linked from the hackathon submission page.\n\n\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Fhero.png\" alt=\"ControlAnything: Ask. Muse wires it. Any device your laptop can reach. Buddy the mascot waves.\" width=\"720\">\u003C\u002Fp>\n\nBuilt for the **Meta Global AI Developer Hackathon** (Indie Developer track, *Push the Frontier*). The name nods to Meta's *Segment Anything*; this is an independent project, not a Meta product.\n\n## Run it in 3 commands (no headset, no key)\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002FApolotary\u002Fcontrolanything && cd controlanything\nnpm install\nnpm run demo:sim     # Node 22.12+ and Chrome; serves http:\u002F\u002Flocalhost:8787 with sound on\n```\n\nAfter `npm run demo:sim`, open `http:\u002F\u002Flocalhost:8787\u002Fsim\u002F` (the simulated room; it stands in for your Mac), then `http:\u002F\u002Flocalhost:8787\u002Fquest\u002F?emulate=1&camera=sim&mic=0` (the headset emulator) and choose **Enter AR**. Click the laptop's outline to tag it, press `M` for Control, click the laptop again to open its card, and choose **Give me knobs for this**. Without a key every model answer is a recorded or scripted replay, labelled **FIXTURE**. The full walk-through is the [judge path](#judge-path-no-hardware).\n\n**Full reviewer guide:** [docs\u002FQUICKSTART.md](docs\u002FQUICKSTART.md) · **For AI coding agents:** [docs\u002FAGENT-GUIDE.md](docs\u002FAGENT-GUIDE.md)\n\n**What to look for while it runs:**\n- The **LIVE \u002F FIXTURE \u002F TEMPLATE** badge on the AR code card says who wrote the code: a Meta model just now, a recorded replay, or a labelled template.\n- In a LIVE run the code card's header names the model (*muse-spark-1.3 is wiring \"…\"*), and so does the status line on the Mac companion (`\u002Fcompanion\u002F`). A FIXTURE run says *Recorded wiring* instead.\n- `\u002Fapi\u002Fmuse\u002Fcalls` lists every model call with its model id, latency and tokens (localhost or a paired device only).\n- `\u002Fapi\u002Fagent\u002Fconnectors` shows the connector Muse deployed: its process, entry file, actions and recent logs, plus which agent engine ran (localhost or the owner only).\n\n## The demos, and where each is verified\n\nIn the Nov 5 takes every request was made from the MacBook's card, naming the device by voice (\"…this OP-1 connected to my Mac\"); Muse wired the named device. Dates in this README are Japan time (JST), where the work was done. The deadline, Nov 4 9:00 PM ET, is Nov 5 11:00 JST, so every \"Nov 5\" below is before the deadline.\n\n| Demo | What happens | Verified |\n|---|---|---|\n| **1. Built-in visual synth** | Touch the water on the laptop's screen and ripples follow your fingertip; or ask for knobs. Muse writes the connector (MIDI CCs to the browser renderer) and the touch program; no setup step: your first touch on the glass finds the screen. | **Real Quest**, live Muse, recorded take (Nov 5): \"Touch the water with your finger\" written in 31.6 s as a hand program with no floating controls; the first touch found the screen and the ripples followed the fingertip. Also confirmed on Nov 4 (about 45 s). |\n| **2. A third-party app: Instagram Reels** | Swipe your right hand up or down to scroll Reels in Chrome. Muse writes a connector that opens Reels on the Mac and presses arrow keys in the front app. macOS needs Accessibility permission for the app running the server. | **Real Quest + real Mac**, live Muse, recorded take (Nov 5): \"Reels hand scroll\" in 54.5 s. Muse opened Reels in Chrome, tested the arrow keys (the reels changed), then hand flicks and its Next\u002FPrev\u002FLike buttons scrolled Reels. |\n| **3. OP-1 Field over USB-MIDI** | Ask for keys and knobs. Notes and CCs go from the AR controls through the Mac companion's Web MIDI to the synth. | **Real Quest + physical OP-1**, live Muse, recorded take (Nov 5): filter knobs plus an AR keyboard, and \"Play the OP-1 Field with fingers\" in 36.7 s; Muse's test notes were confirmed on the OP-1. Also Nov 4 with the earlier UI. |\n| **4. DJI Osmo Mobile 4 over Bluetooth** | Ask for pan and tilt. Muse writes a gimbal connector and a right-hand pan\u002Ftilt program; the bridge clamps speed and range. | **Real Quest + real OM 4**, live Muse, recorded take (Nov 5): \"Gimbal finger steering\" in 30.0 s; the gimbal acknowledged 881 moves from Muse's code (2 tests, 879 while the hand steered). Direct Bluetooth moves also verified on Nov 4. |\n| **5. Buddy, a virtual pet** | Wave, pet or high-five it; show it a real object (photo preview, then **Show Buddy**) or a virtual one. Muse Spark writes its reaction and Muse Image paints a sticker. | **Real Quest**, live models, recorded take (Nov 5): Muse Spark reactions in 5.1–5.7 s, Muse Image stickers in 7–13 s. Buddy's voice now plays from the headset (macOS speech rendered on the Mac, since Quest Browser has no speech engine). |\n| **6. Physical-AI recording** | Record passthrough video plus head and 25-joint hand poses at up to 30 Hz, review video and 3D hands side by side in **Motion lab**, and export a dataset. | **Real Quest**, recorded take (Nov 5): 111.6 s, 3,247 head + 25-joint hand frames at 30 Hz, synced with the Quest's own video recording. Also checked in the browser and emulator (record → Motion lab → dataset export). |\n\nAlso checked: the browser musical synth's **Air Theremin** on the **real Quest** with live Muse (Nov 4, about 37 s). On Nov 5 the generated AR controls were used on the real Quest: OP-1 knobs and keyboard, the gimbal's Aim orb and Recenter\u002FHold buttons, Reels Next\u002FPrev\u002FLike, and a water visualizer's knobs and XY pad. The camera and webcam pages below are browser-checked with synthetic video only, not on real phones or webcams.\n\nMuse tests connector actions and reports the acknowledgements. Those receipts show that the software and transport worked, not an independently observed physical effect. Separate measurements, not one continuous run: an earlier dial build on the real Quest had a p95 frame time of 12.3 ms (about 81 fps) and applied 100\u002F100 commands (Nov 4); live wiring probes reached ready in 8.1 s (*Touch the water*) and about 11 s (*Hands as knobs*). The Nov 5 recorded takes (in the demo video) cover the full ask → code → test → play route for all five demos on the real Quest. Checklist and evidence ledger: [docs\u002FDEMO-ACCEPTANCE.md](docs\u002FDEMO-ACCEPTANCE.md).\n\n## No headset? Use your camera\n\n- **`\u002Fquest\u002Fhands.html`** (also where `\u002Fquest\u002Freviewer.html` now goes) is the same golden path as the Quest, AR first, on a laptop webcam or a phone camera: **Start AR** → SAM 3.1 outlines in the camera view → tag an object (tap, or hold your hand over it) → **Control** → the same suggestions or a spoken ask → the Muse agent writes and tests the connector while its code streams beside the object → controls pinned to the object, or a hand program. Webcam hands come from classical computer vision (no AI model). Android Chrome uses native WebXR AR; iPhone Safari uses the full-screen camera and says so. Checked in headless Chrome with a fake camera and the sim room, not yet on real phones or webcams. See the [hands demo](docs\u002FHANDS-DEMO.md).\n- The earlier Buddy-first camera page stays at **`\u002Fquest\u002Freviewer.html?buddy=1`**: an animated Buddy with photo preview and retake, and touch-playable instruments Muse builds after **Connect demo → Ask Muse to build it**. See the [reviewer guide](docs\u002FREVIEWER-DEMO.md) for HTTPS, pairing and fixture labels.\n\n## The golden path\n\nControlAnything has two layers. **Annotate** looks at the room: SAM 3.1 outlines objects in passthrough, your hands are tracked, and a pinch tags (and keeps tracking) the object you mean. **Control** is where the **Muse agent** on your Mac writes the connection: you ask, Muse codes, tests and deploys the glue, and the controls appear in AR.\n\n1. **Enter AR and tag an object.** Annotate is the default. Pick **Electronics \u002F Objects \u002F All** in the wrist menu (raise a flat left palm). Pinch an outline to tag it; you stay in Annotate. A **Now** panel beside the wrist menu shows the layer, the object, the devices, what Muse is doing and the next step.\n2. **Choose Control.** The selected object's card asks what you want. If it needs a companion (a USB-MIDI synth needs the Mac), the card says so and offers **Connect Mac**: look at the QR code on the Mac app with the headset, then plug the device into the Mac. There is no Set up \u002F Enable ceremony first.\n3. **Ask Muse.** Tap a suggestion or hold the mic and say it: *\"Give me knobs for the filter\"*, *\"Play it with my hands\"*, *\"Write a controller for the visual synth\"*, *\"Touch the water\"*.\n4. **Watch Muse work.** The Muse agent (Muse Spark with real tools) looks at the snapshot of the object, uses a terminal on the Mac, writes a connector program, starts it as a background service, sends test values to the real device and reads the acknowledgements, fixes what fails, and keeps notes for next time. Its terminal and code stream into a card beside the device; the Mac speaks its progress lines.\n5. **Use the controls it made.** Generated **AR keys, pads, XY surfaces and colored controls** appear between you and the device: pinch a knob and twist it like a real one, or pinch and drag up\u002Fdown. If you asked for hand control, Muse's hand program runs in a sandboxed Worker on the headset (screen-touch programs need no setup: your first touch on the screen finds it).\n6. **Stop.** Both palms out stops the current controls and shuts the connector down; ask again for something new. **Stop all** in the wrist menu stops everything; hold **Exit** to leave AR.\n\n### The Muse agent (a coding agent on the Mac)\n\n`apps\u002Fserver\u002Fsrc\u002Fagent\u002Fmuse-agent.ts` is a Hermes-style agent loop on the Meta Model API (`muse-spark-1.3`, function calling, streamed). Its tools:\n\n| Tool | What it does |\n|---|---|\n| `bash` | Runs shell commands in its workspace on the Mac (inspect, `npm install`, run scripts and tests). Obvious system-level\u002Fdestructive commands are filtered; the process still has the Mac user’s OS permissions. |\n| `read_file` \u002F `write_file` \u002F `edit_file` | Reads the workspace and this repo; writes only inside the workspace. Files stream into AR as they are written. |\n| `deploy_connector` | Starts `node \u003Centry>` as a background service for the selected device and declares the actions it accepts. A crash on start comes back with its stack trace. |\n| `test_action` | Sends a value to the running connector, exactly as an AR control would, and returns the connector's log plus the device acknowledgements from the Mac companion. |\n| `open_visuals` | Opens the visual synth on the paired Mac. |\n| `say` | One progress line for the wearer (shown in AR, spoken by macOS speech). |\n| `finish` | Hands over AR controls bound to connector actions, and\u002For a hand program; the server validates and dry-runs the program and sends back any issues to fix. |\n\nThe workspace (`apps\u002Fserver\u002F.data\u002Fmuse-agent\u002F`) persists: `connectors\u002F\u003Cdevice>\u002Findex.mjs`, `NOTES.md` (its memory), and `ce.mjs`, the small runtime a connector imports (`onSet`, `onTrigger`, `onStop`, `midi.cc\u002Fnote\u002Fprogram`, `gimbal.*`, `mac.open\u002Fkey`, `log`). MIDI goes out through the paired Mac companion's Web MIDI (USB synths, plus the built-in visual and musical synths); the gimbal goes through the Osmo bridge; anything else (HTTP to a lamp, `say`, a serial port) the connector does itself in Node. Owner\u002Flocalhost status: `GET \u002Fapi\u002Fagent\u002Fconnectors`. Limits: 24 turns, 40 tool calls, 5 minutes per request. Without an API key the same tools replay a scripted **FIXTURE** run.\n\n**Muse Code engine (opt-in).** With `CE_AGENT_ENGINE=muse-code`, Meta's **Muse Code** CLI (`muse exec`, Meta provider, `muse-spark-1.3`) runs the whole agent loop with its own shell and file tools. It reaches the device tools above (`say`, `open_visuals`, `deploy_connector`, `test_action`, `finish`) through a loopback MCP server with a per-run token, so they get the same checks; its commands and files stream into the same AR code card. It is opt-in: the default is the built-in loop, which also runs instead with no key, no Muse Code binary, or in fixture mode; `\u002Fapi\u002Fagent\u002Fconnectors` reports which engine ran. Verified live in the emulator on Nov 5: every model call was `muse-spark-1.3` and the ask reached working knobs in about 30 s (the [evidence frames](docs\u002Fevidence\u002FREADME.md) and the hero image come from that run). Other runs took 38–73 s.\n\n**Older harness.** `CE_AGENT=0` restores the earlier bounded wiring harness and setup flow. It labels each check: **seen ✓** (the headset camera saw the change: before\u002Fafter frames inside the outline, no model), **renderer ✓** (the Mac's renderer reports what it applied), **acknowledged ✓** (only the executor's acknowledgement) and **not seen ✗** (failed; that control stays locked). In the emulator the camera usually does not see the Mac's screen change, so those passes say *renderer ✓* or *acknowledged ✓*.\n\n## Meta model calls vs. OS and browser features\n\n**Every AI model this project calls at runtime is a Meta model**, called through Meta's Model API. The application does not call or bundle a non-Meta model. Platform tracking and system voices are described separately below. A FIXTURE run (no key) calls no model and says so on every card; a LIVE run calls the models below and logs each call at `\u002Fapi\u002Fmuse\u002Fcalls`.\n\n| Meta model | What it does here |\n|---|---|\n| **SAM 3.1** (`sam-3.1`) | Finds and outlines the devices and objects in passthrough frames: every box you see comes from it. During verification it finds the same outline again on the before and after frames. |\n| **Muse Spark** (`muse-spark-1.3`) | Drives the **Muse agent**: with terminal, file, deploy and test tools it writes, runs and fixes the connector for the selected device and generates its AR controls and hand program. Identifies the pinched device from a crop and the whole frame. Writes the Muse buddy’s reactions to real camera photos and explicitly shared virtual objects. In the older `CE_AGENT=0` flow it also writes the driver from the device's capability manifest or MIDI chart and the per-request wiring program, with repair when checks fail. |\n| **Muse Code** (Meta's coding-agent CLI, running `muse-spark-1.3`) | Opt-in agent engine (`CE_AGENT_ENGINE=muse-code`) that runs the whole agent loop and calls the device tools over MCP; see [the Muse agent](#the-muse-agent-a-coding-agent-on-the-mac). Live in the emulator on Nov 5, all calls `muse-spark-1.3`. Also runs the separate Connector Workshop (`\u002Fcompanion\u002Fcoding\u002F`). |\n| **Muse Wonder** (`muse-wonder-1.0`) | Not called on the default Muse-agent path. A guarded fallback for driver and wiring generation in the older `CE_AGENT=0` flow; only count Wonder as used when a call actually occurred. |\n| **Muse Image** (`muse-image-1.0`) | Paints the buddy's stickers. Optionally paints a device-inspired panel texture, which never delays the controls. |\n| **Muse Voice Transcribe** (`muse-voice-transcribe-1.0`) | Transcribes the device card’s hold-to-talk wiring request, plus the older lab assistant and spoken verification clips. |\n\nThese parts are OS or browser features, or plain code. None of them is an AI model call:\n\n| Part | What it actually is |\n|---|---|\n| Hand and head tracking | Quest OS hand tracking, read through the WebXR Hand Input API. We read the joint poses and run no hand model of our own. |\n| Hand\u002Fscreen signals and UI gestures | Deterministic geometry on WebXR joints, with smoothing and a screen plane placed from the detected screen and fixed by the first touch. Muse’s generated program decides how these signals drive the selected device. |\n| Webcam hand tracking (`\u002Fquest\u002Fhands.html`) | Classical computer vision in a Worker (skin colour, motion, background learning, blobs); no model is loaded or called. |\n| An object you hold as a controller | Follows the hand that holds it (WebXR joints). SAM 3.1 finds it first. |\n| Camera verification (*seen ✓*) | Deterministic before\u002Fafter frame comparison inside the SAM 3.1 outline. |\n| Passthrough frames | Quest Browser camera access (`getUserMedia`). |\n| The Mac visual synth | A WebGL shader with procedural Web Audio splash, wake and hover sounds in Chrome. |\n| The Mac musical synth | An authored Web Audio instrument in Chrome; sound requires an explicit Mac click. Muse writes its hand wiring, not the oscillator\u002Feffect engine. |\n| App voices, reactions and UI sounds | Browser `speechSynthesis`, macOS OS speech, and procedural Web Audio tones\u002Fnoise; no non-Meta AI voice model. Shared master volume\u002Fmute applies across Quest and Mac. |\n| Mac speech, key presses and music actions | macOS speech and AppleScript (System Events key presses, which need Accessibility permission, and Music): OS features. Live startup leaves `CE_MAC_SILENT` unset; explicit muted automation can still use it. |\n| iPhone spoken replies | The iOS system voice (`AVSpeechSynthesizer`). |\n| Device links | Web MIDI, Web Serial and Web Bluetooth (browser), bleak (Bluetooth LE), stored IR codes. |\n| QR pairing | jsQR decoding (not a model). |\n\n## What Muse writes, and where it runs\n\n| Artifact | Generated from | Checked and executed where |\n|---|---|---|\n| **Connector** (Muse agent) | The wearer’s request, the object snapshot, the Mac’s MIDI ports and the instrument manifests | A Node program in the agent workspace, run as a background process on the Mac and tested by the agent against the device. It sends MIDI through the paired companion’s Web MIDI. Stopped on Stop \u002F Stop all \u002F a new ask. |\n| **AR controls** (Muse agent) | The connector’s declared actions and the request | A validated 3D instrument specification with keys, pads, XY surfaces, knobs, buttons or toggles, drawn beside the device; each change is a `wire:\u003Caction>` control event to the connector. |\n| **Driver** | The instrument’s capability manifest or reviewed device\u002FMIDI data | Declarative operations validated on the server against supported transports, action IDs, CCs and ranges. Executors send those operations; driver JSON is not arbitrary executable code. |\n| **Wiring program** | The wearer’s current request, available hand\u002Fscreen signals and verified driver actions | Up to 4KB of JavaScript, validated and dry-run in a restricted `node:vm` context on the server. The accepted program runs every frame in a restricted **Web Worker on the Quest**. It never runs in the Mac companion. |\n| **Labels\u002Finterface description** | Device actions and the request | Bound to validated actions and rendered in the app’s established AR layout. The current demo does not generate arbitrary 3D scene code. |\n\nThe wiring API is `wire(s, out, mem)`: read hand\u002Fscreen signals, call `out.set(actionId, value)` or `out.trigger(actionId)`, and retain small state in `mem`. The runtime restricts actions, clamps values, rate-limits outputs and stops on repeated errors or a watchdog timeout. The server independently checks active wiring, arming and verification before dispatch. These are prototype guardrails, not a general-purpose untrusted-code platform.\n\nLive generation is the normal keyed route; if Muse cannot finish checked code, the run fails visibly and no template is installed. Older experimental paths can show a **Template**, labelled *no Meta model wrote this*. No-key runs are **FIXTURE**, including scripted tool calls and chunked code playback. Driver-library reuse is labelled separately and does not mean the wiring was newly generated. Every new request asks for a new program; an old hand mapping is never silently restored.\n\nAfter Muse finishes, each hand frame needs **no model call**: worker output → `control.event` (`wire:\u003CactionId>`) → validated driver → Mac executor\u002Frenderer. See [architecture](docs\u002FARCHITECTURE.md) for the protocol and limits.\n\n## Demo details\n\n- **Musical synth (optional).** *More → Demo: music synth* opens **ControlAnything Synth** on the paired Mac: an authored Web Audio engine (two octaves of C minor, filter, envelope, delay, three presets) with no built-in hand preset. Muse writes the note and parameter mapping after you ask. Both palms, **Stop all**, closing the panel or disconnecting release its notes. It sends no physical MIDI.\n- **Instagram Reels.** Tag the laptop in Control and choose **Swipe my hand to scroll Instagram Reels**. The connector opens `instagram.com\u002Freels` in Google Chrome on the Mac and presses the down\u002Fup arrow for each deliberate swipe. Allow Accessibility for the app running the server (System Settings → Privacy & Security → Accessibility); without it the connector says so instead of retrying.\n- **DJI Osmo gimbal.** A Bluetooth adapter for the Osmo Mobile: DUML framing, a safety envelope (≤ 90°\u002Fs, pan ±120°, tilt ±45°) and three links (`CE_OSMO=ble` via a small bleak helper, `web` via Chrome Web Bluetooth, `mock`). For the live demo, start with `CE_OSMO=web` and choose **Connect gimbal** on the Osmo link page on port 8799. Muse's connectors call `gimbal.pan\u002Ftilt\u002Frecenter`. The OM 4's USB-C port is power only. See the [hardware demo](docs\u002FHARDWARE-DEMO.md).\n- **Muse buddy.** *Wrist menu → More → Buddy.* An animated desk companion waves, responds to touch and high fives, and reacts to real or virtual objects. Capture previews the exact photo; Show Buddy sends it, while Retake discards it locally. There are no quests or scores.\n- **Hand and head pose recording.** On the Quest it is under `?lab=1`; in the emulator it is in the side panel. Review a take in **Motion lab** (`\u002Fcompanion\u002Ftracking\u002F`): video and 3D hands on one timeline, tracking gaps, *Export dataset* for physical-AI training data. See [tracking review](docs\u002FTRACKING-REVIEW.md).\n- **Physical objects as controllers.** Once a device is armed, choose *Use an object* and pick a mug or bottle. SAM 3.1 finds it; once you pick it up it follows the hand that holds it (WebXR joints, One Euro filter). This is an earlier deterministic controller mode, outside the Muse-agent demo.\n- **Other hardware.** The IR ceiling-light path through an M5Stack Cardputer still needs physical acceptance. Native iPhone, DevTerm and Cardputer clients pair by QR code or passcode; their device acceptance is separate from the browser demos.\n\n## Judge path (no hardware)\n\nNeeds **Node 22.12+** and **Chrome**. No API key: without one, the server replays recorded real responses, labelled **FIXTURE**.\n\n```sh\nnpm install\nnpm run demo:sim            # builds what's missing; attended demo with sound on :8787\n```\n\nAfter `npm run demo:sim`:\n\n1. Open `http:\u002F\u002Flocalhost:8787\u002Fsim\u002F` first. The sim room stands in for your Mac: it pairs itself on localhost, and the laptop on its desk runs the visual synth.\n2. Open `http:\u002F\u002Flocalhost:8787\u002Fquest\u002F?emulate=1&camera=sim&mic=0` (the desktop Quest emulator) and choose **Enter AR**. Click = pinch, right-drag = look, W\u002FA\u002FD\u002FQ\u002FE = move.\n3. **Click the laptop’s box** to tag it, press `M` (or use the wrist menu) for **Control**, then choose **Give me knobs for this** on the device card. The scripted FIXTURE agent writes a visual-synth connector and returns knobs. Skip **Swipe my hand to scroll Instagram Reels** unless you want it: it is not simulated, it opens Instagram in Google Chrome and presses keys on the Mac that runs the server.\n4. Pinch (click) a generated knob and drag it; each change goes to the visual synth on the sim laptop. For the touch route, choose **More → Demo: visual synth**, ask *Touch the water* and touch the screen (the first touch finds it); ordinary mouse clicks are UI pinches, not screen contact, so the automated check below supplies fingertip poses. **Stop** is on the wrist palette or the `X` key. Keys: `G` Visual synth, `1\u002F2\u002F3` Electronics\u002FObjects\u002FAll (Annotate only), `B` Buddy.\n\n`\u002Fcompanion\u002F` is the real Mac app; open it in another tab to watch the code and status there. The agent's steps and evidence are at `\u002Fapi\u002Fagent\u002Fsteps` and `\u002Fapi\u002Fagent\u002Ftargets`.\n\n- **Evidence without a headset:** [docs\u002Fevidence\u002F](docs\u002Fevidence\u002FREADME.md) has frames from a live Muse Code run in the emulator, what was verified on the real Quest on Nov 4, the Nov 5 live runs, and how to read `\u002Fapi\u002Fmuse\u002Fcalls`.\n\n**Automated check** (installed Chrome; its own muted fixture server, own data dir):\n\n```sh\nnpm run build                         # only while no live AR session is using dist\nnode scripts\u002Fe2e-muse-agent.mjs        # Muse agent golden path: tag -> Control -> ask -> knobs -> MIDI -> Stop\nPORT=8796 node scripts\u002Fe2e-judge.mjs   # older setup-first water flow (CE_AGENT=0)\nCE_AGENT=0 node --import tsx apps\u002Fserver\u002Fscripts\u002Fwire-e2e.ts  # fixture WIRE over WebSocket (older setup-first flow)\n```\n\nFor unattended playback, use `npm run demo:sim -- --mute`; attended demos keep sound on after a browser gesture. These checks use server fixture detections. They do not measure detector accuracy, headset frame rate or the real Mac display.\n\n## Run it with hardware\n\n1. **Mac:** put `MODEL_API_KEY` in `.env` for live Meta models; the key stays on the server, which strips secret values from everything it sends to clients. Build before opening the app, then run `CE_DEMO=1 npm start` with `CE_MAC_SILENT` unset (add `CE_OSMO=web` for the gimbal, `CE_AGENT_ENGINE=muse-code` for the Muse Code engine). HTTP serves on :8787 and HTTPS on :8443. The first click\u002FEnter AR unlocks browser audio; a shared visible volume\u002Fmute controls the demo.\n2. **Quest 3** (developer mode, USB-C): `sh scripts\u002Fquest-grant-camera.sh` grants camera access and sets up `adb reverse`. In Quest Browser, open `http:\u002F\u002Flocalhost:8787\u002Fquest\u002F` and choose **Enter AR**. Over the LAN, use `https:\u002F\u002F\u003Cmac-ip>:8443\u002Fquest\u002F` and accept the development certificate.\n3. **Companion:** open `http:\u002F\u002Flocalhost:8787\u002Fcompanion\u002F` in its own Chrome window, full screen. Look at its QR code from the headset.\n4. **Tag, choose Control, then ask Muse.** Plug USB-MIDI devices into the Mac and click **Allow USB MIDI** on the companion once. Select the object in Control, choose a suggestion or hold-to-talk, and watch Muse write and test the connector; then use the AR knobs or your hands. For the water demo, ask the laptop for the visual synth (or choose **More → Demo: visual synth**). For Reels, allow Accessibility first (see [Demo details](#demo-details)).\n\nWhile a live session is open, rebuild with `scripts\u002Fdeploy-live.sh quest` (or `companion` \u002F `sim`), which preserves old chunks. Reload the single Quest tab only after leaving AR; `scripts\u002Fquest-reload.mjs` avoids opening a duplicate camera-owning tab.\n\nChecklist and recording guide: [docs\u002FDEMO-ACCEPTANCE.md](docs\u002FDEMO-ACCEPTANCE.md). OP-1 and gimbal procedure: [docs\u002FHARDWARE-DEMO.md](docs\u002FHARDWARE-DEMO.md). Per-app notes:\n- [server and pairing API](apps\u002Fserver\u002FREADME.md)\n- [Mac companion](apps\u002Fcompanion\u002FREADME.md)\n- [sim room](apps\u002Fsim\u002FREADME.md)\n- [DevTerm](apps\u002Fdevterm\u002FREADME.md)\n- [Cardputer firmware](firmware\u002Fcardputer\u002FREADME.md)\n- the iPhone project, `apps\u002Fiphone\u002F` (iOS 17+)\n\nUse your own devices on a trusted network; this is not for safety-critical equipment.\n\nDevelopment: `npm run typecheck`, `npm test`, `npm run build`.\n\n## Architecture\n\nQuest (WebXR, three.js) ⇄ WebSocket hub ⇄ one Node server on the Mac (Meta model adapters, agent, oracles, forge) ⇄ executors (Mac companion, sim, Cardputer, iPhone, DevTerm, Osmo bridge). The protocol, the agent state machine, the oracles and the generated-controls format are described in **[docs\u002FARCHITECTURE.md](docs\u002FARCHITECTURE.md)**.\n\n## Built during the hackathon\n\nThe application code, clients, firmware, prompts, device data and simulated room were built during the Meta Global AI Developer Hackathon, **Oct 26 – Nov 4, 2026 (ET)**, for submission by Nov 5, 11:00 JST. The hardware, the pretrained models and the third-party libraries and assets below were not built by us. The DJI Osmo gimbal adapter (`apps\u002Fserver\u002Fsrc\u002Fdevices\u002Fosmo\u002F`) is new code written during the hackathon; it draws on public protocol research (below) and on the author's own earlier, private notes on the gimbal's Bluetooth protocol (March 2026, documentation only), from which no code is included.\n\n## Credits and licences\n\nRepository code: **MIT** ([LICENSE](LICENSE)). Versions and transitive dependencies are listed in `package-lock.json`. Full copied notices, their scope and regeneration instructions are in [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).\n\n- **Meta:** the Quest 3 and its passthrough camera. SAM 3.1 and the Muse models via the Meta Model API. **@iwsdk\u002Fxr-input** (Immersive Web SDK input; owns all pointing, poke and pinch): MIT, © Meta Platforms, Inc. and affiliates. Hand and controller meshes from **@webxr-input-profiles\u002Fassets** (MIT, © Amazon; [notice](apps\u002Fquest\u002Fpublic\u002Fxr-profiles\u002FLICENSE.md)). **@meta-sam\u002Fparser**: Meta's package licence.\n- **In-headset UI:** **@pmndrs\u002Fuikit**, **@pmndrs\u002Fuikit-horizon** (pmndrs' Horizon kit, after Meta's Reality Labs design system), **@pmndrs\u002Fuikit-lucide** and **@pmndrs\u002Fpointer-events**: MIT, © Bela Bohlender \u002F pmndrs. **Lucide** icons: ISC.\n- **Ideas, no code copied:**\n  - Google **XR Blocks** ([google\u002Fxrblocks](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxrblocks), Apache-2.0; Li et al., arXiv:2509.25504): glass panel colours, lazy-follow and appear timings, touch rules.\n  - **NVIDIA XR AI** ([NVIDIA\u002Fxr-ai](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fxr-ai)): the agent response contract (acknowledge after a delay, stream replies).\n  - Our arc dials, setup ring, device card and hand rings are our own code.\n- **DJI Osmo protocol references, no code copied:**\n  - [alkersan\u002Fom-research](https:\u002F\u002Fgithub.com\u002Falkersan\u002Fom-research) (MIT);\n  - the DUML dissectors in [o-gs\u002Fdji-firmware-tools](https:\u002F\u002Fgithub.com\u002Fo-gs\u002Fdji-firmware-tools) (GPL-3.0, reference only).\n  The optional Bluetooth helper runs **bleak** (MIT) through `uv`. DJI and Osmo are trademarks of SZ DJI Technology; not affiliated.\n- **Fonts:** **SIL OFL-1.1**. Inter, Chakra Petch and Share Tech Mono come via **@fontsource**. The Quest also bundles JetBrains Mono and an Inter derivative for tabular numerals ([font notice](apps\u002Fquest\u002Fpublic\u002Ffonts\u002FREADME.txt)).\n- **Libraries:**\n  - **three**, **troika-three-text**, **zod**, **express**, **ws**, **selfsigned**, **qrcode**, Vite, IWER and @iwer\u002Fdevui: MIT.\n  - **jpeg-js**: BSD-3-Clause. **jsqr**: Apache-2.0.\n  - DevTerm: Project Nayuki's QR generator (MIT).\n  - Firmware: M5Unified, M5GFX, M5Cardputer and ArduinoJson (MIT); Arduino-ESP32 and IRremoteESP8266 (LGPL-2.1).\n- **Device data:** midi.guide \u002F pencilresearch MIDI data (CC-BY-SA-4.0), Flipper-IRDB (CC0) and SmartIR (MIT). Manufacturer facts are transcribed; manuals are not reproduced. [Sources](apps\u002Fserver\u002Fdata\u002Fdevices\u002FREADME.md).\n- **Sim room:** our own procedural Blender scene, with no third-party scene assets.\n\nModel and product names are descriptive. This project is not affiliated with or endorsed by Meta, DJI, Teenage Engineering or Apple.\n","ControlAnything 是一个基于 WebXR 的空间控制生成系统，支持用户在 Quest 3 等设备中通过手势指向物理设备，并由 AI 代理（Muse）实时生成连接代码与空间化交互界面。其核心结合 SAM 3.1 物体分割、手部追踪、多模态指令理解（语音\u002F文本）及本地终端执行能力，可对接 USB\u002FMIDI\u002F蓝牙\u002F网络设备，自动生成并部署连接器，再在 AR 中渲染 knobs、pads 或手势控件。适用于快速原型开发、AI 编程教学演示、跨设备空间交互实验等场景，无需预定义设备驱动。",2,"2026-11-24 04:41:17","CREATED_QUERY"]