Skip to content

Commit 599619f

Browse files
committed
refactor: keep app selection provider independent
1 parent 32309bb commit 599619f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/cli/commands/connection-presentation.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { fingerprint, type RemoteConnectionState } from '../../remote/remote-connection-state.ts';
22
import type { ConnectVerification } from '../connection/connect-provider-adapters.ts';
3-
import { connectionProviderLeaseKind } from '../connection/provider-policy.ts';
3+
import {
4+
connectionProviderLeaseKind,
5+
connectionProviderSupportsDeferredAppSelection,
6+
} from '../connection/provider-policy.ts';
47
import { shellQuoteIfNeeded } from '@agent-device/host-kit/command';
58

69
export type ConnectReadiness = ConnectVerification & {
@@ -40,7 +43,7 @@ export function buildLeasePreparationNotice(
4043
'No live device session has been created. Run devices to inspect inventory without allocating, then open when ready.',
4144
};
4245
}
43-
if (state.leaseProvider === 'limrun') {
46+
if (connectionProviderSupportsDeferredAppSelection(state.leaseProvider)) {
4447
return {
4548
status: 'deferred',
4649
nextSteps: buildConnectWorkflow(state, verification).nextSteps,
@@ -241,7 +244,7 @@ function buildUnscopedConnectWorkflow(
241244
if (!verification && leaseKind === 'direct-device-provider') {
242245
return { nextSteps: defaultDirectProviderLifecycle() };
243246
}
244-
if (verification?.provider === 'limrun') {
247+
if (connectionProviderSupportsDeferredAppSelection(verification?.provider)) {
245248
return {
246249
nextSteps: ['agent-device apps', 'agent-device open <uploaded-asset-name>'],
247250
};
@@ -342,6 +345,8 @@ function appIdPlaceholder(platform: RemoteConnectionState['platform']): string {
342345

343346
function missingAppLabel(state: RemoteConnectionState): string {
344347
if (state.leaseProvider === 'aws-device-farm') return 'not attached';
345-
if (state.leaseProvider === 'limrun') return 'not installed yet';
348+
if (connectionProviderSupportsDeferredAppSelection(state.leaseProvider)) {
349+
return 'not installed yet';
350+
}
346351
return 'not available';
347352
}

0 commit comments

Comments
 (0)