| 21 | export type AgentDevice = AgentDeviceRuntime & BoundAgentDeviceCommands; |
| 22 | |
| 23 | export 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 | |
| 40 | export function createMemorySessionStore( |
| 41 | records: readonly CommandSessionRecord[] = [], |