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:
Mohamed Boudra
2026-02-22 16:22:21 +07:00
parent 2652bdda2e
commit 0c710b09f5
55 changed files with 2381 additions and 350 deletions
@@ -144,11 +144,9 @@ function toAggregatedAgent(params: {
}
export function useSidebarAgentsList(options?: {
isOpen?: boolean;
serverId?: string | null;
selectedProjectFilterKeys?: string[];
}): SidebarAgentsListResult {
const isSidebarOpen = options?.isOpen ?? true;
const { daemons } = useDaemonRegistry();
const runtime = getHostRuntimeStore();
const daemonLabelSignature = useMemo(
@@ -181,7 +179,7 @@ export function useSidebarAgentsList(options?: {
[options?.selectedProjectFilterKeys]
);
const isActive = Boolean(serverId && isSidebarOpen);
const isActive = Boolean(serverId);
const liveAgents = useSessionStore((state) =>
isActive && serverId ? state.sessions[serverId]?.agents ?? null : null
);
@@ -309,7 +307,7 @@ export function useSidebarAgentsList(options?: {
if (!isActive || !serverId || connectionStatus !== "online") {
return;
}
void runtime.refreshAgentDirectory({ serverId }).catch(() => undefined);
void runtime.refreshAgentDirectory({ serverId, page: { limit: 50 } }).catch(() => undefined);
}, [connectionStatus, isActive, runtime, serverId]);
const isDirectoryLoading =