// (c) 2026 TWWIM UG. All rights reserved. (www.twwim.com) import { useMutation } from '@tanstack/react-query'; import { knowledgeApi } from '@/infrastructure/http/api/knowledge'; import type { PlaygroundAskRequest, PlaygroundAskResponse } from '@archer/api-interface'; /** * Single-responsibility mutation hook for the Knowledge Playground ask flow. * Calls customer-api → NLU2 strict-RAG pipeline. Does NOT touch the * COMMANDS quota; rate limit is per-user on the server. */ export function usePlaygroundAsk(tenantId: string) { return useMutation({ mutationFn: (body) => knowledgeApi.askPlayground(tenantId, body), }); }