refactor(app): introduce attachment storage layer and draft lifecycle management
Replace inline data-URL image handling with a persistent attachment storage service, add draft lifecycle states (active/abandoned/sent) with generation tracking, and update fetchAgent to return project placement alongside agent snapshots.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { generateMessageId } from "@/types/stream";
|
||||
|
||||
export function generateDraftId(): string {
|
||||
return `draft_${generateMessageId()}`;
|
||||
}
|
||||
|
||||
export function buildDraftStoreKey(input: {
|
||||
serverId: string;
|
||||
agentId: string;
|
||||
draftId?: string | null;
|
||||
}): string {
|
||||
const serverId = input.serverId.trim();
|
||||
const explicitDraftId = input.draftId?.trim();
|
||||
if (explicitDraftId) {
|
||||
return `draft:${serverId}:${explicitDraftId}`;
|
||||
}
|
||||
return `agent:${serverId}:${input.agentId.trim()}`;
|
||||
}
|
||||
Reference in New Issue
Block a user