33-01: memory-sanitizer, assistant-memory service, REST routes, 17 tests 33-02: useNexusMode hook, PersonalAssistantPage, sidebar nav, route wiring Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
648 B
TypeScript
22 lines
648 B
TypeScript
// [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}`);
|
|
},
|
|
};
|