Add history import controls (#1053)
This commit is contained in:
@@ -23,6 +23,7 @@ export interface SessionSummary {
|
||||
actual_cost_usd: number | null
|
||||
cost_status: string
|
||||
workspace?: string | null
|
||||
webui_imported?: boolean
|
||||
}
|
||||
|
||||
export interface SessionDetail extends SessionSummary {
|
||||
@@ -122,6 +123,16 @@ export async function deleteSession(id: string, profile?: string | null): Promis
|
||||
}
|
||||
}
|
||||
|
||||
export async function importHermesSession(id: string, profile?: string | null): Promise<{ ok: boolean; imported: boolean; session?: SessionDetail }> {
|
||||
const params = new URLSearchParams()
|
||||
if (profile) params.set('profile', profile)
|
||||
const query = params.toString()
|
||||
return request<{ ok: boolean; imported: boolean; session?: SessionDetail }>(
|
||||
`/api/hermes/sessions/hermes/${encodeURIComponent(id)}/import${query ? `?${query}` : ''}`,
|
||||
{ method: 'POST' },
|
||||
)
|
||||
}
|
||||
|
||||
export interface BatchDeleteSessionTarget {
|
||||
id: string
|
||||
profile?: string | null
|
||||
|
||||
Reference in New Issue
Block a user