From 795981218b13b8116162ca01d91c64cf710bb06c Mon Sep 17 00:00:00 2001 From: Vorflux AI Date: Sat, 28 Mar 2026 23:17:25 +0000 Subject: [PATCH] fix: deduplicate MemoryRelation type and align MemoryEntry with backend schema - Remove duplicate MemoryRelation definition from types.ts, import from api-types.ts - Add MemoryRelation to re-exports in types.ts and index.tsx - Make MemoryEntry.memory required and content optional to match backend MemoryEntrySchema --- packages/memory-graph/src/api-types.ts | 4 ++-- packages/memory-graph/src/index.tsx | 1 + packages/memory-graph/src/types.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/memory-graph/src/api-types.ts b/packages/memory-graph/src/api-types.ts index 631ae715..20f00059 100644 --- a/packages/memory-graph/src/api-types.ts +++ b/packages/memory-graph/src/api-types.ts @@ -2,8 +2,8 @@ export type MemoryRelation = "updates" | "extends" | "derives" export interface MemoryEntry { id: string - content: string | null - memory?: string | null + memory: string + content?: string | null createdAt: string updatedAt: string spaceId?: string | null diff --git a/packages/memory-graph/src/index.tsx b/packages/memory-graph/src/index.tsx index fe6ea39b..1d17766a 100644 --- a/packages/memory-graph/src/index.tsx +++ b/packages/memory-graph/src/index.tsx @@ -35,4 +35,5 @@ export type { DocumentWithMemories, MemoryEntry, DocumentsResponse, + MemoryRelation, } from "./api-types" diff --git a/packages/memory-graph/src/types.ts b/packages/memory-graph/src/types.ts index 40927a1b..447c17ee 100644 --- a/packages/memory-graph/src/types.ts +++ b/packages/memory-graph/src/types.ts @@ -1,6 +1,6 @@ // Graph API types matching backend response -export type MemoryRelation = "updates" | "extends" | "derives" +import type { MemoryRelation } from "./api-types" export interface GraphApiMemory { id: string @@ -221,4 +221,5 @@ export type { DocumentWithMemories, MemoryEntry, DocumentsResponse, + MemoryRelation, } from "./api-types"