Skip to content

Commit 2e7e090

Browse files
committed
refactor(limrun): remove obsolete iOS adapter paths
1 parent b42c7c2 commit 2e7e090

18 files changed

Lines changed: 20 additions & 60 deletions

‎packages/capture-kit/src/alert-tree-driver.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ import { AppError, createRequestCanceledError } from '@agent-device/kernel/error
1818
import { successText } from '@agent-device/kernel/success-text';
1919

2020
/**
21-
* The one driver for every backend that reads alerts from a capture tree (Android ADB, Limrun
22-
* iOS). A backend supplies only its observation (`capture` + `findCandidate`), its acting
23-
* policy (`choose`), and its press seam (`press`). It lives in the capture kit: an iOS provider
24-
* must not depend on the Android package to poll a tree.
21+
* The driver for backends that read alerts from a capture tree. A backend supplies its
22+
* observation (`capture` + `findCandidate`), acting policy (`choose`), and press seam (`press`).
2523
*
2624
* The budget rule: `pollUntilSettled` owns it — every probe started inside the budget is
2725
* awaited and counts; the deadline ends only the LOOP, never a capture in flight. Only the
2826
* caller's cancellation stops a transport. A quiet screen therefore answers `alert-not-found`
29-
* on every backend. The cost: a transport with no abort (Limrun's client) can overrun the
27+
* on every backend. The cost: a transport with no abort can overrun the
3028
* budget by one call, and a capture that never returns keeps the leg open until the caller
3129
* cancels it.
3230
*/
@@ -56,7 +54,7 @@ export type TreeAlertCandidate<
5654
/**
5755
* The seams one tree-based backend owns. `signal` is always the daemon request's own
5856
* cancellation, never a budget timer: it is what may stop a transport in flight. A transport
59-
* with no abort (Limrun's client) cannot be stopped this way — its in-flight call keeps running
57+
* with no abort cannot be stopped this way — its in-flight call keeps running
6058
* and the leg waits for the answer it started (the overrun named above). The caller meanwhile
6159
* learns of its cancellation from its own client transport; the daemon's own answer lands once
6260
* the leg settles on the started probe's answer.

‎packages/capture-kit/src/snapshot/__tests__/ios-snapshot-runtime-viewport.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { IosViewportEvidence } from '@agent-device/contracts/ios-snapshot';
1111
import { AppError } from '@agent-device/kernel/errors';
1212
import type { RawSnapshotNode } from '@agent-device/kernel/snapshot';
1313

14-
// #3182: the provider acquisitions — the simulator AX bridge, an Appium page source, a Limrun tree —
14+
// #3182: the provider acquisitions — the simulator AX bridge or an Appium page source —
1515
// already resolve the box their nodes are measured in, and this presenter is the one seam that turns
1616
// an acquisition into a snapshot result. Publishing nothing here left the default local-iOS producer
1717
// without a viewport while it held the evidence, which is the issue's first `Done when` line.

‎packages/command-surface/src/capture/settings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const settingsCommandMetadata = defineFieldCommandMetadata(
3535
// A readable setting answers with no state; the parse decides per setting.
3636
state: stringField(),
3737
app: stringField(
38-
'App the change targets, by bundle id, package name, or app name: the app `clear-app-state` clears, or the app a `permission` change (or an iOS-simulator `location on|off` privacy change) lands on. A name resolves to the installed app as `open` resolves it: an iOS simulator matches display names and accepts only an installed bundle id, Android accepts only an installed package and refuses a name that resolves to an intent with `setting_app_not_package`, and a Limrun iOS session resolves only the `settings` alias. One that resolves to nothing is refused with `app_not_installed` before anything changes. The app need not be running. Without it the session app is used; a device-wide change (`location set` on any target, the Android `location on|off` toggle, `mobile-data`, macOS permissions) refuses one with `setting_app_not_consumed`. The CLI reads it only from this invocation, never from `AGENT_DEVICE_TARGET_APP` or config `targetApp`.',
38+
'App the change targets, by bundle id, package name, or app name: the app `clear-app-state` clears, or the app a `permission` change (or an iOS-simulator `location on|off` privacy change) lands on. A name resolves to the installed app as `open` resolves it: an iOS simulator, including Limrun, matches display names and accepts only an installed bundle id; Android accepts only an installed package and refuses a name that resolves to an intent with `setting_app_not_package`. One that resolves to nothing is refused with `app_not_installed` before anything changes. The app need not be running. Without it the session app is used; a device-wide change (`location set` on any target, the Android `location on|off` toggle, `mobile-data`, macOS permissions) refuses one with `setting_app_not_consumed`. The CLI reads it only from this invocation, never from `AGENT_DEVICE_TARGET_APP` or config `targetApp`.',
3939
),
4040
latitude: numberField(),
4141
longitude: numberField(),

‎packages/contracts/src/alert-contract.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const MAX_ALERT_WINDOW_MS = 2_147_483_647;
1515
* The one alert failure the family retries on: the backend looked and there was no alert *yet*.
1616
* Both Apple backends state it in typed form — the XCTest runner as this `ErrorPayload.code`
1717
* (surfacing as `details.runnerErrorCode`, like `RUNNER_BUSY`, without changing the wire error
18-
* code), the macOS helper as details.reason — and so do the tree-based acting legs (Android and
19-
* Limrun iOS, through the shared driver), as this `details.reason` paired with `dispatched:
18+
* code), the macOS helper as details.reason — and so does the Android tree-based acting leg,
19+
* as this `details.reason` paired with `dispatched:
2020
* 'no'`. Retry and the fallback hint key on these, never on the message text: a transport,
2121
* runner or helper failure must never read as an absent alert.
2222
*/

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ export type SettingsUpdateOptions =
8282
mode?: PermissionMode;
8383
/**
8484
* The app the permission changes, by bundle id, package name, or app name, resolved as `open`
85-
* resolves it: an iOS simulator matches display names and accepts only an installed bundle
86-
* id, Android accepts only an installed package and refuses a name that resolves to an intent
87-
* with `setting_app_not_package`, and a Limrun iOS session resolves only the `settings`
88-
* alias. Without it the session app is used; no app has to be running or open. macOS
85+
* resolves it: an iOS simulator, including Limrun, matches display names and accepts only an
86+
* installed bundle id. Android accepts only an installed package and refuses a name that
87+
* resolves to an intent with `setting_app_not_package`. Without it the session app is used;
88+
* no app has to be running or open. macOS
8989
* permissions are host-level TCC grants, so naming an app there is refused.
9090
*/
9191
app?: string;

‎packages/contracts/src/interactor-types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export type CloudTextEntryReadiness = (typeof CLOUD_TEXT_ENTRY_READINESS)[number
173173

174174
/**
175175
* What `Interactor.fill` reports back about the entry it performed. The cloud
176-
* interactors (WebDriver and the Limrun iOS session) populate
176+
* interactors using tree-based entry populate
177177
* `textEntryReadiness`; Android and the Apple runner may return target-bound
178178
* `verification: 'unconfirmed'` evidence when the field changed but its value
179179
* cannot confirm the text (app-owned formatting, or an accessibility value that

‎packages/contracts/src/settings-catalog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const SETTINGS = {
173173
],
174174
app: 'input',
175175
appScope: { apple: 'app-scoped', mobile: 'app-scoped', 'macos-host': 'device-level' },
176-
help: 'Changes a permission of the --app app or the session app. An iOS simulator resolves --app to an installed bundle id or display name, Android to an installed package, and a Limrun iOS session only through the settings alias. On Android, deny|reset of a held permission kills a running app; the response reports priorGrantState and warns, and open <app> --relaunch restores it. Android needs a resolvable foreground user and changes nothing without one. On the macOS host, grant|reset change the host TCC grants for the three desktop targets and take no --app.',
176+
help: 'Changes a permission of the --app app or the session app. An iOS simulator, including Limrun, resolves --app to an installed bundle id or display name; Android resolves it to an installed package. On Android, deny|reset of a held permission kills a running app; the response reports priorGrantState and warns, and open <app> --relaunch restores it. Android needs a resolvable foreground user and changes nothing without one. On the macOS host, grant|reset change the host TCC grants for the three desktop targets and take no --app.',
177177
},
178178
} as const satisfies Record<string, SettingDefinition>;
179179

‎packages/provider-limrun/src/app-state-read.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { AppStateRuntimeResult } from '@agent-device/contracts/app-state-runtime';
22
import { AppError } from '@agent-device/kernel/errors';
3+
import { awaitWithSignal } from '@agent-device/kernel/await-with-signal';
34
import type { LimrunDeviceSession } from './device-session.ts';
4-
import { awaitLimrunOperation } from './request-cancellation.ts';
55

66
/**
77
* Android reads the foreground app. Limrun exposes no foreground bundle id on iOS, so an iOS read
@@ -34,7 +34,7 @@ async function confirmLimrunIosInstanceAnswers(
3434
signal: AbortSignal,
3535
): Promise<void> {
3636
try {
37-
await awaitLimrunOperation(session.listApps(), signal);
37+
await awaitWithSignal(session.listApps(), signal);
3838
} catch (error) {
3939
signal.throwIfAborted();
4040
throw new AppError(

‎packages/provider-limrun/src/ios-interactor-snapshot.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ test('shared runner targets follow open, request overrides, home and close', asy
3636
device: iosRunnerDevice,
3737
runner,
3838
client: { elementTree, launchApp: async () => {} },
39-
dependencies: { ios: { resolveAppAlias: async () => 'com.apple.Preferences' } },
4039
} as unknown as LimrunIosSession;
4140
const interactor = createLimrunIosInteractor(session);
4241
await interactor.open('settings');

‎packages/provider-limrun/src/request-cancellation.ts‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
import { awaitWithSignal } from '@agent-device/kernel/await-with-signal';
2-
/**
3-
* The instance-client operations wrapped here do not accept an AbortSignal. Keep the request-bound
4-
* caller cancellable while retaining a handled continuation for the provider operation it started.
5-
*/
6-
export async function awaitLimrunOperation<Value>(
7-
source: Promise<Value>,
8-
signal?: AbortSignal,
9-
onSettled?: () => void,
10-
): Promise<Value> {
11-
return await awaitWithSignal(source.finally(onSettled), signal);
12-
}
13-
142
/**
153
* Request-local ownership for an opaque Limrun SDK operation. A caller can observe its own
164
* abort immediately, but a bound runtime does not release the provider session until every
@@ -32,7 +20,7 @@ export function createLimrunRequestOperationDrain(): LimrunRequestOperationDrain
3220
};
3321
});
3422
pending.add(completion);
35-
return await awaitLimrunOperation(source, signal, settled);
23+
return await awaitWithSignal(source.finally(settled), signal);
3624
},
3725
[Symbol.asyncDispose]: async () => {
3826
while (pending.size > 0) {
@@ -47,5 +35,5 @@ export async function awaitLimrunDeploymentOperation<Value>(
4735
source: Promise<Value>,
4836
signal?: AbortSignal,
4937
): Promise<Value> {
50-
return await (drain ? drain.wait(source, signal) : awaitLimrunOperation(source, signal));
38+
return await (drain ? drain.wait(source, signal) : awaitWithSignal(source, signal));
5139
}

0 commit comments

Comments
 (0)