Skip to content

Commit 2228167

Browse files
Merge pull request #1 from amankansal-lt/feat/testmu-ai-provider
feat(provider-webdriver): add TestMu AI device cloud provider
2 parents 620cecb + abf7a0a commit 2228167

55 files changed

Lines changed: 3410 additions & 252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.fallowrc.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,15 @@
379379
"file": "packages/provider-limrun/src/index.ts",
380380
"exports": ["LimrunIosCommandExecution"]
381381
},
382+
{
383+
"comment": "TestMu session preparation reads these off the lazy loadTestMuDeviceFeatures() import in packages/provider-webdriver/src/provider-definitions.ts, which keeps the package entry's eager closure unchanged; Fallow cannot connect the dynamic member reads.",
384+
"file": "packages/provider-webdriver/src/testmu-device-features.ts",
385+
"exports": [
386+
"buildTestMuDeviceFeatureCapabilities",
387+
"readTestMuDeviceFeatureFields",
388+
"readTestMuDeviceType"
389+
]
390+
},
382391
{
383392
"comment": "Converting the contracts façades from `export *` to explicit named re-exports (the pin-table retirement) made these individually visible to --production analysis for the first time; a bare star previously hid them from this exact check. isRecord/IOS_SAFARI_BUNDLE_ID/REPLAY_DIVERGENCE_* have no production consumer. Kept rather than narrowed here so the façade's re-export surface stays byte-identical to the symbol set the retired pin table asserted — narrowing the surface is a follow-up with its own review, not a side effect of this mechanical conversion.",
384393
"file": "packages/contracts/src/facades/{client,command,divergence,recording}.ts",

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ The same session and evidence model works at every step: the agent explores the
137137
| --- | --- | --- |
138138
| Local | Trying commands and debugging apps on simulators, emulators, physical devices, macOS, and Linux. | Follow the Quick Start. |
139139
| CI/CD | Automated pull request and merge validation with replay scripts and captured artifacts. | Try the [EAS workflow template](https://github.com/callstackincubator/eas-agent-device/blob/main/.eas/workflows/agent-qa-mobile.yml). |
140-
| Cloud / remote | Linux runners, managed devices, and remote jobs. | Set up a [remote proxy](https://oss.callstack.com/agent-device/docs/remote-proxy), connect a [device cloud](https://oss.callstack.com/agent-device/docs/device-clouds) (BrowserStack, AWS Device Farm, Limrun), or [contact Callstack](mailto:[email protected]) for team QA. |
140+
| Cloud / remote | Linux runners, managed devices, and remote jobs. | Set up a [remote proxy](https://oss.callstack.com/agent-device/docs/remote-proxy), connect a [device cloud](https://oss.callstack.com/agent-device/docs/device-clouds) (BrowserStack, AWS Device Farm, TestMu AI, Limrun), or [contact Callstack](mailto:[email protected]) for team QA. |
141141

142142
## How it works
143143

144144
`agent-device` keeps device state in sessions. It uses a local accessibility bridge for iOS Simulator snapshots and XCTest for iOS interactions, physical iOS, and tvOS; ADB and the snapshot helper on Android; HDC and ArkUI `uitest` on HarmonyOS; Vega CLI/VDA on the Vega Virtual Device; a local helper on macOS; and AT-SPI on Linux.
145145

146146
Support depth varies by target. Newer backends such as HarmonyOS and Vega OS cover a subset of commands; run `agent-device capabilities --platform <platform>` to see what a target supports.
147147

148-
Sessions are scoped to the caller's git worktree, and host-local device claims stop parallel agents from taking over each other's simulators and emulators. Inspect ownership without a daemon via `agent-device device status`, and settle provably dead owners with `agent-device device release --stale`. The same commands drive hosted devices on [BrowserStack, AWS Device Farm, and Limrun](https://oss.callstack.com/agent-device/docs/device-clouds).
148+
Sessions are scoped to the caller's git worktree, and host-local device claims stop parallel agents from taking over each other's simulators and emulators. Inspect ownership without a daemon via `agent-device device status`, and settle provably dead owners with `agent-device device release --stale`. The same commands drive hosted devices on [BrowserStack, AWS Device Farm, TestMu AI, and Limrun](https://oss.callstack.com/agent-device/docs/device-clouds).
149149

150150
`agent-device` uses the inspect-act-verify process from Vercel's [agent-browser](https://github.com/vercel-labs/agent-browser) for mobile, TV, and desktop apps. Basic `--platform web` support runs `agent-browser` in the same session and replay system.
151151

‎packages/command-registry/src/flag-definitions-connection.ts‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { PROVIDER_DEVICE_ORIENTATIONS } from '@agent-device/contracts/remote';
1+
import {
2+
PROVIDER_DEVICE_ORIENTATIONS,
3+
PROVIDER_DEVICE_TYPES,
4+
} from '@agent-device/contracts/remote';
25
import type { FlagDefinition } from './flag-types.ts';
36

47
export const CONNECTION_FLAG_DEFINITIONS: readonly FlagDefinition[] = [
@@ -174,6 +177,17 @@ export const CONNECTION_FLAG_DEFINITIONS: readonly FlagDefinition[] = [
174177
projectConfig: false,
175178
recorded: false,
176179
},
180+
{
181+
key: 'providerDeviceType',
182+
names: ['--provider-device-type'],
183+
type: 'enum',
184+
enumValues: PROVIDER_DEVICE_TYPES,
185+
usageLabel: '--provider-device-type real|virtual',
186+
usageDescription:
187+
'TestMu AI device pool: real devices or virtual devices (emulators and simulators). Defaults to virtual',
188+
projectConfig: false,
189+
recorded: false,
190+
},
177191
{
178192
key: 'providerProject',
179193
names: ['--provider-project'],
@@ -236,7 +250,7 @@ export const CONNECTION_FLAG_DEFINITIONS: readonly FlagDefinition[] = [
236250
type: 'string',
237251
usageLabel: '--provider-appium-version <version>',
238252
usageDescription:
239-
'Hosted cloud provider Appium server version, for example 3.2.0. Without it BrowserStack falls back to its default (Appium 1.x)',
253+
'Hosted cloud provider Appium server version, for example 3.2.0. Without it each provider starts its own default (Appium 1.x on BrowserStack)',
240254
projectConfig: false,
241255
recorded: false,
242256
},

‎packages/command-registry/src/flag-groups.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const COMMON_COMMAND_SUPPORTED_FLAG_KEYS = flagKeys(
7878
'device',
7979
'providerApp',
8080
'providerOsVersion',
81+
'providerDeviceType',
8182
'providerProject',
8283
'providerBuild',
8384
'providerSessionName',

‎packages/contracts/src/__tests__/lease-scope.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ test('readLeaseAllocateProviderFlags carries the provider-allocation flags and d
182182
device: 'iPhone 15',
183183
providerApp: 'bs://abc',
184184
providerOsVersion: '17',
185+
providerDeviceType: 'real',
185186
providerProject: 'MyProject',
186187
providerBuild: 'Build-1',
187188
providerSessionName: 'smoke',
@@ -198,6 +199,7 @@ test('readLeaseAllocateProviderFlags carries the provider-allocation flags and d
198199
device: 'iPhone 15',
199200
providerApp: 'bs://abc',
200201
providerOsVersion: '17',
202+
providerDeviceType: 'real',
201203
providerProject: 'MyProject',
202204
providerBuild: 'Build-1',
203205
providerSessionName: 'smoke',

‎packages/contracts/src/client-connection.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export type AgentDeviceRequestOverrides = Pick<
6363
| 'clientId'
6464
| 'providerApp'
6565
| 'providerOsVersion'
66+
| 'providerDeviceType'
6667
| 'providerProject'
6768
| 'providerBuild'
6869
| 'providerSessionName'

‎packages/contracts/src/facades/remote.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ export type {
1414
ProviderConnectionResource,
1515
ProviderConnectionVerification,
1616
} from '../provider-connection.ts';
17-
export { PROVIDER_DEVICE_ORIENTATIONS } from '../remote-config-fields.ts';
17+
export { PROVIDER_DEVICE_ORIENTATIONS, PROVIDER_DEVICE_TYPES } from '../remote-config-fields.ts';
1818
export type {
1919
CloudProviderProfileFields,
2020
ProviderDeviceOrientation,
21+
ProviderDeviceType,
2122
RemoteConfigMetroOptions,
2223
RemoteConnectionProfileFields,
2324
} from '../remote-config-fields.ts';

‎packages/contracts/src/lease-scope.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ const LEASE_ALLOCATE_PROVIDER_FLAG_KEYS = [
212212
// The Cloud provider profile fields; pinned exhaustive against that vocabulary below.
213213
'providerApp',
214214
'providerOsVersion',
215+
'providerDeviceType',
215216
'providerProject',
216217
'providerBuild',
217218
'providerSessionName',

‎packages/contracts/src/remote-config-fields.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ import type { MetroPrepareKind } from './metro.ts';
2020
export const PROVIDER_DEVICE_ORIENTATIONS = ['portrait', 'landscape'] as const;
2121
export type ProviderDeviceOrientation = (typeof PROVIDER_DEVICE_ORIENTATIONS)[number];
2222

23+
/** Device pool a hosted provider session is created in: physical devices or emulators/simulators. */
24+
export const PROVIDER_DEVICE_TYPES = ['real', 'virtual'] as const;
25+
export type ProviderDeviceType = (typeof PROVIDER_DEVICE_TYPES)[number];
26+
2327
export type CloudProviderProfileFields = {
2428
providerApp?: string;
2529
providerOsVersion?: string;
30+
providerDeviceType?: ProviderDeviceType;
2631
providerProject?: string;
2732
providerBuild?: string;
2833
providerSessionName?: string;

‎packages/provider-webdriver/package.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"./providers": {
2020
"types": "./src/providers.ts",
2121
"default": "./src/providers.ts"
22+
},
23+
"./testmu-device-features": {
24+
"types": "./src/testmu-device-features.ts",
25+
"default": "./src/testmu-device-features.ts"
2226
}
2327
}
2428
}

0 commit comments

Comments
 (0)