// Package server is a placeholder for the HTTP surface that lets non-Go // callers (skills, agents, otto) drive imagen without exec-ing the CLI. // // The CLI already covers the v0 use cases, so this package intentionally // ships only an interface and a 501 stub. A follow-up issue (tracked after // the ComfyUI + Replicate adapters land) will flesh it out. package server import ( "fmt" "net/http" ) // Server is the eventual HTTP shape. Concrete implementations can wrap a // backend.Registry + config.Config and expose POST /v1/generate. type Server interface { Handler() http.Handler } // NotImplemented is the placeholder the CLI wires up if someone calls // `imagen serve` before the real server lands. type NotImplemented struct{} // Handler returns an http.Handler that responds 501 to every request. func (NotImplemented) Handler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain; charset=utf-8") w.WriteHeader(http.StatusNotImplemented) fmt.Fprintln(w, "imagen HTTP server: not implemented yet — use the CLI for now") }) }