Add chat-side CRM diff panel with keep/rollback flow
This commit is contained in:
@@ -5,6 +5,7 @@ import { prisma } from "../utils/prisma";
|
||||
import { datasetRoot } from "../dataset/paths";
|
||||
import { ensureDataset } from "../dataset/exporter";
|
||||
import { runLangGraphCrmAgentFor } from "./langgraphCrmAgent";
|
||||
import type { ChangeSet } from "../utils/changeSet";
|
||||
|
||||
type ContactIndexRow = {
|
||||
id: string;
|
||||
@@ -243,6 +244,7 @@ export async function persistChatMessage(input: {
|
||||
output: string;
|
||||
at: string;
|
||||
}>;
|
||||
changeSet?: ChangeSet | null;
|
||||
teamId: string;
|
||||
conversationId: string;
|
||||
authorUserId?: string | null;
|
||||
@@ -251,7 +253,8 @@ export async function persistChatMessage(input: {
|
||||
(input.plan && input.plan.length) ||
|
||||
(input.tools && input.tools.length) ||
|
||||
(input.thinking && input.thinking.length) ||
|
||||
(input.toolRuns && input.toolRuns.length),
|
||||
(input.toolRuns && input.toolRuns.length) ||
|
||||
input.changeSet,
|
||||
);
|
||||
const data: Prisma.ChatMessageCreateInput = {
|
||||
team: { connect: { id: input.teamId } },
|
||||
@@ -265,6 +268,7 @@ export async function persistChatMessage(input: {
|
||||
tools: input.tools ?? [],
|
||||
thinking: input.thinking ?? input.plan ?? [],
|
||||
toolRuns: input.toolRuns ?? [],
|
||||
changeSet: input.changeSet ?? null,
|
||||
} as any)
|
||||
: undefined,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user