/** * The shape recalled memory takes on its way into a prompt. * * Field names follow the old frame rows (`content`, `created_at`) because the * prompt assembler and its tests render them that way; values come from a * contract `MemoryRecord`. */ import type { MemoryImportance, MemoryKind, MemoryRecord, MemorySource } from '@waggle/memory-contract'; export interface RecallFrame { readonly id: string; readonly content: string; readonly kind: MemoryKind; readonly importance: MemoryImportance; readonly source: MemorySource; /** ISO 8601. */ readonly created_at: string; /** Relevance within one result list; 1 for memories picked by a lane. */ readonly score: number; } export function toRecallFrame(record: MemoryRecord, score = 1): RecallFrame { return { id: record.id, content: record.text, kind: record.kind, importance: record.importance, source: record.source, created_at: record.createdAt, score, }; }