DB-backed workspace + LangGraph agent

This commit is contained in:
Ruslan Bakiev
2026-02-18 13:56:35 +07:00
parent a8db021597
commit efa0b79c4c
36 changed files with 2125 additions and 468 deletions

View File

@@ -50,7 +50,15 @@ export async function exportDatasetFromPrismaFor(input: { teamId: string; userId
include: {
note: { select: { content: true, updatedAt: true } },
messages: {
select: { direction: true, channel: true, content: true, occurredAt: true },
select: {
kind: true,
direction: true,
channel: true,
content: true,
durationSec: true,
transcriptJson: true,
occurredAt: true,
},
orderBy: { occurredAt: "asc" },
},
events: {
@@ -70,6 +78,9 @@ export async function exportDatasetFromPrismaFor(input: { teamId: string; userId
teamId: c.teamId,
name: c.name,
company: c.company ?? null,
country: c.country ?? null,
location: c.location ?? null,
avatarUrl: c.avatarUrl ?? null,
email: c.email ?? null,
phone: c.phone ?? null,
createdAt: c.createdAt,
@@ -86,10 +97,13 @@ export async function exportDatasetFromPrismaFor(input: { teamId: string; userId
const msgFile = path.join(messagesDir, `${c.id}.jsonl`);
const msgLines = c.messages.map((m) =>
jsonlLine({
kind: m.kind,
direction: m.direction,
channel: m.channel,
occurredAt: m.occurredAt,
content: m.content,
durationSec: m.durationSec ?? null,
transcript: m.transcriptJson ?? null,
}),
);
await fs.writeFile(msgFile, msgLines.join(""), "utf8");