|
1 | 1 | import { fingerprint, type RemoteConnectionState } from '../../remote/remote-connection-state.ts'; |
2 | 2 | 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'; |
4 | 7 | import { shellQuoteIfNeeded } from '@agent-device/host-kit/command'; |
5 | 8 |
|
6 | 9 | export type ConnectReadiness = ConnectVerification & { |
@@ -40,7 +43,7 @@ export function buildLeasePreparationNotice( |
40 | 43 | 'No live device session has been created. Run devices to inspect inventory without allocating, then open when ready.', |
41 | 44 | }; |
42 | 45 | } |
43 | | - if (state.leaseProvider === 'limrun') { |
| 46 | + if (connectionProviderSupportsDeferredAppSelection(state.leaseProvider)) { |
44 | 47 | return { |
45 | 48 | status: 'deferred', |
46 | 49 | nextSteps: buildConnectWorkflow(state, verification).nextSteps, |
@@ -241,7 +244,7 @@ function buildUnscopedConnectWorkflow( |
241 | 244 | if (!verification && leaseKind === 'direct-device-provider') { |
242 | 245 | return { nextSteps: defaultDirectProviderLifecycle() }; |
243 | 246 | } |
244 | | - if (verification?.provider === 'limrun') { |
| 247 | + if (connectionProviderSupportsDeferredAppSelection(verification?.provider)) { |
245 | 248 | return { |
246 | 249 | nextSteps: ['agent-device apps', 'agent-device open <uploaded-asset-name>'], |
247 | 250 | }; |
@@ -342,6 +345,8 @@ function appIdPlaceholder(platform: RemoteConnectionState['platform']): string { |
342 | 345 |
|
343 | 346 | function missingAppLabel(state: RemoteConnectionState): string { |
344 | 347 | 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 | + } |
346 | 351 | return 'not available'; |
347 | 352 | } |
0 commit comments