- Add NestJS WebSocket Gateway with Socket.IO for real-time communication - Create client SDK (GatewayClient) supporting both browser and Node.js - Implement device registration and point-to-point message routing - Add action types: request/response (RPC), stream (for chat messages) - Integrate Pino logger for structured logging - Configure heartbeat detection (pingInterval/pingTimeout) - Use UUID v7 for time-ordered message IDs Gateway features: - Device registration with deviceId and deviceType (client/agent) - Message routing between devices via Gateway - HTTP API endpoints (/ping, /broadcast) - Auto-reconnect support in client SDK Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
14 lines
326 B
TypeScript
14 lines
326 B
TypeScript
/** Hello Action - 测试用的问候消息 */
|
|
|
|
export const HelloAction = "hello" as const;
|
|
export const HelloResponseAction = "hello_response" as const;
|
|
|
|
/** Hello 请求 payload */
|
|
export interface HelloPayload {
|
|
greeting: string;
|
|
}
|
|
|
|
/** Hello 响应 payload */
|
|
export interface HelloResponsePayload {
|
|
reply: string;
|
|
}
|