MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / load

Function load

apps/api/src/agents/persistence.ts:49–62  ·  view source on GitHub ↗
({ conversationId })

Source from the content-addressed store, hash-verified

47
48export const prismaConversationStore: ConversationStore = {
49 async load({ conversationId }) {
50 const conv = await db.conversation.findUnique({
51 where: { id: conversationId },
52 include: {
53 messages: { orderBy: { createdAt: 'asc' } },
54 },
55 });
56 if (!conv) return null;
57
58 return {
59 items: conv.messages.map((m) => m.parts as unknown as ConversationItem),
60 cursor: conv.updatedAt.getTime(),
61 };
62 },
63
64 async save({ conversationId, items }) {
65 const owner = chatRunContext.getStore();

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected