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

Function methodToDaemonRequest

src/daemon/server/http-server.ts:401–420  ·  view source on GitHub ↗
(
  method: string,
  params: Record<string, unknown>,
  headers: IncomingHttpHeaders,
)

Source from the content-addressed store, hash-verified

399}
400
401function methodToDaemonRequest(
402 method: string,
403 params: Record<string, unknown>,
404 headers: IncomingHttpHeaders,
405): DaemonRequest {
406 if (COMMAND_RPC_METHODS.has(method)) {
407 return toDaemonRequest(parseCommandRpcParams(params), headers);
408 }
409 if (INSTALL_FROM_SOURCE_RPC_METHODS.has(method)) {
410 return toInstallFromSourceDaemonRequest(params, headers);
411 }
412 if (RELEASE_MATERIALIZED_PATHS_RPC_METHODS.has(method)) {
413 return toReleaseMaterializedPathsDaemonRequest(params, headers);
414 }
415 const leaseCommand = LEASE_RPC_METHOD_TO_COMMAND[method];
416 if (leaseCommand) {
417 return toLeaseDaemonRequest(leaseCommand, params, headers);
418 }
419 throw new AppError('INVALID_ARGS', `Method not found: ${method}`);
420}
421
422function isCommandRpcMethod(method: string): boolean {
423 return COMMAND_RPC_METHODS.has(method);

Callers 1

createDaemonHttpServerFunction · 0.85

Calls 5

toDaemonRequestFunction · 0.85
parseCommandRpcParamsFunction · 0.85
toLeaseDaemonRequestFunction · 0.85

Tested by

no test coverage detected