* Gets the ID of the most recently updated session. * * This is useful for resuming the last conversation when the session ID * was not stored. * * @returns A promise that resolves with the session ID, or undefined if no sessions exist * @throws Error if the client is n
()
| 1876 | * ``` |
| 1877 | */ |
| 1878 | async getLastSessionId(): Promise<string | undefined> { |
| 1879 | if (!this.connection) { |
| 1880 | throw new Error("Client not connected"); |
| 1881 | } |
| 1882 | |
| 1883 | const response = await this.connection.sendRequest("session.getLastId", {}); |
| 1884 | return (response as { sessionId?: string }).sessionId; |
| 1885 | } |
| 1886 | |
| 1887 | /** |
| 1888 | * Permanently deletes a session and all its data from disk, including |
no test coverage detected