feat(chat): add one-click Plaza publish for HTML page messages.
Speed up the quick-plaza path with session snapshot reads, publish timeouts, and a modal fix so parent re-renders no longer abort in-flight requests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -64,6 +64,7 @@ import type { AgentRunCreateOptions, AgentRunValidation } from '../utils/agentRu
|
||||
const API = '/api';
|
||||
const DEFAULT_API_TIMEOUT_MS = 20_000;
|
||||
const AGENT_CONNECT_TIMEOUT_MS = 60_000;
|
||||
const QUICK_PLAZA_TIMEOUT_MS = 120_000;
|
||||
const AGENT_RUNS_PATH = '/agent/runs';
|
||||
|
||||
export type AgentRun = {
|
||||
@@ -1086,6 +1087,35 @@ export async function quickShareFromChat(input: {
|
||||
return result.data;
|
||||
}
|
||||
|
||||
export async function quickPlazaFromChat(input: {
|
||||
sessionId: string;
|
||||
messageId: string;
|
||||
selectedLinkIndex?: number;
|
||||
}, signal?: AbortSignal): Promise<{
|
||||
pageId: string;
|
||||
publicationId: string;
|
||||
publicUrl: string | null;
|
||||
post: PlazaPostBrief;
|
||||
}> {
|
||||
const result = await apiFetch<{
|
||||
data: {
|
||||
pageId: string;
|
||||
publicationId: string;
|
||||
publicUrl: string | null;
|
||||
post: PlazaPostBrief;
|
||||
};
|
||||
}>('/mindspace/v1/pages/quick-plaza-from-chat', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
session_id: input.sessionId,
|
||||
message_id: input.messageId,
|
||||
selected_link_index: input.selectedLinkIndex ?? 0,
|
||||
}),
|
||||
signal,
|
||||
}, { timeoutMs: QUICK_PLAZA_TIMEOUT_MS });
|
||||
return result.data;
|
||||
}
|
||||
|
||||
export async function downloadChatMessageDocx(input: {
|
||||
sessionId: string;
|
||||
messageId: string;
|
||||
|
||||
Reference in New Issue
Block a user