From f1e49e11bbced9f58f1bc193107fc16d5ba5561b Mon Sep 17 00:00:00 2001 From: Marc-Antoine Parent Date: Thu, 2 Jul 2026 09:21:55 -0400 Subject: [PATCH] eng-1984 Define cross-app schema contracts --- packages/database/src/crossAppContracts.ts | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/database/src/crossAppContracts.ts b/packages/database/src/crossAppContracts.ts index 55633fa96..27c78b00f 100644 --- a/packages/database/src/crossAppContracts.ts +++ b/packages/database/src/crossAppContracts.ts @@ -21,6 +21,29 @@ type CrossAppBase = LocalRef & { author: Ref; }; +// A node schema +export type CrossAppNodeSchema = CrossAppBase & { + label: string; + template?: string; + templateTitle?: string; +}; + +// A relation type schema +export type CrossAppRelationTypeSchema = CrossAppBase & { + label: string; + complement: string; + // should we add colour? format? +}; + +// A relation triple schema +export type CrossAppRelationTripleSchema = CrossAppBase & { + label: string; + complement: string; + relation?: Ref | CrossAppRelationTypeSchema; + sourceType: Ref; + destinationType: Ref; +}; + // An inline vector semantic embedding type CrossAppEmbedding = { value: number[];