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

Function toBackendContext

src/commands/runtime-common.ts:4–14  ·  view source on GitHub ↗
(
  runtime: Pick<AgentDeviceRuntime, 'signal'>,
  options: CommandContext,
)

Source from the content-addressed store, hash-verified

2import type { AgentDeviceRuntime, CommandContext } from '../runtime-contract.ts';
3
4export function toBackendContext(
5 runtime: Pick<AgentDeviceRuntime, 'signal'>,
6 options: CommandContext,
7): BackendCommandContext {
8 return {
9 session: options.session,
10 requestId: options.requestId,
11 signal: options.signal ?? runtime.signal,
12 metadata: options.metadata,
13 };
14}
15
16export function now(runtime: Pick<AgentDeviceRuntime, 'clock'>): number {
17 return runtime.clock?.now() ?? Date.now();

Callers 15

backCommandFunction · 0.90
homeCommandFunction · 0.90
rotateCommandFunction · 0.90
keyboardCommandFunction · 0.90
clipboardCommandFunction · 0.90
settingsCommandFunction · 0.90
alertCommandFunction · 0.90
appSwitcherCommandFunction · 0.90
recordCommandFunction · 0.90
traceCommandFunction · 0.90
devicesCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected