Files
paseo/packages/app/src/stores/draft-keys.ts
T
Mohamed Boudra 0c710b09f5 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.
2026-02-22 16:22:21 +07:00

19 lines
491 B
TypeScript

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()}`;
}