MCPcopy
hub / github.com/callstack/agent-device / execute

Function execute

src/daemon/selector-runtime.ts:218–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216 if (directResponse) return directResponse;
217 }
218 const execute = async () => {
219 const runtime = createSelectorRuntimeForDevice({
220 ...params,
221 session,
222 device,
223 });
224 const response = await toDaemonResponse(async () => {
225 const result = await runtime.selectors.wait({
226 session: sessionName,
227 requestId: req.meta?.requestId,
228 target: toWaitTarget(parsed, session),
229 });
230 recordIfSession(sessionStore, sessionName, req, result);
231 return toDaemonWaitData(result);
232 });
233 const enrichedResponse = await maybeWaitTimeoutSurfaceResponse(
234 { req, logPath: params.logPath, session, device },
235 response,
236 );
237 // Keep generic wait-surface details first so Android blocker detection can own the top-level message.
238 return await maybeAndroidForegroundBlockerResponse(params, enrichedResponse, 'wait');
239 };
240 if (parsed.kind === 'sleep') return await execute();
241 return await withSessionlessRunnerCleanup(session, device, execute);
242}

Callers 1

dispatchWaitViaRuntimeFunction · 0.70

Calls 7

recordIfSessionFunction · 0.90
toDaemonWaitDataFunction · 0.90
toDaemonResponseFunction · 0.85
toWaitTargetFunction · 0.85

Tested by

no test coverage detected