feat: refresh shared chat and server workflows
This commit is contained in:
@@ -433,6 +433,7 @@ function mergeConversationSummaries(
|
||||
roomScope: preferred.roomScope ?? fallback.roomScope ?? null,
|
||||
notifyOffline: preferred.notifyOffline ?? fallback.notifyOffline,
|
||||
hasUnreadResponse: resolveConversationUnreadMergeState(existing, incoming),
|
||||
hasPendingAttention: preferred.hasPendingAttention === true || fallback.hasPendingAttention === true,
|
||||
currentRequestId: preferred.currentRequestId?.trim() || fallback.currentRequestId?.trim() || null,
|
||||
currentJobStatus: preferred.currentJobStatus ?? fallback.currentJobStatus,
|
||||
currentJobMessage: preferred.currentJobMessage?.trim() || fallback.currentJobMessage?.trim() || null,
|
||||
@@ -1708,6 +1709,7 @@ export async function fetchChatConversations() {
|
||||
response.items.map((item) => ({
|
||||
...item,
|
||||
hasUnreadResponse: resolveStoredConversationUnreadState(item),
|
||||
hasPendingAttention: item.hasPendingAttention === true,
|
||||
notifyOffline: resolveSyncedChatOfflineNotificationSetting(item.sessionId, item.notifyOffline, clientId),
|
||||
})),
|
||||
);
|
||||
@@ -2254,6 +2256,7 @@ export async function submitChatPromptSelection(
|
||||
skipped?: boolean;
|
||||
}>;
|
||||
summaryText?: string | null;
|
||||
attachments?: ChatComposerAttachment[];
|
||||
followupText: string;
|
||||
mode?: 'queue' | 'direct';
|
||||
contextRef?: ChatPromptContextRef | null;
|
||||
@@ -2599,6 +2602,7 @@ export async function submitChatSharePrompt(
|
||||
skipped?: boolean;
|
||||
}>;
|
||||
summaryText?: string | null;
|
||||
attachments?: ChatComposerAttachment[];
|
||||
followupText: string;
|
||||
contextRef?: ChatPromptContextRef | null;
|
||||
},
|
||||
@@ -2644,6 +2648,44 @@ export async function completeChatShareManualBadge(
|
||||
return normalizeChatConversationRequest(response.item);
|
||||
}
|
||||
|
||||
export async function cancelChatShareRequest(
|
||||
token: string,
|
||||
payload: {
|
||||
parentRequestId: string;
|
||||
},
|
||||
) {
|
||||
const response = await requestChatApi<{ ok: boolean; item: ChatConversationRequest }>(
|
||||
`/shares/${encodeURIComponent(token)}/request-cancel`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
},
|
||||
{
|
||||
allowUnauthenticated: true,
|
||||
},
|
||||
);
|
||||
|
||||
return normalizeChatConversationRequest(response.item);
|
||||
}
|
||||
|
||||
export async function retryChatShareRequest(
|
||||
token: string,
|
||||
payload: {
|
||||
parentRequestId: string;
|
||||
},
|
||||
) {
|
||||
return requestChatApi<{ ok: boolean; queuedRequestId: string }>(
|
||||
`/shares/${encodeURIComponent(token)}/request-retry`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
},
|
||||
{
|
||||
allowUnauthenticated: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
type HandleChatServerEventOptions = {
|
||||
eventData: string;
|
||||
currentPageUrl: string;
|
||||
|
||||
Reference in New Issue
Block a user