Enter now queues one follow-up instead of dropping it, and a rectification stop leaves the streamed reply with a grey notice instead of an error alert. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
638 B
TypeScript
18 lines
638 B
TypeScript
export const COMPOSER_QUEUE_LABEL = "已排队,回答结束后发出";
|
|
export const COMPOSER_QUEUE_RECALL_LABEL = "撤回";
|
|
|
|
export type QueuedDraftSettle = "send" | "restore";
|
|
|
|
export function appendQueuedText(current: string, incoming: string): string {
|
|
const next = incoming.trim();
|
|
if (!next) return current.trim();
|
|
if (!current.trim()) return next;
|
|
return `${current.trimEnd()}\n${next}`;
|
|
}
|
|
|
|
export function queuedDraftSettleAction(
|
|
phase: "completed" | "succeeded" | "stopped" | "failed" | "recovering" | "readonly",
|
|
): QueuedDraftSettle {
|
|
return phase === "completed" || phase === "succeeded" ? "send" : "restore";
|
|
}
|