@@ -7,7 +7,16 @@ import type {
77 AppDeploymentResult ,
88 DeployMaterializedAppInput ,
99} from '@agent-device/contracts/app-deployment-runtime' ;
10- import type { RuntimeOperationFact } from '@agent-device/contracts/platform-runtime' ;
10+ import {
11+ type RuntimeOperationFact ,
12+ unavailableFact ,
13+ } from '@agent-device/contracts/platform-runtime' ;
14+
15+ /** The refusal every WebDriver cell reports once the provider session is gone. */
16+ export const webDriverInactiveSession = unavailableFact (
17+ 'owner-capability-missing' ,
18+ 'The WebDriver provider session is no longer active for this device.' ,
19+ ) ;
1120import { publicPlatformString , type DeviceInfo } from '@agent-device/kernel/device' ;
1221import { AppError } from '@agent-device/kernel/errors' ;
1322import { capabilitySupported , unsupportedCapabilityMessage } from './capabilities.ts' ;
@@ -117,19 +126,12 @@ export function createWebDriverDeploymentRuntime(
117126}
118127
119128function deploymentFact ( session : WebDriverProviderSession | undefined ) : RuntimeOperationFact {
120- if ( ! session ) {
121- return Object . freeze ( {
122- available : false ,
123- reason : 'owner-capability-missing' ,
124- hint : 'The WebDriver provider session is no longer active for this device.' ,
125- } as const ) ;
126- }
129+ if ( ! session ) return webDriverInactiveSession ;
127130 if ( ! capabilitySupported ( session . capabilities , 'install' ) ) {
128- return Object . freeze ( {
129- available : false ,
130- reason : 'owner-capability-missing' ,
131- hint : unsupportedCapabilityMessage ( session . capabilities , 'install' ) ,
132- } as const ) ;
131+ return unavailableFact (
132+ 'owner-capability-missing' ,
133+ unsupportedCapabilityMessage ( session . capabilities , 'install' ) ,
134+ ) ;
133135 }
134136 return Object . freeze ( { available : true } as const ) ;
135137}
0 commit comments