MCPcopy Index your code
hub / github.com/callstack/agent-device / constructor

Method constructor

src/cloud-webdriver/runtime.ts:154–176  ·  view source on GitHub ↗
(options: CloudWebDriverRuntimeOptions)

Source from the content-addressed store, hash-verified

152 private readonly options: CloudWebDriverRuntimeOptions;
153
154 constructor(options: CloudWebDriverRuntimeOptions) {
155 this.options = options;
156 this.provider = options.provider;
157 this.capabilities = createCloudWebDriverCapabilities({
158 provider: options.provider,
159 platform: options.platform,
160 overrides: options.capabilityOverrides,
161 });
162 this.leaseLifecycle = {
163 allocate: async (lease, context) => await this.allocate(lease, context?.req),
164 heartbeat: async (lease) => this.heartbeat(lease),
165 release: async (lease) => await this.release(lease),
166 };
167 this.cloudArtifacts = {
168 listCloudArtifacts: async (query) => await this.listCloudArtifacts(query),
169 };
170 this.deviceInventoryProvider = async (request) => {
171 if (request.leaseProvider !== this.provider) return null;
172 if (!request.leaseId) return [];
173 const session = this.sessionsByLeaseId.get(request.leaseId);
174 return session ? [session.device] : [];
175 };
176 }
177
178 ownsDevice(device: DeviceInfo): boolean {
179 return [...this.sessionsByLeaseId.values()].some((session) => session.device.id === device.id);

Callers

nothing calls this directly

Calls 6

allocateMethod · 0.95
heartbeatMethod · 0.95
releaseMethod · 0.95
listCloudArtifactsMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected