mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: add session resume capability with automatic continuation
Add ability to resume inactive sessions and automatically continue with new session ID. Includes message merging for preserving conversation history, UI improvements to allow sending during inactive state, and database schema migration. close #87
This commit is contained in:
@@ -253,6 +253,14 @@ export class ApiClient {
|
||||
})
|
||||
}
|
||||
|
||||
async resumeSession(sessionId: string): Promise<string> {
|
||||
const response = await this.request<{ sessionId: string }>(
|
||||
`/api/sessions/${encodeURIComponent(sessionId)}/resume`,
|
||||
{ method: 'POST' }
|
||||
)
|
||||
return response.sessionId
|
||||
}
|
||||
|
||||
async sendMessage(sessionId: string, text: string, localId?: string | null, attachments?: AttachmentMetadata[]): Promise<void> {
|
||||
await this.request(`/api/sessions/${encodeURIComponent(sessionId)}/messages`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user