Troupeby AliveDocsSign in

Reference

Runtime protocol reference

Every procedure of the open runtime contract, generated from the descriptors in @alivelabs/troupe-protocol (packages/protocol). The local runtime serves them over REST, RPC and MCP; Troupe Cloud serves the same contract.

Groups

67 procedures in 15 groups; 32 are MCP tools.

GroupPurposeProceduresMCP tools
runtimeDiscovery, health and administration of the runtime itself.70
pairingsBrowser access to a local runtime through origin-bound pairing.40
catalogWhat can be requested: device types and OS versions per platform.22
sessionsDevice acquisition: a session holds one device until it is released or expires.76
appsInstall and lifecycle of apps on a session's device.86
uiThe accessibility tree, resolved on the device: snapshots, queries and waits.44
inputActions. Locator and ref targets auto-wait on the runtime side.1411
systemDevice settings: location, appearance, the clipboard and the status bar.50
mediaScreenshots and screen recordings.31
logsDevice, app and driver logs, and crash reports.32
debugThe JavaScript runtime of a React Native debug build, through its dev server (Metro): connect, and evaluate code. Experimental and local only.20
streamsTickets for the live video and input stream (/v1/stream).10
tracesTrace chunks the runtime records for the test framework.20
filesDownloads of files returned as a FileRef.10
runsTest-run reports a runner publishes and clients follow.40

Also: shared schemas, scopes, errors.

Reading a procedure

  • REST is /v1/<group>/<operation-kebab>: GET with query parameters when the procedure is read-only and its input is flat, otherwise POST with a JSON body. RPC is /rpc/v2/<group>/<operation>. Send Authorization: Bearer <token> and Troupe-Contract: 1.0.
  • MCP: the tool name is the id with . replaced by _. Only procedures marked as tools are served on /mcp and by troupe mcp. The hints become the tool's annotations.
  • Auth lists the scopes a caller must hold, all of them (scopes). Tenancy says what the input names and whose view it must be in.
  • Requires names the capabilities the device must declare; the runtime checks them before it calls the platform and answers CAPABILITY_UNSUPPORTED otherwise.
  • Input is a strict object: an unknown key fails with VALIDATION. ? marks an optional field; comments give defaults and bounds. Output objects are read leniently: unknown keys are kept, and an enum written 'a' | 'b' | … is open, so a client must handle values it does not know.
  • Errors: the letters are the implicit sets (U universal, S session, D drive, L locator, E environment), followed by the extra codes. Every surface carries the same error body (errors).
  • Stability: an experimental procedure may change or disappear in any minor version and is never an MCP tool; a stable one changes only additively within its major.

All procedures

ProcedureRESTAuthMCP toolStability
runtime.versionGET /v1/runtime/versionpublic—stable
runtime.capabilitiesGET /v1/runtime/capabilitiessession—stable
runtime.statusGET /v1/runtime/statusruntime:read—stable
runtime.hostInfoGET /v1/runtime/host-inforuntime:read—stable
runtime.doctorGET /v1/runtime/doctorruntime:read—stable
runtime.shutdownPOST /v1/runtime/shutdownruntime:admin—stable
runtime.sweepPOST /v1/runtime/sweepruntime:admin—stable
pairings.createPOST /v1/pairings/createruntime:admin—experimental
pairings.redeemPOST /v1/pairings/redeempublic—experimental
pairings.listGET /v1/pairings/listruntime:admin—experimental
pairings.revokePOST /v1/pairings/revokeruntime:admin—experimental
catalog.deviceTypesGET /v1/catalog/device-typesdevices:readcatalog_deviceTypesstable
catalog.osVersionsGET /v1/catalog/os-versionsdevices:readcatalog_osVersionsstable
sessions.createPOST /v1/sessions/createdevices:acquiresessions_createstable
sessions.getGET /v1/sessions/getdevices:readsessions_getstable
sessions.listGET /v1/sessions/listdevices:readsessions_liststable
sessions.waitGET /v1/sessions/waitdevices:readsessions_waitstable
sessions.heartbeatPOST /v1/sessions/heartbeatdevices:acquiresessions_heartbeatstable
sessions.releasePOST /v1/sessions/releasedevices:acquiresessions_releasestable
sessions.eventsGET /v1/sessions/eventsdevices:read—stable
apps.installPOST /v1/apps/installapps:installapps_installstable
apps.uninstallPOST /v1/apps/uninstallapps:install—stable
apps.launchPOST /v1/apps/launchdevices:driveapps_launchstable
apps.terminatePOST /v1/apps/terminatedevices:driveapps_terminatestable
apps.listGET /v1/apps/listdevices:readapps_liststable
apps.clearDataPOST /v1/apps/clear-dataapps:installapps_clearDatastable
apps.openUrlPOST /v1/apps/open-urldevices:driveapps_openUrlstable
apps.setPermissionsPOST /v1/apps/set-permissionsapps:install—stable
ui.snapshotGET /v1/ui/snapshotdevices:readui_snapshotstable
ui.queryPOST /v1/ui/querydevices:readui_querystable
ui.waitForPOST /v1/ui/wait-fordevices:readui_waitForstable
ui.describeAtGET /v1/ui/describe-atdevices:readui_describeAtstable
input.tapPOST /v1/input/tapdevices:driveinput_tapstable
input.doubleTapPOST /v1/input/double-tapdevices:driveinput_doubleTapstable
input.longPressPOST /v1/input/long-pressdevices:driveinput_longPressstable
input.swipePOST /v1/input/swipedevices:driveinput_swipestable
input.dragPOST /v1/input/dragdevices:drive—stable
input.pinchPOST /v1/input/pinchdevices:drive—stable
input.typePOST /v1/input/typedevices:driveinput_typestable
input.fillPOST /v1/input/filldevices:driveinput_fillstable
input.pressKeyPOST /v1/input/press-keydevices:driveinput_pressKeystable
input.pressButtonPOST /v1/input/press-buttondevices:driveinput_pressButtonstable
input.scrollPOST /v1/input/scrolldevices:driveinput_scrollstable
input.setOrientationPOST /v1/input/set-orientationdevices:driveinput_setOrientationstable
input.gesturePOST /v1/input/gesturedevices:drive—stable
input.hideKeyboardPOST /v1/input/hide-keyboarddevices:driveinput_hideKeyboardstable
system.setLocationPOST /v1/system/set-locationdevices:drive—experimental
system.setAppearancePOST /v1/system/set-appearancedevices:drive—experimental
system.getClipboardGET /v1/system/get-clipboarddevices:drive—experimental
system.setClipboardPOST /v1/system/set-clipboarddevices:drive—experimental
system.setStatusBarPOST /v1/system/set-status-bardevices:drive—experimental
media.screenshotPOST /v1/media/screenshotdevices:readmedia_screenshotstable
media.startRecordingPOST /v1/media/start-recordingdevices:read—stable
media.stopRecordingPOST /v1/media/stop-recordingdevices:read—stable
logs.streamGET /v1/logs/streamlogs:read—stable
logs.readGET /v1/logs/readlogs:readlogs_readstable
logs.crashesGET /v1/logs/crasheslogs:readlogs_crashesstable
debug.connectPOST /v1/debug/connectdevices:drive—experimental
debug.evaluatePOST /v1/debug/evaluatedevices:drive, apps:debug—experimental
streams.ticketPOST /v1/streams/ticketdevices:read—stable
traces.startChunkPOST /v1/traces/start-chunkdevices:read—stable
traces.stopChunkPOST /v1/traces/stop-chunkdevices:read—stable
files.getGET /v1/files/getdevices:read—stable
runs.publishPOST /v1/runs/publishruns:report—experimental
runs.listGET /v1/runs/listruns:read—experimental
runs.getGET /v1/runs/getruns:read—experimental
runs.eventsGET /v1/runs/eventsruns:read—experimental
esc

    Type to search every page, the protocol reference and the cloud API.