// [nexus] API client for assistant memory endpoints
import { api } from "./client";

export interface AssistantMemory {
  companyId: string;
  facts: string[];
  updatedAt: string | null;
}

export const assistantMemoryApi = {
  getMemory(companyId: string): Promise<AssistantMemory> {
    return api.get<AssistantMemory>(`/assistant-memory/${companyId}`);
  },

  appendFact(companyId: string, fact: string): Promise<AssistantMemory> {
    return api.patch<AssistantMemory>(`/assistant-memory/${companyId}`, { fact });
  },

  clearMemory(companyId: string): Promise<void> {
    return api.delete<void>(`/assistant-memory/${companyId}`);
  },
};
