import type { Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
/** Return value of {@link useSession}. */
export interface UseSessionReturn {
    /** The fetched Session, or `null` while loading or on error. */
    readonly session: Session | null;
    /** `true` while the initial fetch is in flight. */
    readonly isLoading: boolean;
    /** `true` while a background refetch is in flight. */
    readonly isRefetching: boolean;
    /** Error from the last failed request, or `null` when healthy. */
    readonly error: Error | null;
    /** Discard cached data and re-fetch the session from the server. */
    readonly refetch: () => void;
}
/**
 * Data hook that fetches a single Session by ID.
 *
 * Pass `null` to skip fetching (stable no-op). When the `id` changes,
 * the previous in-flight request is discarded and a fresh fetch begins.
 *
 * Call `refetch()` to re-query after the backend has modified the
 * session (e.g., after an execution completes or the subject is
 * generated by the LLM).
 *
 * Returns the full proto {@link Session} resource so consumers have
 * access to metadata, spec, and status without additional calls.
 *
 * @example
 * ```tsx
 * function SessionDetail({ sessionId }: { sessionId: string }) {
 *   const { session, isLoading, error, refetch } = useSession(sessionId);
 *
 *   if (isLoading) return <Skeleton />;
 *   if (error) return <ErrorMessage error={error} />;
 *   if (!session) return <NotFound />;
 *
 *   return (
 *     <div>
 *       <h1>{session.status?.subject ?? "Untitled session"}</h1>
 *       <button onClick={refetch}>Refresh</button>
 *     </div>
 *   );
 * }
 * ```
 *
 * @example
 * ```tsx
 * // Skip fetching until session ID is available
 * const { session } = useSession(sessionId ?? null);
 * ```
 */
export declare function useSession(id: string | null): UseSessionReturn;
//# sourceMappingURL=useSession.d.ts.map