mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
19 lines
600 B
TypeScript
19 lines
600 B
TypeScript
export interface ProfileSessionsResponse {
|
|
sessions: unknown[]
|
|
total: number
|
|
profile_totals: Record<string, number>
|
|
[key: string]: unknown
|
|
}
|
|
|
|
type FetchJsonForProfile = (profile: string | null, path: string) => Promise<unknown>
|
|
|
|
export async function fetchPrimaryProfileSessions(
|
|
searchParams: URLSearchParams,
|
|
fetchJsonForProfile: FetchJsonForProfile
|
|
): Promise<ProfileSessionsResponse> {
|
|
try {
|
|
return (await fetchJsonForProfile(null, `/api/profiles/sessions?${searchParams}`)) as ProfileSessionsResponse
|
|
} catch {
|
|
return { sessions: [], total: 0, profile_totals: {} }
|
|
}
|
|
}
|