(params: CommandRpcParams, headers: IncomingHttpHeaders)
| 163 | } |
| 164 | |
| 165 | function toDaemonRequest(params: CommandRpcParams, headers: IncomingHttpHeaders): DaemonRequest { |
| 166 | return { |
| 167 | token: resolveToken(params as Record<string, unknown>, headers), |
| 168 | session: params.session ?? 'default', |
| 169 | command: params.command ?? '', |
| 170 | positionals: params.positionals ?? [], |
| 171 | // flags/runtime/meta are validated as objects at the boundary; their full shape is |
| 172 | // validated in the session open handler downstream. |
| 173 | flags: params.flags as DaemonRequest['flags'], |
| 174 | runtime: params.runtime, |
| 175 | meta: params.meta as DaemonRequest['meta'], |
| 176 | }; |
| 177 | } |
| 178 | |
| 179 | function readStringParam(params: Record<string, unknown>, key: string): string | undefined { |
| 180 | const value = params[key]; |
no test coverage detected