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

Function toDaemonRequest

src/daemon/server/http-server.ts:165–177  ·  view source on GitHub ↗
(params: CommandRpcParams, headers: IncomingHttpHeaders)

Source from the content-addressed store, hash-verified

163}
164
165function 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
179function readStringParam(params: Record<string, unknown>, key: string): string | undefined {
180 const value = params[key];

Callers 1

methodToDaemonRequestFunction · 0.85

Calls 1

resolveTokenFunction · 0.85

Tested by

no test coverage detected