     1	import { ValidationError } from 'hooked-api'
     2	
     3	/**
     4	 * addRoute
     5	 * Registers a new route with the transport layer
     6	 */
     7	export default async ({ params, context, runHooks }) => {
     8	  const { method, path, handler } = params
     9	
    10	  // Validate route configuration
    11	  if (!method || !path || !handler) {
    12	    throw new ValidationError('Route requires method, path, and handler')
    13	  }
    14	
    15	  // debugger
    16	  // Create context for enrichAttributes hooks
    17	  Object.assign(context, params)
    18	
    19	  // Run the addRoute hook to notify transport plugins
    20	  await runHooks('addRoute')
    21	
    22	  return { registered: true, method, path }
    23	}
