import type { Context } from 'hono'; import type { z } from 'zod'; import { body, parse, rpcResponse } from '@/server/http.ts'; import type { HttpApp } from '@/server/http.ts'; export const room = (c: Context) => c.env.ROBOTS.getByName(c.env.ROBOT_NAME); export const result = (c: Context, value: Parameters>[0]) => rpcResponse(value, c.get('requestId')); export const input = async (c: Context, schema: z.ZodType) => parse(schema, await body(c.req.raw));