AgentServer
AgentServer hosts multiple AgentBase instances
on a single Hono HTTP server. Each agent registers at its own URL route, and the server
provides unified health monitoring and static file serving. Use AgentServer when you
have several related agents (sales, support, billing) that share the same deployment.
For a single agent, use AgentBase.serve()
or AgentBase.run() instead.
Constructor
Constructor Parameters
opts
Optional server configuration.
opts.host
Hostname the server binds to.
opts.port
Port the server listens on. Also reads from the PORT environment variable.
Properties
host
The hostname the server binds to.
port
The port the server listens on.
Methods
Retrieve a specific registered agent by its route.
Return all registered agents as a Map.
Register an agent at a URL route on the server.
Start the multi-agent HTTP server.
Serve static files from a directory alongside agent routes.
Remove an agent from the server’s registry by route.
Get the fully configured Hono application.
Example
After starting, agents are available at: