feat: refresh shared chat and server workflows

This commit is contained in:
2026-05-26 12:26:33 +09:00
parent 51e0099bea
commit c1d0f4c1db
82 changed files with 18604 additions and 12461 deletions

View File

@@ -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;