chore: update live chat and work server changes

This commit is contained in:
2026-04-26 16:37:06 +09:00
parent 63e5d263a7
commit 20a6333ed2
38 changed files with 2078 additions and 2281 deletions

View File

@@ -1083,12 +1083,8 @@ export async function updateChatConversationContext(
client_id: normalizedClientId || current.client_id || null,
chat_type_id: nextChatTypeId,
last_chat_type_id: nextChatTypeId || payload.lastChatTypeId?.trim() || current.last_chat_type_id || null,
context_label:
currentChatTypeId != null ? current.context_label || null : requestedContextLabel || current.context_label || null,
context_description:
currentChatTypeId != null
? current.context_description || null
: requestedContextDescription || current.context_description || null,
context_label: resolveNextConversationContextValue(current.context_label, requestedContextLabel),
context_description: resolveNextConversationContextValue(current.context_description, requestedContextDescription),
notify_offline:
normalizedClientId == null && payload.notifyOffline != null
? payload.notifyOffline
@@ -1109,6 +1105,12 @@ export function resolveNextConversationChatTypeId(currentChatTypeId?: string | n
return normalizedRequestedChatTypeId ?? normalizedCurrentChatTypeId ?? null;
}
export function resolveNextConversationContextValue(currentValue?: string | null, requestedValue?: string | null) {
const normalizedRequestedValue = String(requestedValue ?? '').trim() || null;
const normalizedCurrentValue = String(currentValue ?? '').trim() || null;
return normalizedRequestedValue ?? normalizedCurrentValue ?? null;
}
export async function listChatConversations(
clientId?: string | null,
limit = 50,