@artinet/sdk
Version:
TypeScript SDK for Agentic Communication
59 lines • 2.09 kB
TypeScript
import express from "express";
import { CreateExpressServerParams } from "../interfaces/params.js";
import { ServiceManager } from "../../services/manager.js";
import { ExpressServerInterface, ExpressServerOptions } from "../../types/express.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import http from "http";
import { CorsOptions } from "cors";
/**
* @deprecated Use ExpressServer instead.
* @description Creates an Express server for the A2A protocol.
* Handles task creation, streaming, cancellation and more.
* Uses Jayson for JSON-RPC handling.
*/
export declare function createExpressServer(params: CreateExpressServerParams): {
app: express.Express;
};
/**
* @description The express server class.
*/
export declare class ExpressServer extends ServiceManager implements ExpressServerInterface {
readonly basePath: string;
readonly fallbackPath: string;
private _serverInstance;
readonly port: number;
protected app: express.Express;
readonly register: boolean;
readonly corsOptions: CorsOptions;
private initialized;
/**
* @description Gets the server instance.
* @returns {http.Server | undefined} The server instance.
*/
get serverInstance(): http.Server | undefined;
/**
* @description The constructor.
* @param {ExpressServerOptions} params The express server options.
*/
constructor(params: ExpressServerOptions);
/**
* @description Registers the routes.
* @param {StreamableHTTPServerTransport} transport The mcp transport.
*/
registerRoutes(atBasePath?: boolean, transport?: StreamableHTTPServerTransport): void;
/**
* @description Gets the app.
* @returns {express.Express} The app.
*/
getApp(): express.Express;
/**
* @description Starts the server.
* @returns {Promise<http.Server>} The server.
*/
start(): Promise<http.Server>;
/**
* @description Stops the server.
*/
stop(): Promise<void>;
}
//# sourceMappingURL=express-server.d.ts.map