import { ContentSearchResult } from "./useSearchContent"; import { SpaceReputationContextParams } from "../../interfaces/SpaceReputation"; export interface UseAskContentProps extends SpaceReputationContextParams { query: string; sourceTypes?: ("entity" | "comment" | "message")[]; spaceId?: string; /** * With a `spaceId`, also search every space nested under it (children, * grandchildren — the whole subtree, any depth). Ignored without a `spaceId`. * Defaults to false (exact-space search). */ includeChildSpaces?: boolean; conversationId?: string; limit?: number; } export interface UseAskContentReturn { /** Answer text — grows as token events arrive */ answer: string; /** Hydrated source records — set once after streaming completes */ sources: ContentSearchResult[]; /** True while the SSE stream is open and tokens are arriving */ streaming: boolean; /** True from the ask() call until the first token arrives (or an error occurs) */ loading: boolean; error: string | null; ask: (props: UseAskContentProps) => void; /** Aborts any in-flight stream and resets all state */ reset: () => void; } export default function useAskContent(): UseAskContentReturn;