( runtime: Pick<AgentDeviceRuntime, 'signal'>, options: CommandContext, )
| 2 | import type { AgentDeviceRuntime, CommandContext } from '../runtime-contract.ts'; |
| 3 | |
| 4 | export 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 | |
| 16 | export function now(runtime: Pick<AgentDeviceRuntime, 'clock'>): number { |
| 17 | return runtime.clock?.now() ?? Date.now(); |
no outgoing calls
no test coverage detected