Skip to content

Commit 821a8af

Browse files
committed
fix: scope Vega support to VVD
1 parent 40aa4aa commit 821a8af

32 files changed

Lines changed: 185 additions & 157 deletions

CONTEXT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ The perfect-shape refactor is complete and merged. Its end-state:
113113
`src/platforms/apple/os/<os>/`. The public wire stays non-breaking: `PUBLIC_PLATFORMS`
114114
(`src/kernel/device.ts`) still emits `ios`/`macos` leaf output. See
115115
[ADR 0009](docs/adr/0009-apple-platform-consolidation.md).
116+
- Vega platform model. Initial Vega OS support is deliberately **VVD-only**: discovery returns
117+
`VirtualDevice`, and platform capability admission rejects physical Fire TV devices until durable
118+
hardware evidence validates discovery, lifecycle, and the complete remote-control contract.
119+
Vega capture, selector, inventory, install, logging, and performance backends remain separate
120+
follow-up surfaces.
116121
- Folder DAG + layering lint. `scripts/layering/check.ts` enforces two different scopes in CI.
117122
GLOBALLY, across every production source file, it enforces the R1-R3 move rules
118123
(kernel-sink, commands-floor, platforms-seam) and rejects all production static value-import

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
Let your coding agent verify its changes in the running app.
1717

18-
`agent-device` lets coding agents inspect, control, and verify apps on iOS, Android, tvOS, Android TV, Amazon Vega OS TV, web, macOS, and Linux. Agents can read token-efficient accessibility snapshots where supported, find elements by ref or selector, run device actions, and save evidence for review. Vega OS support currently covers discovery, app lifecycle, and complete TV-remote control; its capture and selector backends are still unsupported.
18+
`agent-device` lets coding agents inspect, control, and verify apps on iOS, Android, tvOS, Android TV, Amazon Vega OS TV through the Vega Virtual Device (VVD), web, macOS, and Linux. Agents can read token-efficient accessibility snapshots where supported, find elements by ref or selector, run device actions, and save evidence for review. Initial Vega OS support is VVD-only and covers discovery, app lifecycle, and complete TV-remote control; physical Fire TV, capture, and selector backends remain unsupported.
1919

2020
Your coding agent or QA tool reads each result and chooses the next command. `agent-device` runs the command and saves evidence when asked.
2121

@@ -109,7 +109,7 @@ See [Commands](https://oss.callstack.com/agent-device/docs/commands) for the com
109109

110110
## How it works
111111

112-
`agent-device` keeps device state in sessions. It sends commands to XCTest on iOS and tvOS, ADB and the snapshot helper on Android, Vega CLI/VDA on Amazon Vega OS, a local helper on macOS, and AT-SPI on Linux.
112+
`agent-device` keeps device state in sessions. It sends commands to XCTest on iOS and tvOS, ADB and the snapshot helper on Android, Vega CLI/VDA on the Vega Virtual Device, a local helper on macOS, and AT-SPI on Linux.
113113

114114
Node.js apps can use the typed client or public subpaths. `agent-device/android-adb` provides the Android ADB provider interface, helpers for logcat, the clipboard, the keyboard, and apps, and port reverse management.
115115

skills/agent-device/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: agent-device
3-
description: Automates Apple-platform apps (iOS, tvOS, macOS), Android devices, and Amazon Vega OS TVs. Use when navigating apps, taking snapshots/screenshots where supported, driving TV remotes, tapping, typing, scrolling, extracting UI info, collecting evidence, or planning agent-device CLI commands.
3+
description: Automates Apple-platform apps (iOS, tvOS, macOS), Android devices, and Amazon Vega OS TV apps in Vega Virtual Devices. Use when navigating apps, taking snapshots/screenshots where supported, driving TV remotes, tapping, typing, scrolling, extracting UI info, collecting evidence, or planning agent-device CLI commands.
44
---
55

66
# agent-device

src/cli/parser/__tests__/cli-help-topics.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test('usage includes agent workflows, config, environment, and examples footers'
156156
);
157157
assert.match(
158158
usageText,
159-
/agent-device help tv\s+Use when navigating Android TV, tvOS, or Vega OS focus-first surfaces/,
159+
/agent-device help tv\s+Use when navigating Android TV, tvOS, or Vega VVD focus-first surfaces/,
160160
);
161161
assert.match(
162162
usageText,
@@ -335,7 +335,8 @@ test('usageForCommand resolves tv help topic', async () => {
335335
assert.match(help, /agent-device devices --platform vega --target tv/);
336336
assert.match(help, /Vega OS uses the exact hold duration through inputd-cli/);
337337
assert.match(help, /Use --platform vega --target tv/);
338-
assert.match(help, /Remote-button control requires Developer Mode/);
338+
assert.match(help, /Initial Vega OS support is VVD-only/);
339+
assert.match(help, /Physical Fire TV.*report unsupported/);
339340
});
340341

341342
test('usageForCommand resolves web help topic', async () => {

src/cli/parser/cli-help.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const AGENT_WORKFLOWS = [
3939
},
4040
{
4141
label: 'agent-device help tv',
42-
description: 'Use when navigating Android TV, tvOS, or Vega OS focus-first surfaces',
42+
description: 'Use when navigating Android TV, tvOS, or Vega VVD focus-first surfaces',
4343
},
4444
{
4545
label: 'agent-device help react-native',
@@ -426,17 +426,17 @@ Escalate:
426426
help dogfood exploratory QA report workflow
427427
help validate engineering self-validation loops
428428
help debugging logs, network, alerts, traces, flaky runtime failures
429-
help tv Android TV, tvOS, and Vega OS focus-first remote navigation
429+
help tv Android TV, tvOS, and Vega VVD focus-first remote navigation
430430
help react-devtools React Native performance, profiling, props/state/hooks, slow renders, rerenders
431431
help react-native React Native app automation hazards, overlays, Metro/Re.Pack, and routing
432432
help remote remote/cloud config, tenant, lease, local service tunnels
433433
help macos desktop, frontmost-app, menu bar surfaces`,
434434
},
435435
tv: {
436-
summary: 'Android TV, tvOS, and Vega OS focus-first remote navigation',
436+
summary: 'Android TV, tvOS, and Vega VVD focus-first remote navigation',
437437
body: `agent-device help tv
438438
439-
Use this when the target is Android TV, Apple TV/tvOS, or Amazon Fire TV on Vega OS. TV surfaces are focus-first: move focus with remote/D-pad buttons, then activate the focused control.
439+
Use this when the target is Android TV, Apple TV/tvOS, or an Amazon Vega OS TV app running in the Vega Virtual Device (VVD). TV surfaces are focus-first: move focus with remote/D-pad buttons, then activate the focused control.
440440
441441
Core loop:
442442
agent-device open Settings --platform android --target tv --session tv
@@ -462,7 +462,7 @@ Buttons:
462462
ok, center, and enter are input aliases for select; command output still reports button: "select".
463463
longpress is CLI sugar for --duration-ms 500. --duration-ms overrides that preset.
464464
--duration-ms holds a tvOS or Vega OS remote button for that exact duration. On Android TV, any positive duration maps to the ADB longpress form because Android input keyevent has no exact hold duration.
465-
Vega OS uses the exact hold duration through inputd-cli on a developer-mode device.
465+
Vega OS uses the exact hold duration through inputd-cli in the VVD.
466466
467467
Android TV:
468468
Android TV uses ADB keyevents behind agent-device tv-remote. Keep command plans on agent-device; do not switch to raw adb keyevent.
@@ -475,17 +475,16 @@ tvOS:
475475
476476
Vega OS:
477477
Vega OS is driven through the SDK-matched Vega CLI and VDA, not ADB.
478-
Use --platform vega --target tv for a Vega Virtual Device or physical Vega Fire TV.
478+
Initial Vega OS support is VVD-only. Use --platform vega --target tv for a running Vega Virtual Device.
479479
Use a component ID from the app package or Vega SDK tooling; agent-device app inventory is not yet supported.
480-
Use --serial when more than one Vega VVD or physical TV is connected.
480+
Use --serial VirtualDevice for explicit VVD selection.
481481
Start and stop the local emulator with vega virtual-device start|stop; agent-device does not boot the VVD implicitly.
482-
Remote-button control requires Developer Mode on the selected device.
483-
Initial support covers discovery, app open/close, back, home, and tv-remote. App inventory, snapshot, screenshot, selectors, install, touch/text/gesture, logs, and performance commands report unsupported until their Vega backends are implemented.
482+
Initial support covers VVD discovery, app open/close, back, home, and tv-remote. Physical Fire TV, app inventory, snapshot, screenshot, selectors, install, touch/text/gesture, logs, and performance commands report unsupported until their Vega backends are validated and implemented.
484483
485484
Focus and visual truth:
486485
On Android TV and tvOS, if snapshot -i exposes a focused node, verify it with is focused <selector>.
487486
Use wait focused=true only when repeated snapshots preserve focus metadata for the app.
488-
If the app exposes only a surface view, or focus metadata is transient, use screenshot --overlay-refs, screenshot, or diff snapshot as visual truth and keep moving focus with tv-remote. On Vega OS, use the VVD or physical display as visual truth until capture support lands.
487+
If the app exposes only a surface view, or focus metadata is transient, use screenshot --overlay-refs, screenshot, or diff snapshot as visual truth and keep moving focus with tv-remote. On Vega OS, use the VVD display as visual truth until capture support lands.
489488
Do not assume press/click @ref works on Android TV, tvOS, or Vega OS until the desired element is focused.`,
490489
},
491490
debugging: {

src/commands/cli-grammar/flag-definitions-target.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const TARGET_FLAG_DEFINITIONS: readonly FlagDefinition[] = [
3939
names: ['--serial'],
4040
type: 'string',
4141
usageLabel: '--serial <serial>',
42-
usageDescription: 'Android or Vega device serial',
42+
usageDescription: 'Android device or Vega VVD serial',
4343
},
4444
{
4545
key: 'surface',

src/commands/command-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ function commonProperties(): Record<string, JsonSchema> {
585585
},
586586
device: { type: 'string', description: 'Device name selector.' },
587587
udid: { type: 'string', description: 'iOS device UDID selector.' },
588-
serial: { type: 'string', description: 'Android or Vega device serial selector.' },
588+
serial: { type: 'string', description: 'Android device or Vega VVD serial selector.' },
589589
iosSimulatorDeviceSet: {
590590
type: 'string',
591591
description: 'iOS simulator device-set path used for device resolution.',

src/contracts/device-inventory.test.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,16 @@ test('inventory counts Vega as its own platform family', () => {
1919
const devices: DeviceInfo[] = [
2020
{
2121
platform: 'vega',
22-
id: 'vega-emulator',
23-
name: 'Vega TV Emulator',
22+
id: 'VirtualDevice',
23+
name: 'Vega Virtual Device',
2424
kind: 'emulator',
2525
target: 'tv',
2626
booted: true,
2727
},
28-
{
29-
platform: 'vega',
30-
id: 'vega-device',
31-
name: 'Vega TV',
32-
kind: 'device',
33-
target: 'tv',
34-
booted: false,
35-
},
3628
];
3729

3830
const counts = countDeviceInventoryByGroup(devices);
3931

40-
assert.deepEqual(counts.vega, { available: 2, booted: 1 });
32+
assert.deepEqual(counts.vega, { available: 1, booted: 1 });
4133
assert.deepEqual(counts.android, { available: 0, booted: 0 });
4234
});

src/core/__tests__/capability-plugin-routing-parity.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const CAPABILITY_BUCKET_BY_PLATFORM: Record<Platform, keyof CommandCapability> =
165165
linux: 'linux',
166166
web: 'web',
167167
};
168-
const VEGA_TV_ONLY_COMMANDS_REF = new Set(['open', 'close', 'back', 'home', 'tv-remote']);
168+
const VEGA_VVD_ONLY_COMMANDS_REF = new Set(['open', 'close', 'back', 'home', 'tv-remote']);
169169

170170
// Independent reference for `isCommandSupportedOnDevice` over NON-WEB platforms,
171171
// reproducing the BEFORE pipeline exactly: hardcoded bucket selection (b.1 oracle)
@@ -178,8 +178,8 @@ function isSupportedReference(command: string, device: DeviceInfo): boolean {
178178
const byPlatform = capability[CAPABILITY_BUCKET_BY_PLATFORM[device.platform]];
179179
if (!byPlatform) return false;
180180
const supports =
181-
device.platform === 'vega' && VEGA_TV_ONLY_COMMANDS_REF.has(command)
182-
? (candidate: DeviceInfo) => candidate.target === 'tv'
181+
device.platform === 'vega' && VEGA_VVD_ONLY_COMMANDS_REF.has(command)
182+
? (candidate: DeviceInfo) => candidate.kind === 'emulator' && candidate.target === 'tv'
183183
: SUPPORTS_REF[command];
184184
if (supports && !supports(device)) return false;
185185
const kind = (device.kind ?? 'unknown') as keyof NonNullable<CommandCapability['apple']>;
@@ -219,10 +219,10 @@ test('(b.2) unsupportedHint closures are verbatim across the full device matrix'
219219
const reference = HINT_REF[command];
220220
for (const device of SAMPLE_DEVICES) {
221221
const expected =
222-
device.platform === 'vega' && VEGA_TV_ONLY_COMMANDS_REF.has(command)
223-
? device.target === 'tv'
222+
device.platform === 'vega' && VEGA_VVD_ONLY_COMMANDS_REF.has(command)
223+
? device.kind === 'emulator' && device.target === 'tv'
224224
? undefined
225-
: `${command} is supported only on Vega TV targets.`
225+
: `${command} currently supports only Vega Virtual Devices.`
226226
: reference?.(device);
227227
assert.equal(
228228
unsupportedHintForDevice(command, device),

src/core/command-descriptor/registry.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function readOnlySubactionRecordingEffect(
162162

163163
const APPLE_SIM_AND_DEVICE = { simulator: true, device: true };
164164
const ANDROID_ALL = { emulator: true, device: true, unknown: true };
165-
const VEGA_ALL = { emulator: true, device: true };
165+
const VEGA_VVD = { emulator: true };
166166
const LINUX_DEVICE = { device: true };
167167
const LINUX_NONE = {};
168168

@@ -174,7 +174,7 @@ const ALL_DEVICE_COMMAND_CAPABILITY = {
174174
const APP_RUNTIME_CAPABILITY = ALL_DEVICE_COMMAND_CAPABILITY;
175175
const VEGA_APP_RUNTIME_CAPABILITY = {
176176
...APP_RUNTIME_CAPABILITY,
177-
vega: VEGA_ALL,
177+
vega: VEGA_VVD,
178178
} satisfies CommandCapability;
179179
const APP_INVENTORY_CAPABILITY = {
180180
apple: APPLE_SIM_AND_DEVICE,
@@ -993,7 +993,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
993993
...GENERIC_MUTATING_LINUX_DEVICE_COMMAND_TRAITS,
994994
capability: {
995995
...GENERIC_MUTATING_LINUX_DEVICE_COMMAND_TRAITS.capability,
996-
vega: VEGA_ALL,
996+
vega: VEGA_VVD,
997997
},
998998
},
999999
{
@@ -1018,7 +1018,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
10181018
...GENERIC_MUTATING_LINUX_DEVICE_COMMAND_TRAITS,
10191019
capability: {
10201020
...GENERIC_MUTATING_LINUX_DEVICE_COMMAND_TRAITS.capability,
1021-
vega: VEGA_ALL,
1021+
vega: VEGA_VVD,
10221022
},
10231023
},
10241024
{
@@ -1036,7 +1036,7 @@ export const RAW_COMMAND_DESCRIPTORS = [
10361036
capability: {
10371037
apple: APPLE_SIM_AND_DEVICE,
10381038
android: ANDROID_ALL,
1039-
vega: VEGA_ALL,
1039+
vega: VEGA_VVD,
10401040
linux: LINUX_NONE,
10411041
},
10421042
timeoutPolicy: DEFAULT_TIMEOUT_POLICY,

0 commit comments

Comments
 (0)