* Sends a ping request to the server to verify connectivity. * * @param message - Optional message to include in the ping * @returns A promise that resolves with the ping response containing the message and timestamp * @throws Error if the client is not connected * * @e
(
message?: string
)
| 1701 | * ``` |
| 1702 | */ |
| 1703 | async ping( |
| 1704 | message?: string |
| 1705 | ): Promise<{ message: string; timestamp: string; protocolVersion?: number }> { |
| 1706 | if (!this.connection) { |
| 1707 | throw new Error("Client not connected"); |
| 1708 | } |
| 1709 | |
| 1710 | const result = await this.connection.sendRequest("ping", { message }); |
| 1711 | return result as { |
| 1712 | message: string; |
| 1713 | timestamp: string; |
| 1714 | protocolVersion?: number; |
| 1715 | }; |
| 1716 | } |
| 1717 | |
| 1718 | /** |
| 1719 | * Get CLI status including version and protocol information |
no test coverage detected