feat: add scoped context payload and rollbackable document changes
This commit is contained in:
@@ -42,6 +42,31 @@ export type AgentTraceEvent = {
|
||||
};
|
||||
};
|
||||
|
||||
export type PilotContextPayload = {
|
||||
scopes: Array<"summary" | "deal" | "message" | "calendar">;
|
||||
summary?: {
|
||||
contactId: string;
|
||||
name: string;
|
||||
};
|
||||
deal?: {
|
||||
dealId: string;
|
||||
title: string;
|
||||
contact: string;
|
||||
};
|
||||
message?: {
|
||||
contactId?: string;
|
||||
contact?: string;
|
||||
intent: "add_message_or_reminder";
|
||||
};
|
||||
calendar?: {
|
||||
view: "day" | "week" | "month" | "year" | "agenda";
|
||||
period: string;
|
||||
selectedDateKey: string;
|
||||
focusedEventId?: string;
|
||||
eventIds: string[];
|
||||
};
|
||||
};
|
||||
|
||||
function normalize(s: string) {
|
||||
return s.trim().toLowerCase();
|
||||
}
|
||||
@@ -97,6 +122,7 @@ export async function runCrmAgentFor(
|
||||
teamId: string;
|
||||
userId: string;
|
||||
userText: string;
|
||||
contextPayload?: PilotContextPayload | null;
|
||||
requestId?: string;
|
||||
conversationId?: string;
|
||||
onTrace?: (event: AgentTraceEvent) => Promise<void> | void;
|
||||
|
||||
Reference in New Issue
Block a user