Class FleetConsoleServer

java.lang.Object
ai.badmonkey.agentspaces.console.FleetConsoleServer
All Implemented Interfaces:
AutoCloseable

public final class FleetConsoleServer extends Object implements AutoCloseable
Serves a ConsoleView as the fleet console. Three surfaces, each an open standard someone can build on without touching this class:
  • /api/v1 and below: JSON documents carrying _links in the HAL convention (application/hal+json), so hypermedia clients, Spring HATEOAS included, discover the whole surface from the root. Responses allow cross-origin reads, so an external dashboard consumes the API directly.
  • /api/v1/events: the activity stream over Server-Sent Events, resumable via the standard Last-Event-ID header (or an after query parameter for plain HTTP clients).
  • /: the single-file UI, no build step, themed by CSS custom properties, populated only through the public API.

Registered ConsolePanels appear at /api/v1/panels and as sections on the UI. The server runs on the JDK's built-in HTTP server with virtual threads, the same footing as the A2A gateway, so the console core adds no web framework to a fleet; the Spring Boot starter wires one of these from properties.

  • Field Details

  • Method Details

    • builder

      public static FleetConsoleServer.Builder builder(ConsoleView view)
      Starts a builder.
      Parameters:
      view - the model to serve
      Returns:
      the builder
    • start

      public int start(int port) throws IOException
      Starts serving on the loopback interface — the secure default (ASF-028). Binding a routable interface is an explicit choice via start(InetSocketAddress); the operator token then travels plain HTTP, so front a routable console with a TLS-terminating proxy.
      Parameters:
      port - the port to bind; 0 picks a free port
      Returns:
      the bound port
      Throws:
      IOException - if the port cannot be bound
    • start

      public int start(InetSocketAddress address) throws IOException
      Starts serving on an explicit address (a routable interface is the caller's deliberate choice).
      Parameters:
      address - the address to bind
      Returns:
      the bound port
      Throws:
      IOException - if the address cannot be bound
    • port

      public int port()
      The bound port.
    • close

      public void close()
      Stops serving.
      Specified by:
      close in interface AutoCloseable