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

Function createAgentDevice

src/runtime.ts:23–38  ·  view source on GitHub ↗
(config: AgentDeviceRuntimeConfig)

Source from the content-addressed store, hash-verified

21export type AgentDevice = AgentDeviceRuntime & BoundAgentDeviceCommands;
22
23export function createAgentDevice(config: AgentDeviceRuntimeConfig): AgentDevice {
24 const runtime: AgentDeviceRuntime = {
25 backend: config.backend,
26 artifacts: config.artifacts,
27 sessions: config.sessions ?? createMemorySessionStore(),
28 policy: config.policy ?? restrictedCommandPolicy(),
29 diagnostics: config.diagnostics,
30 clock: config.clock,
31 signal: config.signal,
32 };
33
34 return {
35 ...runtime,
36 ...bindCommands(runtime),
37 };
38}
39
40export function createMemorySessionStore(
41 records: readonly CommandSessionRecord[] = [],

Callers 15

snapshot.test.tsFile · 0.90
createSnapshotOnlyDeviceFunction · 0.90
system.test.tsFile · 0.90
recording.test.tsFile · 0.90
apps.test.tsFile · 0.90
createInteractionDeviceFunction · 0.90
createSelectorDeviceFunction · 0.90

Calls 3

bindCommandsFunction · 0.90
createMemorySessionStoreFunction · 0.85
restrictedCommandPolicyFunction · 0.85

Tested by 3

createSnapshotOnlyDeviceFunction · 0.72
createInteractionDeviceFunction · 0.72
createSelectorDeviceFunction · 0.72