class Sass::Embedded::Host

def compile_request(path:,

def compile_request(path:,
                    source:,
                    importer:,
                    load_paths:,
                    syntax:,
                    url:,
                    source_map:,
                    source_map_include_sources:,
                    style:,
                    functions:,
                    importers:,
                    alert_ascii:,
                    alert_color:,
                    logger:,
                    quiet_deps:,
                    verbose:)
  await do
    alert_color = $stderr.tty? if alert_color.nil?
    @function_registry = FunctionRegistry.new(functions, alert_color: alert_color)
    @importer_registry = ImporterRegistry.new(importers, load_paths, alert_color: alert_color)
    @logger_registry = LoggerRegistry.new(logger)
    send_message EmbeddedProtocol::InboundMessage.new(
      compile_request: EmbeddedProtocol::InboundMessage::CompileRequest.new(
        id: id,
        string: unless source.nil?
                  EmbeddedProtocol::InboundMessage::CompileRequest::StringInput.new(
                    source: source,
                    url: url&.to_s,
                    syntax: Protofier.to_proto_syntax(syntax),
                    importer: importer.nil? ? nil : @importer_registry.register(importer)
                  )
                end,
        path: path.nil? ? nil : File.absolute_path(path),
        style: Protofier.to_proto_output_style(style),
        source_map: source_map,
        source_map_include_sources: source_map_include_sources,
        importers: @importer_registry.importers,
        global_functions: @function_registry.global_functions,
        alert_ascii: alert_ascii,
        alert_color: alert_color,
        quiet_deps: quiet_deps,
        verbose: verbose
      )
    )
  end
end