/** * Express-based A2A server that exposes a Strands Agent as an A2A-compliant HTTP endpoint. * * Separated from the base {@link A2AServer} so that importing the core A2A module * does not pull in Express as a dependency, keeping it browser-compatible. * * The A2A protocol is experimental, so breaking changes in the underlying SDK * may require breaking changes in this module. */ import { type Router } from 'express'; import { UserBuilder } from '@a2a-js/sdk/server/express'; import { A2AServer, type A2AServerConfig } from './server.js'; /** * Configuration options for creating an A2AExpressServer. */ export interface A2AExpressServerConfig extends A2AServerConfig { /** Host to bind the server to (default: '127.0.0.1') */ host?: string; /** Port to listen on (default: 9000) */ port?: number; /** User builder for authentication (default: no authentication) */ userBuilder?: UserBuilder; } /** * Express-based A2A server implementation. * * Provides two usage modes: * - **Standalone**: Call {@link serve} to start a self-contained HTTP server. * - **Middleware**: Call {@link createMiddleware} to get an Express Router that * can be mounted in an existing Express application. */ export declare class A2AExpressServer extends A2AServer { private _host; private _port; private _userBuilder; /** * Creates a new A2AExpressServer. * * @param config - Configuration for the server */ constructor(config: A2AExpressServerConfig); /** * Returns the port the server is configured to listen on. * After `serve()` resolves, this reflects the actual bound port * (useful when configured with port 0 for OS-assigned ports). */ get port(): number; /** * Creates an Express Router middleware for the A2A endpoints. * * Mounts: * - `GET /.well-known/agent-card.json` — Returns the agent card * - `POST /` — Handles A2A JSON-RPC requests * * @returns An Express Router with A2A endpoints mounted */ createMiddleware(): Router; /** * Starts the HTTP server and begins listening for A2A requests. * * @param options - Optional server options */ serve(options?: { signal?: AbortSignal; }): Promise; } //# sourceMappingURL=express-server.d.ts.map