Class FleetConsoleServer
java.lang.Object
ai.badmonkey.agentspaces.console.FleetConsoleServer
- All Implemented Interfaces:
AutoCloseable
Serves a
ConsoleView as the fleet console. Three surfaces, each an
open standard someone can build on without touching this class:
/api/v1and below: JSON documents carrying_linksin 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 standardLast-Event-IDheader (or anafterquery 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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe OAuth2 scope a scoped principal (an identity-provider JWT) must carry to command the fleet; the default forFleetConsoleServer.Builder.requiredScope(String). -
Method Summary
Modifier and TypeMethodDescriptionstatic FleetConsoleServer.Builderbuilder(ConsoleView view) Starts a builder.voidclose()Stops serving.intport()The bound port.intstart(int port) Starts serving on the loopback interface — the secure default (ASF-028).intstart(InetSocketAddress address) Starts serving on an explicit address (a routable interface is the caller's deliberate choice).
-
Field Details
-
OPERATE_SCOPE
The OAuth2 scope a scoped principal (an identity-provider JWT) must carry to command the fleet; the default forFleetConsoleServer.Builder.requiredScope(String).- See Also:
-
-
Method Details
-
builder
Starts a builder.- Parameters:
view- the model to serve- Returns:
- the builder
-
start
Starts serving on the loopback interface — the secure default (ASF-028). Binding a routable interface is an explicit choice viastart(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
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
-